Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: fix configure good and proper.



I've spent my afternoon updating configure to fit better with the latest
features.  I will commit the changes immediately --- it's only been
tried on Debian and Mandrake, so expect a certain amount of pain
elsewhere.  However, the changes went a lot smoother than I expected.
(Plus Bluetooth means I can write this on the sofa.  No, I don't want
your stinking 802.11 :-).)  (I did try in a directory separate from the
source directory, however.)

The main change is for config.modules.  Autoconf now allows files
generated by commands to be treated in the same way as files generated
by substitution, so config.modules is much less of an exception.  The
file is still generated by building and running config.modules.sh; this
is now always run from config.status.  However, that has been changed so
that the information gleaned from configure is built into it.  Its only
job is to see if the user has set `auto=no'. otherwise it simply outputs
the string which was stored when configure was run.  This is basically
what Oliver suggested.

Together with this patch, acconfig.h needs to be deleted.

I have not reapplied the changes to attempt to improve terminfo
configuration.  That will need rewriting; also, we need to avoid a
problem with checking term.h before we know it compiles.

I have also not looked at an ordering problem with sys/ptem.h which will
need investigating; it doesn't exist here.  There is probably a
prerequisite header.

--- /pwshome/zsh/sourceforge/zsh/Config/config.mk	Sun May 20 23:24:30 2001
+++ Config/config.mk	Sat Feb 14 18:03:38 2004
@@ -35,8 +35,8 @@
 
 Makefile: Makefile.in $(dir_top)/config.status $(CONFIG_INCS)
 	cd $(dir_top) && \
-	  CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+	  $(SHELL) ./config.status `echo $(subdir)/$@ | sed 's%^./%%'`
 
 $(dir_top)/Config/defs.mk: $(sdir_top)/Config/defs.mk.in $(dir_top)/config.status
 	cd $(dir_top) && \
-	  CONFIG_FILES=Config/defs.mk CONFIG_HEADERS= $(SHELL) ./config.status
+	  $(SHELL) ./config.status Config/defs.mk
--- /pwshome/zsh/sourceforge/zsh/Makefile.in	Sat Jan 17 17:41:35 2004
+++ Makefile.in	Sat Feb 14 18:04:20 2004
@@ -117,7 +117,7 @@
 @CLEAN_MK@
 
 distclean-here:
-	rm -f Makefile config.h config.status config.log config.cache config.modules stamp-h Config/defs.mk
+	rm -f Makefile config.h config.status config.log config.cache config.modules config.modules.sh stamp-h Config/defs.mk
 
 realclean-here:
 	cd $(sdir) && rm -f config.h.in stamp-h.in configure
@@ -134,13 +134,11 @@
 $(sdir)/configure: $(sdir)/aclocal.m4 $(sdir)/aczsh.m4 $(sdir)/configure.ac
 	cd $(sdir) && autoconf
 
-config.h: stamp-h
-stamp-h: $(sdir)/config.h.in config.status
-	cd $(dir_top) && \
-	  CONFIG_FILES= CONFIG_HEADERS=$(subdir)/config.h $(SHELL) ./config.status
+config.h config.modules: $(sdir)/config.h.in config.status
+	cd $(dir_top) && $(SHELL) ./config.status $@
 
 $(sdir)/config.h.in: $(sdir)/stamp-h.in
-$(sdir)/stamp-h.in: $(sdir)/configure.ac $(sdir)/acconfig.h \
+$(sdir)/stamp-h.in: $(sdir)/configure.ac \
 		$(sdir)/aclocal.m4 $(sdir)/aczsh.m4
 	cd $(sdir) && autoheader
 	echo > $(sdir)/stamp-h.in
--- /pwshome/zsh/sourceforge/zsh/Src/Modules/system.mdd	Sat Aug 30 18:56:18 2003
+++ Src/Modules/system.mdd	Sat Feb 14 18:14:23 2004
@@ -23,5 +23,9 @@
 
 errcount.h: errnames.c
 	grep 'define.*ERRCOUNT' errnames.c > $@
+
+clean-here: clean.system
+clean.system:
+	rm -f errcount.h errnames.c
 Make
 
--- /pwshome/zsh/sourceforge/zsh/Src/mkmakemod.sh	Sat Jun  9 01:04:26 2001
+++ Src/mkmakemod.sh	Sat Feb 14 16:25:30 2004
@@ -466,21 +466,11 @@
 fi
 
 if $second_stage ; then
-    if grep 'Hack for autoconf-2.13' ./config.status > /dev/null 2>&1 ; then
-        bang=\!
-    else
-	bang=
-    fi
-
     trap "rm -f $the_subdir/${the_makefile}" 1 2 15
 
-    # The standard config.status requires the pathname for the .in file to
-    # be relative to the top of the source tree.  As we have it in the build
-    # tree, this is a problem.  zsh's configure script edits config.status,
-    # adding the feature that an input filename starting with "!" has the
-    # "!" removed and is not mangled further.
-    CONFIG_FILES=$the_subdir/${the_makefile}:$bang$the_subdir/${the_makefile}.in CONFIG_HEADERS= ${CONFIG_SHELL-/bin/sh} ./config.status
-
+    ${CONFIG_SHELL-/bin/sh} ./config.status \
+	--file=$the_subdir/${the_makefile}:$the_subdir/${the_makefile}.in ||
+    return 1
 fi
 
 exit 0
--- /pwshome/zsh/sourceforge/zsh/aczsh.m4	Sat Apr  5 19:17:37 2003
+++ aczsh.m4	Sat Feb 14 17:54:58 2004
@@ -594,8 +594,11 @@
   zsh_cv_path_$1=no
 done
 ])
+AH_TEMPLATE([PATH_]translit($1, [a-z], [A-Z])[_FILE],
+[Define to be location of ]$1[ file.])
 if test $zsh_cv_path_$1 != no; then
-  AC_DEFINE_UNQUOTED(PATH_[]translit($1, [a-z], [A-Z])[]_FILE, "$zsh_cv_path_$1")
+  AC_DEFINE_UNQUOTED([PATH_]translit($1, [a-z], [A-Z])[_FILE],
+  "$zsh_cv_path_$1")
 fi
 ])
 
@@ -610,8 +613,10 @@
 [zsh_cv_type_exists_[]translit($2, [ ], [_])=yes],
 [zsh_cv_type_exists_[]translit($2, [ ], [_])=no])
 ])
+AH_TEMPLATE([HAVE_]translit($2, [ a-z], [_A-Z]),
+[Define to 1 if ]$2[ is defined by a system header])
 if test $zsh_cv_type_exists_[]translit($2, [ ], [_]) = yes; then
-  AC_DEFINE(HAVE_[]translit($2, [ a-z], [_A-Z]))
+  AC_DEFINE([HAVE_]translit($2, [ a-z], [_A-Z]))
 fi
 ])
 
@@ -627,8 +632,10 @@
 [zsh_cv_struct_member_[]translit($2, [ ], [_])_$3=yes],
 [zsh_cv_struct_member_[]translit($2, [ ], [_])_$3=no])
 ])
+AH_TEMPLATE([HAVE_]translit($2_$3, [ a-z], [_A-Z]),
+[Define if your system's ]$2[ has a member named ]$3[.])
 if test $zsh_cv_struct_member_[]translit($2, [ ], [_])_$3 = yes; then
-  AC_DEFINE(HAVE_[]translit($2_$3, [ a-z], [_A-Z]))
+  AC_DEFINE([HAVE_]translit($2_$3, [ a-z], [_A-Z]))
 fi
 ])
 
@@ -707,12 +714,15 @@
       zsh_cv_type_socklen_t=int
     fi]
   )
-  AC_DEFINE_UNQUOTED([SOCKLEN_T], [$zsh_cv_type_socklen_t])]
+  AC_DEFINE_UNQUOTED([SOCKLEN_T], [$zsh_cv_type_socklen_t],
+  [Define to the base type of the third argument of accept])]
 )
 
 dnl Check for limit $1 e.g. RLIMIT_RSS.
 AC_DEFUN(zsh_LIMIT_PRESENT,
-[AC_CACHE_CHECK([for limit $1],
+[AH_TEMPLATE([HAVE_]$1,
+[Define to 1 if ]$1[ is present (whether or not as a macro).])
+AC_CACHE_CHECK([for limit $1],
 zsh_cv_have_$1,
 [AC_TRY_COMPILE([
 #include <sys/types.h>
--- /pwshome/zsh/sourceforge/zsh/configure.ac	Sat Jan 17 17:41:40 2004
+++ configure.ac	Sat Feb 14 17:56:55 2004
@@ -39,9 +39,12 @@
 dnl Find out machine type, vendor, and operating system
 dnl What type of host is this?
 AC_CANONICAL_HOST
-AC_DEFINE_UNQUOTED(MACHTYPE, "$host_cpu")
-AC_DEFINE_UNQUOTED(VENDOR,   "$host_vendor")
-AC_DEFINE_UNQUOTED(OSTYPE,   "$host_os")
+AC_DEFINE_UNQUOTED(MACHTYPE, "$host_cpu",
+[Define to be the machine type (microprocessor class or machine model).])
+AC_DEFINE_UNQUOTED(VENDOR,   "$host_vendor",
+[Define to be a string corresponding the vendor of the machine.])
+AC_DEFINE_UNQUOTED(OSTYPE,   "$host_os",
+[Define to be the name of the operating system.])
 
 dnl -----------------------------
 dnl CHECKING COMMAND LINE OPTIONS
@@ -54,6 +57,8 @@
 
 dnl Do you want to debug zsh?
 ifdef([zsh-debug],[undefine([zsh-debug])])dnl
+AH_TEMPLATE([DEBUG],
+[Define to 1 if you want to debug zsh.])
 AC_ARG_ENABLE(zsh-debug,
 [  --enable-zsh-debug         compile with debug code and debugger symbols],
 [if test x$enableval = xyes; then
@@ -62,6 +67,8 @@
 
 dnl Do you want zsh memory allocation routines.
 ifdef([zsh-mem],[undefine([zsh-mem])])dnl
+AH_TEMPLATE([ZSH_MEM],
+[Define to 1 if you want to use zsh's own memory allocation routines])
 AC_ARG_ENABLE(zsh-mem,
 [  --enable-zsh-mem           compile with zsh memory allocation routines],
 [if test x$enableval = xyes; then
@@ -70,6 +77,8 @@
 
 dnl Do you want to debug zsh memory allocation routines.
 ifdef([zsh-mem-debug],[undefine([zsh-mem-debug])])dnl
+AH_TEMPLATE([ZSH_MEM_DEBUG],
+[Define to 1 if you want to debug zsh memory allocation routines.])
 AC_ARG_ENABLE(zsh-mem-debug,
 [  --enable-zsh-mem-debug     debug zsh memory allocation routines],
 [if test x$enableval = xyes; then
@@ -77,6 +86,8 @@
 fi])
 
 dnl Do you want to print warnings when errors in memory allocation.
+AH_TEMPLATE([ZSH_MEM_WARNING],
+[Define to 1 if you want to turn on warnings of memory allocation errors])
 ifdef([zsh-mem-warning],[undefine([zsh-mem-warning])])dnl
 AC_ARG_ENABLE(zsh-mem-warning,
 [  --enable-zsh-mem-warning   print warnings for errors in memory allocation],
@@ -86,6 +97,8 @@
 
 dnl Do you want to turn on error checking for free().
 ifdef([zsh-secure-free],[undefine([zsh-secure-free])])dnl
+AH_TEMPLATE([ZSH_SECURE_FREE],
+[Define to 1 if you want to turn on memory checking for free().])
 AC_ARG_ENABLE(zsh-secure-free,
 [  --enable-zsh-secure-free   turn on error checking for free()],
 [if test x$enableval = xyes; then
@@ -95,6 +108,9 @@
 dnl Do you want debugging information on internal hash tables.
 dnl This turns on the `hashinfo' builtin command.
 ifdef([zsh-hash-debug],[undefine([zsh-hash-debug])])dnl
