diff --git a/ChangeLog b/ChangeLog index 0f37efe6..ff90939c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -52,13 +52,15 @@ Cvs code - ISSET and then using SET or UNSET when we want a simple toggle for a flag. - Added multiple buffer capability (God help us). New configure - option --enable-loadoninsert (-L), changes to do_insertfile(), + option --enable-multibuffer (-F), changes to do_insertfile(), do_insertfile_void(), toggle_init(), do_gotoline(), edit_update(), and write_file(), new functions add_open_file(), open_file_change_name(), load_open_file(), open_file_dup_search(), open_file_dup_fix(), open_prevfile(), open_nextfile(), close_open_file(), get_full_path(), die_save_file(), etc. (David Lawrence Ramsey). + - Using --enable-extra automatically defines --enable-multibuffer + changes to version() and configure.in. - Makefile.am: - Include ABOUT-NLS and the new THANKS files to the distributed list. - THANKS: diff --git a/README b/README index 78452e08..2ff5dce7 100644 --- a/README +++ b/README @@ -65,8 +65,8 @@ Current Status of wrap margin based on window size. + Write marked text to separate file (^O after selecting with ^^). + Append to file (Meta-A at write file menu). - + Multiple file buffers! (--enable-loadoninsert configure option, - --loadoninsert, -L cmdline flag, Meta-L toggle, then ^R to load). + + Multiple file buffers! (--enable-multibuffer configure option, + --multibuffer, -F cmdline flag, Meta-F toggle, then ^R to load). + Better compatibility with Pico. Mouse mode now supports clicking shortcuts and files in browser, search toggles that are Pico extensions moved to Meta keys so as to not interfere with Pico diff --git a/acconfig.h b/acconfig.h index fcf08226..61863cc0 100644 --- a/acconfig.h +++ b/acconfig.h @@ -55,7 +55,7 @@ #undef DISABLE_MOUSE /* Define this to load files upon inserting them, and allow switching between them; this is disabled if NANO_SMALL is defined */ -#undef ENABLE_LOADONINSERT +#undef ENABLE_MULTIBUFFER /* Define this to use the .nanorc file */ #undef ENABLE_NANORC diff --git a/aclocal.m4 b/aclocal.m4 index 81e16ed3..53a4f77e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -344,7 +344,7 @@ main () # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License +# be used in projects which are not available under the GNU General Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. @@ -523,6 +523,7 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "" ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; @@ -530,9 +531,9 @@ return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "" esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" - echo creating "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" - echo creating "$ac_dir/Makefile" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" fi ;; @@ -693,7 +694,7 @@ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) # Ulrich Drepper , 1996. # # This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License +# be used in projects which are not available under the GNU General Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. @@ -856,7 +857,7 @@ AC_DEFUN([AM_LANGINFO_CODESET], # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License +# be used in projects which are not available under the GNU General Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. diff --git a/config.h.in b/config.h.in index a9e03bb5..dab21292 100644 --- a/config.h.in +++ b/config.h.in @@ -1,4 +1,4 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ +/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ /* Define if using alloca.c. */ #undef C_ALLOCA @@ -89,7 +89,7 @@ #undef DISABLE_MOUSE /* Define this to load files upon inserting them, and allow switching between them; this is disabled if NANO_SMALL is defined */ -#undef ENABLE_LOADONINSERT +#undef ENABLE_MULTIBUFFER /* Define this to use the .nanorc file */ #undef ENABLE_NANORC diff --git a/configure b/configure index bc9ee28e..e85f0f0d 100755 --- a/configure +++ b/configure @@ -17,7 +17,7 @@ ac_help="$ac_help ac_help="$ac_help --enable-extra Enable extra (optional) functions, including easter eggs" ac_help="$ac_help - --enable-loadoninsert Enable use of file loading on insertion, and switching between loaded files; this is disabled if --enable-tiny is used" + --enable-multibuffer Enable use of file loading on insertion, and switching between loaded files; this is disabled if --enable-tiny is used" ac_help="$ac_help --enable-nanorc Enable use of .nanorc file" ac_help="$ac_help @@ -46,12 +46,12 @@ ac_help="$ac_help --disable-glibtest Do not try to compile and run a test GLIB program" ac_help="$ac_help --enable-debug Enable debugging (def disabled)" +ac_help="$ac_help + --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib" ac_help="$ac_help --disable-nls do not use Native Language Support" ac_help="$ac_help --with-included-gettext use the GNU gettext library included here" -ac_help="$ac_help - --with-catgets use catgets functions if available" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -1041,30 +1041,52 @@ else fi fi -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:1046: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi + echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 +echo "configure:1047: checking for strerror in -lcposix" >&5 +ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lcposix $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lcposix" else echo "$ac_t""no" 1>&6 - ISC= fi + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1068: checking how to run the C preprocessor" >&5 +echo "configure:1090: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1079,13 +1101,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1096,13 +1118,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1106: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1113,13 +1135,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1144,12 +1166,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1148: checking for ANSI C header files" >&5 +echo "configure:1170: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1157,7 +1179,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1161: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1183: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1174,7 +1196,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1192,7 +1214,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1213,7 +1235,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1224,7 +1246,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1251,17 +1273,17 @@ for ac_hdr in fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h reg do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1255: checking for $ac_hdr" >&5 +echo "configure:1277: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1265: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1332,18 +1354,22 @@ if test "${enable_extra+set}" = set; then #define NANO_EXTRA 1 EOF extra_support=yes + cat >> confdefs.h <<\EOF +#define ENABLE_MULTIBUFFER 1 +EOF + multibuffer_support=yes fi fi -# Check whether --enable-loadoninsert or --disable-loadoninsert was given. -if test "${enable_loadoninsert+set}" = set; then - enableval="$enable_loadoninsert" +# Check whether --enable-multibuffer or --disable-multibuffer was given. +if test "${enable_multibuffer+set}" = set; then + enableval="$enable_multibuffer" if test x$enableval = xyes && test x$tiny_support != xyes; then cat >> confdefs.h <<\EOF -#define ENABLE_LOADONINSERT 1 +#define ENABLE_MULTIBUFFER 1 EOF - loadoninsert_support=yes + multibuffer_support=yes fi fi @@ -1468,7 +1494,7 @@ fi echo $ac_n "checking whether to use slang""... $ac_c" 1>&6 -echo "configure:1472: checking whether to use slang" >&5 +echo "configure:1498: checking whether to use slang" >&5 CURSES_LIB_NAME="" # Check whether --with-slang or --without-slang was given. if test "${with_slang+set}" = set; then @@ -1488,17 +1514,17 @@ if test "${with_slang+set}" = set; then ac_safe=`echo "slcurses.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for slcurses.h""... $ac_c" 1>&6 -echo "configure:1492: checking for slcurses.h" >&5 +echo "configure:1518: checking for slcurses.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1528: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1515,21 +1541,21 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for SLtt_initialize in -lslang""... $ac_c" 1>&6 -echo "configure:1519: checking for SLtt_initialize in -lslang" >&5 +echo "configure:1545: checking for SLtt_initialize in -lslang" >&5 _libs=$LIBS LIBS="$LIBS -lslang" if test "$cross_compiling" = yes; then echo "configure: warning: *** Can not use slang when cross-compiling" 1>&2 else cat > conftest.$ac_ext < #include int main () { SLtt_initialize (NULL); return 0; } EOF -if { (eval echo configure:1533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1559: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1552,7 +1578,7 @@ else # We might need the term library for termlib in ncurses curses termcap terminfo termlib; do echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6 -echo "configure:1556: checking for tputs in -l${termlib}" >&5 +echo "configure:1582: checking for tputs in -l${termlib}" >&5 ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1560,7 +1586,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l${termlib} $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1595,20 +1621,20 @@ fi done echo $ac_n "checking for SLtt_initialize in -lslang $tcap""... $ac_c" 1>&6 -echo "configure:1599: checking for SLtt_initialize in -lslang $tcap" >&5 +echo "configure:1625: checking for SLtt_initialize in -lslang $tcap" >&5 LIBS="$LIBS $tcap" if test "$cross_compiling" = yes; then echo "configure: warning: *** Can not use slang when cross-compiling" 1>&2 else cat > conftest.$ac_ext < #include int main () { SLtt_initialize (NULL); return 0; } EOF -if { (eval echo configure:1612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1630,20 +1656,20 @@ else echo "$ac_t""no" 1>&6 # We might need the math library echo $ac_n "checking for SLtt_initialize in -lslang $tcap -lm""... $ac_c" 1>&6 -echo "configure:1634: checking for SLtt_initialize in -lslang $tcap -lm" >&5 +echo "configure:1660: checking for SLtt_initialize in -lslang $tcap -lm" >&5 LIBS="$LIBS -lm" if test "$cross_compiling" = yes; then echo "configure: warning: *** Can not use slang when cross-compiling" 1>&2 else cat > conftest.$ac_ext < #include int main () { SLtt_initialize (NULL); return 0; } EOF -if { (eval echo configure:1647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1700,12 +1726,12 @@ fi for ac_func in snprintf vsnprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1704: checking for $ac_func" >&5 +echo "configure:1730: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1807,7 +1833,7 @@ fi # Extract the first word of "glib-config", so it can be a program name with args. set dummy glib-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1811: checking for $ac_word" >&5 +echo "configure:1837: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1842,7 +1868,7 @@ fi min_glib_version=1.2.4 echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 -echo "configure:1846: checking for GLIB - version >= $min_glib_version" >&5 +echo "configure:1872: checking for GLIB - version >= $min_glib_version" >&5 no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes @@ -1865,7 +1891,7 @@ echo "configure:1846: checking for GLIB - version >= $min_glib_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -1941,7 +1967,7 @@ main () } EOF -if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1971: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1975,7 +2001,7 @@ fi CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat > conftest.$ac_ext < @@ -1985,7 +2011,7 @@ int main() { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } EOF -if { (eval echo configure:1989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" @@ -2032,12 +2058,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2036: checking return type of signal handlers" >&5 +echo "configure:2062: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2054,7 +2080,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2084: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2073,12 +2099,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:2077: checking for vprintf" >&5 +echo "configure:2103: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -2125,12 +2151,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:2129: checking for _doprnt" >&5 +echo "configure:2155: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -2180,12 +2206,12 @@ fi for ac_func in getopt_long do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2184: checking for $ac_func" >&5 +echo "configure:2210: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2241,17 +2267,17 @@ then do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2245: checking for $ac_hdr" >&5 +echo "configure:2271: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2278,7 +2304,7 @@ fi done echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 -echo "configure:2282: checking for tgetent in -lncurses" >&5 +echo "configure:2308: checking for tgetent in -lncurses" >&5 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2286,7 +2312,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2327: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2322,7 +2348,7 @@ fi if eval "test x$CURSES_LIB_NAME = x" then echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 -echo "configure:2326: checking for tgetent in -lcurses" >&5 +echo "configure:2352: checking for tgetent in -lcurses" >&5 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2330,7 +2356,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2367,7 +2393,7 @@ fi if eval "test x$CURSES_LIB_NAME = x" then echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>&6 -echo "configure:2371: checking for initscr in -lcurses" >&5 +echo "configure:2397: checking for initscr in -lcurses" >&5 ac_lib_var=`echo curses'_'initscr | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2375,7 +2401,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2411,7 +2437,7 @@ fi if eval "test x$CURSES_LIB_NAME = x" then echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 -echo "configure:2415: checking for tgetent in -ltermcap" >&5 +echo "configure:2441: checking for tgetent in -ltermcap" >&5 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2419,7 +2445,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermcap $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2464,7 +2490,7 @@ fi echo $ac_n "checking for use_default_colors in -l$CURSES_LIB_NAME""... $ac_c" 1>&6 -echo "configure:2468: checking for use_default_colors in -l$CURSES_LIB_NAME" >&5 +echo "configure:2494: checking for use_default_colors in -l$CURSES_LIB_NAME" >&5 ac_lib_var=`echo $CURSES_LIB_NAME'_'use_default_colors | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2472,7 +2498,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$CURSES_LIB_NAME $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2508,7 +2534,7 @@ fi if test x$slang_support != xyes; then echo $ac_n "checking for wresize in -l$CURSES_LIB_NAME""... $ac_c" 1>&6 -echo "configure:2512: checking for wresize in -l$CURSES_LIB_NAME" >&5 +echo "configure:2538: checking for wresize in -l$CURSES_LIB_NAME" >&5 ac_lib_var=`echo $CURSES_LIB_NAME'_'wresize | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2516,7 +2542,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$CURSES_LIB_NAME $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2551,7 +2577,7 @@ else fi echo $ac_n "checking for resizeterm in -l$CURSES_LIB_NAME""... $ac_c" 1>&6 -echo "configure:2555: checking for resizeterm in -l$CURSES_LIB_NAME" >&5 +echo "configure:2581: checking for resizeterm in -l$CURSES_LIB_NAME" >&5 ac_lib_var=`echo $CURSES_LIB_NAME'_'resizeterm | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2559,7 +2585,7 @@ else ac_save_LIBS="$LIBS" LIBS="-l$CURSES_LIB_NAME $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2596,12 +2622,12 @@ fi # Taken from aumix (can't tell form the variable name?) echo $ac_n "checking for private member _use_keypad in WINDOW""... $ac_c" 1>&6 -echo "configure:2600: checking for private member _use_keypad in WINDOW" >&5 +echo "configure:2626: checking for private member _use_keypad in WINDOW" >&5 if eval "test \"`echo '$''{'aumix_cv_struct_window_usekeypad'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2612,7 +2638,7 @@ int main() { WINDOW w; w._use_keypad; ; return 0; } EOF -if { (eval echo configure:2616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* aumix_cv_struct_window_usekeypad=yes else @@ -2655,10 +2681,37 @@ then LDFLAGS="$LDFLAGS $glib_libs" fi + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:2692: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2662: checking for $ac_word" >&5 +echo "configure:2715: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2686,12 +2739,12 @@ else fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2690: checking for working const" >&5 +echo "configure:2743: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2761,21 +2814,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2765: checking for inline" >&5 +echo "configure:2818: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2832: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2801,12 +2854,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2805: checking for off_t" >&5 +echo "configure:2858: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2834,12 +2887,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2838: checking for size_t" >&5 +echo "configure:2891: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2869,19 +2922,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:2873: checking for working alloca.h" >&5 +echo "configure:2926: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -2902,12 +2955,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2906: checking for alloca" >&5 +echo "configure:2959: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2992: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -2967,12 +3020,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2971: checking whether alloca needs Cray hooks" >&5 +echo "configure:3024: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3001: checking for $ac_func" >&5 +echo "configure:3054: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3082: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3052,7 +3105,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3056: checking stack direction for C alloca" >&5 +echo "configure:3109: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3060,7 +3113,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -3104,17 +3157,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3108: checking for $ac_hdr" >&5 +echo "configure:3161: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3118: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3171: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3143,12 +3196,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3147: checking for $ac_func" >&5 +echo "configure:3200: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3196,7 +3249,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3200: checking for working mmap" >&5 +echo "configure:3253: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3204,7 +3257,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -3366,23 +3419,60 @@ EOF fi - - for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h sys/param.h + + echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6 +echo "configure:3425: checking whether we are using the GNU C Library 2.1 or newer" >&5 +if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "Lucky GNU user" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_gnu_library_2_1=yes +else + rm -rf conftest* + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi + +echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6 + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3376: checking for $ac_hdr" >&5 +echo "configure:3466: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3408,16 +3498,17 @@ else fi done - for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ -strdup __argz_count __argz_stringify __argz_next + for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \ +getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ +strdup strtoul tsearch __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3416: checking for $ac_func" >&5 +echo "configure:3507: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3465,85 +3556,184 @@ fi done - if test "${ac_cv_func_stpcpy+set}" != "set"; then - for ac_func in stpcpy -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3473: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + + + # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + +fi + + + echo $ac_n "checking for iconv""... $ac_c" 1>&6 +echo "configure:3575: checking for iconv" >&5 +if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); +#include +#include +int main() { +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); +; return 0; } +EOF +if { (eval echo configure:3593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_func_iconv=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + cat > conftest.$ac_ext < +#include +int main() { +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); +; return 0; } +EOF +if { (eval echo configure:3615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + LIBS="$am_save_LIBS" + fi + +fi + +echo "$ac_t""$am_cv_func_iconv" 1>&6 + if test "$am_cv_func_iconv" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ICONV 1 +EOF + + echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 +echo "configure:3636: checking for iconv declaration" >&5 + if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext < +#include +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif int main() { -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - ; return 0; } EOF -if { (eval echo configure:3501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" + am_cv_proto_iconv_arg1="" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + am_cv_proto_iconv_arg1="const" fi rm -f conftest* + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 + cat >> confdefs.h <&6 +echo "configure:3690: checking for nl_langinfo and CODESET" >&5 +if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 else - echo "$ac_t""no" 1>&6 + cat > conftest.$ac_ext < +int main() { +char* cs = nl_langinfo(CODESET); +; return 0; } +EOF +if { (eval echo configure:3702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_langinfo_codeset=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_langinfo_codeset=no +fi +rm -f conftest* + fi -done - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - cat >> confdefs.h <<\EOF -#define HAVE_STPCPY 1 +echo "$ac_t""$am_cv_langinfo_codeset" 1>&6 + if test $am_cv_langinfo_codeset = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LANGINFO_CODESET 1 EOF - fi + fi if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3535: checking for LC_MESSAGES" >&5 +echo "configure:3725: checking for LC_MESSAGES" >&5 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { return LC_MESSAGES ; return 0; } EOF -if { (eval echo configure:3547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3737: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* am_cv_val_LC_MESSAGES=yes else @@ -3564,7 +3754,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3568: checking whether NLS is requested" >&5 +echo "configure:3758: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -3576,7 +3766,9 @@ fi echo "$ac_t""$USE_NLS" 1>&6 + BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no + INTLLIBS= if test "$USE_NLS" = "yes"; then cat >> confdefs.h <<\EOF @@ -3584,7 +3776,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3588: checking whether included gettext is requested" >&5 +echo "configure:3780: checking whether included gettext is requested" >&5 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" @@ -3597,23 +3789,24 @@ fi nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE + CATOBJEXT=NONE + + + ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3607: checking for libintl.h" >&5 +echo "configure:3800: checking for libintl.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3617: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3629,134 +3822,144 @@ rm -f conftest* fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6 -echo "configure:3634: checking for gettext in libc" >&5 -if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then + echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6 +echo "configure:3827: checking for GNU gettext in libc" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +extern int _nl_msg_cat_cntr; int main() { -return (int) gettext ("") +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:3646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - gt_cv_func_gettext_libc=yes + gt_cv_func_gnugettext1_libc=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - gt_cv_func_gettext_libc=no + gt_cv_func_gnugettext1_libc=no fi rm -f conftest* fi -echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 +echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6 - if test "$gt_cv_func_gettext_libc" != "yes"; then - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:3662: checking for bindtextdomain in -lintl" >&5 -ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + if test "$gt_cv_func_gnugettext1_libc" != "yes"; then + echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6 +echo "configure:3857: checking for GNU gettext in libintl" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - ac_save_LIBS="$LIBS" -LIBS="-lintl $LIBS" -cat > conftest.$ac_ext < conftest.$ac_ext < +extern int _nl_msg_cat_cntr; int main() { -bindtextdomain() +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr ; return 0; } EOF -if { (eval echo configure:3681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" + gt_cv_func_gnugettext1_libintl=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" + gt_cv_func_gnugettext1_libintl=no fi rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:3697: checking for gettext in libintl" >&5 -if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:3702: checking for gettext in -lintl" >&5 -ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lintl $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - gt_cv_func_gettext_libintl=yes -else - echo "$ac_t""no" 1>&6 -gt_cv_func_gettext_libintl=no -fi - -fi - -echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 -else - echo "$ac_t""no" 1>&6 + LIBS="$gt_save_LIBS" fi +echo "$ac_t""$gt_cv_func_gnugettext1_libintl" 1>&6 fi - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - cat >> confdefs.h <<\EOF + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + cat >> confdefs.h <<\EOF #define HAVE_GETTEXT 1 EOF - # Extract the first word of "msgfmt", so it can be a program name with args. + + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + INTLLIBS="-lintl $LIBICONV" + fi + + gt_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + for ac_func in dcgettext +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3906: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + + LIBS="$gt_save_LIBS" + + # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3760: checking for $ac_word" >&5 +echo "configure:3963: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3786,66 +3989,11 @@ if test -n "$MSGFMT"; then else echo "$ac_t""no" 1>&6 fi - if test "$MSGFMT" != "no"; then - for ac_func in dcgettext -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3794: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:3822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - - # Extract the first word of "gmsgfmt", so it can be a program name with args. + if test "$MSGFMT" != "no"; then + # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3849: checking for $ac_word" >&5 +echo "configure:3997: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3878,10 +4026,12 @@ else echo "$ac_t""no" 1>&6 fi - # Extract the first word of "xgettext", so it can be a program name with args. + fi + + # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3885: checking for $ac_word" >&5 +echo "configure:4035: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3912,300 +4062,15 @@ else echo "$ac_t""no" 1>&6 fi - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - CATOBJEXT=.gmo - DATADIRNAME=share -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CATOBJEXT=.mo - DATADIRNAME=lib -fi -rm -f conftest* - INSTOBJEXT=.mo - fi - fi + CATOBJEXT=.gmo + fi else echo "$ac_t""no" 1>&6 fi - if test "$CATOBJEXT" = "NONE"; then - echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6 -echo "configure:3948: checking whether catgets can be used" >&5 - # Check whether --with-catgets or --without-catgets was given. -if test "${with_catgets+set}" = set; then - withval="$with_catgets" - nls_cv_use_catgets=$withval -else - nls_cv_use_catgets=no -fi - - echo "$ac_t""$nls_cv_use_catgets" 1>&6 - - if test "$nls_cv_use_catgets" = "yes"; then - echo $ac_n "checking for main in -li""... $ac_c" 1>&6 -echo "configure:3961: checking for main in -li" >&5 -ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-li $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo i | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi - - echo $ac_n "checking for catgets""... $ac_c" 1>&6 -echo "configure:4004: checking for catgets" >&5 -if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char catgets(); - -int main() { - -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_catgets) || defined (__stub___catgets) -choke me -#else -catgets(); -#endif - -; return 0; } -EOF -if { (eval echo configure:4032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_catgets=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_catgets=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'catgets`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <<\EOF -#define HAVE_CATGETS 1 -EOF - - INTLOBJS="\$(CATOBJS)" - # Extract the first word of "gencat", so it can be a program name with args. -set dummy gencat; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4054: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GENCAT" in - /*) - ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GENCAT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GENCAT" && ac_cv_path_GENCAT="no" - ;; -esac -fi -GENCAT="$ac_cv_path_GENCAT" -if test -n "$GENCAT"; then - echo "$ac_t""$GENCAT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - if test "$GENCAT" != "no"; then - # Extract the first word of "gmsgfmt", so it can be a program name with args. -set dummy gmsgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4090: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" - ;; -esac -fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - if test "$GMSGFMT" = "no"; then - # Extract the first word of "msgfmt", so it can be a program name with args. -set dummy msgfmt; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4127: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$GMSGFMT" in - /*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then - ac_cv_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="no" - ;; -esac -fi -GMSGFMT="$ac_cv_path_GMSGFMT" -if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - fi - # Extract the first word of "xgettext", so it can be a program name with args. -set dummy xgettext; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4162: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - case "$XGETTEXT" in - /*) - ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in $PATH; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then - ac_cv_path_XGETTEXT="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" - ;; -esac -fi -XGETTEXT="$ac_cv_path_XGETTEXT" -if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.cat - INSTOBJEXT=.cat - DATADIRNAME=lib - INTLDEPS='$(top_builddir)/intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=intl/libintl.h - nls_cv_header_libgt=intl/libgettext.h - fi -else - echo "$ac_t""no" 1>&6 -fi - - fi - fi - if test "$CATOBJEXT" = "NONE"; then nls_cv_use_gnu_gettext=yes fi @@ -4216,7 +4081,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4220: checking for $ac_word" >&5 +echo "configure:4085: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4250,7 +4115,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4254: checking for $ac_word" >&5 +echo "configure:4119: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4286,7 +4151,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4290: checking for $ac_word" >&5 +echo "configure:4155: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4318,15 +4183,11 @@ else fi + BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=intl/libintl.h - nls_cv_header_libgt=intl/libgettext.h + INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi if test "$XGETTEXT" != ":"; then @@ -4338,22 +4199,65 @@ fi fi fi - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=intl/libintl.h - nls_cv_header_libgt=intl/libgettext.h + POSUB=po fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + for ac_prog in bison +do +# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:4217: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$INTLBISON"; then + ac_cv_prog_INTLBISON="$INTLBISON" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_INTLBISON="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +INTLBISON="$ac_cv_prog_INTLBISON" +if test -n "$INTLBISON"; then + echo "$ac_t""$INTLBISON" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$INTLBISON" && break +done + + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + echo $ac_n "checking version of bison""... $ac_c" 1>&6 +echo "configure:4250: checking version of bison" >&5 + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + echo "$ac_t""$ac_prog_version" 1>&6 + fi + if test $ac_verc_fail = yes; then + INTLBISON=: fi for lang in $ALL_LINGUAS; do @@ -4370,7 +4274,17 @@ fi + + nls_cv_header_intl= + nls_cv_header_libgt= + + DATADIRNAME=share + + INSTOBJEXT=.mo + + + GENCAT=gencat @@ -4379,12 +4293,23 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4383: checking for catalogs to be installed" >&5 +echo "configure:4297: checking for catalogs to be installed" >&5 NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi done LINGUAS=$NEW_LINGUAS echo "$ac_t""$LINGUAS" 1>&6 @@ -4395,66 +4320,6 @@ echo "configure:4383: checking for catalogs to be installed" >&5 fi fi - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - - - test -d intl || mkdir intl - if test "$CATOBJEXT" = ".cat"; then - ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6 -echo "configure:4411: checking for linux/version.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4421: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - msgformat=linux -else - echo "$ac_t""no" 1>&6 -msgformat=xopen -fi - - - sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed - fi - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed - - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - - - MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" @@ -4464,22 +4329,8 @@ fi fi - l= + INTL_LIBTOOL_SUFFIX_PREFIX= - - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES trap '' 1 2 15 @@ -4632,29 +4483,34 @@ s%@GLIB_CONFIG@%$GLIB_CONFIG%g s%@GLIB_CFLAGS@%$GLIB_CFLAGS%g s%@GLIB_LIBS@%$GLIB_LIBS%g s%@CURSES_LIB@%$CURSES_LIB%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g s%@RANLIB@%$RANLIB%g s%@ALLOCA@%$ALLOCA%g +s%@GLIBC21@%$GLIBC21%g +s%@LIBICONV@%$LIBICONV%g s%@USE_NLS@%$USE_NLS%g s%@MSGFMT@%$MSGFMT%g s%@GMSGFMT@%$GMSGFMT%g s%@XGETTEXT@%$XGETTEXT%g -s%@GENCAT@%$GENCAT%g +s%@INTLBISON@%$INTLBISON%g +s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g s%@CATALOGS@%$CATALOGS%g s%@CATOBJEXT@%$CATOBJEXT%g -s%@DATADIRNAME@%$DATADIRNAME%g s%@GMOFILES@%$GMOFILES%g -s%@INSTOBJEXT@%$INSTOBJEXT%g -s%@INTLDEPS@%$INTLDEPS%g s%@INTLLIBS@%$INTLLIBS%g s%@INTLOBJS@%$INTLOBJS%g s%@POFILES@%$POFILES%g s%@POSUB@%$POSUB%g -s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g -s%@GT_NO@%$GT_NO%g -s%@GT_YES@%$GT_YES%g +s%@DATADIRNAME@%$DATADIRNAME%g +s%@INSTOBJEXT@%$INSTOBJEXT%g +s%@GENCAT@%$GENCAT%g s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g -s%@l@%$l%g +s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g CEOF EOF @@ -4862,51 +4718,6 @@ cat >> $CONFIG_STATUS <<\EOF fi fi; done -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -srcdir=$ac_given_srcdir -while test -n "$ac_sources"; do - set $ac_dests; ac_dest=$1; shift; ac_dests=$* - set $ac_sources; ac_source=$1; shift; ac_sources=$* - - echo "linking $srcdir/$ac_source to $ac_dest" - - if test ! -r $srcdir/$ac_source; then - { echo "configure: error: $srcdir/$ac_source: File not found" 1>&2; exit 1; } - fi - rm -f $ac_dest - - # Make relative symlinks. - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` - if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then - # The dest file is in a subdirectory. - test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" - ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dest_dir_suffix. - ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dest_dir_suffix= ac_dots= - fi - - case "$srcdir" in - [/$]*) ac_rel_source="$srcdir/$ac_source" ;; - *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; - esac - - # Make a symlink if possible; otherwise try a hard link. - if ln -s $ac_rel_source $ac_dest 2>/dev/null || - ln $srcdir/$ac_source $ac_dest; then : - else - { echo "configure: error: can not link $ac_dest to $srcdir/$ac_source" 1>&2; exit 1; } - fi -done EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -case "$CONFIG_FILES" in *po/Makefile.in*) - sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile - esac +for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done exit 0 EOF diff --git a/configure.in b/configure.in index 2a80053f..e8f051ce 100644 --- a/configure.in +++ b/configure.in @@ -31,12 +31,13 @@ AC_ARG_ENABLE(extra, [ --enable-extra Enable extra (optional) functions, including easter eggs], [if test x$enableval = xyes; then AC_DEFINE(NANO_EXTRA) extra_support=yes + AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes fi]) -AC_ARG_ENABLE(loadoninsert, -[ --enable-loadoninsert Enable use of file loading on insertion, and switching between loaded files; this is disabled if --enable-tiny is used], +AC_ARG_ENABLE(multibuffer, +[ --enable-multibuffer Enable use of file loading on insertion, and switching between loaded files; this is disabled if --enable-tiny is used], [if test x$enableval = xyes && test x$tiny_support != xyes; then - AC_DEFINE(ENABLE_LOADONINSERT) loadoninsert_support=yes + AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes fi]) AC_ARG_ENABLE(nanorc, diff --git a/files.c b/files.c index 938abbed..3b804a57 100644 --- a/files.c +++ b/files.c @@ -48,7 +48,7 @@ void load_file(void) { current = fileage; -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER /* add a new entry to the open_files structure, and check for duplicate entries; if a duplicate entry was found, reload the currently open file (it may have been changed during duplicate @@ -308,7 +308,7 @@ int do_insertfile(int loading_file) } #endif -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (loading_file) { /* update the current entry in the open_files structure; we @@ -324,7 +324,7 @@ int do_insertfile(int loading_file) i = open_file(realname, 1, 0); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (loading_file) filename = mallocstrcpy(filename, realname); #endif @@ -333,7 +333,7 @@ int do_insertfile(int loading_file) dump_buffer(fileage); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (loading_file) load_file(); else @@ -344,7 +344,7 @@ int do_insertfile(int loading_file) /* Here we want to rebuild the edit window */ fix_editbot(); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER /* If we've loaded another file, update the titlebar's contents */ if (loading_file) { clearok(topwin, FALSE); @@ -375,8 +375,8 @@ int do_insertfile(int loading_file) int do_insertfile_void(void) { int result = 0; -#ifdef ENABLE_LOADONINSERT - result = do_insertfile(ISSET(LOADONINSERT)); +#ifdef ENABLE_MULTIBUFFER + result = do_insertfile(ISSET(MULTIBUFFER)); #else result = do_insertfile(0); #endif @@ -385,7 +385,7 @@ int do_insertfile_void(void) return result; } -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER /* * Add/update an entry to the open_files filestruct. If update is * zero, a new entry is created; otherwise, the current entry is updated. @@ -1159,7 +1159,7 @@ int do_writeout(char *path, int exiting, int append) #endif i = write_file(answer, 0, append, 0); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER /* if we're not about to exit, update the current entry in the open_files structure */ if (!exiting) { diff --git a/global.c b/global.c index 081d1eb1..66acb218 100644 --- a/global.c +++ b/global.c @@ -54,7 +54,7 @@ filestruct *editbot = NULL; /* Same for the bottom */ filestruct *filebot = NULL; /* Last node in the file struct */ filestruct *cutbuffer = NULL; /* A place to store cut text */ -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER filestruct *open_files = NULL; /* The list of open files */ #endif @@ -148,7 +148,7 @@ void toggle_init(void) *toggle_cuttoend_msg, *toggle_wrap_msg, *toggle_case_msg, *toggle_backwards_msg; -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER char *toggle_load_msg, *nano_openprev_msg, *nano_opennext_msg; #endif @@ -170,8 +170,8 @@ void toggle_init(void) #endif toggle_wrap_msg = _("Auto wrap"); -#ifdef ENABLE_LOADONINSERT - toggle_load_msg = _("File loading on insertion"); +#ifdef ENABLE_MULTIBUFFER + toggle_load_msg = _("Multiple file buffers"); nano_openprev_msg = _("Open previously loaded file"); nano_opennext_msg = _("Open next loaded file"); #endif @@ -197,9 +197,9 @@ void toggle_init(void) toggle_init_one(&toggles[9], TOGGLE_CASE_KEY, toggle_case_msg, CASE_SENSITIVE, 0); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER toggle_init_one(&toggles[10], TOGGLE_LOAD_KEY, toggle_load_msg, - LOADONINSERT, 0); + MULTIBUFFER, 0); toggle_init_one(&toggles[11], NANO_OPENPREV_KEY, nano_openprev_msg, 0, '<'); toggle_init_one(&toggles[12], NANO_OPENNEXT_KEY, nano_opennext_msg, @@ -238,7 +238,7 @@ void shortcut_init(int unjustify) nano_help_msg = _("Invoke the help menu"); nano_writeout_msg = _("Write the current file to disk"); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER nano_exit_msg = _("Close currently loaded file/Exit from nano"); #else nano_exit_msg = _("Exit from nano"); @@ -284,7 +284,7 @@ void shortcut_init(int unjustify) sc_init_one(&main_list[0], NANO_HELP_KEY, _("Get Help"), nano_help_msg, 0, NANO_HELP_FKEY, 0, VIEW, do_help); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (open_files != NULL && (open_files->prev || open_files->next)) sc_init_one(&main_list[1], NANO_EXIT_KEY, _("Close"), nano_exit_msg, 0, NANO_EXIT_FKEY, 0, VIEW, do_exit); diff --git a/nano.c b/nano.c index 4dcfcd7b..cdfba353 100644 --- a/nano.c +++ b/nano.c @@ -126,7 +126,7 @@ void die(char *msg, ...) isn't up to date) */ die_save_file(filename); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER /* then save all of the other loaded files, if any */ if (open_files) { filestruct *tmp; @@ -402,10 +402,10 @@ void usage(void) printf(_("Usage: nano [GNU long option] [option] +LINE \n\n")); printf(_("Option Long option Meaning\n")); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER printf (_ - (" -L --loadoninsert Enable file loading on insertion\n")); + (" -F --multibuffer Enable multiple file buffers\n")); #endif printf(_ @@ -463,6 +463,9 @@ void usage(void) #else printf(_("Usage: nano [option] +LINE \n\n")); printf(_("Option Meaning\n")); +#ifdef ENABLE_MULTIBUFFER + printf(_(" -F Enable multiple file buffers\n")); +#endif printf(_(" -T [num] Set width of a tab to num\n")); printf(_(" -R Use regular expressions for search\n")); printf(_(" -V Print version information and exit\n")); @@ -510,10 +513,12 @@ void version(void) #ifdef NANO_EXTRA printf(" --enable-extra"); -#endif -#ifdef ENABLE_LOADONINSERT - printf(" --enable-loadoninsert"); -#endif +#else +#ifdef ENABLE_MULTIBUFFER + printf(" --enable-multibuffer"); +#endif /* ENABLE_MULTIBUFFER */ +#endif /* NANO_EXTRA */ + #ifdef ENABLE_NANORC printf(" --enable-nanorc"); #endif @@ -1007,9 +1012,10 @@ void do_wrap(filestruct * inptr, char input_char) space or tab, then null terminate it so we can strcat it to hell */ while ((inptr->next->data[non] == ' ' - || inptr->next->data[non] == '\t')) - p[non] = inptr->next->data[non++]; - + || inptr->next->data[non] == '\t')) { + p[non] = inptr->next->data[non]; + non++; + } p[non] = 0; strcat(p, temp->data); strcat(p, " "); @@ -1516,7 +1522,7 @@ int do_alt_speller(char *file_name) do_gotoline(lineno_cur, 0); set_modified(); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER /* if we have multiple files open, the spell-checked (current) file is now stored after the un-spell-checked file in the open_files structure, so go back to the un-spell-checked file and close it */ @@ -1572,7 +1578,7 @@ int do_exit(void) if (!ISSET(MODIFIED)) { -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (!close_open_file()) { display_main_list(); return 1; @@ -1598,7 +1604,7 @@ int do_exit(void) if (i == 1) { if (do_writeout(filename, 1, 0) > 0) { -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (!close_open_file()) { display_main_list(); return 1; @@ -1610,7 +1616,7 @@ int do_exit(void) } } else if (i == 0) { -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER if (!close_open_file()) { display_main_list(); return 1; @@ -2382,8 +2388,8 @@ int main(int argc, char *argv[]) {"nofollow", 0, 0, 'l'}, {"tabsize", 1, 0, 'T'}, -#ifdef ENABLE_LOADONINSERT - {"loadoninsert", 0, 0, 'L'}, +#ifdef ENABLE_MULTIBUFFER + {"MULTIBUFFER", 0, 0, 'L'}, #endif {0, 0, 0, 0} @@ -2415,9 +2421,9 @@ int main(int argc, char *argv[]) switch (optchr) { -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER case 'L': - SET(LOADONINSERT); + SET(MULTIBUFFER); break; #endif @@ -2697,8 +2703,8 @@ int main(int argc, char *argv[]) break; case 126: /* Hack, make insert key do something useful, like insert file */ -#ifdef ENABLE_LOADONINSERT - do_insertfile(ISSET(LOADONINSERT)); +#ifdef ENABLE_MULTIBUFFER + do_insertfile(ISSET(MULTIBUFFER)); #else do_insertfile(0); #endif @@ -2767,7 +2773,7 @@ int main(int argc, char *argv[]) break; } break; -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER case NANO_OPENPREV_KEY: open_prevfile(0); keyhandled = 1; diff --git a/nano.h b/nano.h index 4d441f1d..bca145a4 100644 --- a/nano.h +++ b/nano.h @@ -74,7 +74,7 @@ typedef struct filestruct { struct filestruct *next; /* Next node */ struct filestruct *prev; /* Previous node */ -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER struct filestruct *file; /* Current file */ int file_current_x; /* Current file's x-coordinate position */ int file_current_y; /* Current file's y-coordinate position */ @@ -139,7 +139,7 @@ typedef struct rcoption { #define CUT_TO_END (1<<17) #define DISABLE_CURPOS (1<<18) #define REVERSE_SEARCH (1<<19) -#define LOADONINSERT (1<<20) +#define MULTIBUFFER (1<<20) /* Control key sequences, changing these would be very very bad */ @@ -272,13 +272,13 @@ know what you're doing */ #define TOGGLE_WRAP_KEY NANO_ALT_W #define TOGGLE_BACKWARDS_KEY NANO_ALT_B #define TOGGLE_CASE_KEY NANO_ALT_A -#define TOGGLE_LOAD_KEY NANO_ALT_L +#define TOGGLE_LOAD_KEY NANO_ALT_F /* Toggle stuff, these static lengths need to go away RSN */ #ifdef HAVE_REGEX_H -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER #define TOGGLE_LEN 14 #else #define TOGGLE_LEN 11 @@ -288,7 +288,7 @@ know what you're doing */ #define REPLACE_LIST_LEN 8 #else -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER #define TOGGLE_LEN 13 #else #define TOGGLE_LEN 10 diff --git a/nanorc.sample b/nanorc.sample index 319a09f5..8e155b41 100644 --- a/nanorc.sample +++ b/nanorc.sample @@ -42,5 +42,7 @@ # set suspend # Load files upon inserting them, and allow switching between them -# set loadoninsert - +# You must have configured with --enable-multibuffer or --enable-extra for +# this to work +# +# set multibuffer diff --git a/proto.h b/proto.h index 887a6c16..dcc962f0 100644 --- a/proto.h +++ b/proto.h @@ -51,7 +51,7 @@ extern struct stat fileinfo; extern filestruct *current, *fileage, *edittop, *editbot, *filebot; extern filestruct *cutbuffer, *mark_beginbuf; -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER extern filestruct *open_files; #endif @@ -96,7 +96,7 @@ int renumber_all(void); int open_file(char *filename, int insert, int quiet); int do_insertfile(int loading_file); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER int add_open_file(int update, int dup_fix); #endif @@ -178,7 +178,7 @@ void do_credits(void); int do_writeout_void(void), do_exit(void), do_gotoline_void(void); int do_insertfile_void(void), do_search(void); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER int load_open_file(void), close_open_file(void); #endif @@ -191,14 +191,14 @@ int do_first_line(void), do_last_line(void); int do_replace(void), do_help(void), do_enter_void(void); int keypad_on(WINDOW * win, int newval); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER int open_file_dup_fix(int update); int open_prevfile(int closing_file), open_nextfile(int closing_file); #endif char *charalloc (size_t howmuch); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER char *get_full_path(const char *origpath); #endif @@ -224,6 +224,6 @@ filestruct *make_new_node(filestruct * prevnode); filestruct *findnextstr(int quiet, filestruct * begin, int beginx, char *needle); -#ifdef ENABLE_LOADONINSERT +#ifdef ENABLE_MULTIBUFFER filestruct *open_file_dup_search(void); #endif