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

separate module-linking patch for 4.2.2



Unless I've accidentally deleted a hunk, this is the current patch I'm
using to link zsh/cap and zsh/pcre with different library sets than the
rest of the modules.  It is a suboptimal solution.

--- zsh-4.2.2.orig/aclocal.m4
+++ zsh-4.2.2/aclocal.m4
@@ -1,59 +1,5 @@
-# Local additions to Autoconf macros.
-# Copyright (C) 1992, 1994 Free Software Foundation, Inc.
-# Francois Pinard <pinard@xxxxxxxxxxxxxxxx>, 1992.
-
-# @defmac fp_PROG_CC_STDC
-# @maindex PROG_CC_STDC
-# @ovindex CC
-# If the C compiler in not in ANSI C mode by default, try to add an option
-# to output variable @code{CC} to make it so.  This macro tries various
-# options that select ANSI C on some system or another.  It considers the
-# compiler to be in ANSI C mode if it defines @code{__STDC__} to 1 and
-# handles function prototypes correctly.
-# 
-# If you use this macro, you should check after calling it whether the C
-# compiler has been set to accept ANSI C; if not, the shell variable
-# @code{fp_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
-# code in ANSI C, you can make an un-ANSIfied copy of it by using the
-# program @code{ansi2knr}, which comes with Ghostscript.
-# @end defmac
-
-define(fp_PROG_CC_STDC,
-[AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C,
-fp_cv_prog_cc_stdc,
-[fp_cv_prog_cc_stdc=no
-ac_save_CFLAGS="$CFLAGS"
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX			-qlanglvl=ansi
-# Ultrix and OSF/1	-std1
-# HP-UX			-Ae  or  -Aa -D_HPUX_SOURCE
-# SVR4			-Xc
-#  For HP-UX, we try -Ae first; this turns on ANSI but also extensions,
-#  as well as defining _HPUX_SOURCE, and we can then use long long.
-#  We keep the old version for backward compatibility.
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" -Xc
-do
-  CFLAGS="$ac_save_CFLAGS $ac_arg"
-  AC_TRY_COMPILE(
-[#ifndef __STDC__
-choke me
-#endif	
-], [int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};],
-[fp_cv_prog_cc_stdc="$ac_arg"; break])
-done
-CFLAGS="$ac_save_CFLAGS"
-])
-case "x$fp_cv_prog_cc_stdc" in
-  x|xno) ;;
-  *) CC="$CC $fp_cv_prog_cc_stdc" ;;
-esac
-])
-
-AC_DEFUN(AC_PROG_LN,
-[AC_MSG_CHECKING(whether ln works)
+AC_DEFUN([AC_PROG_LN],
+[AC_MSG_CHECKING([whether ln works])
 AC_CACHE_VAL(ac_cv_prog_LN,
 [rm -f conftestdata conftestlink
 echo > conftestdata
@@ -74,4 +20,67 @@
 AC_SUBST(LN)dnl
 ])
 
+# Check to see how 'make' treats includes.	-*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote="\""
+      _am_result=BSD
+   fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
 builtin(include, aczsh.m4)
--- zsh-4.2.2.orig/configure.ac
+++ zsh-4.2.2/configure.ac
@@ -310,16 +310,6 @@
 [AC_DEFINE(MAX_FUNCTION_DEPTH, 4096)]
 )
 
-dnl Do you want to look for pcre support?
-AC_ARG_ENABLE(pcre,
-AC_HELP_STRING([--enable-pcre],
-[enable the search for the pcre library (may create run-time library dependencies)]))
-
-dnl Do you want to look for capability support?
-AC_ARG_ENABLE(cap,
-AC_HELP_STRING([--enable-cap],
-[enable the search for POSIX capabilities (may require additional headers to be added by hand)]))
-
 dnl ------------------
 dnl CHECK THE COMPILER
 dnl ------------------
@@ -419,7 +409,6 @@
   darwin*) CPP="$CPP -traditional-cpp" ;;
 esac
 
-fp_PROG_CC_STDC
 AC_MSG_CHECKING([whether to use prototypes])
 if test ."$ansi2knr" = .yes || test ."$ansi2knr" = .no; then
   msg="(overridden) "
@@ -511,24 +500,12 @@
 AC_HEADER_STAT
 AC_HEADER_SYS_WAIT
 
-oldcflags="$CFLAGS"
-if test x$enable_pcre = xyes; then
-AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config)
-dnl Typically (meaning on this single RedHat 9 box in front of me)
-dnl pcre-config --cflags produces a -I output which needs to go into
-dnl CPPFLAGS else configure's preprocessor tests don't pick it up,
-dnl producing a warning.
-if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then
-  CPPFLAGS="$CPPFLAGS `pcre-config --cflags`"
-fi
-fi
-
 AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
 		 termios.h sys/param.h sys/filio.h string.h memory.h \
 		 limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
 		 locale.h errno.h stdio.h stdlib.h unistd.h sys/capability.h \
 		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
-		 netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \
+		 netinet/in_systm.h langinfo.h wchar.h stddef.h \
 		 sys/stropts.h)
 if test $dynamic = yes; then
   AC_CHECK_HEADERS(dlfcn.h)
