Browse Source

configure: libtool 1.5 tweaks

Yang Tse 7 years ago
parent
commit
34f9ec0c54
5 changed files with 88 additions and 28 deletions
  1. 25
    17
      buildconf
  2. 1
    0
      configure.ac
  3. 1
    0
      m4/.gitignore
  4. 1
    11
      m4/curl-override.m4
  5. 60
    0
      m4/zz50-xc-ovr.m4

+ 25
- 17
buildconf View File

@@ -6,7 +6,7 @@
6 6
 #                            | (__| |_| |  _ <| |___
7 7
 #                             \___|\___/|_| \_\_____|
8 8
 #
9
-# Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
9
+# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
10 10
 #
11 11
 # This software is licensed as described in the file COPYING, which
12 12
 # you should have received as part of this distribution. The terms
@@ -315,7 +315,7 @@ for fname in .deps \
315 315
     libcurl.pc \
316 316
     libtool \
317 317
     libtool.m4 \
318
-    libtool.m4.bak \
318
+    libtool.m4.tmp \
319 319
     ltmain.sh \
320 320
     ltoptions.m4 \
321 321
     ltsugar.m4 \
@@ -339,33 +339,41 @@ fi
339 339
 echo "buildconf: running libtoolize"
340 340
 $libtoolize --copy --automake --force || die "The libtoolize command failed"
341 341
 
342
+# When using libtool 1.5.X (X < 26) we copy libtool.m4 to our local m4
343
+# subdirectory and this local copy is patched to fix some warnings that
344
+# are triggered when running aclocal and using autoconf 2.62 or later.
345
+
342 346
 if test "$lt_major" = "1" && test "$lt_minor" = "5"; then
343 347
   if test -z "$lt_patch" || test "$lt_patch" -lt "26"; then
344
-    if test -f m4/libtool.m4; then
345
-      our_libtool_m4='m4/libtool.m4'
346
-    elif test -f libtool.m4; then
347
-      our_libtool_m4='libtool.m4'
348
+    echo "buildconf: copying libtool.m4 to local m4 subdir"
349
+    ac_dir=`${ACLOCAL:-aclocal} --print-ac-dir`
350
+    if test -f $ac_dir/libtool.m4; then
351
+      cp -f $ac_dir/libtool.m4 m4/libtool.m4
352
+    else
353
+      echo "buildconf: $ac_dir/libtool.m4 not found"
348 354
     fi
349
-    if test -n "$our_libtool_m4"; then
350
-      echo "buildconf: running libtoolize hack to rename some variables"
351
-      $PERL -i.bak -pe \
355
+    if test -f m4/libtool.m4; then
356
+      echo "buildconf: renaming some variables in local m4/libtool.m4"
357
+      $PERL -i.tmp -pe \
352 358
         's/lt_prog_compiler_pic_works/lt_cv_prog_compiler_pic_works/g; \
353 359
          s/lt_prog_compiler_static_works/lt_cv_prog_compiler_static_works/g;' \
354
-        $our_libtool_m4
360
+        m4/libtool.m4
361
+      rm -f m4/libtool.m4.tmp
355 362
     fi
356 363
   fi
357 364
 fi
358 365
 
366
+if test -f m4/libtool.m4; then
367
+  echo "buildconf: converting all mv to mv -f in local m4/libtool.m4"
368
+  $PERL -i.tmp -pe 's/\bmv +([^-\s])/mv -f $1/g' m4/libtool.m4
369
+  rm -f m4/libtool.m4.tmp
370
+fi
371
+
359 372
 echo "buildconf: running aclocal"
360 373
 ${ACLOCAL:-aclocal} -I m4 $ACLOCAL_FLAGS || die "The aclocal command line failed"
361 374
 
362
-if test -n "$PERL"; then
363
-  echo "buildconf: running aclocal hack to convert all mv to mv -f"
364
-  $PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
365
-else
366
-  echo "buildconf: perl not found"
367
-  exit 1
368
-fi
375
+echo "buildconf: converting all mv to mv -f in local aclocal.m4"
376
+$PERL -i.bak -pe 's/\bmv +([^-\s])/mv -f $1/g' aclocal.m4
369 377
 
370 378
 echo "buildconf: running autoheader"
371 379
 ${AUTOHEADER:-autoheader} || die "The autoheader command failed"

+ 1
- 0
configure.ac View File

@@ -26,6 +26,7 @@ AC_PREREQ(2.57)
26 26
 dnl We don't know the version number "statically" so we use a dash here
