Patched from mail. See ChangeLog

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@608 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1995-09-12 22:30:13 +00:00
parent 41ddf10f66
commit ecfdf5feb3
7 changed files with 8 additions and 69 deletions

View file

@ -44,7 +44,7 @@
-mccallum -mccallum
*/ */
#ifndef __ELF__ #if !defined(__ELF__) && !defined(SYS_AUTOLOAD)
#define main LibobjectsMain #define main LibobjectsMain
extern int LibobjectsMain(/* int argc, char *argv[] */); extern int LibobjectsMain(/* int argc, char *argv[] */);
#endif /* __ELF__ */ #endif /* __ELF__ */

View file

@ -44,7 +44,7 @@
-mccallum -mccallum
*/ */
#ifndef __ELF__ #if !defined(__ELF__) && !defined(SYS_AUTOLOAD)
#define main LibobjectsMain #define main LibobjectsMain
extern int LibobjectsMain(/* int argc, char *argv[] */); extern int LibobjectsMain(/* int argc, char *argv[] */);
#endif /* __ELF__ */ #endif /* __ELF__ */

View file

@ -42,6 +42,7 @@
#include <memory.h> #include <memory.h>
#endif /* not STDC_HEADERS and HAVE_MEMORY_H */ #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#define rindex strrchr #define rindex strrchr
#define index strchr
#define bcopy(s, d, n) memcpy ((d), (s), (n)) #define bcopy(s, d, n) memcpy ((d), (s), (n))
#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n)) #define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
#define bzero(s, n) memset ((s), 0, (n)) #define bzero(s, n) memset ((s), 0, (n))

View file

@ -182,7 +182,7 @@ _gnu_process_args(int argc, char *argv[], char *env[])
that it automatically gets called before main with the argument and that it automatically gets called before main with the argument and
environment pointers. FIXME: Would like to do something similar environment pointers. FIXME: Would like to do something similar
for other formats besides ELF. */ for other formats besides ELF. */
#ifdef __ELF__ #if defined(__ELF__) || defined(SYS_AUTOLOAD)
#ifdef linux #ifdef linux
/* Under linux the functions in __libc_subinit are called before the /* Under linux the functions in __libc_subinit are called before the

View file

@ -162,7 +162,7 @@ objc_load_module(
return 1; return 1;
} }
#ifndef __ELF__ #if !defined(__ELF__) && !defined(SYS_AUTOLOAD)
/* Get the constructor list and load in the objects */ /* Get the constructor list and load in the objects */
ctor_list = (void_fn *)__objc_dynamic_find_symbol(handle, CTOR_LIST); ctor_list = (void_fn *)__objc_dynamic_find_symbol(handle, CTOR_LIST);
if (!ctor_list) { if (!ctor_list) {

View file

@ -44,7 +44,7 @@
-mccallum -mccallum
*/ */
#ifndef __ELF__ #if !defined(__ELF__) && !defined(SYS_AUTOLOAD)
#define main LibobjectsMain #define main LibobjectsMain
extern int LibobjectsMain(/* int argc, char *argv[] */); extern int LibobjectsMain(/* int argc, char *argv[] */);
#endif /* __ELF__ */ #endif /* __ELF__ */

View file

@ -166,72 +166,10 @@ AC_SUBST(NeXT_runtime)
AC_SUBST(NeXT_cc) AC_SUBST(NeXT_cc)
AC_SUBST(NEXT_INCLUDES) AC_SUBST(NEXT_INCLUDES)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Check for dynamic linking # Setup dynamic linking
#
# the name we assign to DYNAMIC_LINKER cooresponds to the interface that
# is inluded in objc-load.c (i.e. #include "${DYNAMIC_LINKER}-load.h")
#-------------------------------------------------------------------- #--------------------------------------------------------------------
DYNAMIC_LINKER=null OBJC_SYS_DYNAMIC_FLAGS()
AC_CHECK_LIB(dl, dlopen, DYNAMIC_LINKER=simple LIBS="${LIBS} -ldl")
DLD_INCLUDE=''
if test $DYNAMIC_LINKER = null; then
AC_CHECK_LIB(dld, main, DYNAMIC_LINKER=dld LIBS="${LIBS} -ldld")
AC_CHECK_HEADER(dld/defs.h, found_dld_defs=yes, found_dld_defs=no)
# Try to distinguish between GNU dld and HPUX dld
AC_CHECK_HEADER(dl.h, DYNAMIC_LINKER=hpux)
# Check in non-standard places
if test $ac_cv_lib_dld = no; then
AC_MSG_CHECKING(for dld in user directory)
if test -f ${srcdir}/../dld/libdld.a; then
DYNAMIC_LINKER=dld
found_dld_defs=yes
DLD_INCLUDE="-I$(OSDIR)/.."
LIBS="${LIBS} -L$(OSDIR)/../dld -ldld"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
fi
if test $ac_cv_lib_dld = yes && test $found_dld_defs = no && test $ac_cv_header_dl_h = no; then
AC_MSG_WARN(Could not find dld/defs.h header)
echo
echo "objc-load needs the the dld/defs.h header to get information"
echo "about how to use GNU dld"
echo
fi
fi
AC_SUBST(DYNAMIC_LINKER)
AC_SUBST(DLD_INCLUDE)
# These determine how the NSBundle example makefile is setup
# They don't always work...
if test $DYNAMIC_LINKER = dld; then
DYNAMIC_BUNDLER_LINKER="ld -r"
DYNAMIC_LDFLAGS="-static"
DYNAMIC_CFLAGS=""
elif test $DYNAMIC_LINKER = simple; then
DYNAMIC_BUNDLER_LINKER="$(CC) -nostdlib"
DYNAMIC_LDFLAGS=""
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)
AC_SUBST(DYNAMIC_LDFLAGS)
AC_SUBST(DYNAMIC_CFLAGS)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Find some programs # Find some programs