* 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
This commit is contained in:
Thomas Tanner 1999-05-20 17:54:09 +00:00
parent bcdbd54041
commit 1707ab25bb
8 changed files with 108 additions and 86 deletions

View File

@ -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.

View File

@ -24,6 +24,14 @@ for sub in demo depdemo 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

View 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);

View File

@ -88,12 +88,12 @@ if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
fi
LIBADD_DL=
AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1) LIBADD_DL="-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_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_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="-ldld"])
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

View 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

5
libtool.m4 vendored
View 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
])

View File

@ -2109,6 +2109,43 @@ 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 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
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line @LINENO@ "ltconfig"
/* 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()
; 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="dlopen" lt_cv_dlopen_libs="-ldl"
else
echo "$ac_t""no" 1>&6
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
@ -2148,49 +2185,11 @@ else
fi
rm -f conftest*
fi
if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
echo "$ac_t""yes" 1>&6
lt_cv_dlopen="dlopen"
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 "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
#line @LINENO@ "ltconfig"
/* 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()
; 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="dlopen" lt_cv_dlopen_libs="-ldl"
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
echo "$progname:@LINENO@: checking for dld_link in -ldld" >&5
ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`

View 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]);