27 27
 AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
28 28
 
29
+XC_OVR_ZZ50
29 30
 CURL_OVERRIDE_AUTOCONF
30 31
 
31 32
 dnl configure script copyright

+ 1
- 0
m4/.gitignore View File

@@ -1,4 +1,5 @@
1 1
 libtool.m4
2
+libtool.m4.tmp
2 3
 ltoptions.m4
3 4
 ltsugar.m4
4 5
 ltversion.m4

+ 1
- 11
m4/curl-override.m4 View File

@@ -2,7 +2,7 @@
2 2
 #***************************************************************************
3 3
 
4 4
 # File version for 'aclocal' use. Keep it a single number.
5
-# serial 4
5
+# serial 5
6 6
 
7 7
 dnl CURL_OVERRIDE_AUTOCONF
8 8
 dnl -------------------------------------------------
@@ -16,16 +16,6 @@ AC_BEFORE([$0],[AC_PROG_LIBTOOL])
16 16
 # using curl-override.m4
17 17
 ])
18 18
 
19
-dnl Override some Libtool tests
20
-dnl -------------------------------------------------
21
-dnl This is done to prevent Libtool 1.5.X from doing
22
-dnl unnecesary C++, Fortran and Java tests and reduce
23
-dnl resulting configure script by nearly 300 Kb.
24
-
25
-m4_define([AC_LIBTOOL_LANG_CXX_CONFIG],[:])
26
-m4_define([AC_LIBTOOL_LANG_F77_CONFIG],[:])
27
-m4_define([AC_LIBTOOL_LANG_GCJ_CONFIG],[:])
28
-
29 19
 dnl Override Autoconf's AC_LANG_PROGRAM (C)
30 20
 dnl -------------------------------------------------
31 21
 dnl This is done to prevent compiler warning

+ 60
- 0
m4/zz50-xc-ovr.m4 View File

@@ -0,0 +1,60 @@
1
+#---------------------------------------------------------------------------
2
+#
3
+# zz50-xc-ovr.m4
4
+#
5
+# Copyright (c) 2011 Daniel Stenberg <daniel@haxx.se>
6
+#
7
+# Permission to use, copy, modify, and distribute this software for any
8
+# purpose with or without fee is hereby granted, provided that the above
9
+# copyright notice and this permission notice appear in all copies.
10
+#
11
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
+#
19
+#---------------------------------------------------------------------------
20
+
21
+# serial 1
22
+
23
+
24
+dnl The funny name of this file is intentional in order to make it
25
+dnl sort alphabetically after any libtool, autoconf or automake
26
+dnl provided .m4 macro file that might get copied into this same
27
+dnl subdirectory. This allows that macro (re)definitions from this
28
+dnl file may override those provided in other files.
29
+
30
+
31
+dnl Override some language related macros
32
+dnl -------------------------------------------------
33
+dnl This is done to prevent Libtool 1.5.X from doing
34
+dnl unnecesary C++, Fortran and Java tests when only
35
+dnl using C language and reduce resulting configure
36
+dnl script by nearly 300 Kb.
37
+
38
+m4_ifdef([AC_LIBTOOL_LANG_CXX_CONFIG],
39
+  [m4_undefine([AC_LIBTOOL_LANG_CXX_CONFIG])])
40
+m4_define([AC_LIBTOOL_LANG_CXX_CONFIG],[:])
41
+
42
+m4_ifdef([AC_LIBTOOL_LANG_F77_CONFIG],
43
+  [m4_undefine([AC_LIBTOOL_LANG_F77_CONFIG])])
44
+m4_define([AC_LIBTOOL_LANG_F77_CONFIG],[:])
45
+
46
+m4_ifdef([AC_LIBTOOL_LANG_GCJ_CONFIG],
47
+  [m4_undefine([AC_LIBTOOL_LANG_GCJ_CONFIG])])
48
+m4_define([AC_LIBTOOL_LANG_GCJ_CONFIG],[:])
49
+
50
+
51
+dnl XC_OVR_ZZ50
52
+dnl -------------------------------------------------
53
+dnl Placing a call to this macro in configure.ac will
54
+dnl make macros in this file visible to other macros
55
+dnl used for same configure script, overriding those
56
+dnl provided elsewhere.
57
+
58
+AC_DEFUN([XC_OVR_ZZ50],
59
+  [AC_BEFORE([$0],[AC_PROG_LIBTOOL])])
60
+

Loading…
Cancel
Save