@@ -617,15 +594,15 @@
 AC_ARG_WITH(curses-terminfo,
 [  --with-curses-terminfo     use terminfo support from curses library],
 [if test x$withval = xyes; then
-  termcap_curses_order="tinfo curses ncurses termcap"
+  termcap_curses_order="curses ncurses termcap"
   AC_SEARCH_LIBS(tigetstr, [$termcap_curses_order])
 else
-  termcap_curses_order="tinfo termcap curses ncurses"
+  termcap_curses_order="termcap curses ncurses"
 fi],
 [case "$host_os" in
   hpux10.*|hpux11.*|solaris*)
       termcap_curses_order="Hcurses curses ncurses termcap" ;;
-  *)             termcap_curses_order="tinfo termcap curses ncurses" ;;
+  *)             termcap_curses_order="termcap curses ncurses" ;;
 esac])dnl
 
 AH_TEMPLATE([HAVE_BOOLCODES],
@@ -721,19 +698,10 @@
   AC_CHECK_LIB(dl, dlopen)
 fi
 
-if test x$enable_cap = xyes; then
-  AC_CHECK_LIB(cap, cap_get_proc)
-fi
-
 AC_CHECK_LIB(socket, socket)
 
 AC_CHECK_LIB(iconv, iconv)
 
-if test x$enable_pcre = xyes; then
-dnl pcre-config should probably be employed here
-AC_SEARCH_LIBS(pcre_compile, pcre)
-fi
-
 dnl ---------------------
 dnl CHECK TERMCAP LIBRARY
 dnl ---------------------
@@ -1051,7 +1019,6 @@
 	       brk sbrk \
 	       pathconf sysconf \
 	       tgetent tigetflag tigetnum tigetstr setupterm \
-	       pcre_compile pcre_study pcre_exec \
 	       nl_langinfo \
 	       erand48 open_memstream \
 	       wctomb iconv \
@@ -1059,10 +1026,6 @@
 	       htons ntohs)
 AC_FUNC_STRCOLL
 
-if test x$enable_cap = xyes; then
-  AC_CHECK_FUNCS(cap_get_proc)
-fi
-
 dnl  Check if tgetent accepts NULL (and will allocate its own termcap buffer)
 dnl  Some termcaps reportedly accept a zero buffer, but then dump core
 dnl  in tgetstr().
@@ -2454,10 +2417,14 @@
 AC_SUBST_FILE(DEFS_MK)dnl
 AC_SUBST_FILE(VERSION_MK)dnl
 
+AM_MAKE_INCLUDE
+
 AC_CONFIG_FILES(Config/defs.mk Makefile Doc/Makefile Etc/Makefile \
-Src/Makefile Test/Makefile)
+Src/Makefile Test/Makefile Src/mkmakemod.sh.in)
 AC_CONFIG_COMMANDS([config.modules], [. ./config.modules.sh])
 AC_CONFIG_COMMANDS([stamp-h], [echo >stamp-h])
+AC_CONFIG_COMMANDS([Src/mkmakemod.sh],
+		   [sed "s/_@_/@/g" Src/mkmakemod.sh.in >Src/mkmakemod.sh])
 
 AC_OUTPUT
 
@@ -2498,4 +2465,3 @@
 echo "See config.modules for installed modules and functions.
 "
 
-
--- zsh-4.2.2.orig/Src/Makefile.in
+++ zsh-4.2.2/Src/Makefile.in
@@ -109,17 +109,24 @@
 
 @CONFIG_MK@
 
