configure: libtool 1.5 tweaks
authorYang Tse <yangsita@gmail.com>
Thu, 15 Dec 2011 17:01:00 +0000 (18:01 +0100)
committerYang Tse <yangsita@gmail.com>
Thu, 15 Dec 2011 17:01:00 +0000 (18:01 +0100)
buildconf
configure.ac
m4/.gitignore
m4/curl-override.m4
m4/zz50-xc-ovr.m4 [new file with mode: 0644]

index 28f3852..b3469e3 100755 (executable)
--- a/buildconf
+++ b/buildconf
@@ -6,7 +6,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
 #
 # This software is licensed as described in the file COPYING, which
 # you should have received as part of this distribution. The terms
@@ -315,7 +315,7 @@ for fname in .deps \
     libcurl.pc \
     libtool \
     libtool.m4 \
-    libtool.m4.bak \
+    libtool.m4.tmp \
     ltmain.sh \
     ltoptions.m4 \
     ltsugar.m4 \
@@ -339,33 +339,41 @@ fi
 echo "buildconf: running libtoolize"
 $libtoolize --copy --automake --force || die "The libtoolize command failed"
 
+# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
+# subdirectory and this local copy is patched to fix some warnings that
+# are triggered when running aclocal and using autoconf 2.62 or later.
+
 if test "$lt_major" = "1" && test "$lt_minor" = "5"; then
   if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then
-    if test -f m4/libtool.m4; then
-      our_libtool_m4='m4/libtool.m4'
-    elif test -f libtool.m4; then
-      our_libtool_m4='libtool.m4'
+    echo "buildconf: copying libtool.m4 to local m4 subdir"
+    ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir`
+    if test -f $ac_dir/libtool.m4; then
+      cp -f $ac_dir/libtool.m4 m4/libtool.m4
+    else
+      echo "buildconf: $ac_dir/libtool.m4 not found"
     fi
-    if test -n "$our_libtool_m4"; then
-      echo "buildconf: running libtoolize hack to rename some variables"
-      $PERL -i.bak -pe \
+    if test -f m4/libtool.m4; then
+      echo "buildconf: renaming some variables in local m4/libtool.m4"
+      $PERL -i.tmp -pe \
         's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \
          s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \
-        $our_libtool_m4
+        m4/libtool.m4
+      rm -f m4/libtool.m4.tmp
     fi
   fi
 fi
 
+if test -f m4/libtool.m4; then
+  echo "buildconf: converting all mv to mv -f in local m4/libtool.m4"
+  $PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4
+  rm -f m4/libtool.m4.tmp
+fi
+
 echo "buildconf: running aclocal"
 ${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "The aclocal command line failed"
 
-if test -n "$PERL"; then
-  echo "buildconf: running aclocal hack to convert all mv to mv -f"
-  $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
-else
-  echo "buildconf: perl not found"
-  exit 1
-fi
+echo "buildconf: converting all mv to mv -f in local aclocal.m4"
+$PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
 
 echo "buildconf: running autoheader"
 ${AUTOHEADER:-autoheader} || die "The autoheader command failed"
index 4bf25dc..3e95b0c 100644 (file)
@@ -26,6 +26,7 @@ AC_PREREQ(2.57)
 dnl We don't know the version number "statically" so we use a dash here
 AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
 
+XC_OVR_ZZ50
 CURL_OVERRIDE_AUTOCONF
 
 dnl configure script copyright
index 38066dd..f0f1d4d 100644 (file)
@@ -1,4 +1,5 @@
 libtool.m4
+libtool.m4.tmp
 ltoptions.m4
 ltsugar.m4
 ltversion.m4
index 5a14190..ad3110e 100644 (file)
@@ -2,7 +2,7 @@
 #***************************************************************************
 
 # File version for 'aclocal' use. Keep it a single number.
-# serial 4
+# serial 5
 
 dnl CURL_OVERRIDE_AUTOCONF
 dnl -------------------------------------------------
@@ -16,16 +16,6 @@ AC_BEFORE([$0],[AC_PROG_LIBTOOL])
 # using curl-override.m4
 ])
 
-dnl Override some Libtool tests
-dnl -------------------------------------------------
-dnl This is done to prevent Libtool 1.5.X from doing
-dnl unnecesary C++, Fortran and Java tests and reduce
-dnl resulting configure script by nearly 300 Kb.
-
-m4_define([AC_LIBTOOL_LANG_CXX_CONFIG],[:])
-m4_define([AC_LIBTOOL_LANG_F77_CONFIG],[:])
-m4_define([AC_LIBTOOL_LANG_GCJ_CONFIG],[:])
-
 dnl Override Autoconf's AC_LANG_PROGRAM (C)
 dnl -------------------------------------------------
 dnl This is done to prevent compiler warning
diff --git a/m4/zz50-xc-ovr.m4 b/m4/zz50-xc-ovr.m4
new file mode 100644 (file)
index 0000000..7e9ae59
--- /dev/null
@@ -0,0 +1,60 @@
+#---------------------------------------------------------------------------
+#
+# zz50-xc-ovr.m4
+#
+# Copyright (c) 2011 Daniel Stenberg <daniel@haxx.se>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+#---------------------------------------------------------------------------
+
+# serial 1
+
+
+dnl The funny name of this file is intentional in order to make it
+dnl sort alphabetically after any libtool, autoconf or automake
+dnl provided .m4 macro file that might get copied into this same
+dnl subdirectory. This allows that macro (re)definitions from this
+dnl file may override those provided in other files.
+
+
+dnl Override some language related macros
+dnl -------------------------------------------------
+dnl This is done to prevent Libtool 1.5.X from doing
+dnl unnecesary C++, Fortran and Java tests when only
+dnl using C language and reduce resulting configure
+dnl script by nearly 300 Kb.
+
+m4_ifdef([AC_LIBTOOL_LANG_CXX_CONFIG],
+  [m4_undefine([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_define([AC_LIBTOOL_LANG_CXX_CONFIG],[:])
+
+m4_ifdef([AC_LIBTOOL_LANG_F77_CONFIG],
+  [m4_undefine([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_define([AC_LIBTOOL_LANG_F77_CONFIG],[:])
+
+m4_ifdef([AC_LIBTOOL_LANG_GCJ_CONFIG],
+  [m4_undefine([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_define([AC_LIBTOOL_LANG_GCJ_CONFIG],[:])
+
+
+dnl XC_OVR_ZZ50
+dnl -------------------------------------------------
+dnl Placing a call to this macro in configure.ac will
+dnl make macros in this file visible to other macros
+dnl used for same configure script, overriding those
+dnl provided elsewhere.
+
+AC_DEFUN([XC_OVR_ZZ50],
+  [AC_BEFORE([$0],[AC_PROG_LIBTOOL])])
+