Create one configure script from configure fragments.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 10 Mar 2004 19:31:38 +0000 (19:31 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 10 Mar 2004 19:31:38 +0000 (19:31 +0000)
A first step towards new distribution system.

configure.in.pre
prepare

index fb53f87c19f4cb3483349582a5a7ef8b27314b96..c2e6e08b814d71f3621e993dda87f430063fb1a9 100644 (file)
@@ -307,15 +307,16 @@ AC_ARG_ENABLE(stack-trace,
 # Disable all assembler optimizations
 #
 AC_MSG_CHECKING(whether to enable assembler optimizations)
-summary_asm="no"
+want_asm="yes"
 AC_ARG_ENABLE(asm,
   [  --disable-asm           do not use assembler optimizations],
   [
     AC_MSG_RESULT(no)
+    want_asm="no"
   ],
   [
     AC_MSG_RESULT(yes)
-    summary_asm="yes"
+    want_asm="yes"
   ])
 
 
@@ -1092,12 +1093,6 @@ if test x$without_irssi = xfalse; then
   fi
 fi
 
-if test x$mp_gmp = xfalse; then
-  AC_CONFIG_SUBDIRS(lib/silcmath/mpi)
-fi
-
-#AC_CONFIG_SUBDIRS(lib/zlib)
-
 SILC_TOP_SRCDIR=`pwd`
 AC_SUBST(SILC_TOP_SRCDIR)
 #SILC_INSTALL_PREFIX=$ac_default_prefix
@@ -1117,6 +1112,8 @@ if test x$libtoolfix = xtrue; then
 fi
 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
 
+# Included configure scripts
+AD_INCLUDE_CONFIGURE
 
 #
 # Makefile outputs
@@ -1133,9 +1130,6 @@ lib/silccore/Makefile
 lib/silccore/tests/Makefile
 lib/silccrypt/Makefile
 lib/silccrypt/tests/Makefile
-lib/silcmath/Makefile
-lib/silcmath/mpi/Makefile.defines
-lib/silcmath/mpi/Makefile.defines_int
 lib/silcsim/Makefile
 lib/silcske/Makefile
 lib/silcutil/Makefile
@@ -1145,6 +1139,7 @@ lib/silcutil/beos/Makefile
 lib/silcutil/os2/Makefile
 lib/silcutil/epoc/Makefile
 lib/silcutil/tests/Makefile
+lib/silcmath/Makefile
 lib/silcsftp/Makefile
 lib/silcsftp/tests/Makefile
 doc/example_silcd.conf
@@ -1249,7 +1244,7 @@ fi
 echo " SIM support ...................: $sim_support"
 echo " IPv6 support ..................: $summary_ipv6"
 echo " Iconv support .................: $iconv_support"
-echo " Assembler optimizations .......: $summary_asm"
+echo " Assembler optimizations .......: $want_asm"
 
 mp="MPI"
 if test x$mp_gmp = xtrue; then
diff --git a/prepare b/prepare
index b20bca415455857e5c0ebbf65097774e0b221e21..f72a5f5959143ae9ddcc53eb33225f98c67326f2 100755 (executable)
--- a/prepare
+++ b/prepare
 #
 SILC_VERSION=0.9.12                    # Base version
 
+#############################################################################
+
+#############################################################################
+# Functions
+
+#
+# Creates the main configure script from the configure.ad fragments in
+# the source tree.
+#
+# Arguments: ad_make_configure <main_configure_file>
+#
+function ad_make_configure()
+{
+  rm -f configure.in
+
+  cfs=`find . -name configure\*\.ad`
+  for i in $cfs
+  do
+    if test "x$i" = "x$1"; then
+      continue
+    fi
+    cat $i >> configure.ad.cfs
+  done
+
+  if test -f configure.ad.cfs; then
+    sed '/AD_INCLUDE_CONFIGURE/ r configure.ad.cfs' $1 > configure.in.tmp
+    sed -e "/AD_INCLUDE_CONFIGURE/s///" configure.in.tmp > configure.in
+    rm -f configure.ad.cfs configure.in.tmp
+  else
+    cp $1 configure.in
+  fi
+}
+
+
 #############################################################################
 
 echo "Preparing SILC source tree for configuration and compilation..."
@@ -107,8 +141,9 @@ done
 
 sed '/SILC_DIST_DEFINE/ r am_cond' configure.in2 >configure.in3
 dl=`grep "$distribution"_DISTLABEL= distributions |cut -d=  -f2`
-sed -e "/SILC_DIST_DEFINE/s//$dl/" configure.in3 >configure.in
-rm -f configure.in2 configure.in3 am_cond
+sed -e "/SILC_DIST_DEFINE/s//$dl/" configure.in3 >configure.in4
+ad_make_configure ./configure.in4
+rm -f configure.in2 configure.in3 configure.in4 am_cond
 
 
 #
@@ -116,10 +151,6 @@ rm -f configure.in2 configure.in3 am_cond
 #
 cp Makefile.defines.pre Makefile.defines.in
 cp Makefile.defines_int.pre Makefile.defines_int.in
-cp Makefile.defines.in irssi
-cp Makefile.defines_int.in irssi
-cp Makefile.defines.in lib/silcmath/mpi
-cp Makefile.defines_int.in lib/silcmath/mpi
 
 aclocal
 autoconf
@@ -127,14 +158,16 @@ autoheader >/dev/null 2>/dev/null
 libtoolize --automake --copy
 automake
 
-echo "Preparing mpi"
-cd lib/silcmath/mpi
-aclocal
-autoconf
-autoheader >/dev/null 2>/dev/null
-libtoolize --automake --copy
-automake >/dev/null 2>/dev/null
-cd ../../..
+#echo "Preparing mpi"
+#cp Makefile.defines.in lib/silcmath/mpi
+#cp Makefile.defines_int.in lib/silcmath/mpi
+#cd lib/silcmath/mpi
+#aclocal
+#autoconf
+#autoheader >/dev/null 2>/dev/null
+#libtoolize --automake --copy
+#automake >/dev/null 2>/dev/null
+#cd ../../..
 
 file=includes/version_internal.h
 echo "/* Automatically generated by ./prepare */" >$file
@@ -145,6 +178,8 @@ echo "#define SILC_NAME \"SILC $distribution\"" >>$file
 
 # preparing irssi
 echo "Preparing irssi"
+cp Makefile.defines.in irssi
+cp Makefile.defines_int.in irssi
 cd irssi
 sh autogen.sh 2>/dev/null 1>/dev/null
 cd ..