-Makemod prep: $(CONFIG_INCS) $(dir_top)/config.modules
+Makemod prep: $(CONFIG_INCS) $(dir_top)/config.modules mkmakemod.sh
 	@case $(sdir_top) in \
 	    /*) top_srcdir=$(sdir_top) ;; \
 	    *) top_srcdir=$(subdir)/$(sdir_top) ;; \
 	esac; \
 	export top_srcdir; \
 	echo 'cd $(dir_top) && $(SHELL)' \
-	    '$$top_srcdir/$(subdir)/mkmakemod.sh $(subdir) Makemod'; \
+	    '$(subdir)/mkmakemod.sh $(subdir) Makemod'; \
 	cd $(dir_top) && \
-	    $(SHELL) $$top_srcdir/$(subdir)/mkmakemod.sh $(subdir) Makemod
+	    $(SHELL) $(subdir)/mkmakemod.sh $(subdir) Makemod
 	@$(MAKE) -f Makemod $(MAKEDEFS) prep || rm -f Makemod
+
+mkmakemod.sh: $(dir_top)/config.status mkmakemod.sh.in
+	$(dir_top)/../config.status
+
+mkmakemod.sh.in: mkmakemod.sh.in.in
+	$(dir_top)/../config.status
+
 .PHONY: prep
 
 FORCE:
@@ -191,6 +198,7 @@
 clean-here:
 	rm -f modules.stamp zsh$(EXEEXT)
 	rm -f libzsh-*.$(DL_EXT)
+	rm -f mkmakemod.sh.in mkmakemod.sh
 .PHONY: clean-here
 
 distclean-here:
--- zsh-4.2.2.orig/Src/Makemod.in.in
+++ zsh-4.2.2/Src/Makemod.in.in
@@ -111,7 +111,7 @@
 	for subdir in $$subdirs; do \
 	    dir=$(subdir)/$$subdir; \
 	    test -d $$dir || mkdir $$dir; \
-	    $(SHELL) $$top_srcdir/Src/mkmakemod.sh $$dir Makefile || exit 1; \
+	    $(SHELL) Src/mkmakemod.sh $$dir Makefile || exit 1; \
 	    ( cd $$dir && $(MAKE) $(MAKEDEFS) $@ ) || exit 1; \
 	done
 .PHONY: prep
@@ -149,7 +149,8 @@
 .PHONY: mostlyclean-here
 
 clean-here:
-	rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp
+	rm -f *.o.c *.syms *.pro *.epro *.mdh *.mdhi *.mdhs *.mdh.tmp \
+	*.configure *.ach config.cache config.status config.log *.rules
 .PHONY: clean-here
 
 distclean-here:
@@ -173,11 +174,11 @@
 	esac; \
 	export top_srcdir; \
 	echo 'cd $(dir_top) && $(SHELL)' \
-	    '$$top_srcdir/Src/mkmakemod.sh -m $(subdir) $(makefile)'; \
+	    'Src/mkmakemod.sh -m $(subdir) $(makefile)'; \
 	cd $(dir_top) && \
-	    $(SHELL) $$top_srcdir/Src/mkmakemod.sh -m $(subdir) $(makefile)
+	    $(SHELL) Src/mkmakemod.sh -m $(subdir) $(makefile)
 
-$(makefile).in: $(sdir_src)/mkmakemod.sh $(sdir_src)/Makemod.in.in $(MDDS) \
+$(makefile).in: $(dir_top)/Src/mkmakemod.sh $(sdir_src)/Makemod.in.in $(MDDS) \
 	$(dir_top)/config.modules
 	@case $(sdir_top) in \
 	    /*) top_srcdir=$(sdir_top) ;; \
@@ -185,7 +186,6 @@
 	esac; \
 	export top_srcdir; \
 	echo 'cd $(dir_top) && $(SHELL)' \
-	    '$$top_srcdir/Src/mkmakemod.sh -i $(subdir) $(makefile)'; \
+	    'Src/mkmakemod.sh -i $(subdir) $(makefile)'; \
 	cd $(dir_top) && \
-	    $(SHELL) $$top_srcdir/Src/mkmakemod.sh -i $(subdir) $(makefile)
-
+	    $(SHELL) Src/mkmakemod.sh -i $(subdir) $(makefile)
--- zsh-4.2.2.orig/Src/Modules/.cvsignore
+++ zsh-4.2.2/Src/Modules/.cvsignore
@@ -15,3 +15,4 @@
 *.swp
 errnames.c errcount.h
 *.dll
+*.rules
--- zsh-4.2.2.orig/Src/Modules/cap.mdd
+++ zsh-4.2.2/Src/Modules/cap.mdd
@@ -5,3 +5,5 @@
 autobins="cap getcap setcap"
 
 objects="cap.o"
+
+autoconf=yes
--- zsh-4.2.2.orig/Src/Modules/cap.c
+++ zsh-4.2.2/Src/Modules/cap.c
@@ -29,6 +29,7 @@
 
 #include "cap.mdh"
 #include "cap.pro"
+#include "cap.ach"
 
 #ifdef HAVE_CAP_GET_PROC
 
--- zsh-4.2.2.orig/Src/Modules/pcre.mdd
+++ zsh-4.2.2/Src/Modules/pcre.mdd
@@ -1,7 +1,9 @@
 name=zsh/pcre
-link=`if test x$enable_pcre = xyes; then echo dynamic; else echo no; fi`
+link=dynamic
 load=no
 
 autobins="pcre_compile pcre_study pcre_match"
 
 objects="pcre.o"
+
+autoconf=yes
--- zsh-4.2.2.orig/Src/Modules/pcre.c
+++ zsh-4.2.2/Src/Modules/pcre.c
@@ -30,6 +30,7 @@
 
 #include "pcre.mdh"
 #include "pcre.pro"
+#include "pcre.ach"
 
 #define CPCRE_PLAIN 0
 
--- zsh-4.2.2.orig/Src/mkmakemod.sh.in.in
+++ zsh-4.2.2/Src/mkmakemod.sh.in.in
@@ -0,0 +1,494 @@
+#!/bin/sh
+#
+# mkmakemod.sh: generate Makefile.in files for module building
+#
+# Options:
+#   -m = file is already generated; only build the second stage
+#   -i = do not build second stage
+#
+# Args:
+#   $1 = subdirectory to look in, relative to $top_srcdir
+#   $2 = final output filename, within the $1 directory
+#
+# This script must be run from the top-level build directory, and $top_srcdir
+# must be set correctly in the environment.
+#
+# This looks in $1, and uses all the *.mdd files there.  Each .mdd file
+# defines one module.  The .mdd file is actually a shell script, which will
+# be sourced.  It may define the following shell variables:
+#
+#   name            name of this module
+#   moddeps         modules on which this module depends (default none)
+#   nozshdep        non-empty indicates no dependence on the `zsh/main' pseudo-module
+#   alwayslink      if non-empty, always link the module into the executable
+#   autobins        builtins defined by the module, for autoloading
+#   autoinfixconds  infix condition codes defined by the module, for
+#                   autoloading (without the leading `-')
+#   autoprefixconds like autoinfixconds, but for prefix condition codes
+#   autoparams      parameters defined by the module, for autoloading
+#   automathfuncs   math functions defined by the module, for autoloading
+#   objects         .o files making up this module (*must* be defined)
+#   proto           .syms files for this module (default generated from $objects)
+#   headers         extra headers for this module (default none)
+#   hdrdeps         extra headers on which the .mdh depends (default none)
+#   otherincs       extra headers that are included indirectly (default none)
+#
+# The .mdd file may also include a Makefile.in fragment between lines
+# `:<<\Make' and `Make' -- this will be copied into Makemod.in.
+#
+# The resulting Makemod.in knows how to build each module that is defined.
+# For each module in also knows how to build a .mdh file.  Each source file
+# should #include the .mdh file for the module it is a part of.  The .mdh
+# file #includes the .mdh files for any module dependencies, then each of
+# $headers, and then each .epro (for global declarations).  It will
+# be recreated if any of the dependency .mdh files changes, or if any of
+# $headers or $hdrdeps changes.  When anything depends on it, all the .epros
+# and $otherincs will be made up to date, but the .mdh file won't actually
+# be rebuilt if those files change.
+#
+# The order of sections of the output file is thus:
+#   simple generated macros
+#   macros generated from *.mdd
+#   included Makemod.in.in
+#   rules generated from *.mdd
+# The order dependencies are basically that the generated macros are required
+# in Makemod.in.in, but some of the macros that it creates are needed in the
+# later rules.
+#
+
+# sed script to normalise a pathname
+sed_normalise='
+    s,^,/,
+    s,$,/,
+    :1
+    s,/\./,/,
+    t1
+    :2
+    s,/[^/.][^/]*/\.\./,/,
+    s,/\.[^/.][^/]*/\.\./,/,
+    s,/\.\.[^/][^/]*/\.\./,/,
+    t2
+    s,^/$,.,
+    s,^/,,
+    s,\(.\)/$,\1,
+'
+
+# decide which stages to process
+first_stage=true
+second_stage=true
+if test ."$1" = .-m; then
+    shift
+    first_stage=false
+elif test ."$1" = .-i; then
+    shift
+    second_stage=false
+fi
+
+top_srcdir=`echo $top_srcdir | sed "$sed_normalise"`
+the_subdir=$1
+the_makefile=$2
+
+if $first_stage; then
+
+    dir_top=`echo $the_subdir | sed 's,[^/][^/]*,..,g'`
+
+    trap "rm -f $the_subdir/${the_makefile}.in" 1 2 15
+    echo "creating $the_subdir/${the_makefile}.in"
+    exec 3>&1 >$the_subdir/${the_makefile}.in
+    echo "##### ${the_makefile}.in generated automatically by mkmakemod.sh"
+    echo "##### DO NOT EDIT!"
+    echo
+    echo "##### ===== DEFINITIONS ===== #####"
+    echo
+    echo "makefile = ${the_makefile}"
+    echo "dir_top = ${dir_top}"
+    echo "subdir = ${the_subdir}"
+    echo
+
+    bin_mods=`grep link=static ./config.modules | \
+    sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`
+    dyn_mods="`grep link=dynamic ./config.modules | \
+    sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`"
+    module_list="${bin_mods}${dyn_mods}"
+
+    # check both 2.13 and 2.50 syntax
+    if grep '%_@_D_@_%D%' config.status >/dev/null ||
+       grep ',_@_D_@_,D,' config.status >/dev/null; then
+	is_dynamic=true
+    else
+	is_dynamic=false
+    fi
+
+    here_mddnames=
+    all_subdirs=
+    all_modobjs=
+    all_modules=
+    all_mdds=
+    all_mdhs=
+    all_proto=
+    lastsub=//
+    for module in $module_list; do
+        modfile="`grep '^name='$module' ' ./config.modules | \
+	  sed -e 's/^.* modfile=//' -e 's/ .*//'`"
+	case $modfile in
+	    $the_subdir/$lastsub/*) ;;
+	    $the_subdir/*/*)
+		lastsub=`echo $modfile | sed 's,^'$the_subdir'/,,;s,/[^/]*$,,'`
+		case "$all_subdirs " in
+		    *" $lastsub "* ) ;;
+		    * )
+			all_subdirs="$all_subdirs $lastsub"
+		    ;;
+		esac
+		;;
+	    $the_subdir/*)
+		mddname=`echo $modfile | sed 's,^.*/,,;s,\.mdd$,,'`
+		here_mddnames="$here_mddnames $mddname"
+		build=$is_dynamic
+		case $is_dynamic_@_$bin_mods in
+		    *" $module "*)
+			build=true
+			all_modobjs="$all_modobjs modobjs.${mddname}" ;;
+		    true_@_*)
+			all_modules="$all_modules ${mddname}.\$(DL_EXT)" ;;
+		esac
+		all_mdds="$all_mdds ${mddname}.mdd"
+		$build && all_mdhs="$all_mdhs ${mddname}.mdh"
+		$build && all_proto="$all_proto proto.${mddname}"
+		;;
+	esac
+    done
+    echo "MODOBJS =$all_modobjs"
+    echo "MODULES =$all_modules"
+    echo "MDDS    =$all_mdds"
+    echo "MDHS    =$all_mdhs"
+    echo "PROTOS  =$all_proto"
+    echo "SUBDIRS =$all_subdirs"
+    echo
+    echo "ENTRYOBJ = \$(dir_src)/modentry..o"
+    echo "NNTRYOBJ ="
+    echo "ENTRYOPT = -emodentry"
+    echo "NNTRYOPT ="
+    echo
+
+    echo "##### ===== INCLUDING Makemod.in.in ===== #####"
+    echo
+    cat $top_srcdir/Src/Makemod.in.in
+    echo
+
+    case $the_subdir in
+	Src) modobjs_sed= ;;
+	Src/*) modobjs_sed="| sed 's\" \" "`echo $the_subdir | sed 's,^Src/,,'`"/\"g' " ;;
+	*) modobjs_sed="| sed 's\" \" ../$the_subdir/\"g' " ;;
+    esac
+
+    other_mdhs=
+    remote_mdhs=
+    other_exports=
+    remote_exports=
+    other_modules=
+    remote_modules=
+    for mddname in $here_mddnames; do
+
+	unset name moddeps nozshdep alwayslink hasexport
+	unset autobins autoinfixconds autoprefixconds autoparams automathfuncs
+	unset objects proto headers hdrdeps otherincs autoconf achfile
+	. $top_srcdir/$the_subdir/${mddname}.mdd
+	q_name=`echo $name | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
+	test -n "${moddeps+set}" || moddeps=
+	test -n "$nozshdep" || moddeps="$moddeps zsh/main"
+	test -n "${proto+set}" ||
+	    proto=`echo $objects '' | sed 's,\.o ,.syms ,g'`
+
+	dobjects=`echo $objects '' | sed 's,\.o ,..o ,g'`
+	modhdeps=
+	mododeps=
+	exportdeps=
+	imports=
+	q_moddeps=
+	for dep in $moddeps; do
+	    depfile="`grep '^name='$dep' ' ./config.modules | \
+	      sed -e 's/^.* modfile=//' -e 's/ .*//'`"
+	    q_dep=`echo $dep | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
+	    q_moddeps="$q_moddeps $q_dep"
+	    eval `echo $depfile | sed 's,/\([^/]*\)\.mdd$,;depbase=\1,;s,^,loc=,'`
+	    case "$binmod" in
+		*" $dep "* )
+		    dep=zsh/main
+		;;
+	    esac
+
+	    case $the_subdir in
+		$loc)
+		    mdh="${depbase}.mdh"
+		    export="${depbase}.export"
+		    case "$dep" in
+			zsh/main )
+			    mdll="\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "
+			;;
+			* )
+			    mdll="${depbase}.\$(DL_EXT) "
+			;;
+		    esac
+		    ;;
+		$loc/*)
+		    mdh="\$(dir_top)/$loc/${depbase}.mdh"
+		    case "$other_mdhs " in
+			*" $mdh "*) ;;
+			*) other_mdhs="$other_mdhs $mdh" ;;
+		    esac
+		    export="\$(dir_top)/$loc/${depbase}.export"
+		    case "$other_exports " in
+			*" $export "*) ;;
+			*) other_exports="$other_exports $export" ;;
+		    esac
+		    case "$dep" in
+			zsh/main )
+			    mdll="\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "
+			;;
+			* )
+			    mdll="\$(dir_top)/$loc/${depbase}.\$(DL_EXT) "
+			;;
+		    esac
+		    case "$other_modules " in
+			*" $mdll "*) ;;
+			*) other_modules="$other_modules $mdll" ;;
+		    esac
+		    ;;
+		*)
+		    mdh="\$(dir_top)/$loc/${depbase}.mdh"
+		    case "$remote_mdhs " in
+			*" $mdh "*) ;;
+			*) remote_mdhs="$remote_mdhs $mdh" ;;
+		    esac
+		    export="\$(dir_top)/$loc/${depbase}.export"
+		    case "$remote_exports " in
+			*" $export "*) ;;
+			*) remote_exports="$remote_exports $export" ;;
+		    esac
+		    case "$dep" in
+			zsh/main )
+			    mdll="\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "
+			;;
+			* )
+			    mdll="\$(dir_top)/$loc/${depbase}.\$(DL_EXT) "
+			;;
+		    esac
+		    case "$remote_modules " in
+			*" $mdll "*) ;;
+			*) remote_modules="$remote_modules $mdll" ;;
+		    esac
+		    ;;
+	    esac
+	    modhdeps="$modhdeps $mdh"
+	    exportdeps="$exportdeps $export"
+	    imports="$imports \$(IMPOPT)$export"
+	    case "$mododeps " in
+		*" $mdll "* )
+		    :
+		;;
+		* )
+		    mododeps="$mododeps $mdll"
+		;;
+	    esac
+	done
+
+	echo "##### ===== DEPENDENCIES GENERATED FROM ${mddname}.mdd ===== #####"
+	echo
+	echo "MODOBJS_${mddname} = $objects"
+	echo "MODDOBJS_${mddname} = $dobjects \$(_@_E_@_NTRYOBJ)"
+	echo "SYMS_${mddname} = $proto"
+	echo "EPRO_${mddname} = "`echo $proto '' | sed 's,\.syms ,.epro ,g'`
+	echo "INCS_${mddname} = \$(EPRO_${mddname}) $otherincs"
+	echo "EXPIMP_${mddname} = $imports \$(EXPOPT)$mddname.export"
+	echo "NXPIMP_${mddname} ="
+	echo "LINKMODS_${mddname} = $mododeps"
+	echo "NOLINKMODS_${mddname} = "
+	echo
+	echo "proto.${mddname}: \$(EPRO_${mddname})"
+	echo "\$(SYMS_${mddname}): \$(PROTODEPS)"
+	echo
+	echo "${mddname}.export: \$(SYMS_${mddname})"
+	echo "	( echo '#!'; cat \$(SYMS_${mddname}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$_@_"
+	echo
+	echo "modobjs.${mddname}: \$(MODOBJS_${mddname})"
+	echo "	echo '' \$(MODOBJS_${mddname}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
+	echo
+
+	if test -n "$autoconf"; then
+#	    touch ${the_subdir}/${mddname}.rules
+	    echo "@am__include@ @am__quote@${mddname}.rules@am__quote@"
+	    echo
+	    echo "${mddname}.ach ${mddname}.rules: \$(sdir_src)/Modules/${mddname}.configure"
+	    echo "	\$(sdir_src)/Modules/${mddname}.configure"
+	    echo "	touch ${mddname}.ach"
+	    echo
+	    echo "\$(sdir_src)/Modules/${mddname}.configure: \$(sdir_src)/Modules/${mddname}.configure.ac \$(sdir_src)/Modules/${mddname}.ach.in"
+	    echo "	cd \$(sdir_src)/Modules && autoconf ${mddname}.configure.ac >${mddname}.configure"
+	    echo "	chmod +x \$(sdir_src)/Modules/${mddname}.configure"
+	    echo
+	    echo "\$(sdir_src)/Modules/${mddname}.ach.in:"
+	    echo "	cd \$(sdir_src)/Modules && autoheader ${mddname}.configure.ac"
+	achfile="${mddname}.ach"
+	fi
+
+	if test -z "$alwayslink"; then
+	    case " $all_modules" in *" ${mddname}."*)
+		echo "install.modules-here: install.modules.${mddname}"
+		echo "uninstall.modules-here: uninstall.modules.${mddname}"
+		echo
+	    ;; esac
+	    instsubdir=`echo $name | sed 's,^,/,;s,/[^/]*$,,'`
+	    echo "install.modules.${mddname}: ${mddname}.\$(DL_EXT)"
+	    echo "	\$(SHELL) \$(sdir_top)/mkinstalldirs \$(DESTDIR)\$(MODDIR)${instsubdir}"
+	    echo "	\$(INSTALL_PROGRAM) \$(STRIPFLAGS) ${mddname}.\$(DL_EXT) \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"
+	    echo
+	    echo "uninstall.modules.${mddname}:"
+	    echo "	rm -f \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"
+	    echo
+	    echo "${mddname}.\$(DL_EXT): \$(MODDOBJS_${mddname}) ${mddname}.export $exportdeps \$(_@_LINKMODS_@__${mddname})"
+	    echo '	rm -f $_@_'
+	    echo "	\$(DLLINK) \$(_@_E_@_XPIMP_$mddname) \$(_@_E_@_NTRYOPT) \$(MODDOBJS_${mddname}) \$(_@_LINKMODS_@__${mddname}) \$(LIBS) \$(EXTRALIBS_${mddname}) "
+	    echo
+	fi
+	echo "${mddname}.mdhi: ${mddname}.mdhs \$(INCS_${mddname})"
+	echo "	_@_test -f \$_@_ || echo 'do not delete this file' > \$_@_"
+	echo
+	echo "${mddname}.mdhs: ${mddname}.mdd"
+	echo "	_@_\$(MAKE) -f \$(makefile) \$(MAKEDEFS) ${mddname}.mdh.tmp"
+	echo "	_@_if cmp -s ${mddname}.mdh ${mddname}.mdh.tmp; then \\"
+	echo "	    rm -f ${mddname}.mdh.tmp; \\"
+	echo "	    echo \"\\\`${mddname}.mdh' is up to date.\"; \\"
+	echo "	else \\"
+	echo "	    mv -f ${mddname}.mdh.tmp ${mddname}.mdh; \\"
+	echo "	    echo \"Updated \\\`${mddname}.mdh'.\"; \\"
+	echo "	fi"
+	echo "	echo 'timestamp for ${mddname}.mdh against ${mddname}.mdd' > \$_@_"
+	echo
+	echo "${mddname}.mdh: ${modhdeps} ${headers} ${hdrdeps} ${mddname}.mdhi"
+	echo "	_@_\$(MAKE) -f \$(makefile) \$(MAKEDEFS) ${mddname}.mdh.tmp"
+	echo "	_@_mv -f ${mddname}.mdh.tmp ${mddname}.mdh"
+	echo "	_@_echo \"Updated \\\`${mddname}.mdh'.\""
+	echo
+	echo "${mddname}.mdh.tmp:"
+	echo "	_@_( \\"
+	echo "	    echo '#ifndef have_${q_name}_module'; \\"
+	echo "	    echo '#define have_${q_name}_module'; \\"
+	echo "	    echo; \\"
+	echo "	    echo '# ifndef IMPORTING_MODULE_${q_name}'; \\"
+	echo "	    if test _@_SHORTBOOTNAMES_@_ = yes; then \\"
+	echo "		echo '#  ifndef MODULE'; \\"
+	echo "	    fi; \\"
+	echo "	    echo '#   define boot_ boot_${q_name}'; \\"
+	echo "	    echo '#   define cleanup_ cleanup_${q_name}'; \\"
+	echo "	    echo '#   define setup_ setup_${q_name}'; \\"
+	echo "	    echo '#   define finish_ finish_${q_name}'; \\"
+	echo "	    if test _@_SHORTBOOTNAMES_@_ = yes; then \\"
+	echo "		echo '#  endif /* !MODULE */'; \\"
+	echo "	    fi; \\"
+	echo "	    echo '# endif /* !IMPORTING_MODULE_${q_name} */'; \\"
+	echo "	    echo; \\"
+	if test -n "$moddeps"; then (
+	    set x $q_moddeps
+	    echo "	    echo '/* Module dependencies */'; \\"
+	    for hdep in $modhdeps; do
+		shift
+		echo "	    echo '# define IMPORTING_MODULE_${1} 1'; \\"
+		echo "	    echo '# include \"${hdep}\"'; \\"
+	    done
+	    echo "	    echo; \\"
+	) fi
+	if test -n "$headers"; then
+	    echo "	    echo '/* Extra headers for this module */'; \\"
+	    echo "	    for hdr in $headers; do \\"
+	    echo "		if test -f \$\$hdr; then \\"
+	    echo "		    echo '# include \"'\$\$hdr'\"'; \\"
+	    echo "		else \\"
+	    echo "		    echo '# include \"\$(sdir)/'\$\$hdr'\"'; \\"
+	    echo "		fi; \\"
+	    echo "	    done; \\"
+	    echo "	    echo; \\"
+	fi
+	if test -n "$proto"; then
+	    echo "	    echo '# undef mod_import_variable'; \\"
+	    echo "	    echo '# undef mod_import_function'; \\"
+	    echo "	    echo '# if defined(IMPORTING_MODULE_${q_name}) &&  defined(MODULE)'; \\"
+	    echo "	    echo '#  define mod_import_variable _@_MOD_IMPORT_VARIABLE_@_'; \\"
+	    echo "	    echo '#  define mod_import_function _@_MOD_IMPORT_FUNCTION_@_'; \\"
+	    echo "	    echo '# else'; \\"
+	    echo "	    echo '#  define mod_import_function'; \\"
+	    echo "	    echo '#  define mod_import_variable'; \\"
+	    echo "	    echo '# endif /* IMPORTING_MODULE_${q_name} && MODULE */'; \\"
+	    echo "	    for epro in \$(EPRO_${mddname}); do \\"
+	    echo "		echo '# include \"'\$\$epro'\"'; \\"
+	    echo "	    done; \\"
+	    echo "	    echo '# undef mod_import_variable'; \\"
+	    echo "	    echo '# define mod_import_variable'; \\"
+	    echo "	    echo '# undef mod_import_variable'; \\"
+	    echo "	    echo '# define mod_import_variable'; \\"
+	    echo "	    echo '# ifndef mod_export'; \\"
+	    echo "	    echo '#  define mod_export _@_MOD_EXPORT_@_'; \\"
+	    echo "	    echo '# endif /* mod_export */'; \\"
+	    echo "	    echo; \\"
+	fi
+	echo "	    echo '#endif /* !have_${q_name}_module */'; \\"
+	echo "	) > \$_@_"
+	echo
+	echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh $achfile"
+	sed -e '/^ *: *<< *\\Make *$/,/^Make$/!d' \
+	    -e 's/^ *: *<< *\\Make *$//; /^Make$/d' \
+	    < $top_srcdir/$the_subdir/${mddname}.mdd
+	echo
+
+    done
+
+    if test -n "$remote_mdhs$other_mdhs$remote_exports$other_exports$remote_modules$other_modules"; then
+	echo "##### ===== DEPENDENCIES FOR REMOTE MODULES ===== #####"
+	echo
+	for mdh in $remote_mdhs; do
+	    echo "$mdh: FORCE"
+	    echo "	_@_cd _@_%_@_ && \$(MAKE) \$(MAKEDEFS) _@_%_@_$mdh"
+	    echo
+	done | sed 's,^\(.*\)_@_%_@_\(.*\)_@_%_@_\(.*\)/\([^/]*\)$,\1\3\2\4,'
+	if test -n "$other_mdhs"; then
+	    echo "${other_mdhs}:" | sed 's,^ ,,'
+	    echo "	false # should only happen with make -n"
+	    echo
+	fi
+	for export in $remote_exports; do
+	    echo "$export: FORCE"
+	    echo "	_@_cd _@_%_@_ && \$(MAKE) \$(MAKEDEFS) _@_%_@_$export"
+	    echo
+	done | sed 's,^\(.*\)_@_%_@_\(.*\)_@_%_@_\(.*\)/\([^/]*\)$,\1\3\2\4,'
+	if test -n "$other_exports"; then
+	    echo "${other_exports}:" | sed 's,^ ,,'
+	    echo "	false # should only happen with make -n"
+	    echo
+	fi
+	for mdll in $remote_modules; do
+	    echo "$mdll: FORCE"
+	    echo "	_@_cd _@_%_@_ && \$(MAKE) \$(MAKEDEFS) _@_%_@_$mdll"
+	    echo
+	done | sed 's,^\(.*\)_@_%_@_\(.*\)_@_%_@_\(.*\)/\([^/]*\)$,\1\3\2\4,'
+	if test -n "$other_modules"; then
+	    echo "${other_modules}:" | sed 's,^ ,,'
+	    echo "	false # should only happen with make -n"
+	    echo
+	fi
+    fi
+
+    echo "##### End of ${the_makefile}.in"
+
+    exec >&3 3>&-
+
+fi
+
+if $second_stage ; then
+    trap "rm -f $the_subdir/${the_makefile}" 1 2 15
+
+    ${CONFIG_SHELL-/bin/sh} ./config.status \
+	--file=$the_subdir/${the_makefile}:$the_subdir/${the_makefile}.in ||
+    return 1
+fi
+
+exit 0



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