]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* bootstrap: fix libltdl/Makefile.in
authorThomas Tanner <tanner@gmx.de>
Thu, 20 May 1999 17:53:22 +0000 (17:53 +0000)
committerThomas Tanner <tanner@gmx.de>
Thu, 20 May 1999 17:53:22 +0000 (17:53 +0000)
* cdemo/main.c: "Welcome _to_ ..."
* mdemo/main.c: ditto
* libltdl/configure.in: support multiple dlopening mechanisms
  at once
* libltdl/ltdl.c: prefix system dependent functions with "sys_"
  to avoid symbol conflicts (libdld didn't work)
* libtool.m4 (AC_LIBLTDL_*): set INCLTDL to the path of ltdl.h
* ltconfig.in: check for dlopen with -ldl first

ChangeLog
bootstrap
cdemo/main.c
libltdl/configure.in
libltdl/ltdl.c
libtool.m4
ltconfig.in
mdemo/main.c

index 6aa00f80483d02218e10ca61209faac33cab8b77..fd09ba91b1ffce07b54d2d86f3d46e00bbe1e5e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+1999-05-20 Thomas Tanner  <tanner@gmx.de>
+
+       * bootstrap: fix libltdl/Makefile.in
+       * cdemo/main.c: "Welcome _to_ ..."
+       * mdemo/main.c: ditto
+       * libltdl/configure.in: support multiple dlopening mechanisms
+         at once
+       * libltdl/ltdl.c: prefix system dependent functions with "sys_"
+         to avoid symbol conflicts (libdld didn't work)
+       * libtool.m4 (AC_LIBLTDL_*): set INCLTDL to the path of ltdl.h
+       * ltconfig.in: check for dlopen with -ldl first
+
 1999-05-19  Gary V. Vaughan  <gary@oranda.demon.co.uk>
 
        * NEWS: Added 1.3.1 news items.
index 4cda5fe0eada30effab156aa6c66cfb044db02a1..20f0a5f1ea1399bfabacc3a56f0849fc09adbd2a 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -24,6 +24,14 @@ for sub in demo libltdl mdemo cdemo; do
   autoconf
   cd ..
 done
+
+# fix libltdl's Makefile.in
+cd libltdl
+sed -e 's/chmod 777/chmod 755/g' -e '/ln \$\$d\/\$\$file/d' \
+ Makefile.in > Makefile.tmp
+mv Makefile.tmp Makefile.in
+cd ..
+
 rm -f ltconfig ltmain.sh libtoolize
 
 exit 0
index 79602a249be85b288fa6a64be54493a02813bcdc..de84ba4390077ca872035416e4ceef4c5f70b381 100644 (file)
@@ -29,7 +29,7 @@ main (argc,argv)
 {
   int value;
 
-  printf ("Welcome GNU libtool cdemo!\n");
+  printf ("Welcome to GNU libtool cdemo!\n");
 
   value = hello();
   printf ("hello returned: %i\n", value);
index 2b589bf4502db7dcc0720e0d2eb4915e1e3be5e2..d6d7b116f31fce2356470c5160436d1660b3b362 100644 (file)
@@ -89,11 +89,11 @@ fi
 
 LIBADD_DL=
 AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-ldl"],
-[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)],
-[AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1) LIBADD_DL="-ldld"],
-[AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
-[AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="-ldld"])]
-)])])])
+[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1)])])
+AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1)],
+[AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1) LIBADD_DL="$LIBADD_DL -ldld"])])
+AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1)dnl
+test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
 AC_SUBST(LIBADD_DL)
 
 if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = yes; then
index e22bea7466fef0413ae5da4fecd63ac253527a67..307a019dc2a45bd25409177289212c9e6fee4459 100644 (file)
@@ -246,19 +246,19 @@ strrchr(str, ch)
 #endif
 
 static int
-dl_init __P((void))
+sys_dl_init __P((void))
 {
        return 0;
 }
 
 static int
