mirror of
git://git.savannah.gnu.org/libtool.git
synced 2025-01-12 14:06:37 +08:00
* demo/Makefile.am: moved testsuite specific declarations to the end,
the deplibs check is now optional * libltdl/configure.in: read libtool --config only once, merged AC_SYS_SYMBOL_UNDERSCORE+AC_SYS_NM_PARSE from libtool.m4 * libtool.m4: AC_SYS_SYMBOL_UNDERSCORE+AC_SYS_NM_PARSE were not used, lt_dlopen and silent may be empty, AC_SYS_LIBTOOL_CYGWIN no longer necessary * ltconfig.in: NM is already checked in libtool.m4, * ltmain.in: always link all static dependency_libs * tests/Makefile.am: added deplibs.test * tests/demo-exec.test, demo-inst.test: removed hell0 * tests/deplibs.test: new test to test the deplibs_check_method
This commit is contained in:
parent
b29cdab5af
commit
b6eed25814
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
||||
1999-04-01 Thomas Tanner <tanner@gmx.de>
|
||||
|
||||
* demo/Makefile.am: moved testsuite specific declarations to the end,
|
||||
the deplibs check is now optional
|
||||
* libltdl/configure.in: read libtool --config only once,
|
||||
merged AC_SYS_SYMBOL_UNDERSCORE+AC_SYS_NM_PARSE from libtool.m4
|
||||
* libtool.m4: AC_SYS_SYMBOL_UNDERSCORE+AC_SYS_NM_PARSE were not
|
||||
used, lt_dlopen and silent may be empty, AC_SYS_LIBTOOL_CYGWIN
|
||||
no longer necessary
|
||||
* ltconfig.in: NM is already checked in libtool.m4,
|
||||
* ltmain.in: always link all static dependency_libs
|
||||
* tests/Makefile.am: added deplibs.test
|
||||
* tests/demo-exec.test, demo-inst.test: removed hell0
|
||||
* tests/deplibs.test: new test to test the deplibs_check_method
|
||||
|
||||
1999-03-31 Thomas Tanner <tanner@gmx.de>
|
||||
|
||||
* ltmain.in: always link a library before its dependency libs
|
||||
|
@ -4,9 +4,6 @@ AUTOMAKE_OPTIONS = no-dependencies foreign
|
||||
|
||||
EXTRA_DIST = $(TESTS) acinclude.m4
|
||||
|
||||
hardcode_tests = hc-direct hc-libflag hc-libpath hc-minusL
|
||||
CLEANFILES = $(hardcode_tests)
|
||||
|
||||
# Build a libtool library, libhello.la for installation in libdir.
|
||||
lib_LTLIBRARIES = libhello.la
|
||||
libhello_la_SOURCES = hello.c foo.c
|
||||
@ -50,18 +47,16 @@ helldl:
|
||||
chmod +x $@
|
||||
endif
|
||||
|
||||
# This is one of the essential tests for deplibs_check_method=pass_all.
|
||||
# If this one passes with pass_all, it is likely that pass_all works
|
||||
noinst_LIBRARIES = libhell0.a
|
||||
libhell0_a_SOURCES = hello.c foo.c
|
||||
lib_LTLIBRARIES += libhell1.la libhell2.la
|
||||
libhell1_la_SOURCES = hell1.c
|
||||
libhell2_la_SOURCES = hell2.c
|
||||
libhell1_la_LIBADD = -L. -lhell0 # libtool rejects libhell0.la
|
||||
libhell2_la_LIBADD = -L. -lhell0 # we have to use -L/-l. Why?
|
||||
bin_PROGRAMS += hell0
|
||||
hell0_SOURCES = main.c
|
||||
hell0_LDADD = libhell1.la libhell2.la $(LIBM)
|
||||
$(OBJECTS): libtool
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# The following declarations are only used in the testsuite:
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
hardcode_tests = hc-direct hc-libflag hc-libpath hc-minusL
|
||||
CLEANFILES = $(hardcode_tests)
|
||||
|
||||
# Unfortunately, in order to test libtool thoroughly, we need access
|
||||
# to its private directory.
|
||||
@ -123,6 +118,21 @@ hc-minusL: $(hell_OBJECTS) $(hell_DEPENDENCIES)
|
||||
echo "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"; \
|
||||
eval "$(CC) $(LDFLAGS) -o $@ $(hell_OBJECTS) -L./$(objdir) -lhello $(LIBS) $(LIBM) $$flag || echo unsupported > $@"
|
||||
|
||||
$(OBJECTS): libtool
|
||||
libtool: $(LIBTOOL_DEPS)
|
||||
$(SHELL) ./config.status --recheck
|
||||
# This is one of the essential tests for deplibs_check_method=pass_all.
|
||||
# If this one passes with pass_all, it is likely that pass_all works
|
||||
noinst_LIBRARIES = libhell0.a
|
||||
libhell0_a_SOURCES = hello.c foo.c
|
||||
EXTRA_LTLIBRARIES += libhell1.la libhell2.la
|
||||
libhell1_la_SOURCES = hell1.c
|
||||
libhell1_la_LIBADD = -L. -lhell0
|
||||
libhell1_la_LDFLAGS = -rpath $(libdir)
|
||||
libhell1_la_DEPENDENCIES = libhell0.a
|
||||
libhell2_la_SOURCES = hell2.c
|
||||
libhell2_la_LIBADD = -L. -lhell0
|
||||
libhell2_la_LDFLAGS = -rpath $(libdir)
|
||||
libhell2_la_DEPENDENCIES = libhell0.a
|
||||
EXTRA_PROGRAMS += hell0
|
||||
hell0_SOURCES = main.c
|
||||
hell0_LDADD = libhell1.la libhell2.la $(LIBM)
|
||||
|
||||
deplibs-check: hell0
|
||||
|
@ -30,17 +30,19 @@ AC_ARG_ENABLE(ltdl-install,
|
||||
AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
|
||||
AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
|
||||
|
||||
dnl Read the libtool configuration
|
||||
rm -f conftest
|
||||
./libtool --config > conftest
|
||||
. ./conftest
|
||||
rm -f conftest
|
||||
|
||||
AC_CACHE_CHECK([which extension is used for shared libraries],
|
||||
libltdl_cv_shlibext, [dnl
|
||||
(
|
||||
rm -f conftest
|
||||
./libtool --config > conftest
|
||||
. ./conftest
|
||||
last=
|
||||
for spec in $library_names_spec; do
|
||||
last="$spec"
|
||||
done
|
||||
rm -f conftest
|
||||
changequote(, )
|
||||
echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
|
||||
changequote([, ])
|
||||
@ -54,34 +56,14 @@ if test -n "$libltdl_cv_shlibext"; then
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([which variable specifies run-time library path],
|
||||
libltdl_cv_shlibpath_var, [dnl
|
||||
(
|
||||
rm -f conftest
|
||||
./libtool --config > conftest
|
||||
. ./conftest
|
||||
rm -f conftest
|
||||
echo "$shlibpath_var" > conftest
|
||||
)
|
||||
libltdl_cv_shlibpath_var=`cat conftest`
|
||||
rm -f conftest
|
||||
])
|
||||
libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
|
||||
if test -n "$libltdl_cv_shlibpath_var"; then
|
||||
AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
|
||||
[Define to the name of the environment variable that determines the dynamic library search path. ])
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for objdir],
|
||||
libltdl_cv_objdir, [dnl
|
||||
(
|
||||
rm -f conftest
|
||||
./libtool --config > conftest
|
||||
. ./conftest
|
||||
rm -f conftest
|
||||
echo "$objdir" > conftest
|
||||
)
|
||||
libltdl_cv_objdir=`cat conftest`
|
||||
rm -f conftest
|
||||
])
|
||||
libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"])
|
||||
test -z "$libltdl_cv_objdir" && libltdl_cv_objdir=".libs"
|
||||
AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
|
||||
[Define to the sub-directory in which libtool stores uninstalled libraries. ])
|
||||
@ -93,19 +75,11 @@ AC_CHECK_FUNCS(strdup strchr strrchr index rindex)
|
||||
|
||||
AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
|
||||
libltdl_cv_preloaded_symbols, [dnl
|
||||
(
|
||||
rm -f conftest
|
||||
./libtool --config > conftest
|
||||
. ./conftest
|
||||
rm -f conftest
|
||||
if test -n "$global_symbol_pipe"; then
|
||||
echo yes > conftest
|
||||
else
|
||||
echo no > conftest
|
||||
fi
|
||||
)
|
||||
libltdl_cv_preloaded_symbols=`cat conftest`
|
||||
rm -f conftest
|
||||
if test -n "$global_symbol_pipe"; then
|
||||
libltdl_cv_preloaded_symbols=yes
|
||||
else
|
||||
libltdl_cv_preloaded_symbols=no
|
||||
fi
|
||||
])
|
||||
if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
|
||||
AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
|
||||
@ -136,7 +110,208 @@ if test "$test_dlerror" = yes; then
|
||||
LIBS="$LIBS_SAVE"
|
||||
fi
|
||||
|
||||
AC_SYS_SYMBOL_UNDERSCORE
|
||||
dnl Check for command to grab the raw symbol name followed
|
||||
dnl by C symbol name from nm.
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
# Check for command to grab the raw symbol name followed by C symbol from nm.
|
||||
AC_MSG_CHECKING([command to parse $NM output])
|
||||
AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
|
||||
[# These are sane defaults that work on at least a few old systems.
|
||||
# {They come from Ultrix. What could be older than Ultrix?!! ;)}
|
||||
|
||||
changequote(,)dnl
|
||||
# Character class describing NM global symbol codes.
|
||||
ac_symcode='[BCDEGRST]'
|
||||
|
||||
# Regexp to match symbols that can be accessed directly from C.
|
||||
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
|
||||
|
||||
# Transform the above into a raw symbol and a C symbol.
|
||||
ac_symxfrm='\1 \2\3 \3'
|
||||
|
||||
# Transform an extracted symbol line into a proper C declaration
|
||||
ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
|
||||
|
||||
# Define system-specific variables.
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
ac_symcode='[BCDT]'
|
||||
;;
|
||||
cygwin* | mingw*)
|
||||
ac_symcode='[ABCDGISTW]'
|
||||
;;
|
||||
hpux*)
|
||||
ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
|
||||
;;
|
||||
irix*)
|
||||
ac_symcode='[BCDEGRST]'
|
||||
;;
|
||||
solaris*)
|
||||
ac_symcode='[BDT]'
|
||||
;;
|
||||
esac
|
||||
|
||||
# If we're using GNU nm, then use its standard symbol codes.
|
||||
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
ac_symcode='[ABCDGISTW]'
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
# Try without a prefix undercore, then with it.
|
||||
for ac_symprfx in "" "_"; do
|
||||
|
||||
ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
|
||||
|
||||
# Check to see that the pipe works correctly.
|
||||
ac_pipe_works=no
|
||||
rm -f conftest.$ac_ext
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
char nm_test_var;
|
||||
void nm_test_func(){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(){nm_test_var='a';nm_test_func;return 0;}
|
||||
EOF
|
||||
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
# Now try to grab the symbols.
|
||||
ac_nlist=conftest.nm
|
||||
|
||||
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
||||
|
||||
# Try sorting and uniquifying the output.
|
||||
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
|
||||
mv -f "$ac_nlist"T "$ac_nlist"
|
||||
else
|
||||
rm -f "$ac_nlist"T
|
||||
fi
|
||||
|
||||
# Make sure that we snagged all the symbols we need.
|
||||
if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
|
||||
if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
|
||||
cat <<EOF > conftest.c
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EOF
|
||||
# Now generate the symbol file.
|
||||
eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
|
||||
|
||||
cat <<EOF >> conftest.c
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define lt_ptr_t void *
|
||||
#else
|
||||
# define lt_ptr_t char *
|
||||
# define const
|
||||
#endif
|
||||
|
||||
/* The mapping between symbol names and symbols. */
|
||||
const struct {
|
||||
const char *name;
|
||||
lt_ptr_t address;
|
||||
}
|
||||
changequote(,)dnl
|
||||
lt_preloaded_symbols[] =
|
||||
changequote([,])dnl
|
||||
{
|
||||
EOF
|
||||
sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
|
||||
cat <<\EOF >> conftest.c
|
||||
{0, (lt_ptr_t) 0}
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EOF
|
||||
# Now try linking the two files.
|
||||
mv conftest.$ac_objext conftestm.$ac_objext
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
LIBS="conftestm.$ac_objext"
|
||||
CFLAGS="$CFLAGS$no_builtin_flag"
|
||||
if AC_TRY_EVAL(ac_link) && test -s conftest; then
|
||||
ac_pipe_works=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
LIBS="$ac_save_LIBS"
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
else
|
||||
echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "$progname: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
rm -rf conftest*
|
||||
|
||||
# Do not use the global_symbol_pipe unless it works.
|
||||
if test "$ac_pipe_works" = yes; then
|
||||
if test x"$ac_symprfx" = x"_"; then
|
||||
ac_cv_sys_symbol_underscore=yes
|
||||
else
|
||||
ac_cv_sys_symbol_underscore=no
|
||||
fi
|
||||
break
|
||||
else
|
||||
ac_cv_sys_global_symbol_pipe=
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
ac_result=yes
|
||||
if test -z "$ac_cv_sys_global_symbol_pipe"; then
|
||||
ac_result=no
|
||||
fi
|
||||
AC_MSG_RESULT($ac_result)
|
||||
|
||||
dnl does the compiler prefix global symbols with an underscore?
|
||||
AC_MSG_CHECKING([for _ prefix in compiled symbols])
|
||||
AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
|
||||
[ac_cv_sys_symbol_underscore=no
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
void nm_test_func(){}
|
||||
int main(){nm_test_func;return 0;}
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
# Now try to grab the symbols.
|
||||
ac_nlist=conftest.nm
|
||||
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
||||
# See whether the symbols have a leading underscore.
|
||||
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
|
||||
ac_cv_sys_symbol_underscore=yes
|
||||
else
|
||||
if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
|
||||
:
|
||||
else
|
||||
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
rm -rf conftest*
|
||||
])
|
||||
AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
|
||||
|
||||
if test x"$ac_cv_sys_symbol_underscore" = xyes; then
|
||||
if test x"$ac_cv_func_dlopen" = xyes ||
|
||||
test x"$ac_cv_lib_dl_dlopen" = xyes ; then
|
||||
|
229
libtool.m4
vendored
229
libtool.m4
vendored
@ -62,8 +62,6 @@ AC_REQUIRE([AC_PROG_RANLIB])dnl
|
||||
AC_REQUIRE([AC_PROG_CC])dnl
|
||||
AC_REQUIRE([AC_PROG_LD])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_SYS_NM_PARSE])dnl
|
||||
AC_REQUIRE([AC_SYS_SYMBOL_UNDERSCORE])dnl
|
||||
AC_REQUIRE([AC_PROG_LN_S])dnl
|
||||
dnl
|
||||
|
||||
@ -72,10 +70,10 @@ libtool_flags="--cache-file=$cache_file"
|
||||
test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
|
||||
test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
|
||||
test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
|
||||
test "$lt_dlopen" = yes && libtool_flags="$libtool_flags --enable-dlopen"
|
||||
test "$silent" = yes && libtool_flags="$libtool_flags --silent"
|
||||
test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
|
||||
test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
|
||||
test x"$lt_dlopen" = xyes && libtool_flags="$libtool_flags --enable-dlopen"
|
||||
test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
|
||||
|
||||
# Some flags need to be propagated to the compiler or linker for good
|
||||
# libtool support.
|
||||
@ -112,7 +110,8 @@ case "$host" in
|
||||
;;
|
||||
|
||||
*-*-cygwin*)
|
||||
AC_SYS_LIBTOOL_CYGWIN
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
;;
|
||||
|
||||
esac
|
||||
@ -129,7 +128,7 @@ if test x"$need_locks" = xno; then
|
||||
fi
|
||||
])
|
||||
|
||||
# AC_LIBTOOL_DLOPEN - check for dlopen support
|
||||
# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
|
||||
AC_DEFUN(AC_LIBTOOL_DLOPEN, [lt_dlopen=yes])
|
||||
|
||||
# AC_ENABLE_SHARED - implement the --enable-shared flag
|
||||
@ -350,221 +349,6 @@ AC_MSG_RESULT([$NM])
|
||||
AC_SUBST(NM)
|
||||
])
|
||||
|
||||
# AC_SYS_NM_PARSE - Check for command to grab the raw symbol name followed
|
||||
# by C symbol name from nm.
|
||||
AC_DEFUN(AC_SYS_NM_PARSE,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
AC_REQUIRE([AC_PROG_NM])dnl
|
||||
# Check for command to grab the raw symbol name followed by C symbol from nm.
|
||||
AC_MSG_CHECKING([command to parse $NM output])
|
||||
AC_CACHE_VAL(ac_cv_sys_global_symbol_pipe,
|
||||
[# These are sane defaults that work on at least a few old systems.
|
||||
# {They come from Ultrix. What could be older than Ultrix?!! ;)}
|
||||
|
||||
changequote(,)dnl
|
||||
# Character class describing NM global symbol codes.
|
||||
ac_symcode='[BCDEGRST]'
|
||||
|
||||
# Regexp to match symbols that can be accessed directly from C.
|
||||
ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
|
||||
|
||||
# Transform the above into a raw symbol and a C symbol.
|
||||
ac_symxfrm='\1 \2\3 \3'
|
||||
|
||||
# Transform an extracted symbol line into a proper C declaration
|
||||
ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
|
||||
|
||||
# Define system-specific variables.
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
ac_symcode='[BCDT]'
|
||||
;;
|
||||
cygwin* | mingw*)
|
||||
ac_symcode='[ABCDGISTW]'
|
||||
;;
|
||||
hpux*)
|
||||
ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
|
||||
;;
|
||||
irix*)
|
||||
ac_symcode='[BCDEGRST]'
|
||||
;;
|
||||
solaris*)
|
||||
ac_symcode='[BDT]'
|
||||
;;
|
||||
esac
|
||||
|
||||
# If we're using GNU nm, then use its standard symbol codes.
|
||||
if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
|
||||
ac_symcode='[ABCDGISTW]'
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
# Try without a prefix undercore, then with it.
|
||||
for ac_symprfx in "" "_"; do
|
||||
|
||||
ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($ac_symcode\)[ ][ ]*\($ac_symprfx\)$ac_sympat$/$ac_symxfrm/p'"
|
||||
|
||||
# Check to see that the pipe works correctly.
|
||||
ac_pipe_works=no
|
||||
rm -f conftest.$ac_ext
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
char nm_test_var;
|
||||
void nm_test_func(){}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
int main(){nm_test_var='a';nm_test_func;return 0;}
|
||||
EOF
|
||||
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
# Now try to grab the symbols.
|
||||
ac_nlist=conftest.nm
|
||||
|
||||
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
||||
|
||||
# Try sorting and uniquifying the output.
|
||||
if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
|
||||
mv -f "$ac_nlist"T "$ac_nlist"
|
||||
else
|
||||
rm -f "$ac_nlist"T
|
||||
fi
|
||||
|
||||
# Make sure that we snagged all the symbols we need.
|
||||
if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
|
||||
if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
|
||||
cat <<EOF > conftest.c
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
EOF
|
||||
# Now generate the symbol file.
|
||||
eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
|
||||
|
||||
cat <<EOF >> conftest.c
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# define lt_ptr_t void *
|
||||
#else
|
||||
# define lt_ptr_t char *
|
||||
# define const
|
||||
#endif
|
||||
|
||||
/* The mapping between symbol names and symbols. */
|
||||
const struct {
|
||||
const char *name;
|
||||
lt_ptr_t address;
|
||||
}
|
||||
changequote(,)dnl
|
||||
lt_preloaded_symbols[] =
|
||||
changequote([,])dnl
|
||||
{
|
||||
EOF
|
||||
sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
|
||||
cat <<\EOF >> conftest.c
|
||||
{0, (lt_ptr_t) 0}
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
EOF
|
||||
# Now try linking the two files.
|
||||
mv conftest.$ac_objext conftestm.$ac_objext
|
||||
ac_save_LIBS="$LIBS"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
LIBS="conftestm.$ac_objext"
|
||||
CFLAGS="$CFLAGS$no_builtin_flag"
|
||||
if AC_TRY_EVAL(ac_link) && test -s conftest; then
|
||||
ac_pipe_works=yes
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
LIBS="$ac_save_LIBS"
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
else
|
||||
echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "$progname: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
rm -rf conftest*
|
||||
|
||||
# Do not use the global_symbol_pipe unless it works.
|
||||
if test "$ac_pipe_works" = yes; then
|
||||
if test x"$ac_symprfx" = x"_"; then
|
||||
ac_cv_sys_symbol_underscore=yes
|
||||
else
|
||||
ac_cv_sys_symbol_underscore=no
|
||||
fi
|
||||
break
|
||||
else
|
||||
ac_cv_sys_global_symbol_pipe=
|
||||
fi
|
||||
done
|
||||
])
|
||||
|
||||
ac_result=yes
|
||||
if test -z "$ac_cv_sys_global_symbol_pipe"; then
|
||||
ac_result=no
|
||||
fi
|
||||
AC_MSG_RESULT($ac_result)
|
||||
])
|
||||
|
||||
# AC_SYS_LIBTOOL_CYGWIN - find tools needed on cygwin
|
||||
AC_DEFUN(AC_SYS_LIBTOOL_CYGWIN,
|
||||
[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
])
|
||||
|
||||
# AC_SYS_SYMBOL_UNDERSCORE - does the compiler prefix global symbols
|
||||
# with an underscore?
|
||||
AC_DEFUN(AC_SYS_SYMBOL_UNDERSCORE,
|
||||
[AC_REQUIRE([AC_PROG_NM])dnl
|
||||
AC_REQUIRE([AC_SYS_NM_PARSE])dnl
|
||||
AC_MSG_CHECKING([for _ prefix in compiled symbols])
|
||||
AC_CACHE_VAL(ac_cv_sys_symbol_underscore,
|
||||
[ac_cv_sys_symbol_underscore=no
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
void nm_test_func(){}
|
||||
int main(){nm_test_func;return 0;}
|
||||
EOF
|
||||
if AC_TRY_EVAL(ac_compile); then
|
||||
# Now try to grab the symbols.
|
||||
ac_nlist=conftest.nm
|
||||
if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
|
||||
# See whether the symbols have a leading underscore.
|
||||
if egrep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
|
||||
ac_cv_sys_symbol_underscore=yes
|
||||
else
|
||||
if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
|
||||
:
|
||||
else
|
||||
echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
|
||||
fi
|
||||
else
|
||||
echo "configure: failed program was:" >&AC_FD_CC
|
||||
cat conftest.c >&AC_FD_CC
|
||||
fi
|
||||
rm -rf conftest*
|
||||
])
|
||||
AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
|
||||
])
|
||||
|
||||
# AC_CHECK_LIBM - check for math library
|
||||
AC_DEFUN(AC_CHECK_LIBM,
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
@ -635,6 +419,3 @@ AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
|
||||
AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
|
||||
AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
|
||||
AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
|
||||
AC_DEFUN(AM_SYS_NM_PARSE, [indir([AC_SYS_NM_PARSE])])dnl
|
||||
AC_DEFUN(AM_SYS_SYMBOL_UNDERSCORE, [indir([AC_SYS_SYMBOL_UNDERSCORE])])dnl
|
||||
AC_DEFUN(AM_SYS_LIBTOOL_CYGWIN, [indir([AC_SYS_LIBTOOL_CYGWIN])])dnl
|
||||
|
37
ltconfig.in
37
ltconfig.in
@ -1362,37 +1362,6 @@ else
|
||||
fi
|
||||
echo "$ac_t$ld_shlibs" 1>&6
|
||||
|
||||
if test -z "$NM"; then
|
||||
echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
|
||||
case "$NM" in
|
||||
/* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
|
||||
for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/nm; then
|
||||
# Check to see if the nm accepts a BSD-compat flag.
|
||||
# Adding the `sed 1q' prevents false positives on HP-UX, which says:
|
||||
# nm: unknown option "B" ignored
|
||||
if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
NM="$ac_dir/nm -B"
|
||||
break
|
||||
elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
|
||||
NM="$ac_dir/nm -p"
|
||||
break
|
||||
else
|
||||
NM=${NM="$ac_dir/nm"} # keep the first match, but
|
||||
continue # so that we can try to find one that supports BSD flags
|
||||
fi
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$NM" && NM=nm
|
||||
;;
|
||||
esac
|
||||
echo "$ac_t$NM" 1>&6
|
||||
fi
|
||||
|
||||
# Check for command to grab the raw symbol name followed by C symbol from nm.
|
||||
echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6
|
||||
|
||||
@ -1541,7 +1510,11 @@ EOF
|
||||
global_symbol_pipe=
|
||||
fi
|
||||
done
|
||||
echo "$ac_t$pipe_works" 1>&6
|
||||
if test "$pipe_works" = yes; then
|
||||
echo "${ac_t}ok" 1>&6
|
||||
else
|
||||
echo "${ac_t}failed" 1>&6
|
||||
fi
|
||||
|
||||
if test -z "$global_symbol_pipe"; then
|
||||
global_symbol_to_cdecl=
|
||||
|
@ -2527,7 +2527,7 @@ EOF
|
||||
absdeplibs="$absdeplibs $deplib"
|
||||
;;
|
||||
esac
|
||||
elif test "$hardcode_into_libs" = no; then
|
||||
else
|
||||
# Need to hardcode shared library paths
|
||||
# or/and link against static libraries
|
||||
case "$newdependency_libs " in
|
||||
|
@ -11,7 +11,7 @@ TESTS = cdemo-static.test cdemo-make.test cdemo-exec.test \
|
||||
mdemo-inst.test mdemo-unst.test \
|
||||
cdemo-conf.test cdemo-make.test cdemo-exec.test \
|
||||
demo-conf.test demo-make.test demo-exec.test \
|
||||
demo-inst.test demo-unst.test \
|
||||
demo-inst.test demo-unst.test deplibs.test \
|
||||
depdemo-conf.test depdemo-make.test depdemo-exec.test \
|
||||
depdemo-inst.test depdemo-unst.test \
|
||||
mdemo-conf.test mdemo-make.test mdemo-exec.test \
|
||||
|
@ -32,12 +32,6 @@ else
|
||||
status=1
|
||||
fi
|
||||
|
||||
if ../demo/hell0 | grep 'Welcome to GNU Hell'; then :
|
||||
else
|
||||
echo "$0: cannot execute ../demo/hell0" 1>&2
|
||||
status=1
|
||||
fi
|
||||
|
||||
if ../demo/helldl | egrep -e '(Welcome to .*GNU Hell|unsupported)'; then :
|
||||
else
|
||||
echo "$0: cannot execute ../demo/helldl" 1>&2
|
||||
|
@ -43,18 +43,6 @@ else
|
||||
status=1
|
||||
fi
|
||||
|
||||
if $prefix/bin/hell0 | grep 'Welcome to GNU Hell'; then :
|
||||
else
|
||||
echo "$0: cannot execute $prefix/bin/hell0" 1>&2
|
||||
|
||||
# Simple check to see if they are superuser.
|
||||
if test -w /; then :
|
||||
else
|
||||
echo "You may need to run $0 as the superuser."
|
||||
fi
|
||||
status=1
|
||||
fi
|
||||
|
||||
if $prefix/bin/helldl | egrep -e '(Welcome to .*GNU Hell|unsupported)'; then :
|
||||
else
|
||||
echo "$0: cannot execute $prefix/bin/helldl" 1>&2
|
||||
|
Loading…
Reference in New Issue
Block a user