From 0c2857af24a536366560a8a13c64fd6ea25f8408 Mon Sep 17 00:00:00 2001 From: wlemb Date: Fri, 20 Jul 2001 14:36:50 +0000 Subject: * src/libs/libgroff/tmpname.cc: New file, defining get_tempname(). * src/libs/libgroff/mkstemp.cc: New file. * src/libs/libgroff/mksdir.cc: New file. * src/libs/libgroff/tmpfile.cc [HAVE_MKSTEMP_PROTO]: Removed. (xtmpfile) [!HAVE_MKSTEMP]: Removed. * src/libs/libgroff/Makefile.sub: Updated. * src/include/lib.h: Add mksdir() prototype. * src/include/posix.h: Define S_IXUSR if not yet defined. * src/preproc/html/pre-html.cc (MAX_RETRIES): Removed. (createAllPages): Use mksdir() instead of current code. * src/utils/indxbib/indxbib.cc [HAVE_MKSTEMP_PROTO]: Removed. (main): [!HAVE_MKSTEMP]: Removed. * aclocal.m4 (GROFF_MKSTEMP): Updated to use new mkstemp.cc file. (GROFF_INTTYPES_H, GROFF_UNSIGNED_LONG_LONG, GROFF_UINTMAX_T): New macros. * configure.ac: Add tests for stdint.h, sys/time.h, and gettimeofday(). Call new GROFF_xxx macros. * configure: Regenerated. * Makefile.in: Comments updated. --- ChangeLog | 25 +++ Makefile.in | 31 +++- aclocal.m4 | 56 +++++- configure | 385 ++++++++++++++++++++++++++--------------- configure.ac | 7 +- doc/groff.texinfo | 18 +- src/devices/grolbp/lbp.h | 2 +- src/include/lib.h | 2 + src/include/posix.h | 6 +- src/libs/libbib/linear.cc | 2 +- src/libs/libbib/map.c | 2 +- src/libs/libbib/search.cc | 2 +- src/libs/libgroff/Makefile.sub | 5 + src/libs/libgroff/fontfile.cc | 2 +- src/libs/libgroff/mksdir.cc | 34 ++++ src/libs/libgroff/mkstemp.cc | 34 ++++ src/libs/libgroff/new.cc | 2 +- src/libs/libgroff/tmpfile.cc | 16 -- src/libs/libgroff/tmpname.cc | 107 ++++++++++++ src/preproc/html/pre-html.cc | 27 +-- src/roff/groff/pipeline.c | 9 - src/utils/afmtodit/afmtodit.pl | 2 +- src/utils/indxbib/indxbib.cc | 14 -- tmac/groff_mdoc.man | 2 +- tmac/s.tmac | 2 +- 25 files changed, 551 insertions(+), 243 deletions(-) create mode 100644 src/libs/libgroff/mksdir.cc create mode 100644 src/libs/libgroff/mkstemp.cc create mode 100644 src/libs/libgroff/tmpname.cc diff --git a/ChangeLog b/ChangeLog index 5a664398..457ed033 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2001-07-20 Werner LEMBERG + + * src/libs/libgroff/tmpname.cc: New file, defining get_tempname(). + * src/libs/libgroff/mkstemp.cc: New file. + * src/libs/libgroff/mksdir.cc: New file. + * src/libs/libgroff/tmpfile.cc [HAVE_MKSTEMP_PROTO]: Removed. + (xtmpfile) [!HAVE_MKSTEMP]: Removed. + * src/libs/libgroff/Makefile.sub: Updated. + * src/include/lib.h: Add mksdir() prototype. + * src/include/posix.h: Define S_IXUSR if not yet defined. + + * src/preproc/html/pre-html.cc (MAX_RETRIES): Removed. + (createAllPages): Use mksdir() instead of current code. + * src/utils/indxbib/indxbib.cc [HAVE_MKSTEMP_PROTO]: Removed. + (main): [!HAVE_MKSTEMP]: Removed. + + * aclocal.m4 (GROFF_MKSTEMP): Updated to use new mkstemp.cc file. + (GROFF_INTTYPES_H, GROFF_UNSIGNED_LONG_LONG, GROFF_UINTMAX_T): New + macros. + * configure.ac: Add tests for stdint.h, sys/time.h, and + gettimeofday(). + Call new GROFF_xxx macros. + * configure: Regenerated. + * Makefile.in: Comments updated. + 2001-07-20 Gaius Mulley * src/preproc/html/pre-html.cc (scanArguments): Use getopt_long() diff --git a/Makefile.in b/Makefile.in index e00000a3..d188380b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -176,30 +176,45 @@ man7dir=$(manroot)/man$(man7ext) # DEFINES should include the following: # -DHAVE_MMAP if you have mmap() and # -DARRAY_DELETE_NEEDS_SIZE if your C++ doesn't understand `delete []' -# -DHAVE_SYS_SIGLIST if you have sys_siglist[] +# -DSYS_SIGLIST_DECLARED if you have sys_siglist[] # -DWCOREFLAG=0200 if the 0200 bit of the status returned by # wait() indicates whether a core image was # produced for a process that was terminated # by a signal -# -DHAVE_UNISTD_H if you have -# -DHAVE_CC_OSFCN_H if you have a C++ +# # -DHAVE_DIRENT_H if you have # -DHAVE_LIMITS_H if you have # -DHAVE_CC_LIMITS_H if you have a C++ -# -DHAVE_SYS_DIR_H if you have +# -DHAVE_MATH_H if you have +# -DHAVE_CC_OSFCN_H if you have a C++ +# -DHAVE_STDINT_H if you have # -DHAVE_STDLIB_H if you have +# -DHAVE_STRING_H if you have # -DHAVE_STRINGS_H if you have +# -DHAVE_SYS_DIR_H if you have +# -DHAVE_SYS_TIME_H if you have +# -DHAVE_UNISTD_H if you have +# +# -DHAVE_FMOD if you have fmod() +# -DHAVE_GETCWD if you have getcwd() +# -DHAVE_GETTIMEOFDAY if you have gettimeofday() +# -DHAVE_MMAP if you have mmap() +# -DHAVE_PUTENV if you have putenv() # -DHAVE_RENAME if you have rename() -# -DHAVE_MKSTEMP if you have mkstemp() -# -DHAVE_STRSEP if you have strsep() # -DHAVE_STRCASECMP if you have strcasecmp() +# -DHAVE_STRNCASECMP if you have strncasecmp() +# -DHAVE_STRERROR if you have strerror() +# -DHAVE_STRSEP if you have strsep() +# -DHAVE_STRTOL if you have strtol() +# # -DNEED_DECLARATION_HYPOT if your C++ doesn't declare hypot() -# -DNEED_DECLARATION_PUTENV if your C++ doesn't declare putenv() -# -DNEED_DECLARATION_POPEN if your C++ doesn't declare popen() # -DNEED_DECLARATION_PCLOSE if your C++ doesn't declare pclose() +# -DNEED_DECLARATION_POPEN if your C++ doesn't declare popen() +# -DNEED_DECLARATION_PUTENV if your C++ doesn't declare putenv() # -DNEED_DECLARATION_STRNCASECMP # if your C++ doesn't declare # strncasecmp() +# # -DRET_TYPE_SRAND_IS_VOID if your srand() returns void or int # -DHAVE_SYS_NERR if you have sysnerr in or # -DHAVE_SYS_ERRLIST if you have sys_errlist in or diff --git a/aclocal.m4 b/aclocal.m4 index 83a68398..bf2b2959 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -474,13 +474,53 @@ fi AC_LANG_POP(C++)])dnl dnl dnl -dnl Check for mkstemp() and its function prototype. +dnl If mkstemp() isn't available, use our own mkstemp.cc file. dnl AC_DEFUN(GROFF_MKSTEMP, -[AC_CHECK_FUNC(mkstemp, -[AC_DEFINE(HAVE_MKSTEMP) -AC_MSG_CHECKING([for mkstemp prototype in ]) -AC_EGREP_CPP(mkstemp, -[#include ], -AC_MSG_RESULT(yes);AC_DEFINE(HAVE_MKSTEMP_PROTO), -AC_MSG_RESULT(no))])]) +[AC_LANG_PUSH(C++) +AC_LIBSOURCE(mkstemp.cc) +AC_CHECK_FUNC(mkstemp, , [_AC_LIBOBJ(mkstemp)]) +AC_LANG_POP(C++)])dnl +dnl +dnl +dnl Test whether exists, doesn't clash with , +dnl and declares uintmax_t. Taken from the fileutils package. +dnl +AC_DEFUN(GROFF_INTTYPES_H, +[AC_LANG_PUSH(C++) +AC_MSG_CHECKING([for inttypes.h]) +AC_TRY_COMPILE([#include +#include ], +[uintmax_t i = (uintmax_t)-1;], +groff_cv_header_inttypes_h=yes, +groff_cv_header_inttypes_h=no) +AC_MSG_RESULT($groff_cv_header_inttypes_h) +AC_LANG_POP(C++)])dnl +dnl +dnl +dnl Test for working `unsigned long long'. Taken from the fileutils package. +dnl +AC_DEFUN(GROFF_UNSIGNED_LONG_LONG, +[AC_LANG_PUSH(C++) +AC_MSG_CHECKING([for unsigned long long]) +AC_TRY_LINK([unsigned long long ull = 1; int i = 63;], +[unsigned long long ullmax = (unsigned long long)-1; +return ull << i | ull >> i | ullmax / ull | ullmax % ull;], +groff_cv_type_unsigned_long_long=yes, +groff_cv_type_unsigned_long_long=no) +AC_MSG_RESULT($groff_cv_type_unsigned_long_long) +AC_LANG_POP(C++)])dnl +dnl +dnl +dnl Define uintmax_t to `unsigned long' or `unsigned long long' +dnl if does not exist. Taken from the fileutils package. +dnl +AC_DEFUN(GROFF_UINTMAX_T, +[AC_REQUIRE([GROFF_INTTYPES_H]) +if test $groff_cv_header_inttypes_h = no; then + AC_REQUIRE([GROFF_UNSIGNED_LONG_LONG]) + test $groff_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + AC_DEFINE_UNQUOTED(uintmax_t, $ac_type) +fi])dnl diff --git a/configure b/configure index 9980963f..b436adf3 100755 --- a/configure +++ b/configure @@ -2661,7 +2661,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_header in stdlib.h unistd.h dirent.h limits.h sys/dir.h \ - string.h strings.h math.h + string.h strings.h math.h stdint.h sys/time.h do ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` echo "$as_me:2667: checking for $ac_header" >&5 @@ -3391,11 +3391,117 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:3394: checking for declaration of time_t" >&5 -echo $ECHO_N "checking for declaration of time_t... $ECHO_C" >&6 +echo "$as_me:3394: checking for inttypes.h" >&5 +echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line 3397 "configure" #include "confdefs.h" +#include +#include +int +main () +{ +uintmax_t i = (uintmax_t)-1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:3410: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:3413: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:3416: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3419: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + groff_cv_header_inttypes_h=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +groff_cv_header_inttypes_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:3428: result: $groff_cv_header_inttypes_h" >&5 +echo "${ECHO_T}$groff_cv_header_inttypes_h" >&6 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +echo "$as_me:3442: checking for unsigned long long" >&5 +echo $ECHO_N "checking for unsigned long long... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line 3445 "configure" +#include "confdefs.h" +unsigned long long ull = 1; int i = 63; +int +main () +{ +unsigned long long ullmax = (unsigned long long)-1; +return ull << i | ull >> i | ullmax / ull | ullmax % ull; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3458: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3461: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3464: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3467: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + groff_cv_type_unsigned_long_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +groff_cv_type_unsigned_long_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +echo "$as_me:3476: result: $groff_cv_type_unsigned_long_long" >&5 +echo "${ECHO_T}$groff_cv_type_unsigned_long_long" >&6 +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test $groff_cv_header_inttypes_h = no; then + + test $groff_cv_type_unsigned_long_long = yes \ + && ac_type='unsigned long long' \ + || ac_type='unsigned long' + cat >>confdefs.h <&5 +echo $ECHO_N "checking for declaration of time_t... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line 3503 "configure" +#include "confdefs.h" #include int main () @@ -3406,23 +3512,23 @@ time_t t = time(0); struct tm *p = localtime(&t); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3409: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3515: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3412: \$? = $ac_status" >&5 + echo "$as_me:3518: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3415: \"$ac_try\"") >&5 + { (eval echo "$as_me:3521: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3418: \$? = $ac_status" >&5 + echo "$as_me:3524: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:3420: result: yes" >&5 + echo "$as_me:3526: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -echo "$as_me:3425: result: no" >&5 +echo "$as_me:3531: result: no" >&5 echo "${ECHO_T}no" >&6;cat >>confdefs.h <<\EOF #define LONG_FOR_TIME_T 1 EOF @@ -3435,13 +3541,13 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:3438: checking return type of signal handlers" >&5 +echo "$as_me:3544: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3444 "configure" +#line 3550 "configure" #include "confdefs.h" #include #include @@ -3463,16 +3569,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3466: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3572: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3469: \$? = $ac_status" >&5 + echo "$as_me:3575: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3472: \"$ac_try\"") >&5 + { (eval echo "$as_me:3578: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3475: \$? = $ac_status" >&5 + echo "$as_me:3581: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else @@ -3482,17 +3588,17 @@ ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:3485: result: $ac_cv_type_signal" >&5 +echo "$as_me:3591: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 +echo "$as_me:3598: checking struct exception" >&5 echo $ECHO_N "checking struct exception... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 3495 "configure" +#line 3601 "configure" #include "confdefs.h" #include int @@ -3504,18 +3610,18 @@ struct exception e; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:3507: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3613: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:3510: \$? = $ac_status" >&5 + echo "$as_me:3616: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:3513: \"$ac_try\"") >&5 + { (eval echo "$as_me:3619: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3516: \$? = $ac_status" >&5 + echo "$as_me:3622: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:3518: result: yes" >&5 + echo "$as_me:3624: result: yes" >&5 echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\EOF #define HAVE_STRUCT_EXCEPTION 1 EOF @@ -3523,11 +3629,11 @@ EOF else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -echo "$as_me:3526: result: no" >&5 +echo "$as_me:3632: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:3530: checking for sin in -lm" >&5 +echo "$as_me:3636: checking for sin in -lm" >&5 echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3535,7 +3641,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 3538 "configure" +#line 3644 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -3554,16 +3660,16 @@ sin (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3557: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3663: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3560: \$? = $ac_status" >&5 + echo "$as_me:3666: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3563: \"$ac_try\"") >&5 + { (eval echo "$as_me:3669: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3566: \$? = $ac_status" >&5 + echo "$as_me:3672: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sin=yes else @@ -3574,7 +3680,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:3577: result: $ac_cv_lib_m_sin" >&5 +echo "$as_me:3683: result: $ac_cv_lib_m_sin" >&5 echo "${ECHO_T}$ac_cv_lib_m_sin" >&6 if test $ac_cv_lib_m_sin = yes; then LIBM=-lm @@ -3583,23 +3689,23 @@ fi for ac_header in stdlib.h unistd.h do ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` -echo "$as_me:3586: checking for $ac_header" >&5 +echo "$as_me:3692: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$ac_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3592 "configure" +#line 3698 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:3596: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:3702: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:3602: \$? = $ac_status" >&5 + echo "$as_me:3708: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -3618,7 +3724,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:3621: result: `eval echo '${'$ac_ac_Header'}'`" >&5 +echo "$as_me:3727: result: `eval echo '${'$ac_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$ac_ac_Header'}'`" >&6 if test `eval echo '${'$ac_ac_Header'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:3740: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$ac_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3640 "configure" +#line 3746 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -3668,16 +3774,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3671: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3777: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3674: \$? = $ac_status" >&5 + echo "$as_me:3780: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3677: \"$ac_try\"") >&5 + { (eval echo "$as_me:3783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3680: \$? = $ac_status" >&5 + echo "$as_me:3786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$ac_ac_var=yes" else @@ -3687,7 +3793,7 @@ eval "$ac_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3690: result: `eval echo '${'$ac_ac_var'}'`" >&5 +echo "$as_me:3796: result: `eval echo '${'$ac_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6 if test `eval echo '${'$ac_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:3806: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3706,7 +3812,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF -#line 3709 "configure" +#line 3815 "configure" #include "confdefs.h" /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: @@ -3838,15 +3944,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:3841: \"$ac_link\"") >&5 +if { (eval echo "$as_me:3947: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3844: \$? = $ac_status" >&5 + echo "$as_me:3950: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:3846: \"$ac_try\"") >&5 + { (eval echo "$as_me:3952: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3849: \$? = $ac_status" >&5 + echo "$as_me:3955: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else @@ -3858,7 +3964,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext fi fi -echo "$as_me:3861: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "$as_me:3967: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then @@ -3875,13 +3981,13 @@ LIBS="$LIBS -lc $LIBM" for ac_func in fmod strtol getcwd strerror putenv do ac_ac_var=`echo "ac_cv_func_$ac_func" | $ac_tr_sh` -echo "$as_me:3878: checking for $ac_func" >&5 +echo "$as_me:3984: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$ac_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3884 "configure" +#line 3990 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -3912,16 +4018,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3915: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4021: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3918: \$? = $ac_status" >&5 + echo "$as_me:4024: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3921: \"$ac_try\"") >&5 + { (eval echo "$as_me:4027: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3924: \$? = $ac_status" >&5 + echo "$as_me:4030: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$ac_ac_var=yes" else @@ -3931,7 +4037,7 @@ eval "$ac_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:3934: result: `eval echo '${'$ac_ac_var'}'`" >&5 +echo "$as_me:4040: result: `eval echo '${'$ac_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6 if test `eval echo '${'$ac_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:4057: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$ac_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 3957 "configure" +#line 4063 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -3985,16 +4091,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:3988: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4094: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:3991: \$? = $ac_status" >&5 + echo "$as_me:4097: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:3994: \"$ac_try\"") >&5 + { (eval echo "$as_me:4100: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3997: \$? = $ac_status" >&5 + echo "$as_me:4103: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$ac_ac_var=yes" else @@ -4004,7 +4110,7 @@ eval "$ac_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4007: result: `eval echo '${'$ac_ac_var'}'`" >&5 +echo "$as_me:4113: result: `eval echo '${'$ac_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$ac_ac_var'}'`" >&6 if test `eval echo '${'$ac_ac_var'}'` = yes; then cat >>confdefs.h <&5 +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +echo "$as_me:4129: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4023 "configure" +#line 4135 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -4051,16 +4163,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4054: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4166: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4057: \$? = $ac_status" >&5 + echo "$as_me:4169: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4060: \"$ac_try\"") >&5 + { (eval echo "$as_me:4172: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4063: \$? = $ac_status" >&5 + echo "$as_me:4175: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -4070,42 +4182,27 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4073: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:4185: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 if test $ac_cv_func_mkstemp = yes; then - cat >>confdefs.h <<\EOF -#define HAVE_MKSTEMP 1 -EOF - -echo "$as_me:4080: checking for mkstemp prototype in " >&5 -echo $ECHO_N "checking for mkstemp prototype in ... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line 4083 "configure" -#include "confdefs.h" -#include -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "mkstemp" >/dev/null 2>&1; then - echo "$as_me:4089: result: yes" >&5 -echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\EOF -#define HAVE_MKSTEMP_PROTO 1 -EOF - + : else - echo "$as_me:4095: result: no" >&5 -echo "${ECHO_T}no" >&6 + LIBOBJS="$LIBOBJS mkstemp.$ac_objext" fi -rm -f conftest* -fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:4102: checking for sys_siglist declaration in signal.h or unistd.h" >&5 +echo "$as_me:4199: checking for sys_siglist declaration in signal.h or unistd.h" >&5 echo $ECHO_N "checking for sys_siglist declaration in signal.h or unistd.h... $ECHO_C" >&6 if test "${ac_cv_decl_sys_siglist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4108 "configure" +#line 4205 "configure" #include "confdefs.h" #include #include @@ -4123,16 +4220,16 @@ char *msg = *(sys_siglist + 1); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4126: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4223: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4129: \$? = $ac_status" >&5 + echo "$as_me:4226: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4132: \"$ac_try\"") >&5 + { (eval echo "$as_me:4229: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4135: \$? = $ac_status" >&5 + echo "$as_me:4232: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_decl_sys_siglist=yes else @@ -4142,7 +4239,7 @@ ac_cv_decl_sys_siglist=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4145: result: $ac_cv_decl_sys_siglist" >&5 +echo "$as_me:4242: result: $ac_cv_decl_sys_siglist" >&5 echo "${ECHO_T}$ac_cv_decl_sys_siglist" >&6 if test $ac_cv_decl_sys_siglist = yes; then @@ -4158,10 +4255,10 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:4161: checking whether ANSI array delete syntax supported" >&5 +echo "$as_me:4258: checking whether ANSI array delete syntax supported" >&5 echo $ECHO_N "checking whether ANSI array delete syntax supported... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 4164 "configure" +#line 4261 "configure" #include "confdefs.h" int @@ -4173,23 +4270,23 @@ char *p = new char[5]; delete [] p; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4176: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4273: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4179: \$? = $ac_status" >&5 + echo "$as_me:4276: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4182: \"$ac_try\"") >&5 + { (eval echo "$as_me:4279: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4185: \$? = $ac_status" >&5 + echo "$as_me:4282: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:4187: result: yes" >&5 + echo "$as_me:4284: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -echo "$as_me:4192: result: no" >&5 +echo "$as_me:4289: result: no" >&5 echo "${ECHO_T}no" >&6;cat >>confdefs.h <<\EOF #define ARRAY_DELETE_NEEDS_SIZE 1 EOF @@ -4208,10 +4305,10 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:4211: checking traditional preprocessor" >&5 +echo "$as_me:4308: checking traditional preprocessor" >&5 echo $ECHO_N "checking traditional preprocessor... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 4214 "configure" +#line 4311 "configure" #include "confdefs.h" #define name2(a,b) a/**/b int @@ -4223,18 +4320,18 @@ int name2(foo,bar); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4226: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:4323: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4229: \$? = $ac_status" >&5 + echo "$as_me:4326: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4232: \"$ac_try\"") >&5 + { (eval echo "$as_me:4329: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4235: \$? = $ac_status" >&5 + echo "$as_me:4332: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:4237: result: yes" >&5 + echo "$as_me:4334: result: yes" >&5 echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\EOF #define TRADITIONAL_CPP 1 EOF @@ -4242,7 +4339,7 @@ EOF else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -echo "$as_me:4245: result: no" >&5 +echo "$as_me:4342: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -4252,14 +4349,14 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:4255: checking w_coredump" >&5 +echo "$as_me:4352: checking w_coredump" >&5 echo $ECHO_N "checking w_coredump... $ECHO_C" >&6 if test "$cross_compiling" = yes; then - echo "$as_me:4258: result: no" >&5 + echo "$as_me:4355: result: no" >&5 echo "${ECHO_T}no" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4262 "configure" +#line 4359 "configure" #include "confdefs.h" #include #include @@ -4275,17 +4372,17 @@ main() } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:4278: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4375: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4281: \$? = $ac_status" >&5 + echo "$as_me:4378: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:4283: \"$ac_try\"") >&5 + { (eval echo "$as_me:4380: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4286: \$? = $ac_status" >&5 + echo "$as_me:4383: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:4288: result: yes" >&5 + echo "$as_me:4385: result: yes" >&5 echo "${ECHO_T}yes" >&6;cat >>confdefs.h <<\EOF #define WCOREFLAG 0200 EOF @@ -4294,18 +4391,18 @@ else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -echo "$as_me:4297: result: no" >&5 +echo "$as_me:4394: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4302: checking default value for grops -b option" >&5 +echo "$as_me:4399: checking default value for grops -b option" >&5 echo $ECHO_N "checking default value for grops -b option... $ECHO_C" >&6 test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=7 -echo "$as_me:4305: result: $BROKEN_SPOOLER_FLAGS" >&5 +echo "$as_me:4402: result: $BROKEN_SPOOLER_FLAGS" >&5 echo "${ECHO_T}$BROKEN_SPOOLER_FLAGS" >&6 -echo "$as_me:4308: checking default paper size" >&5 +echo "$as_me:4405: checking default paper size" >&5 echo $ECHO_N "checking default paper size... $ECHO_C" >&6 if test -z "$PAGE"; then descfile= @@ -4344,22 +4441,22 @@ if test -z "$PAGE"; then esac fi test -n "$PAGE" || PAGE=letter -echo "$as_me:4347: result: $PAGE" >&5 +echo "$as_me:4444: result: $PAGE" >&5 echo "${ECHO_T}$PAGE" >&6 -echo "$as_me:4350: checking for existing troff installation" >&5 +echo "$as_me:4447: checking for existing troff installation" >&5 echo $ECHO_N "checking for existing troff installation... $ECHO_C" >&6 if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" = x0; then - echo "$as_me:4353: result: yes" >&5 + echo "$as_me:4450: result: yes" >&5 echo "${ECHO_T}yes" >&6 g=g else - echo "$as_me:4357: result: no" >&5 + echo "$as_me:4454: result: no" >&5 echo "${ECHO_T}no" >&6 g= fi -echo "$as_me:4362: checking for prefix of system macro packages" >&5 +echo "$as_me:4459: checking for prefix of system macro packages" >&5 echo $ECHO_N "checking for prefix of system macro packages... $ECHO_C" >&6 sys_tmac_prefix= sys_tmac_file_prefix= @@ -4376,11 +4473,11 @@ for d in /usr/share/lib/tmac /usr/lib/tmac; do done done done -echo "$as_me:4379: result: $sys_tmac_prefix" >&5 +echo "$as_me:4476: result: $sys_tmac_prefix" >&5 echo "${ECHO_T}$sys_tmac_prefix" >&6 tmac_wrap= -echo "$as_me:4383: checking which system macro packages should be made available" >&5 +echo "$as_me:4480: checking which system macro packages should be made available" >&5 echo $ECHO_N "checking which system macro packages should be made available... $ECHO_C" >&6 if test "x$sys_tmac_file_prefix" = "xtmac."; then for f in $sys_tmac_prefix*; do @@ -4416,7 +4513,7 @@ elif test -n "$sys_tmac_prefix"; then done rm -f conftest.sol fi -echo "$as_me:4419: result: $tmac_wrap" >&5 +echo "$as_me:4516: result: $tmac_wrap" >&5 echo "${ECHO_T}$tmac_wrap" >&6 $srcdir/mkinstalldirs src/xditview @@ -4531,7 +4628,7 @@ rm -f confdef2opt.sed : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:4534: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:4631: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -4699,7 +4796,7 @@ cat >>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:4702: error: ambiguous option: $1 + { { echo "$as_me:4799: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -4722,12 +4819,12 @@ Try \`$0 --help' for more information." >&2;} 'src/xditview/Imakefile' ) CONFIG_FILES="$CONFIG_FILES src/xditview/Imakefile" ;; # This is an error. - -*) { { echo "$as_me:4725: error: unrecognized option: $1 + -*) { { echo "$as_me:4822: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; - *) { { echo "$as_me:4730: error: invalid argument: $1" >&5 + *) { { echo "$as_me:4827: error: invalid argument: $1" >&5 echo "$as_me: error: invalid argument: $1" >&2;} { (exit 1); exit 1; }; };; esac @@ -4968,7 +5065,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:4971: creating $ac_file" >&5 + { echo "$as_me:5068: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -4986,7 +5083,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:4989: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:5086: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -4999,7 +5096,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:5002: error: cannot find input file: $f" >&5 + { { echo "$as_me:5099: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; diff --git a/configure.ac b/configure.ac index ed6c9a62..60c7da36 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ GROFF_CSH_HACK(SH_SCRIPT_SED_CMD='1s/.*/:/', SH_SCRIPT_SED_CMD='1s/a/a/') AC_SUBST(SH_SCRIPT_SED_CMD) dnl checks for headers AC_CHECK_HEADERS(stdlib.h unistd.h dirent.h limits.h sys/dir.h \ - string.h strings.h math.h) + string.h strings.h math.h stdint.h sys/time.h) GROFF_ISC_SYSV3 GROFF_POSIX GROFF_SRAND @@ -35,7 +35,10 @@ GROFF_SYS_NERR GROFF_SYS_ERRLIST GROFF_OSFCN_H GROFF_LIMITS_H +GROFF_INTTYPES_H dnl checks for typedefs +GROFF_UNSIGNED_LONG_LONG +GROFF_UINTMAX_T GROFF_TIME_T AC_TYPE_SIGNAL GROFF_STRUCT_EXCEPTION @@ -47,7 +50,7 @@ saved_libs="$LIBS" LIBS="$LIBS -lc $LIBM" AC_REPLACE_FUNCS(fmod strtol getcwd strerror putenv) LIBS="$saved_libs" -AC_CHECK_FUNCS(rename strcasecmp strncasecmp strsep) +AC_CHECK_FUNCS(rename strcasecmp strncasecmp strsep gettimeofday) GROFF_MKSTEMP AC_DECL_SYS_SIGLIST dnl checks for compiler characteristics diff --git a/doc/groff.texinfo b/doc/groff.texinfo index c8965c78..9beddffd 100644 --- a/doc/groff.texinfo +++ b/doc/groff.texinfo @@ -211,13 +211,13 @@ @ifinfo -This Info file documents GNU troff version 1.16. +This Info file documents GNU troff version 1.17. Published by the Free Software Foundation 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA -Copyright (C) 1994-2000 Free Software Foundation, Inc. +Copyright (C) 1994-2000, 2001 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are @@ -258,8 +258,8 @@ instead of in the original English. @titlepage @title groff @subtitle The GNU implementation of @code{troff} -@subtitle Edition 1.16 -@subtitle Spring 2000 +@subtitle Edition 1.17 +@subtitle Spring 2001 @author by Trent A.@w{ }Fisher @author and Werner Lemberg @@ -268,10 +268,10 @@ instead of in the original English. @page @vskip 0pt plus 1filll -Copyright @copyright@w{ }1994-2000 Free Software Foundation,@w{ }Inc. +Copyright @copyright@w{ }1994-2000, 2001 Free Software Foundation,@w{ }Inc. @sp 2 -Version 1.16 of @code{groff}, @* -Spring 2000 +Version 1.17 of @code{groff}, @* +Spring 2001 @sp 2 Published by the Free Software Foundation @* 59 Temple Place, Suite 330 @* @@ -304,7 +304,7 @@ Cover art by Etienne Suvasa. @node Top, Copying, (dir), (dir) @ifinfo -This Info file documents groff version 1.16, the GNU implementation of +This Info file documents groff version 1.17, the GNU implementation of the troff typesetting system. This is an in-progress document; contributions, comments, or @@ -7403,7 +7403,7 @@ The @code{als} request can make a macro have more than one name. This would be called as @Example -.vl $Id: groff.texinfo,v 1.77 2001/05/07 13:36:24 wlemb Exp $ +.vl $Id: groff.texinfo,v 1.78 2001/07/20 14:36:51 wlemb Exp $ @endExample @endDefesc diff --git a/src/devices/grolbp/lbp.h b/src/devices/grolbp/lbp.h index cacf3eaf..3b8a9410 100644 --- a/src/devices/grolbp/lbp.h +++ b/src/devices/grolbp/lbp.h @@ -1,5 +1,5 @@ // -*- C -*- -/* Copyright (C) 1994, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1994, 2000, 2001 Free Software Foundation, Inc. Written by Francisco Andrés Verdú groff is free software; you can redistribute it and/or modify it under diff --git a/src/include/lib.h b/src/include/lib.h index c424b8e8..6eb67952 100644 --- a/src/include/lib.h +++ b/src/include/lib.h @@ -43,6 +43,8 @@ int is_prime(unsigned); #include #endif +int mksdir(char *tmpl); + FILE *xtmpfile(char **namep = 0, const char *postfix_long = 0, const char *postfix_short = 0, int do_unlink = 1); diff --git a/src/include/posix.h b/src/include/posix.h index 80f59cad..9a03ecdb 100644 --- a/src/include/posix.h +++ b/src/include/posix.h @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1992, 2000 Free Software Foundation, Inc. +/* Copyright (C) 1992, 2000, 2001 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. @@ -46,6 +46,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define S_IWUSR 0200 #endif +#ifndef S_IXUSR +#define S_IXUSR 0100 +#endif + #ifndef S_ISREG #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif diff --git a/src/libs/libbib/linear.cc b/src/libs/libbib/linear.cc index a8c2a553..1b631085 100644 --- a/src/libs/libbib/linear.cc +++ b/src/libs/libbib/linear.cc @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. diff --git a/src/libs/libbib/map.c b/src/libs/libbib/map.c index ee5d0087..531d8670 100644 --- a/src/libs/libbib/map.c +++ b/src/libs/libbib/map.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. diff --git a/src/libs/libbib/search.cc b/src/libs/libbib/search.cc index 1e027c60..dde55d57 100644 --- a/src/libs/libbib/search.cc +++ b/src/libs/libbib/search.cc @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. diff --git a/src/libs/libgroff/Makefile.sub b/src/libs/libgroff/Makefile.sub index ff5c655c..007102c7 100644 --- a/src/libs/libgroff/Makefile.sub +++ b/src/libs/libgroff/Makefile.sub @@ -19,6 +19,7 @@ OBJS=\ lineno.o \ macropath.o \ maxfilename.o \ + mksdir.o \ nametoindex.o \ new.o \ prime.o \ @@ -28,6 +29,7 @@ OBJS=\ string.o \ strsave.o \ tmpfile.o \ + tmpname.o \ iftoa.o \ itoa.o \ matherr.o \ @@ -51,6 +53,8 @@ CCSRCS=\ $(srcdir)/lineno.cc \ $(srcdir)/macropath.cc \ $(srcdir)/maxfilename.cc \ + $(srcdir)/mksdir.cc \ + $(srcdir)/mkstemp.cc \ $(srcdir)/nametoindex.cc \ $(srcdir)/new.cc \ $(srcdir)/prime.cc \ @@ -60,6 +64,7 @@ CCSRCS=\ $(srcdir)/string.cc \ $(srcdir)/strsave.cc \ $(srcdir)/tmpfile.cc \ + $(srcdir)/tmpname.cc \ version.cc CSRCS=\ $(srcdir)/fmod.c \ diff --git a/src/libs/libgroff/fontfile.cc b/src/libs/libgroff/fontfile.cc index cc1ad2c4..95cf6551 100644 --- a/src/libs/libgroff/fontfile.cc +++ b/src/libs/libgroff/fontfile.cc @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2000 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. diff --git a/src/libs/libgroff/mksdir.cc b/src/libs/libgroff/mksdir.cc new file mode 100644 index 00000000..bf4d300b --- /dev/null +++ b/src/libs/libgroff/mksdir.cc @@ -0,0 +1,34 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + Written by Werner Lemberg (wl@gnu.org) + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* This file is heavily based on the file mkstemp.c which is part of the + fileutils package. */ + + +extern int gen_tempname(char *, int = 0); + +/* Generate a unique temporary directory name from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the filename unique. + Then open the directory and return a fd. */ +int mksdir(char *tmpl) +{ + return gen_tempname(tmpl, 1); +} diff --git a/src/libs/libgroff/mkstemp.cc b/src/libs/libgroff/mkstemp.cc new file mode 100644 index 00000000..cd2717c3 --- /dev/null +++ b/src/libs/libgroff/mkstemp.cc @@ -0,0 +1,34 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + Written by Werner Lemberg (wl@gnu.org) + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* This file is heavily based on the file mkstemp.c which is part of the + fileutils package. */ + + +extern int gen_tempname(char *, int); + +/* Generate a unique temporary file name from TEMPLATE. + The last six characters of TEMPLATE must be "XXXXXX"; + they are replaced with a string that makes the filename unique. + Then open the file and return a fd. */ +int mkstemp(char *tmpl) +{ + return gen_tempname(tmpl, 0); +} diff --git a/src/libs/libgroff/new.cc b/src/libs/libgroff/new.cc index 8d98591a..9933cc45 100644 --- a/src/libs/libgroff/new.cc +++ b/src/libs/libgroff/new.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +/* Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. diff --git a/src/libs/libgroff/tmpfile.cc b/src/libs/libgroff/tmpfile.cc index 4a53a06b..fdce09ee 100644 --- a/src/libs/libgroff/tmpfile.cc +++ b/src/libs/libgroff/tmpfile.cc @@ -30,12 +30,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "error.h" #include "nonposix.h" -#ifndef HAVE_MKSTEMP_PROTO -extern "C" { - extern int mkstemp (char *); -} -#endif - // If this is set, create temporary files there #define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR" // otherwise if this is set, create temporary files there @@ -161,8 +155,6 @@ FILE *xtmpfile(char **namep, int do_unlink) { char *templ = xtmptemplate(postfix_long, postfix_short); - -#ifdef HAVE_MKSTEMP errno = 0; int fd = mkstemp(templ); if (fd < 0) @@ -171,14 +163,6 @@ FILE *xtmpfile(char **namep, FILE *fp = fdopen(fd, FOPEN_RWB); // many callers of xtmpfile use binary I/O if (!fp) fatal("fdopen: %1", strerror(errno)); -#else /* not HAVE_MKSTEMP */ - if (!mktemp(templ) || !templ[0]) - fatal("cannot create file name for temporary file"); - errno = 0; - FILE *fp = fopen(templ, FOPEN_RWB); - if (!fp) - fatal("cannot open `%1': %2", templ, strerror(errno)); -#endif /* not HAVE_MKSTEMP */ if (do_unlink) add_tmp_file(templ); if (namep) diff --git a/src/libs/libgroff/tmpname.cc b/src/libs/libgroff/tmpname.cc new file mode 100644 index 00000000..bd0e3a07 --- /dev/null +++ b/src/libs/libgroff/tmpname.cc @@ -0,0 +1,107 @@ +/* Copyright (C) 2001 Free Software Foundation, Inc. + Written by Werner Lemberg (wl@gnu.org) + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with groff; see the file COPYING. If not, write to the Free Software +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/* This file is heavily based on the function __gen_tempname() in the + file tempname.c which is part of the fileutils package. */ + + +#include +#include +#include +#include +#include + +#include "posix.h" +#include "nonposix.h" + +#ifndef TMP_MAX +# define TMP_MAX 238328 +#endif + +#if HAVE_SYS_TIME_H +# include +#endif + +#if HAVE_STDINT_H +# include +#endif + +/* Use the widest available unsigned type if uint64_t is not + available. The algorithm below extracts a number less than 62**6 + (approximately 2**35.725) from uint64_t, so ancient hosts where + uintmax_t is only 32 bits lose about 3.725 bits of randomness, + which is better than not having mkstemp at all. */ +#if !defined UINT64_MAX && !defined uint64_t +# define uint64_t uintmax_t +#endif + +/* These are the characters used in temporary filenames. */ +static const char letters[] = +"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + +int gen_tempname(char *tmpl, int dir) +{ + static uint64_t value; + + size_t len = strlen(tmpl); + if (len < 6 || strcmp(&tmpl[len - 6], "XXXXXX")) + return -1; /* EINVAL */ + + /* This is where the Xs start. */ + char *XXXXXX = &tmpl[len - 6]; + + /* Get some more or less random data. */ +#if HAVE_GETTIMEOFDAY + timeval tv; + gettimeofday(&tv, NULL); + uint64_t random_time_bits = ((uint64_t)tv.tv_usec << 16) ^ tv.tv_sec; +#else + uint64_t random_time_bits = time(NULL); +#endif + value += random_time_bits ^ getpid(); + + for (int count = 0; count < TMP_MAX; value += 7777, ++count) { + uint64_t v = value; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % 62]; + v /= 62; + XXXXXX[1] = letters[v % 62]; + v /= 62; + XXXXXX[2] = letters[v % 62]; + v /= 62; + XXXXXX[3] = letters[v % 62]; + v /= 62; + XXXXXX[4] = letters[v % 62]; + v /= 62; + XXXXXX[5] = letters[v % 62]; + + int fd = dir ? mkdir(tmpl, S_IRUSR | S_IWUSR | S_IXUSR) + : open(tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + + if (fd >= 0) + return fd; + else if (errno != EEXIST) + return -1; + } + + /* We got out of the loop because we ran out of combinations to try. */ + return -1; /* EEXIST */ +} diff --git a/src/preproc/html/pre-html.cc b/src/preproc/html/pre-html.cc index 6f2b9789..399345be 100644 --- a/src/preproc/html/pre-html.cc +++ b/src/preproc/html/pre-html.cc @@ -62,7 +62,6 @@ extern "C" const char *Version_string; #define IMAGE_BOARDER_PIXELS 0 #define MAX_WIDTH 8 // inches #define INLINE_LEADER_CHAR '\\' -#define MAX_RETRIES 4096 // number of different page directory names to try before giving up #define TRANSPARENT "-background \"#FFF\" -transparent \"#FFF\"" @@ -838,32 +837,14 @@ static int createAllPages (void) { char buffer[4096]; char *s; - int retries = MAX_RETRIES; imagePageStem = xtmptemplate(PAGE_TEMPLATE_LONG, PAGE_TEMPLATE_SHORT); strcpy(buffer, imagePageStem); - do { - if (mktemp(imagePageStem) == NULL) { - sys_fatal("mktemp"); - return -1; - } - if (mkdir(imagePageStem, 0700) == 0) break; - if (errno == EEXIST) { - // directory already exists, try another name - retries--; - if (retries == 0) { - // time to give up - sys_fatal("mkdir"); - return -1; - } - } else { - // another error, quit - sys_fatal("mkdir"); - return -1; - } - strcpy(imagePageStem, buffer); - } while (1); + if (mksdir(imagePageStem) < 0) { + sys_fatal("mksdir"); + return -1; + } s = make_message("echo showpage | " "gs%s -q -dSAFER -sDEVICE=%s -r%d " diff --git a/src/roff/groff/pipeline.c b/src/roff/groff/pipeline.c index f26608ff..977e7039 100644 --- a/src/roff/groff/pipeline.c +++ b/src/roff/groff/pipeline.c @@ -18,15 +18,6 @@ You should have received a copy of the GNU General Public License along with groff; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* -Compile options are: - --DWCOREFLAG=0200 (or whatever) --DHAVE_SYS_SIGLIST --DSYS_SIGLIST_DECLARED --DHAVE_UNISTD_H -*/ - #include #include #include diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl index bfc058a4..04bfe78e 100644 --- a/src/utils/afmtodit/afmtodit.pl +++ b/src/utils/afmtodit/afmtodit.pl @@ -1,6 +1,6 @@ #! /usr/bin/perl -P- # -*- Perl -*- -# Copyright (C) 1989-2000 Free Software Foundation, Inc. +# Copyright (C) 1989-2000, 2001 Free Software Foundation, Inc. # Written by James Clark (jjc@jclark.com) # # This file is part of groff. diff --git a/src/utils/indxbib/indxbib.cc b/src/utils/indxbib/indxbib.cc index db3e9a40..635d99df 100644 --- a/src/utils/indxbib/indxbib.cc +++ b/src/utils/indxbib/indxbib.cc @@ -39,12 +39,6 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ extern "C" const char *Version_string; -#ifndef HAVE_MKSTEMP_PROTO -extern "C" { - extern int mkstemp(char *); -} -#endif - #define DEFAULT_HASH_TABLE_SIZE 997 #define TEMP_INDEX_TEMPLATE "indxbibXXXXXX" @@ -240,16 +234,8 @@ int main(int argc, char **argv) else { temp_index_file = strsave(TEMP_INDEX_TEMPLATE); } -#ifndef HAVE_MKSTEMP - if (!mktemp(temp_index_file) || !temp_index_file[0]) - fatal("cannot create file name for temporary file"); -#endif catch_fatal_signals(); -#ifdef HAVE_MKSTEMP int fd = mkstemp(temp_index_file); -#else - int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH); -#endif if (fd < 0) fatal("can't create temporary index file: %1", strerror(errno)); indxfp = fdopen(fd, FOPEN_WB); diff --git a/tmac/groff_mdoc.man b/tmac/groff_mdoc.man index dec06553..b4182d11 100644 --- a/tmac/groff_mdoc.man +++ b/tmac/groff_mdoc.man @@ -46,7 +46,7 @@ .\" for an already extremely slow package. .\" . -.Dd April 10, 2001 +.Dd July 20, 2001 .Os .Dt GROFF_MDOC 7 . diff --git a/tmac/s.tmac b/tmac/s.tmac index 7d1ad49c..91762a99 100644 --- a/tmac/s.tmac +++ b/tmac/s.tmac @@ -3,7 +3,7 @@ s.tmac -Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc. +Copyright (C) 1989, 1990, 1991, 1992, 2001 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) This file is part of groff. -- cgit v1.2.1