-dl_exit __P((void))
+sys_dl_exit __P((void))
 {
        return 0;
 }
 
 static int
-dl_open (handle, filename)
+sys_dl_open (handle, filename)
        lt_dlhandle handle;
        const char *filename;
 {
@@ -275,7 +275,7 @@ dl_open (handle, filename)
 }
 
 static int
-dl_close (handle)
+sys_dl_close (handle)
        lt_dlhandle handle;
 {
        if (dlclose(handle->handle) != 0) {
@@ -290,7 +290,7 @@ dl_close (handle)
 }
 
 static lt_ptr_t
-dl_sym (handle, symbol)
+sys_dl_sym (handle, symbol)
        lt_dlhandle handle;
        const char *symbol;
 {
@@ -308,15 +308,15 @@ dl_sym (handle, symbol)
 static
 lt_dltype_t
 #ifdef NEED_USCORE
-dl = { LTDL_TYPE_TOP, "_", dl_init, dl_exit,
-       dl_open, dl_close, dl_sym };
+sys_dl = { LTDL_TYPE_TOP, "_", sys_dl_init, sys_dl_exit,
+       sys_dl_open, sys_dl_close, sys_dl_sym };
 #else
-dl = { LTDL_TYPE_TOP, 0, dl_init, dl_exit,
-       dl_open, dl_close, dl_sym };
+sys_dl = { LTDL_TYPE_TOP, 0, sys_dl_init, sys_dl_exit,
+       sys_dl_open, sys_dl_close, sys_dl_sym };
 #endif
 
 #undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &dl
+#define LTDL_TYPE_TOP &sys_dl
 
 #endif
 
@@ -364,19 +364,19 @@ dl = { LTDL_TYPE_TOP, 0, dl_init, dl_exit,
 #define        LTDL_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | BIND_VERBOSE | DYNAMIC_PATH)
 
 static int
-shl_init __P((void))
+sys_shl_init __P((void))
 {
        return 0;
 }
 
 static int
-shl_exit __P((void))
+sys_shl_exit __P((void))
 {
        return 0;
 }
 
 static int
-shl_open (handle, filename)
+sys_shl_open (handle, filename)
        lt_dlhandle handle;
        const char *filename;
 {
@@ -389,7 +389,7 @@ shl_open (handle, filename)
 }
 
 static int
-shl_close (handle)
+sys_shl_close (handle)
        lt_dlhandle handle;
 {
        if (shl_unload((shl_t) (handle->handle)) != 0) {
@@ -400,7 +400,7 @@ shl_close (handle)
 }
 
 static lt_ptr_t
-shl_sym (handle, symbol)
+sys_shl_sym (handle, symbol)
        lt_dlhandle handle;
        const char *symbol;
 {
@@ -416,11 +416,11 @@ shl_sym (handle, symbol)
 
 static
 lt_dltype_t
-shl = { LTDL_TYPE_TOP, 0, shl_init, shl_exit,
-       shl_open, shl_close, shl_sym };
+sys_shl = { LTDL_TYPE_TOP, 0, sys_shl_init, sys_shl_exit,
+       sys_shl_open, sys_shl_close, sys_shl_sym };
 
 #undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &shl
+#define LTDL_TYPE_TOP &sys_shl
 
 #endif
 
@@ -433,19 +433,19 @@ shl = { LTDL_TYPE_TOP, 0, shl_init, shl_exit,
 #endif
 
 static int
-dld_init __P((void))
+sys_dld_init __P((void))
 {
        return 0;
 }
 
 static int
-dld_exit __P((void))
+sys_dld_exit __P((void))
 {
        return 0;
 }
 
 static int
-dld_open (handle, filename)
+sys_dld_open (handle, filename)
        lt_dlhandle handle;
        const char *filename;
 {
@@ -463,7 +463,7 @@ dld_open (handle, filename)
 }
 
 static int
-dld_close (handle)
+sys_dld_close (handle)
        lt_dlhandle handle;
 {
        if (dld_unlink_by_file((char*)(handle->handle), 1) != 0) {
@@ -475,7 +475,7 @@ dld_close (handle)
 }
 
 static lt_ptr_t
-dld_sym (handle, symbol)
+sys_dld_sym (handle, symbol)
        lt_dlhandle handle;
        const char *symbol;
 {
@@ -488,11 +488,11 @@ dld_sym (handle, symbol)
 
 static
 lt_dltype_t
-dld = { LTDL_TYPE_TOP, 0, dld_init, dld_exit,
-       dld_open, dld_close, dld_sym };
+sys_dld = { LTDL_TYPE_TOP, 0, sys_dld_init, sys_dld_exit,
+       sys_dld_open, sys_dld_close, sys_dld_sym };
 
 #undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &dld
+#define LTDL_TYPE_TOP &sys_dld
 
 #endif
 
@@ -503,19 +503,19 @@ dld = { LTDL_TYPE_TOP, 0, dld_init, dld_exit,
 #include <windows.h>
 
 static int
-wll_init __P((void))
+sys_wll_init __P((void))
 {
        return 0;
 }
 
 static int
-wll_exit __P((void))
+sys_wll_exit __P((void))
 {
        return 0;
 }
 
 static int
-wll_open (handle, filename)
+sys_wll_open (handle, filename)
        lt_dlhandle handle;
        const char *filename;
 {
@@ -528,7 +528,7 @@ wll_open (handle, filename)
 }
 
 static int
-wll_close (handle)
+sys_wll_close (handle)
        lt_dlhandle handle;
 {
        if (FreeLibrary(handle->handle) != 0) {
@@ -539,7 +539,7 @@ wll_close (handle)
 }
 
 static lt_ptr_t
-wll_sym (handle, symbol)
+sys_wll_sym (handle, symbol)
        lt_dlhandle handle;
        const char *symbol;
 {
@@ -552,11 +552,11 @@ wll_sym (handle, symbol)
 
 static
 lt_dltype_t
-wll = { LTDL_TYPE_TOP, 0, wll_init, wll_exit,
-       wll_open, wll_close, wll_sym };
+sys_wll = { LTDL_TYPE_TOP, 0, sys_wll_init, sys_wll_exit,
+       sys_wll_open, sys_wll_close, sys_wll_sym };
 
 #undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &wll
+#define LTDL_TYPE_TOP &sys_wll
 
 #endif
 
@@ -567,19 +567,19 @@ wll = { LTDL_TYPE_TOP, 0, wll_init, wll_exit,
 #include <kernel/image.h>
 
 static int
-bedl_init __P((void))
+sys_bedl_init __P((void))
 {
        return 0;
 }
 
 static int
-bedl_exit __P((void))
+sys_bedl_exit __P((void))
 {
        return 0;
 }
 
 static int
-bedl_open (handle, filename)
+sys_bedl_open (handle, filename)
        lt_dlhandle handle;
        const char *filename;
 {
@@ -602,7 +602,7 @@ bedl_open (handle, filename)
 }
 
 static int
-bedl_close (handle)
+sys_bedl_close (handle)
        lt_dlhandle handle;
 {
        if (unload_add_on((image_id)handle->handle) != B_OK) {
@@ -613,7 +613,7 @@ bedl_close (handle)
 }
 
 static lt_ptr_t
-bedl_sym (handle, symbol)
+sys_bedl_sym (handle, symbol)
        lt_dlhandle handle;
        const char *symbol;
 {
@@ -630,11 +630,11 @@ bedl_sym (handle, symbol)
 
 static
 lt_dltype_t
-bedl = { LTDL_TYPE_TOP, 0, bedl_init, bedl_exit,
-       bedl_open, bedl_close, bedl_sym };
+sys_bedl = { LTDL_TYPE_TOP, 0, sys_bedl_init, sys_bedl_exit,
+       sys_bedl_open, sys_bedl_close, sys_bedl_sym };
 
 #undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &bedl
+#define LTDL_TYPE_TOP &sys_bedl
 
 #endif
 
index cec5c03c0b20b0e2df6afd37004160ab5d34ccb2..2ad32064dd79db7a0df7e1b35df7896d78c22a8d 100644 (file)
@@ -21,7 +21,7 @@
 ## configuration script generated by Autoconf, you may include it under
 ## the same distribution terms that you use for the rest of that program.
 
-# serial 39 AC_PROG_LIBTOOL
+# serial 40 AC_PROG_LIBTOOL
 AC_DEFUN(AC_PROG_LIBTOOL,
 [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
 
@@ -382,6 +382,7 @@ AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
   esac
   LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+  INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
 ])
 
 # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
@@ -405,9 +406,11 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
   if test x"$enable_ltdl_install" = x"yes"; then
     ac_configure_args="$ac_configure_args --enable-ltdl-install"
     LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+    INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
   else
     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
     LIBLTDL="-lltdl"
+    INCLTDL=
   fi
 ])
 
index 09af499b4183b519f4474dfb6e908b09895b573d..55c67b32a33177ba3d68c0c916881d11c044a570 100755 (executable)
@@ -2098,86 +2098,85 @@ if test "x$enable_dlopen" != xyes; then
 else
 if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
   lt_cv_dlopen=no lt_cv_dlopen_libs=
-echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "$progname:@LINENO@: checking for dlopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  cat > conftest.$ac_ext <<EOF
+  ac_save_LIBS="$LIBS"
+LIBS="-ldl  $LIBS"
+cat > conftest.$ac_ext <<EOF
 #line @LINENO@ "ltconfig"
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char dlopen(); below.  */
-#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
 
 int main() {
-
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-dlopen();
-#endif
-
+dlopen()
 ; return 0; }
 EOF
 if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_func_dlopen=yes"
+  eval "ac_cv_lib_$ac_lib_var=yes"
 else
   echo "$progname: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_func_dlopen=no"
+  eval "ac_cv_lib_$ac_lib_var=no"
 fi
 rm -f conftest*
-fi
+LIBS="$ac_save_LIBS"
 
-if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  lt_cv_dlopen="dlopen"
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
 else
   echo "$ac_t""no" 1>&6
-echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "$progname:@LINENO@: checking for dlopen in -ldl" >&5
-ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+echo $ac_n "checking for dlopen""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for dlopen" >&5
+if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-ldl  $LIBS"
-cat > conftest.$ac_ext <<EOF
+  cat > conftest.$ac_ext <<EOF
 #line @LINENO@ "ltconfig"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char dlopen(); below.  */
+#include <assert.h>
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
 char dlopen();
 
 int main() {
-dlopen()
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+dlopen();
+#endif
+
 ; return 0; }
 EOF
 if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
+  eval "ac_cv_func_dlopen=yes"
 else
   echo "$progname: failed program was:" >&5
   cat conftest.$ac_ext >&5
   rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
+  eval "ac_cv_func_dlopen=no"
 fi
 rm -f conftest*
-LIBS="$ac_save_LIBS"
-
 fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen="dlopen"
 else
   echo "$ac_t""no" 1>&6
 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
index 8376cb2ba1ca287dae92784842ce1707d12c0072..34e942df7f7c574ad51a15b2635e7718508e8ad2 100644 (file)
@@ -151,7 +151,7 @@ main (argc, argv)
   int i;
   int ret = 0;
 
-  printf ("Welcome GNU libtool mdemo!\n");
+  printf ("Welcome to GNU libtool mdemo!\n");
 
   if (argc < 2) {
     fprintf (stderr, "usage: %s module [module...]\n", argv[0]);