You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2008/09/24 10:35:33 UTC

svn commit: r698466 - in /tomcat/connectors/trunk/jk/native: configure.in scripts/build/jk_common.m4

Author: mturk
Date: Wed Sep 24 01:35:33 2008
New Revision: 698466

URL: http://svn.apache.org/viewvc?rev=698466&view=rev
Log:
Add config.nice generation. Mostly copy/paste from APR

Modified:
    tomcat/connectors/trunk/jk/native/configure.in
    tomcat/connectors/trunk/jk/native/scripts/build/jk_common.m4

Modified: tomcat/connectors/trunk/jk/native/configure.in
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/configure.in?rev=698466&r1=698465&r2=698466&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/configure.in (original)
+++ tomcat/connectors/trunk/jk/native/configure.in Wed Sep 24 01:35:33 2008
@@ -35,6 +35,10 @@
 dnl
 sinclude(scripts/build/jk_common.m4)
 
+dnl Generate ./config.nice for reproducing runs of configure
+dnl
+JK_CONFIG_NICE(config.nice)
+
 AC_PATH_PROG(TEST,test,$PATH)dnl
 AC_SUBST(TEST)
 

Modified: tomcat/connectors/trunk/jk/native/scripts/build/jk_common.m4
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/scripts/build/jk_common.m4?rev=698466&r1=698465&r2=698466&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/scripts/build/jk_common.m4 (original)
+++ tomcat/connectors/trunk/jk/native/scripts/build/jk_common.m4 Wed Sep 24 01:35:33 2008
@@ -75,3 +75,86 @@
     $1=$jk_new_val
   fi
 ]) dnl
+
+dnl Iteratively interpolate the contents of the second argument
+dnl until interpolation offers no new result. Then assign the
+dnl final result to $1.
+dnl
+dnl Example:
+dnl
+dnl foo=1
+dnl bar='${foo}/2'
+dnl baz='${bar}/3'
+dnl JK_EXPAND_VAR(fraz, $baz)
+dnl   $fraz is now "1/2/3"
+dnl 
+AC_DEFUN([JK_EXPAND_VAR], [
+jk_last=
+jk_cur="$2"
+while test "x${jk_cur}" != "x${jk_last}";
+do
+  jk_last="${jk_cur}"
+  jk_cur=`eval "echo ${jk_cur}"`
+done
+$1="${jk_cur}"
+])
+
+dnl
+dnl JK_CONFIG_NICE(filename)
+dnl
+dnl Saves a snapshot of the configure command-line for later reuse
+dnl
+AC_DEFUN([JK_CONFIG_NICE], [
+  rm -f $1
+  cat >$1<<EOF
+#! /bin/sh
+#
+# Created by configure
+
+EOF
+  if test -n "$CC"; then
+    echo "CC=\"$CC\"; export CC" >> $1
+  fi
+  if test -n "$CFLAGS"; then
+    echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1
+  fi
+  if test -n "$CPPFLAGS"; then
+    echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> $1
+  fi
+  if test -n "$LDFLAGS"; then
+    echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1
+  fi
+  if test -n "$LTFLAGS"; then
+    echo "LTFLAGS=\"$LTFLAGS\"; export LTFLAGS" >> $1
+  fi
+  if test -n "$LIBS"; then
+    echo "LIBS=\"$LIBS\"; export LIBS" >> $1
+  fi
+  if test -n "$INCLUDES"; then
+    echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> $1
+  fi
+  if test -n "$NOTEST_CFLAGS"; then
+    echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> $1
+  fi
+  if test -n "$NOTEST_CPPFLAGS"; then
+    echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> $1
+  fi
+  if test -n "$NOTEST_LDFLAGS"; then
+    echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> $1
+  fi
+  if test -n "$NOTEST_LIBS"; then
+    echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1
+  fi
+
+  # Retrieve command-line arguments.
+  eval "set x $[0] $ac_configure_args"
+  shift
+
+  for arg
+  do
+    JK_EXPAND_VAR(arg, $arg)
+    echo "\"[$]arg\" \\" >> $1
+  done
+  echo '"[$]@"' >> $1
+  chmod +x $1
+])dnl



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org