mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Updates, bug fixes for using the dynamic linker to look up paths of
object files from which classes have been loaded git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14872 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
40d05e748f
commit
ea1ac7c7c1
5 changed files with 151 additions and 85 deletions
|
@ -20,66 +20,25 @@ if test $DYNAMIC_LINKER = null; then
|
|||
AC_CHECK_HEADER(dld/defs.h, DYNAMIC_LINKER=dld)
|
||||
fi
|
||||
|
||||
# NB: This is used as follows: in Source/Makefile.postamble we copy
|
||||
# $(DYNAMIC_LINKER)-load.h into dynamic-load.h
|
||||
AC_MSG_CHECKING([for dynamic linker type])
|
||||
AC_MSG_RESULT([$DYNAMIC_LINKER])
|
||||
|
||||
if test $DYNAMIC_LINKER = simple; then
|
||||
AC_MSG_CHECKING([checking if dladdr() is available])
|
||||
old_LDFLAGS="$LDFLAGS"
|
||||
case "$target_os" in
|
||||
linux-gnu*) LDFLAGS="$old_LDFLAGS -ldl";;
|
||||
solaris*) LDFLAGS="$old_LDFLAGS -ldl";;
|
||||
sysv4.2*) LDFLAGS="$old_LDFLAGS -ldl";;
|
||||
esac
|
||||
AC_TRY_LINK([#include <dlfcn.h>], dladdr(0,0);,
|
||||
AC_DEFINE(HAVE_DLADDR,1, [Define if you have dladdr]))
|
||||
AC_DEFINE(HAVE_DLADDR,1, [Define if you have dladdr])
|
||||
AC_MSG_RESULT([yes]),
|
||||
AC_MSG_RESULT([no]))
|
||||
LDFLAGS="$old_LDFLAGS"
|
||||
fi
|
||||
|
||||
AC_SUBST(DYNAMIC_LINKER)dnl
|
||||
])
|
||||
AC_DEFUN(OBJC_SYS_DYNAMIC_FLAGS,
|
||||
[dnl
|
||||
AC_REQUIRE([OBJC_CON_AUTOLOAD])dnl
|
||||
AC_REQUIRE([OBJC_SYS_DYNAMIC_LINKER])dnl
|
||||
#--------------------------------------------------------------------
|
||||
# Set the flags for compiling dynamically loadable objects
|
||||
#
|
||||
# Makes the following substitutions:
|
||||
# DYNAMIC_BUNDLER_LINKER - The command to link the object files into
|
||||
# a dynamically loadable module.
|
||||
# DYNAMIC_LDFLAGS - Flags required when compiling the main program
|
||||
# that will do the dynamic linking
|
||||
# DYNAMIC_CFLAGS - Flags required when compiling the object files that
|
||||
# will be included in the loaded module.
|
||||
#--------------------------------------------------------------------
|
||||
if test $DYNAMIC_LINKER = dld; then
|
||||
DYNAMIC_BUNDLER_LINKER="ld -r"
|
||||
DYNAMIC_LDFLAGS="-static"
|
||||
DYNAMIC_CFLAGS=""
|
||||
elif test $DYNAMIC_LINKER = simple; then
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="-shared"
|
||||
AC_TRY_LINK([extern void loadf();], loadf();,
|
||||
objc_shared_linker=yes, objc_shared_linker=no)
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
if test $objc_shared_linker = yes; then
|
||||
DYNAMIC_BUNDLER_LINKER='$(CC) -shared'
|
||||
elif test $objc_cv_con_autoload = yes; then
|
||||
DYNAMIC_BUNDLER_LINKER='$(CC) -Xlinker -r'
|
||||
else
|
||||
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib'
|
||||
fi
|
||||
save_LDFLAGS=$LDFLAGS
|
||||
LDFLAGS="-rdynamic"
|
||||
AC_TRY_RUN([], objc_dynamic_ldflag="-rdynamic", objc_dynamic_ldflag="",
|
||||
objc_dynamic_ldflag="")
|
||||
LDFLAGS=$save_LDFLAGS
|
||||
DYNAMIC_LDFLAGS="$objc_dynamic_ldflag"
|
||||
DYNAMIC_CFLAGS="-fPIC"
|
||||
elif test $DYNAMIC_LINKER = hpux; then
|
||||
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib -Xlinker -b'
|
||||
DYNAMIC_LDFLAGS="-Xlinker -E"
|
||||
DYNAMIC_CFLAGS="-fPIC"
|
||||
elif test $DYNAMIC_LINKER = null; then
|
||||
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib -Xlinker -r'
|
||||
DYNAMIC_LDFLAGS=""
|
||||
DYNAMIC_CFLAGS=""
|
||||
else
|
||||
DYNAMIC_BUNDLER_LINKER='$(CC) -nostdlib -Xlinker -r'
|
||||
DYNAMIC_LDFLAGS=""
|
||||
DYNAMIC_CFLAGS=""
|
||||
fi
|
||||
AC_SUBST(DYNAMIC_BUNDLER_LINKER)dnl
|
||||
AC_SUBST(DYNAMIC_LDFLAGS)dnl
|
||||
AC_SUBST(DYNAMIC_CFLAGS)dnl
|
||||
])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue