+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.
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
{
int value;
- printf ("Welcome GNU libtool cdemo!\n");
+ printf ("Welcome to GNU libtool cdemo!\n");
value = hello();
printf ("hello returned: %i\n", value);
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
#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;
{
}
static int
-dl_close (handle)
+sys_dl_close (handle)
lt_dlhandle handle;
{
if (dlclose(handle->handle) != 0) {
}
static lt_ptr_t
-dl_sym (handle, symbol)
+sys_dl_sym (handle, symbol)
lt_dlhandle handle;
const char *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
#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;
{
}
static int
-shl_close (handle)
+sys_shl_close (handle)
lt_dlhandle handle;
{
if (shl_unload((shl_t) (handle->handle)) != 0) {
}
static lt_ptr_t
-shl_sym (handle, symbol)
+sys_shl_sym (handle, symbol)
lt_dlhandle handle;
const char *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
#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;
{
}
static int
-dld_close (handle)
+sys_dld_close (handle)
lt_dlhandle handle;
{
if (dld_unlink_by_file((char*)(handle->handle), 1) != 0) {
}
static lt_ptr_t
-dld_sym (handle, symbol)
+sys_dld_sym (handle, symbol)
lt_dlhandle handle;
const char *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
#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;
{
}
static int
-wll_close (handle)
+sys_wll_close (handle)
lt_dlhandle handle;
{
if (FreeLibrary(handle->handle) != 0) {
}
static lt_ptr_t
-wll_sym (handle, symbol)
+sys_wll_sym (handle, symbol)
lt_dlhandle handle;
const char *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
#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;
{
}
static int
-bedl_close (handle)
+sys_bedl_close (handle)
lt_dlhandle handle;
{
if (unload_add_on((image_id)handle->handle) != B_OK) {
}
static lt_ptr_t
-bedl_sym (handle, symbol)
+sys_bedl_sym (handle, symbol)
lt_dlhandle handle;
const char *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
## 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
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
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
])
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
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]);