]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* demo/configure.in (BINARY_HELLDL): test whether dlopen is
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 16 Dec 1998 02:36:20 +0000 (02:36 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 16 Dec 1998 02:36:20 +0000 (02:36 +0000)
supported at configure time
* demo/Makefile.am (helldl): use automake conditionals to build
helldl as a script or as a binary program

ChangeLog
demo/Makefile.am
demo/configure.in

index ee607cda4e90a0f3ee526f49dfde4999bdfeac15..3d00404cb1a2221ff72ed0fd593c6e2dc0c6ec54 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index bccf547ea7345f1093d1c33abf38cb46551d2c5e..f6ead3ccec024c17ff17c6df790810b73887dcf0 100644 (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
index a6885e0602c97473032bbc73227d87bc20b2d8ae..2018f4e815e62432da231542ed7dbcecb2db09e5 100644 (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)