about summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-11-26 20:01:01 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-11-26 20:01:01 +0000
commit49a1ad7516f84672dcea24bc6178f87f92789c7c (patch)
tree95839ab8df06151f9322c89ffe7734b28f36a360 /configure.in
parentad5f9584c11561eb8d58b155aac018a771548e75 (diff)
downloadzsh-49a1ad7516f84672dcea24bc6178f87f92789c7c.tar.gz
zsh-49a1ad7516f84672dcea24bc6178f87f92789c7c.tar.xz
zsh-49a1ad7516f84672dcea24bc6178f87f92789c7c.zip
13194: change in module configuration system
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in91
1 files changed, 81 insertions, 10 deletions
diff --git a/configure.in b/configure.in
index fa268707f..b14a15fbb 100644
--- a/configure.in
+++ b/configure.in
@@ -189,16 +189,6 @@ AC_ARG_ENABLE(dynamic,
 [  --disable-dynamic          turn off dynamically loaded binary modules],
 [dynamic="$enableval"], [dynamic=yes])
 
-dnl Do you want to disable a list of modules?
-dnl Unfortunately we can't give --disable-* a value, so we'll have
-dnl to do it as an `--enable-*', rather unnaturally.
-undefine([OMIT_MODULES])dnl
-AC_ARG_ENABLE(omit-modules,
-[  --enable-omit-modules      give comma-separated list of modules to ignore],
-[OMIT_MODULES="$enableval"], [OMIT_MODULES=])
-
-AC_SUBST(OMIT_MODULES)dnl
-
 dnl Do you want to compile as K&R C.
 AC_ARG_ENABLE(ansi2knr,
 [  --enable-ansi2knr          translate source to K&R C before compiling],
@@ -1713,6 +1703,87 @@ AC_SUBST(MOD_IMPORT_VARIABLE)dnl
 AC_SUBST(MOD_IMPORT_FUNCTION)dnl
 AC_SUBST(EXTRAZSHOBJS)dnl
 
+# Generate config.modules.  We look for *.mdd files in first and second
+# level subdirectories.  Any existing line not containing 'auto=y' will be
+# retained, provided the .mdd file itself was found.
+CONFIG_MODULES=./config.modules
+echo "creating ${CONFIG_MODULES}"
+userlist=" "
+if test -f config.modules; then
+  userlist=`sed -e '/^#/d' -e '/auto=y/d' -e 's/ .*/ /' -e 's/^name=/ /' \
+        ${CONFIG_MODULES}`
+  mv ${CONFIG_MODULES} ${CONFIG_MODULES}.old
+fi
+(cd ${srcdir}
+echo "# Edit this file to change the way modules are loaded."
+echo "# The format is strict; do not break lines or add extra spaces."
+echo "#"
+echo "# Values of \`link' are \`static', \`dynamic' or \`no' to compile the"
+echo "# module into the shell, link it in at run time, or not use it at all."
+echo "# In the final case, no attempt will be made to compile it."
+echo "# Use \`static' or \`no' if you do not have dynamic loading."
+echo "#"
+echo "# Values of \`load' are \`yes' or \`no'; if yes, any builtins etc."
+echo "# provided by the module will be autoloaded by the main shell"
+echo "# (so long as \`link' is not set to \`no')."
+echo "#"
+echo "# Values of \`auto' are \`yes' or \`no'. configure sets the value to"
+echo "# \`yes'.  If you set it by hand to \`no', the line will be retained"
+echo "# when the file is regenerated in future."
+echo "#"
+echo "# You will need to run \`config.status --recheck' if you add a new"
+echo "# module."
+echo "#"
+echo "# You should not change the values for the pseudo-module zsh/main,"
+echo "# which is the main shell."
+for modfile in */*.mdd */*/*.mdd; do
+  name=
+  link=
+  load=
+  . $modfile
+  if test x$name != x -a 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"
+	    ;;
+	 *) load=" load=no"
+	    ;;
+       esac
+       case $link in
+	 static) echo "name=$name modfile=$modfile link=static auto=yes${load}"
+	         ;;
+	 dynamic) if test $dynamic != no; then
+		    echo "name=$name modfile=$modfile link=dynamic\
+ auto=yes${load}"
+		  else
+		    echo "name=$name modfile=$modfile link=no\
+ auto=no load=no"
+		  fi
+		  ;;
+	 either) if test $dynamic != no; then
+		   echo "name=$name modfile=$modfile link=dynamic\
+ auto=yes${load}"
+		 else
+		   echo "name=$name modfile=$modfile link=static\
+ auto=yes${load}"
+		 fi
+		 ;;
+	      *) echo "name=$name modfile=$modfile link=no auto=yes load=no"
+		 ;;
+       esac
+       ;;
+    esac
+  fi
+done) >${CONFIG_MODULES}
+rm -f ${CONFIG_MODULES}.old
+
 CLEAN_MK="${srcdir}/Config/clean.mk"
 CONFIG_MK="${srcdir}/Config/config.mk"
 dnl defs.mk is in the build tree, not the source tree