libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_LTDL_DLLIB in HEAD/ltdl.m4


From: libtool-patches
Subject: Re: AC_LTDL_DLLIB in HEAD/ltdl.m4
Date: Fri, 21 Sep 2001 02:01:23 -0500
User-agent: Mutt/1.2.5i

On Wed, Sep 19, 2001 at 07:58:14PM -0500, address@hidden wrote:
> We've modified libtool.m4 to perfer shl_load on HP-UX *even* if dlopen
> is available. The rationale for this is because dlopen() requires a
> patch which all users might not have (we're running into this problem
> now). Unfortunately, ltdl calls AC_LTDL_DLLIB which searches for
> *every* possible loader and defines them all in libtldl/ltdl.c. Why?
> Why not just pick the first we find? The current behaviour uses
> shl_load and dlopen on HP-UX by default. I'd like to get this changed
> to shl_load only.

Patch below. Tested on HP-UX 10.20 and 11.00.

-- 
albert chin (address@hidden)

-- snip snip
2001-09-21  Albert Chin-A-Young <address@hidden>

        * ltdl.m4: Even though HP-UX 10.20 and 11.00 support
        shl_load *and* dlopen, dlopen works correctly only
        with a patch. Because we want to avoid the situation
        where we build on a system with the patch but deploy
        on a system without, use shl_load exclusively if found.


Index: ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/ltdl.m4,v
retrieving revision 1.36
diff -u -3 -p -r1.36 ltdl.m4
--- ltdl.m4     2001/09/13 19:47:02     1.36
+++ ltdl.m4     2001/09/21 06:32:49
@@ -250,39 +250,37 @@ AC_DEFUN([AC_LTDL_DLLIB],
 [LIBADD_DL=
 AC_SUBST(LIBADD_DL)
 AC_LANG_PUSH([C])
-AC_CHECK_LIB([dl], [dlopen],
-  [AC_DEFINE([HAVE_LIBDL], [1],
-     [Define if you have the libdl library or equivalent.])
-   LIBADD_DL="-ldl"],
-  [AC_TRY_LINK([#if HAVE_DLFCN_H
-#  include <dlfcn.h>
-#endif
-    ],
-    [dlopen(0, 0);],
-    [AC_DEFINE(HAVE_LIBDL, 1,
-      [Define if you have the libdl library or equivalent.])],
-    [AC_CHECK_LIB(svld, dlopen,
-      [AC_DEFINE(HAVE_LIBDL, 1,
-        [Define if you have the libdl library or equivalent.])
-      LIBADD_DL="-lsvld"
-      ])
-    ])
-  ])
-
 AC_CHECK_FUNC(shl_load,
   [AC_DEFINE([HAVE_SHL_LOAD], [1],
     [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.])
-    LIBADD_DL="$LIBADD_DL -ldld"
+    LIBADD_DL="$LIBADD_DL -ldld"],
+    [AC_CHECK_LIB([dl], [dlopen],
+      [AC_DEFINE([HAVE_LIBDL], [1],
+         [Define if you have the libdl library or equivalent.])
+       LIBADD_DL="-ldl"],
+      [AC_TRY_LINK([#if HAVE_DLFCN_H
+#  include <dlfcn.h>
+#endif
+        ],
+        [dlopen(0, 0);],
+        [AC_DEFINE([HAVE_LIBDL], [1],
+          [Define if you have the libdl library or equivalent.])],
+        [AC_CHECK_LIB([svld], [dlopen],
+          [AC_DEFINE([HAVE_LIBDL], [1],
+            [Define if you have the libdl library or equivalent.])
+          LIBADD_DL="-lsvld"],
+          [AC_CHECK_LIB([dld], [dld_link],
+            [AC_DEFINE([HAVE_DLD], [1],
+              [Define if you have the GNU dld library.])
+            test x"$ac_cv_lib_dld_shl_load" = xyes || LIBADD_DL="$LIBADD_DL 
-ldld"
+            ])
+          ])
+        ])
+      ])
     ])
-  ])
-
-AC_CHECK_LIB([dld], [dld_link],
-  [AC_DEFINE([HAVE_DLD], [1],
-    [Define if you have the GNU dld library.])
-  test x"$ac_cv_lib_dld_shl_load" = xyes || LIBADD_DL="$LIBADD_DL -ldld"
   ])
 
 if test x"$ac_cv_func_dlopen" = xyes || test x"$ac_cv_lib_dl_dlopen" = xyes



reply via email to

[Prev in Thread] Current Thread [Next in Thread]