diff --git a/ChangeLog b/ChangeLog index ee607cda..3d00404c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 1998-12-16 Alexandre Oliva + * 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 diff --git a/demo/Makefile.am b/demo/Makefile.am index bccf547e..f6ead3cc 100644 --- a/demo/Makefile.am +++ b/demo/Makefile.am @@ -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 diff --git a/demo/configure.in b/demo/configure.in index a6885e06..2018f4e8 100644 --- a/demo/configure.in +++ b/demo/configure.in @@ -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)