Patch for libtool

Tyler Berry loki at io.com
Thu Sep 26 00:49:29 PDT 2002


As a sometime developer, I have begun attempting to integrate a libltdl (libtool) powered dynamic module loader into my current baby, and discovered that there is an incompatibility between Autoconf 2.53 and up (I'm using 2.54) and Libtool 1.4.x. Specifically, the problem is in libtool.m4, where the m4 macro AC_PROVIDE_AC_LIBTOOL_... is used. This is deprecated in favor of AC_PROVIDE_ELSEIF.

Attached is a patch for libtool which ought to be applied in Chapter 6 of the book if we don't want to be packaging a libtool that is subtly broken for developers.
-------------- next part --------------
diff -Naur libtool-1.4.2-old/acinclude.m4 libtool-1.4.2/acinclude.m4
--- libtool-1.4.2-old/acinclude.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/acinclude.m4	2002-09-26 06:02:31.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/aclocal.m4 libtool-1.4.2/aclocal.m4
--- libtool-1.4.2-old/aclocal.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/aclocal.m4	2002-09-26 06:02:31.000000000 +0000
@@ -58,8 +58,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -103,7 +103,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/cdemo/acinclude.m4 libtool-1.4.2/cdemo/acinclude.m4
--- libtool-1.4.2-old/cdemo/acinclude.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/cdemo/acinclude.m4	2002-09-26 06:02:31.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/cdemo/aclocal.m4 libtool-1.4.2/cdemo/aclocal.m4
--- libtool-1.4.2-old/cdemo/aclocal.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/cdemo/aclocal.m4	2002-09-26 06:02:31.000000000 +0000
@@ -58,8 +58,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -103,7 +103,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/demo/acinclude.m4 libtool-1.4.2/demo/acinclude.m4
--- libtool-1.4.2-old/demo/acinclude.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/demo/acinclude.m4	2002-09-26 06:02:32.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/demo/aclocal.m4 libtool-1.4.2/demo/aclocal.m4
--- libtool-1.4.2-old/demo/aclocal.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/demo/aclocal.m4	2002-09-26 06:02:31.000000000 +0000
@@ -58,8 +58,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -103,7 +103,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/depdemo/acinclude.m4 libtool-1.4.2/depdemo/acinclude.m4
--- libtool-1.4.2-old/depdemo/acinclude.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/depdemo/acinclude.m4	2002-09-26 06:02:31.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/depdemo/aclocal.m4 libtool-1.4.2/depdemo/aclocal.m4
--- libtool-1.4.2-old/depdemo/aclocal.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/depdemo/aclocal.m4	2002-09-26 06:02:31.000000000 +0000
@@ -58,8 +58,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -103,7 +103,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/libltdl/acinclude.m4 libtool-1.4.2/libltdl/acinclude.m4
--- libtool-1.4.2-old/libltdl/acinclude.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/libltdl/acinclude.m4	2002-09-26 06:02:31.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/libltdl/aclocal.m4 libtool-1.4.2/libltdl/aclocal.m4
--- libtool-1.4.2-old/libltdl/aclocal.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/libltdl/aclocal.m4	2002-09-26 06:02:31.000000000 +0000
@@ -58,8 +58,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -103,7 +103,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/libtool.m4 libtool-1.4.2/libtool.m4
--- libtool-1.4.2-old/libtool.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/libtool.m4	2002-09-26 06:02:31.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/mdemo/acinclude.m4 libtool-1.4.2/mdemo/acinclude.m4
--- libtool-1.4.2-old/mdemo/acinclude.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/mdemo/acinclude.m4	2002-09-26 06:02:30.000000000 +0000
@@ -68,8 +68,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -113,7 +113,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)
diff -Naur libtool-1.4.2-old/mdemo/aclocal.m4 libtool-1.4.2/mdemo/aclocal.m4
--- libtool-1.4.2-old/mdemo/aclocal.m4	2002-09-26 05:18:08.000000000 +0000
+++ libtool-1.4.2/mdemo/aclocal.m4	2002-09-26 06:02:30.000000000 +0000
@@ -58,8 +58,8 @@
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(STRIP, strip, :)
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 enable_win32_dll=yes, enable_win32_dll=no)
 
 AC_ARG_ENABLE(libtool-lock,
@@ -103,7 +103,7 @@
   fi
   ;;
 
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
 [*-*-cygwin* | *-*-mingw* | *-*-pw32*)
   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
   AC_CHECK_TOOL(AS, as, false)


More information about the lfs-dev mailing list