* demo/configure.in (BINARY_HELLDL): test whether dlopen is

supported at configure time
	* demo/Makefile.am (helldl): use automake conditionals to build
	helldl as a script or as a binary program
This commit is contained in:
Alexandre Oliva 1998-12-16 02:36:20 +00:00 committed by Alexandre Oliva
parent 60fdde04e2
commit 508ebd073c
3 changed files with 29 additions and 16 deletions

View File

@ -1,5 +1,10 @@
1998-12-16 Alexandre Oliva <oliva@dcc.unicamp.br>
* demo/configure.in (BINARY_HELLDL): test whether dlopen is
supported at configure time
* demo/Makefile.am (helldl): use automake conditionals to build
helldl as a script or as a binary program
* tests/Makefile.am (EXTRA_DIST): remove ltdl-*.test
(clean-local): don't clean libltdl any more
* tests/ltdl-conf.test: removed

View File

@ -17,7 +17,13 @@ libhello_la_LDFLAGS = -version-info 3:12:1 -lm
include_HEADERS = foo.h
bin_PROGRAMS = hell hell.debug helldl
if BINARY_HELLDL
BUILD_helldl = helldl
else
BUILD_helldl =
endif
bin_PROGRAMS = hell hell.debug $(BUILD_helldl)
# Build hell from main.c and libhello.la
hell_SOURCES = main.c
@ -28,10 +34,23 @@ hell_debug_SOURCES = main.c
hell_debug_LDADD = libhello.la
hell_debug_LDFLAGS = -static
if BINARY_HELLDL
# Create a version of hell that does a preloaded dlopen.
helldl_SOURCES = dlmain.c
helldl_LDFLAGS = -export-dynamic -dlpreopen libhello.la
helldl: libhello.la
helldl_DEPENDENCIES = libhello.la
else
bin_SCRIPTS = helldl
# create a script that says that -dlopen is not supported
helldl:
rm -f $@
echo '#! /bin/sh' > $@
echo '-dlopen is unsupported' >> $@
chmod +x $@
endif
# Unfortunately, in order to test libtool thoroughly, we need access
# to its private directory.
@ -45,20 +64,6 @@ $(srcdir)/acinclude.m4:
rm -f $(srcdir)/acinclude.m4
cd $(srcdir) && $(LN_S) ../libtool.m4 acinclude.m4
# Don't build helldl on unsupported platforms.
helldl: $(helldl_OBJECTS) $(helldl_DEPENDENCIES)
@rm -f helldl helldlT
@eval "`egrep '^global_symbol_pipe=' ../libtool`"; \
if test -z "$$global_symbol_pipe"; then \
echo 'creating helldl (-dlopen is unsupported)'; \
echo "#! /bin/sh" > helldlT; \
echo "echo '-dlopen is unsupported'" >> helldlT; \
chmod +x helldlT; \
mv -f helldlT helldl; \
else \
echo '$(LINK) $(helldl_LDFLAGS) $(helldl_OBJECTS) $(helldl_LDADD)'; \
$(LINK) $(helldl_LDFLAGS) $(helldl_OBJECTS) $(helldl_LDADD); \
fi
# Test programs to see what gets hardcoded.
.PHONY: hardcode

View File

@ -6,5 +6,8 @@ AC_PROG_CC
AC_EXEEXT
AM_PROG_LIBTOOL
AM_CONDITIONAL(BINARY_HELLDL, [dnl
grep '^global_symbol_pipe=..*$' ./libtool >/dev/null])
dnl Output the makefile
AC_OUTPUT(Makefile)