]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/configure.in: check for shl_load in libdld
authorThomas Tanner <tanner@gmx.de>
Sun, 11 Apr 1999 21:12:46 +0000 (21:12 +0000)
committerThomas Tanner <tanner@gmx.de>
Sun, 11 Apr 1999 21:12:46 +0000 (21:12 +0000)
* libltdl/ltdl.c (shl_close, shl_sym): use (shl_t *) instead of shl_t
* ltconfig.in (check for gcc): removed a bogus line,
  check for shl_load in libdld
* ltmain.in: added a warning to the header of the .la file
  to warn users against deleting the file.

ChangeLog
libltdl/configure.in
libltdl/ltdl.c
ltconfig.in
ltmain.in

index a04fcd41d2a0293b6f2aade8627b2075918bfc44..97a75929d86b2870e7e1c3a9fb54f2804974a9ed 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+1999-04-11 Thomas Tanner  <tanner@gmx.de>
+
+       * libltdl/configure.in: check for shl_load in libdld
+       * libltdl/ltdl.c (shl_close, shl_sym): use (shl_t *) instead of shl_t
+       * ltconfig.in (check for gcc): removed a bogus line,
+         check for shl_load in libdld
+       * ltmain.in: added a warning to the header of the .la file
+         to warn users against deleting the file.
+
 1999-04-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * libtool.m4 (AC_PROG_LD, AC_PROG_NM): When looking for programs,
index c07c9d3efbae27fde7577924923850ed7cce0964..465a1f7aa26a5c7eead5036266b4eae00559e5d6 100644 (file)
@@ -89,15 +89,20 @@ fi
 test_dlerror=no
 LIBADD_DL=
 AC_CHECK_FUNCS(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
-                         [Define if you have the libdl library or equivalent. ]) test_dlerror=yes],
+                         [Define if you have the libdl library or equivalent. ]) dnl
+                          test_dlerror=yes],
   [AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
-                              [Define if you have the libdl library. ]) dnl
+                            [Define if you have the libdl library. ]) dnl
                             LIBADD_DL="-ldl" test_dlerror=yes],
     [AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
-                                   [Define if you have the GNU dld library. ]) dnl
+                                 [Define if you have the GNU dld library. ]) dnl
                                  LIBADD_DL="-ldld"],
       [AC_CHECK_FUNCS(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
-                                  [Define if you have the shl_load function. ])])]
+                                [Define if you have the shl_load function. ])],
+       [AC_CHECK_LIB(dld, shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
+                                  [Define if you have the shl_load function. ]) dnl
+                                  LIBADD_DL="-ldld"])]
+       )]
     )]
   )]
 )
index f0a344a0886e48166ba13af979f611913f1f0711..00e94450e6fbaf6eeb9f3a107364c15f64b0a162 100644 (file)
@@ -392,7 +392,7 @@ static int
 shl_close (handle)
        lt_dlhandle handle;
 {
-       if (shl_unload((shl_t) (handle->handle)) != 0) {
+       if (shl_unload((shl_t*) (handle->handle)) != 0) {
                last_error = cannot_close_error;
                return 1;
        }
@@ -406,12 +406,12 @@ shl_sym (handle, symbol)
 {
        lt_ptr_t address;
 
-       if (shl_findsym((shl_t) (handle->handle), symbol, TYPE_UNDEFINED,
-           &address) != 0 || !(handle->handle) || !address) {
-               last_error = symbol_error;
-               return 0;
-       }
-       return address;
+       if (handle->handle && shl_findsym((shl_t*) (handle->handle),
+           symbol, TYPE_UNDEFINED, &address) == 0)
+               if (address)
+                       return address;
+       last_error = symbol_error;
+       return 0;
 }
 
 static
index a42699e8764363db09051b9fac85ef102c175a25..bab0b8dba69754c004be455460ab895276468190 100755 (executable)
@@ -503,7 +503,6 @@ if test "$with_gcc" != yes || test -z "$CC"; then
     echo $ac_n "checking for gcc... $ac_c" 1>&6
     IFS="${IFS=        }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
     for dir in $PATH; do
-      IFS="$save_ifs"
       test -z "$dir" && dir=.
       if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then
        CC="gcc"
@@ -2181,6 +2180,47 @@ if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
   lt_cv_dlopen="shl_load"
 else
   echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
+echo "$progname:@LINENO@: checking for shl_load in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_load | 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
+  ac_save_LIBS="$LIBS"
+LIBS="-ldld  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line @LINENO@ "ltconfig"
+#include "confdefs.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 shl_load();
+
+int main() {
+shl_load()
+; 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"
+else
+  echo "$progname: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
 fi
 
     
index c258081e9fce0528e31cf7d3ea1c3cc214d5b839..33bf5fcbe8da402a5f14f88bcb3a83119b176c93 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2936,8 +2936,11 @@ fi\
          fi
          $rm $output
          $echo > $output "\
-# $output - a libtool library file
+# $outputname.la - a libtool library file
 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
 
 # The name that we can dlopen(3).
 dlname='$dlname'