+AH_TEMPLATE([ZSH_HASH_DEBUG],
+[Define to 1 if you want to get debugging information on internal
+ hash tables.  This turns on the `hashinfo' builtin.])
 AC_ARG_ENABLE(zsh-hash-debug,
 [  --enable-zsh-hash-debug    turn on debugging of internal hash tables],
 [if test x$enableval = xyes; then
@@ -116,6 +132,9 @@
 else
   zshenv="$etcdir/zshenv"
 fi])
+AH_TEMPLATE([GLOBAL_ZSHENV],
+[The global file to source absolutely first whenever zsh is run;
+ if undefined, don't source anything.])
 if test "x$zshenv" != xno; then
   AC_DEFINE_UNQUOTED(GLOBAL_ZSHENV, "$zshenv")
 fi
@@ -129,6 +148,9 @@
 else
   zshrc="$etcdir/zshrc"
 fi])
+AH_TEMPLATE([GLOBAL_ZSHRC],
+[The global file to source whenever zsh is run;
+ if undefined, don't source anything])
 if test "x$zshrc" != xno; then
   AC_DEFINE_UNQUOTED(GLOBAL_ZSHRC, "$zshrc")
 fi
@@ -142,6 +164,9 @@
 else
   zprofile="$etcdir/zprofile"
 fi])
+AH_TEMPLATE([GLOBAL_ZPROFILE],
+[The global file to source whenever zsh is run as a login shell,
+ before zshrc is read; if undefined, don't source anything.])
 if test "x$zprofile" != xno; then
   AC_DEFINE_UNQUOTED(GLOBAL_ZPROFILE, "$zprofile")
 fi
@@ -155,6 +180,9 @@
 else
   zlogin="$etcdir/zlogin"
 fi])
+AH_TEMPLATE([GLOBAL_ZLOGIN],
+[The global file to source whenever zsh is run as a login shell;
+ if undefined, don't source anything])
 if test "x$zlogin" != xno; then
   AC_DEFINE_UNQUOTED(GLOBAL_ZLOGIN, "$zlogin")
 fi
@@ -168,6 +196,10 @@
 else
   zlogout="$etcdir/zlogout"
 fi])
+AH_TEMPLATE([GLOBAL_ZLOGOUT],
+[The global file to source whenever zsh was run as a login shell.
+ This is sourced right before exiting.  If undefined, don't source
+ anything.])
 if test "x$zlogout" != xno; then
   AC_DEFINE_UNQUOTED(GLOBAL_ZLOGOUT, "$zlogout")
 fi
@@ -192,6 +224,10 @@
 
 dnl Do you want to disable restricted on r* commands
 ifdef([restricted-r],[undefine([restricted-r])])dnl
+AH_TEMPLATE([RESTRICTED_R],
+[Undefine this if you don't want to get a restricted shell
+ when zsh is exec'd with basename that starts with r.
+ By default this is defined.])
 AC_ARG_ENABLE(restricted-r,
 [  --disable-restricted-r     turn off r* invocation for restricted shell],
 [if test x$enableval = xyes; then
@@ -201,6 +237,8 @@
 )
 
 dnl Do you want to disable use of locale functions
+AH_TEMPLATE([CONFIG_LOCALE],
+[Undefine if you don't want local features.  By default this is defined.])
 AC_ARG_ENABLE([locale],
 [  --disable-locale           turn off locale features],
 [if test x$enableval = xyes; then
@@ -250,6 +288,8 @@
 
 dnl Do you want maildir support?
 ifdef([maildir_support],[undefine([maildir_support])])dnl
+AH_TEMPLATE([MAILDIR_SUPPORT],
+[Define for Maildir support])
 AC_ARG_ENABLE(maildir-support,
 [  --enable-maildir-support   enable maildir support in MAIL and MAILPATH],
 [if test x$enableval = xyes; then
@@ -258,6 +298,8 @@
 
 dnl Do you want to set a maximum function depth?
 ifdef([max_function_depth],[undefine([max_function_depth])])dnl
+AH_TEMPLATE([MAX_FUNCTION_DEPTH],
+[Define for function depth limits])
 AC_ARG_ENABLE(max-function-depth,
 [  --enable-max-function-depth=MAX   limit function depth to MAX],
 [if test x$enableval = xyes; then
@@ -360,10 +402,6 @@
 AC_PROG_GCC_TRADITIONAL     dnl Do we need -traditional flag for gcc.
 AC_C_CONST                  dnl Does compiler support `const'.
 
-AC_CYGWIN                   dnl Check for cygwin environment
-
-AC_EXEEXT                   dnl Check for executable extension, e.g. .exe
-
 fp_PROG_CC_STDC
 AC_MSG_CHECKING([whether to use prototypes])
 if test ."$ansi2knr" = .yes || test ."$ansi2knr" = .no; then
@@ -376,6 +414,8 @@
     ansi2knr=no
   fi
 fi
+AH_TEMPLATE([PROTOTYPES],
+[Define to 1 if ANSI function prototypes are usable.])
 if test "$ansi2knr" = yes; then
   AC_MSG_RESULT(${msg}no)
   U=_
@@ -394,6 +434,8 @@
 [AC_TRY_COMPILE([union{void *p;long l;}u={0};], [u.l=1;],
   zsh_cv_c_have_union_init=yes,
   zsh_cv_c_have_union_init=no)])
+AH_TEMPLATE([HAVE_UNION_INIT],
+[Define to 1 if the compiler can initialise a union.])
 if test $zsh_cv_c_have_union_init = yes; then
   AC_DEFINE(HAVE_UNION_INIT)
 fi
@@ -405,6 +447,8 @@
   zsh_cv_c_broken_signed_to_unsigned_casting=yes,
   zsh_cv_c_broken_signed_to_unsigned_casting=no,
   zsh_cv_c_broken_signed_to_unsigned_casting=no)])
+AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING],
+[Define to 1 if compiler incorrectly cast signed to unsigned.])
 if test $zsh_cv_c_broken_signed_to_unsigned_casting = yes; then
   AC_DEFINE(BROKEN_SIGNED_TO_UNSIGNED_CASTING)
 fi
@@ -415,6 +459,8 @@
 [AC_TRY_COMPILE([int foo(), n;], [int i[foo()], a[n+1];],
   zsh_cv_c_variable_length_arrays=yes,
   zsh_cv_c_variable_length_arrays=no)])
+AH_TEMPLATE([HAVE_VARIABLE_LENGTH_ARRAYS],
+[Define to 1 if compiler supports variable-length arrays])
 if test $zsh_cv_c_variable_length_arrays = yes; then
   AC_DEFINE(HAVE_VARIABLE_LENGTH_ARRAYS)
 fi
@@ -466,6 +512,8 @@
 fi
 
 dnl Some SCO systems cannot include both sys/time.h and sys/select.h
+AH_TEMPLATE([TIME_H_SELECT_H_CONFLICTS],
+[Define if sys/time.h and sys/select.h cannot be both included.])
 if test $ac_cv_header_sys_time_h = yes && test $ac_cv_header_sys_select_h = yes; then
   AC_CACHE_CHECK(for conflicts in sys/time.h and sys/select.h,
   zsh_cv_header_time_h_select_h_conflicts,
@@ -498,6 +546,8 @@
   zsh_cv_header_termios_h_tiocgwinsz=no
 fi
  
+AH_TEMPLATE([GWINSZ_IN_SYS_IOCTL],
+[Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
 if test $zsh_cv_header_termios_h_tiocgwinsz = no; then
   AC_CACHE_CHECK(TIOCGWINSZ in sys/ioctl.h,
   zsh_cv_header_sys_ioctl_h_tiocgwinsz,
@@ -511,6 +561,8 @@
   fi
 fi
  
+AH_TEMPLATE([WINSIZE_IN_PTEM],
+[Define if your system defines `struct winsize' in sys/ptem.h.])
 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
 
 dnl -------------------
@@ -543,6 +595,20 @@
   *)             termcap_curses_order="tinfo termcap curses ncurses" ;;
 esac])dnl
 
+AH_TEMPLATE([HAVE_BOOLCODES],
+[Define if you have the termcap boolcodes symbol.])
+AH_TEMPLATE([HAVE_NUMCODES],
+[Define if you have the termcap numcodes symbol.])
+AH_TEMPLATE([HAVE_STRCODES],
+[Define if you have the termcap strcodes symbol.])
+AH_TEMPLATE([HAVE_BOOLNAMES],
+[Define if you have the terminfo boolnames symbol.])
+AH_TEMPLATE([HAVE_NUMNAMES],
+[Define if you have the terminfo numnames symbol.])
+AH_TEMPLATE([HAVE_STRNAMES],
+[Define if you have the terminfo strnames symbol.])
+AH_TEMPLATE([TERM_H_NEEDS_CURSES_H],
+[Define if term.h chokes without curses.h.])
 AC_SEARCH_LIBS(tgetent, [$termcap_curses_order])
 case "$LIBS" in
 *curses*)
@@ -658,6 +724,10 @@
   zsh_cv_decl_ospeed_must_define=no)])
 fi
 
+AH_TEMPLATE([HAVE_OSPEED],
+[Define to 1 if your termcap library has the ospeed variable])
+AH_TEMPLATE([MUST_DEFINE_OSPEED],
+[Define to 1 if you have ospeed, but it is not defined in termcap.h])
 if test $zsh_cv_decl_ospeed_include_defines = yes; then
   AC_DEFINE(HAVE_OSPEED)
 elif test $zsh_cv_decl_ospeed_must_define = yes; then
@@ -688,6 +758,25 @@
 zsh_cv_long_is_64_bit=no,
 zsh_cv_long_is_64_bit=no)])
 
+AH_TEMPLATE([ino_t],
+[Define to `unsigned long' if <sys/types.h> doesn't define.])
+AH_TEMPLATE([LONG_IS_64_BIT],
+[Definitions used when a long is less than eight byte, to try to
+ provide some support for eight byte operations.
+
+ Note that ZSH_64_BIT_TYPE, OFF_T_IS_64_BIT, INO_T_IS_64_BIT do *not* get
+ defined if long is already 64 bits, since in that case no special handling
+ is required.
+
+ Define to 1 if long is 64 bits])
+AH_TEMPLATE([ZSH_64_BIT_TYPE],
+[Define to a 64 bit integer type if there is one, but long is shorter.])
+AH_TEMPLATE([ZSH_64_BIT_UTYPE],
+[Define to an unsigned variant of ZSH_64_BIT_TYPE if that is defined.])
+AH_TEMPLATE([OFF_T_IS_64_BIT],
+[Define to 1 if off_t is 64 bit (for large file support)])
+AH_TEMPLATE([INO_T_IS_64_BIT],
+[Define to 1 if ino_t is 64 bit (for large file support).])
 if test $zsh_cv_long_is_64_bit = yes; then
   AC_DEFINE(LONG_IS_64_BIT)
 else
@@ -765,6 +854,8 @@
 [#include <sys/types.h>
 #include <signal.h>], [sigset_t tempsigset;],
   zsh_cv_type_sigset_t=yes, zsh_cv_type_sigset_t=no)])
+AH_TEMPLATE([sigset_t],
+[Define to `unsigned int' if <sys/types.h> or <signal.h> doesn't define])
 if test $zsh_cv_type_sigset_t = no; then
   AC_DEFINE(sigset_t, unsigned int)
 fi
@@ -883,6 +974,8 @@
 ], struct sockaddr_in6, sin6_scope_id)
 
 dnl Check for h_errno external variable
+AH_TEMPLATE([USE_LOCAL_H_ERRNO],
+[Define to 1 if h_errno is not defined by the system.])
 AC_CACHE_CHECK(if we need our own h_errno,
   zsh_cv_decl_h_errno_use_local,
   [AC_TRY_LINK( ,[extern int h_errno; h_errno = 0;],
@@ -935,6 +1028,8 @@
 dnl  in tgetstr().
 dnl  Under Cygwin test program crashes but exit code is still 0. So,
 dnl  we test for a file that porgram should create
+AH_TEMPLATE([TGETENT_ACCEPTS_NULL],
+[Define to 1 if tgetent() accepts NULL as a buffer.])
 AC_CACHE_CHECK(if tgetent accepts NULL,
 zsh_cv_func_tgetent_accepts_null,
 [AC_TRY_RUN([
@@ -986,6 +1081,8 @@
   fi,
   zsh_cv_func_tgetent_zero_success=no,
   zsh_cv_func_tgetent_zero_success=no)])
+AH_TEMPLATE([TGETENT_SUCCESS],
+[Define to what tgetent() returns on success (0 on HP-UX X/Open curses).])
 if test $zsh_cv_func_tgetent_zero_success = yes; then
   AC_DEFINE(TGETENT_SUCCESS, 0)
 else
@@ -1018,6 +1115,14 @@
 dnl CHECK SIGNALS
 dnl -------------
 dnl What style of signal do you have (POSIX, BSD, or SYSV)?
+AH_TEMPLATE([POSIX_SIGNALS],
+[Define to 1 if you use POSIX style signal handling.])
+AH_TEMPLATE([BSD_SIGNALS],
+[Define to 1 if you use BSD style signal handling (and can block signals).])
+AH_TEMPLATE([SYSV_SIGNALS],
+[Define to 1 if you use SYS style signal handling (and can block signals).])
+AH_TEMPLATE([NO_SIGNAL_BLOCKING],
+[Define to 1 if you have no signal blocking at all (bummer).])
 AC_MSG_CHECKING(what style of signals to use)
 if test $ac_cv_func_sigaction = yes && test $ac_cv_func_sigprocmask = yes; then
   signals_style=POSIX_SIGNALS
@@ -1151,6 +1256,14 @@
 dnl ------------------
 dnl rlimit type checks
 dnl ------------------
+AH_TEMPLATE([RLIM_T_IS_QUAD_T],
+[Define to 1 if struct rlimit uses quad_t.])
+AH_TEMPLATE([RLIM_T_IS_LONG_LONG],
+[Define to 1 if struct rlimit uses long long])
+AH_TEMPLATE([RLIM_T_IS_UNSIGNED],
+[Define to 1 if struct rlimit uses unsigned.])
+AH_TEMPLATE([rlim_t],
+[Define to the type used in struct rlimit.])
 DEFAULT_RLIM_T=long
 AC_CACHE_CHECK(if rlim_t is longer than a long,
 zsh_cv_rlim_t_is_longer,
@@ -1240,6 +1353,8 @@
 zsh_LIMIT_PRESENT(RLIMIT_TCACHE)
 zsh_LIMIT_PRESENT(RLIMIT_VMEM)
 
+AH_TEMPLATE([RLIMIT_VMEM_IS_RSS],
+[Define to 1 if RLIMIT_VMEM and RLIMIT_RSS both exist and are equal.])
 AC_CACHE_CHECK(if RLIMIT_VMEM and RLIMIT_RSS are the same,
 zsh_cv_rlimit_vmem_is_rss,
 [AC_TRY_RUN([
@@ -1265,6 +1380,8 @@
 fi
 
 
+AH_TEMPLATE([RLIMIT_VMEM_IS_AS],
+[Define to 1 if RLIMIT_VMEM and RLIMIT_AS both exist and are equal.])
 AC_CACHE_CHECK(if RLIMIT_VMEM and RLIMIT_AS are the same,
 zsh_cv_rlimit_vmem_is_as,
 [AC_TRY_RUN([
@@ -1301,12 +1418,15 @@
 else
   zsh_cv_cs_path="/bin:/usr/bin"
 fi])
-AC_DEFINE_UNQUOTED(DEFAULT_PATH, "$zsh_cv_cs_path")
+AC_DEFINE_UNQUOTED(DEFAULT_PATH, "$zsh_cv_cs_path",
+[The default path; used when running commands with command -p])
 
 
 dnl ----------------------------
 dnl CHECK FOR /dev/fd FILESYSTEM
 dnl ----------------------------
+AH_TEMPLATE([PATH_DEV_FD],
+[Define to the path of the /dev/fd filesystem.])
 AC_CACHE_CHECK(for /dev/fd filesystem, zsh_cv_sys_path_dev_fd,
 [for zsh_cv_sys_path_dev_fd in /proc/self/fd /dev/fd no; do
    test x`echo ok|cat $zsh_cv_sys_path_dev_fd/0 2>/dev/null` = xok && break
@@ -1320,6 +1440,8 @@
 dnl ---------------------------------
 AC_CACHE_CHECK(for RFS superroot directory, zsh_cv_sys_superroot,
 [test -d /../.LOCALROOT && zsh_cv_sys_superroot=yes || zsh_cv_sys_superroot=no])
+AH_TEMPLATE([HAVE_SUPERROOT],
+[Define to 1 if you have RFS superroot directory.])
 if test $zsh_cv_sys_superroot = yes; then
   AC_DEFINE(HAVE_SUPERROOT)
 fi
@@ -1331,6 +1453,8 @@
     *QNX*) zsh_cv_use_getcwd=yes ;;
     *) zsh_cv_use_getcwd=no ;;
  esac])
+AH_TEMPLATE([USE_GETCWD],
+[Define to 1 if you need to use the native getcwd.])
 if test $zsh_cv_use_getcwd = yes; then
   AC_DEFINE(USE_GETCWD)
 fi
@@ -1338,6 +1462,8 @@
 dnl -------------
 dnl CHECK FOR NIS
 dnl -------------
+AH_TEMPLATE([HAVE_NIS],
+[Define to 1 if you have NIS.])
 AC_CACHE_CHECK(for NIS, zsh_cv_sys_nis,
 [test -f /usr/bin/ypcat && /usr/bin/ypcat passwd.byname > /dev/null 2>&1 && \
 zsh_cv_sys_nis=yes || zsh_cv_sys_nis=no])
@@ -1348,6 +1474,8 @@
 dnl -----------------
 dnl CHECK FOR NISPLUS
 dnl -----------------
+AH_TEMPLATE([HAVE_NIS_PLUS],
+[Define to 1 if you have NISPLUS.])
 AC_CACHE_CHECK(for NIS+, zsh_cv_sys_nis_plus,
 [test $ac_cv_func_nis_list = yes && test -f /usr/bin/nisls && \
  /usr/bin/nisls > /dev/null 2>&1 && \
@@ -1372,6 +1500,8 @@
 [AC_TRY_COMPILE([#include <unistd.h>
 double brk();], [int i;],
 zsh_cv_header_unistd_h_brk_proto=no, zsh_cv_header_unistd_h_brk_proto=yes)])
+AH_TEMPLATE([HAVE_BRK_PROTO],
+[Define to 1 if there is a prototype defined for brk() on your system.])
 if test $zsh_cv_header_unistd_h_brk_proto = yes; then
   AC_DEFINE(HAVE_BRK_PROTO)
 fi
@@ -1381,6 +1511,8 @@
 [AC_TRY_COMPILE([#include <unistd.h>
 double sbrk();], [int i;],
 zsh_cv_header_unistd_h_sbrk_proto=no, zsh_cv_header_unistd_h_sbrk_proto=yes)])
+AH_TEMPLATE([HAVE_SBRK_PROTO],
+[Define to 1 if there is a prototype defined for sbrk() on your system.])
 if test $zsh_cv_header_unistd_h_sbrk_proto = yes; then
   AC_DEFINE(HAVE_SBRK_PROTO)
 fi
@@ -1389,6 +1521,10 @@
 dnl ioctl and mknod prototypes for OSF
 dnl ----------------------------------
 
+AH_TEMPLATE([HAVE_IOCTL_PROTO],
+[Define to 1 if there is a prototype defined for ioctl() on your system])
+AH_TEMPLATE([HAVE_MKNOD_PROTO],
+[Define to 1 if there is a prototype defined for mknod() on your system])
 if test "$ac_cv_prog_cc_stdc" != no; then
   AC_CACHE_CHECK(for ioctl prototype in <sys/ioctl.h>,
   zsh_cv_header_sys_ioctl_h_ioctl_proto,
@@ -1413,6 +1549,8 @@
 dnl -------------------
 dnl select() defined in <sys/socket.h>, ie BeOS R4.51
 dnl -------------------
+AH_TEMPLATE([SELECT_IN_SYS_SOCKET_H],
+[Define to 1 if select() is defined in <sys/socket.h>, ie BeOS R4.51])
 if test $ac_cv_header_sys_select_h != yes; then
   AC_CACHE_CHECK(for select() in <sys/socket.h>,
   zsh_cv_header_socket_h_select_proto,
@@ -1460,6 +1598,8 @@
   zsh_cv_sys_fifo=yes,
   zsh_cv_sys_fifo=no,
   zsh_cv_sys_fifo=yes)])
+AH_TEMPLATE([HAVE_FIFOS],
+[Define to 1 if system has working FIFOs.])
 if test $zsh_cv_sys_fifo = yes; then
   AC_DEFINE(HAVE_FIFOS)
 fi
@@ -1473,6 +1613,8 @@
 else
   zsh_cv_prog_sh_echo_escape=yes
 fi])
+AH_TEMPLATE([SH_USE_BSD_ECHO],
+[Define to 1 if /bin/sh does not interpret \ escape sequences.])
 if test $zsh_cv_prog_sh_echo_escape = no; then
   AC_DEFINE(SH_USE_BSD_ECHO)
 fi
@@ -1505,6 +1647,8 @@
   zsh_cv_sys_link=yes,
   zsh_cv_sys_link=no,
   zsh_cv_sys_link=yes)])
+AH_TEMPLATE([HAVE_LINK],
+[Define to 1 if system has working link().])
 if test $zsh_cv_sys_link = yes; then
   AC_DEFINE(HAVE_LINK)
 fi
@@ -1529,6 +1673,8 @@
   zsh_cv_sys_killesrch=yes,
   zsh_cv_sys_killesrch=no,
   zsh_cv_sys_killesrch=yes)])
+AH_TEMPLATE([BROKEN_KILL_ESRCH],
+[Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51.])
 if test $zsh_cv_sys_killesrch = no; then
   AC_DEFINE(BROKEN_KILL_ESRCH)
 fi
@@ -1537,6 +1683,8 @@
 dnl if POSIX, test for working sigsuspend().
 dnl for instance, BeOS R4.51 is broken.
 dnl -----------
+AH_TEMPLATE([BROKEN_POSIX_SIGSUSPEND],
+Define to 1 if sigsuspend() is broken, ie BeOS R4.51.])
 if test $signals_style = POSIX_SIGNALS; then
     AC_CACHE_CHECK(if POSIX sigsuspend() works,
     zsh_cv_sys_sigsuspend,
@@ -1578,6 +1726,8 @@
 dnl if found tcsetpgrp, test to see if it actually works
 dnl for instance, BeOS R4.51 does not support it yet
 dnl -----------
+AH_TEMPLATE([BROKEN_TCSETPGRP],
+[Define to 1 if tcsetpgrp() doesn't work, ie BeOS R4.51.])
 if test -t 0 && test $ac_cv_func_tcsetpgrp = yes; then
     AC_CACHE_CHECK(if tcsetpgrp() actually works,
     zsh_cv_sys_tcsetpgrp,
@@ -1603,6 +1753,8 @@
 dnl for instance, BeOS R4.51 is not multiuser yet, and fakes getpwnam()
 dnl test by looking up two usernames that shouldn't succeed, and compare entry
 dnl -----------
+AH_TEMPLATE([GETPWNAM_FAKED],
+[Define to 1 if getpwnam() is faked, ie BeOS R4.51.])
 if test $ac_cv_func_getpwnam = yes; then
     AC_CACHE_CHECK(if getpwnam() is faked,
     zsh_cv_sys_getpwnam_faked,
@@ -1637,6 +1789,8 @@
 dnl ---------------
 dnl dynamic loading
 dnl ---------------
+AH_TEMPLATE([HPUXDYNAMIC],
+[Define to 1 if you want to use dynamically loaded modules on HPUX 10.])
 L=N
 INSTLIB="install.bin-\$(L)"
 UNINSTLIB="uninstall.bin-\$(L)"
@@ -1674,6 +1828,10 @@
 
 test -n "$GCC" && LDARG=-Wl,
 
+AH_TEMPLATE([DLSYM_NEEDS_UNDERSCORE],
+[Define to 1 if an underscore has to be prepended to dlsym() argument.])
+AH_TEMPLATE([DYNAMIC_NAME_CLASH_OK],
+[Define to 1 if multiple modules defining the same symbol are OK.])
 if test "x$aixdynamic" = xyes; then
   DL_EXT="${DL_EXT=so}"
   DLLD="${DLLD=$CC}"
@@ -1943,6 +2101,8 @@
   RTLD_GLOBAL_OK=no
 fi
 
+AH_TEMPLATE([DYNAMIC],
+[Define to 1 if you want to use dynamically loaded modules.])
 if test "x$dynamic" = xyes; then
   D=D
   AC_DEFINE(DYNAMIC)dnl
@@ -1950,6 +2110,8 @@
   D=N
 fi
 
+AH_TEMPLATE([AIXDYNAMIC],
+[Define to 1 if you want to use dynamically loaded modules on AIX.])
 if test "x$aixdynamic" = xyes; then
   E=E
   AC_DEFINE(AIXDYNAMIC)dnl
@@ -1971,7 +2133,8 @@
   EXTRAZSHOBJS="$EXTRAZSHOBJS zsh.res.o"
 fi
 
-AC_DEFINE_UNQUOTED(DL_EXT, "$DL_EXT")dnl
+AC_DEFINE_UNQUOTED(DL_EXT, "$DL_EXT",
+[The extension used for dynamically loaded modules.])dnl
 AC_SUBST(D)dnl
 AC_SUBST(DL_EXT)dnl
 AC_SUBST(DLLD)dnl
@@ -2004,6 +2167,9 @@
   userlist="`sed -e '/^#/d' -e '/auto=y/d' -e 's/ .*/ /' -e 's/^name=/ /' \
         ${CONFIG_MODULES}`"
   mv ${CONFIG_MODULES} ${CONFIG_MODULES}.old
+else
+  # Save testing for existence each time.
+  echo > ${CONFIG_MODULES}.old
 fi
 (echo "# Edit this file to change the way modules are loaded."
 echo "# The format is strict; do not break lines or add extra spaces."
@@ -2032,65 +2198,106 @@
 echo "#"
 echo "# You should not change the values for the pseudo-module zsh/main,"
 echo "# which is the main shell (apart from the functions entry)."
+EOM
+dnl The autoconf macros are only available in configure, not
+dnl config.status, and only change when configure is rerun.
+dnl So we need to run the autoconf tests here and store the results.
+dnl We then generate config.modules, preserving any user-generated
+dnl information, from config.status.
 for modfile in `cd ${srcdir}; echo */*.mdd */*/*.mdd`; do
   name=
   link=
   load=
   functions=
+  result=
   . ${srcdir}/$modfile
   if test x$name != x && test x"$link" != x; then
-    case "$userlist" in
-    *" $name "*) # not autogenerated, keep original
-                grep "^name=$name " ${CONFIG_MODULES}.old
-		;;
-    *) case "$link" in
-	  *\ *) eval "link=\`$link\`"
-	       ;;
-       esac
-       case "${load}" in
-	y*) load=" load=yes"
+    case "$link" in
+      *\ *) eval "link=\`$link\`"
 	    ;;
-	 *) load=" load=no"
-	    ;;
-       esac
-       if test "x$functions" != x; then
-         # N.B. no additional quotes
-         f=" functions=$functions"
-       else
-         f=
-       fi
-       case "$link" in
-	 static) echo "name=$name modfile=$modfile link=static auto=yes${load}$f"
-	         ;;
-	 dynamic) if test $dynamic != no; then
-		    echo "name=$name modfile=$modfile link=dynamic\
+    esac
+    case "${load}" in
+      y*) load=" load=yes"
+	  ;;
+      *) load=" load=no"
+	 ;;
+    esac
+    if test "x$functions" != x; then
+      # N.B. no additional quotes
+      f=" functions=$functions"
+    else
+      f=
+    fi
+    case "$link" in
+      static) result="name=$name modfile=$modfile link=static auto=yes${load}$f"
+	      ;;
+      dynamic) if test $dynamic != no; then
+		  result="name=$name modfile=$modfile link=dynamic\
  auto=yes${load}$f"
-		  else
-		    echo "name=$name modfile=$modfile link=no\
+	       else
+		 result="name=$name modfile=$modfile link=no\
  auto=yes load=no$f"
-		  fi
-		  ;;
-	 either) if test $dynamic != no; then
-		   echo "name=$name modfile=$modfile link=dynamic\
+	       fi
+	       ;;
+      either) if test $dynamic != no; then
+		result="name=$name modfile=$modfile link=dynamic\
  auto=yes${load}$f"
-		 else
-		   echo "name=$name modfile=$modfile link=static\
+	      else
+		result="name=$name modfile=$modfile link=static\
  auto=yes${load}$f"
-		 fi
-		 ;;
-	      *) echo "name=$name modfile=$modfile link=no auto=yes load=no$f"
-		 ;;
-       esac
-       ;;
+	      fi
+	      ;;
+       *) result="name=$name modfile=$modfile link=no auto=yes load=no$f"
+	  ;;
     esac
+dnl $result is the default output for config.modules.  We generate
+dnl code to check if we should use this.
+cat <<EOM >> ${CONFIG_MODULES}.sh
+case "\$userlist" in
+  *" $name "*) grep "^name=$name " \${CONFIG_MODULES}.old;;
+  *) echo "$result";;
+esac
+EOM
   fi
-done) >${CONFIG_MODULES}
+done
+cat <<\EOM >> ${CONFIG_MODULES}.sh
+) >${CONFIG_MODULES}
 rm -f ${CONFIG_MODULES}.old
 EOM
-AC_OUTPUT_COMMANDS(,[if test -z "\$CONFIG_FILES\$CONFIG_HEADERS"; then
-`cat ./${CONFIG_MODULES}.sh && rm -f ./${CONFIG_MODULES}.sh`
-fi])
-. ./${CONFIG_MODULES}.sh
+
+dnl AH_TOP replaces the code which used to appear at the top
+dnl of acconfig.h.
+AH_TOP([/***** begin user configuration section *****/
+
+/* Define this to be the location of your password file */
+#define PASSWD_FILE "/etc/passwd"
+
+/* Define this to be the name of your NIS/YP password *
+ * map (if applicable)                                */
+#define PASSWD_MAP "passwd.byname"
+
+/* Define to 1 if you want user names to be cached */
+#define CACHE_USERNAMES 1
+
+/* Define to 1 if system supports job control */
+#define JOB_CONTROL 1
+
+/* Define this if you use "suspended" instead of "stopped" */
+#define USE_SUSPENDED 1
+ 
+/* The default history buffer size in lines */
+#define DEFAULT_HISTSIZE 30
+
+/* The default editor for the fc builtin */
+#define DEFAULT_FCEDIT "vi"
+
+/* The default prefix for temporary files */
+#define DEFAULT_TMPPREFIX "/tmp/zsh"
+
+/***** end of user configuration section            *****/
+/***** shouldn't have to change anything below here *****/
+
+])
 
 CLEAN_MK="${srcdir}/Config/clean.mk"
 CONFIG_MK="${srcdir}/Config/config.mk"
@@ -2103,9 +2310,11 @@
 AC_SUBST_FILE(DEFS_MK)dnl
 AC_SUBST_FILE(VERSION_MK)dnl
 
-AC_OUTPUT(Config/defs.mk Makefile Doc/Makefile Etc/Makefile Src/Makefile \
-Test/Makefile,
-[test -z "$CONFIG_HEADERS" || echo > stamp-h])
+AC_CONFIG_FILES(Config/defs.mk Makefile Doc/Makefile Etc/Makefile \
+Src/Makefile Test/Makefile)
+AC_CONFIG_COMMANDS([config.modules], [. config.modules.sh])
+
+AC_OUTPUT
 
 eval "zshbin1=${bindir}"
 eval "zshbin2=${zshbin1}"

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



Messages sorted by: Reverse Date, Date, Thread, Author