]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* mdemo/main.c: removed hardcoded library names; link against -lm
authorThomas Tanner <tanner@gmx.de>
Sat, 7 Nov 1998 04:33:47 +0000 (04:33 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sat, 7 Nov 1998 04:33:47 +0000 (04:33 +0000)
* tests/mdemo-exec, tests/mdemo-inst: pass the library names
to the program

ChangeLog
mdemo/Makefile.am
mdemo/main.c
tests/mdemo-exec.test
tests/mdemo-inst.test

index e335f35f391e1f0d4e2cbb2c0a00020b3f7ae421..d9a06a86eb2eaf7ff619beca88f15d37ba786017 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1998-11-07  Thomas Tanner  <tanner@gmx.de>
+
+       * mdemo/main.c: removed hardcoded library names; link against -lm
+       * tests/mdemo-exec, tests/mdemo-inst: pass the library names 
+       to the program
+
 1998-11-07  Marc J. Fraioli  <fraioli@dg-rtp.dg.com>
 
        * README: Added DG/UX
index 52df8d8ec6135ab423cf6899feeadebd3d75b7d1..0272e5b58d64d0636a94b4258a79acc959a85b15 100644 (file)
@@ -20,7 +20,7 @@ bin_PROGRAMS = hell hell.debug
 
 # Create a version of hell that does dlopen.
 hell_SOURCES = main.c ltdl.c
-hell_LDFLAGS = $(LIBADD_DL)
+hell_LDFLAGS = $(LIBADD_DL) -lm
 hell_DEPENDENCIES = libfoo1.la libfoo2.la
 
 # Create an easier-to-debug version of hell.
index f9b0c748bf3d33396aa02987f3519ecd90377233..bf142f318a3a426142d4b0ff5d26b94eacbf5902 100644 (file)
@@ -22,7 +22,7 @@ USA. */
 #include <stdio.h>
 #include <string.h>
 
-void testlib(char *lib, char *alt)
+int testlib(char *lib)
 {
   lt_dlhandle handle;  
   int (*pfoo1)() = 0;
@@ -31,11 +31,9 @@ void testlib(char *lib, char *alt)
   int *pnothing = 0;
 
   handle = lt_dlopen(lib);
-  if (!handle)
-         handle = lt_dlopen(alt);
   if (!handle) {
     fprintf (stderr, "can't open library %s!\n", lib);
-    return;
+    return 1;
   }
   phello = lt_dlsym(handle, "hello");  
   pfoo1 = lt_dlsym(handle, "foo1");  
@@ -74,19 +72,22 @@ void testlib(char *lib, char *alt)
     fprintf (stderr, "did not find the `foo' function\n");
 
   lt_dlclose(handle);
+  return 0;
 }
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char **argv)
 {
+  int i;
 
   printf ("Welcome to *modular* GNU Hell!\n");
 
-  testlib(".libs/libfoo1.so", ".libs/libfoo1.a");
-
-  testlib(".libs/libfoo2.so", ".libs/libfoo2.a");
+  if (argc < 2) {
+    fprintf (stderr, "usage: %s libname [libname...]\n", argv[0]);
+  }
   
+  for (i = 1; i < argc; i++)
+    if (testlib(argv[i]))
+       return 1;
   return 0;
 }
index a37da01c0fd003240c7b80471b575a538a4bb5e5..3a231a51a1b9a6e389da33ba88e52496c71bbd9f 100755 (executable)
@@ -19,14 +19,19 @@ fi
 # Check to see if the programs really run.
 echo "Executing uninstalled programs in ../mdemo"
 
+old_library1=`sed -n -e "s/^old_library='\(.*\)'/\1/p" ../mdemo/libfoo1.la`
+old_library2=`sed -n -e "s/^old_library='\(.*\)'/\1/p" ../mdemo/libfoo2.la`
+dlname1=`sed -n -e "s/^dlname='\(.*\)'/\1/p" ../mdemo/libfoo1.la`
+dlname2=`sed -n -e "s/^dlname='\(.*\)'/\1/p" ../mdemo/libfoo2.la`
+
 status=0
-if ../mdemo/hell.debug| grep 'GNU Hell'; then :
+if ../mdemo/hell.debug .libs/$old_library1 .libs/$old_library2; then :
 else
   echo "$0: cannot execute ../mdemo/hell.debug" 1>&2
   status=1
 fi
 
-if ../mdemo/hell | grep 'GNU Hell'; then :
+if ../mdemo/hell ../mdemo/.libs/$dlname1 ../mdemo/.libs/$dlname2; then :
 else
   echo "$0: cannot execute ../mdemo/hell" 1>&2
   status=1
index e56fdd0175ae325b8519e1b4692f933b43c2182e..eb867141c50d3bc0e976a3d1851d4f1adb2417e3 100755 (executable)
@@ -24,14 +24,20 @@ echo "= Running $make install in ../mdemo"
 $make install || exit 1
 
 echo "= Executing installed programs"
+
+old_library1=`sed -n -e "s/^old_library='\(.*\)'/\1/p" ../mdemo/libfoo1.la`
+old_library2=`sed -n -e "s/^old_library='\(.*\)'/\1/p" ../mdemo/libfoo2.la`
+dlname1=`sed -n -e "s/^dlname='\(.*\)'/\1/p" ../mdemo/libfoo1.la`
+dlname2=`sed -n -e "s/^dlname='\(.*\)'/\1/p" ../mdemo/libfoo2.la`
+
 status=0
-if $prefix/bin/hell.debug | grep 'Welcome to GNU Hell'; then :
+if $prefix/bin/hell.debug .libs/$old_library1 .libs/$old_library2; then :
 else
   echo "$0: cannot execute $prefix/bin/hell.debug" 1>&2
   status=1
 fi
 
-if $prefix/bin/hell | grep 'Welcome to GNU Hell'; then :
+if $prefix/bin/hell $prefix/lib/$dlname1 $prefix/lib/$dlname2; then :
 else
   echo "$0: cannot execute $prefix/bin/hell" 1>&2