]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* autogen: libltdl needs autoheader
authorThomas Tanner <tanner@gmx.de>
Thu, 11 Feb 1999 23:48:25 +0000 (23:48 +0000)
committerThomas Tanner <tanner@gmx.de>
Thu, 11 Feb 1999 23:48:25 +0000 (23:48 +0000)
* demo/Makefile.am: renamed hell.debug to hell.static
  (we're demonstrating static linking, not debugging)
* tests/demo*: ditto
* doc/libtool.texi (libltdl): documented new lt_dlopen(NULL)
  feature
* libltdl/acconfig.h: required for config.h
* libltdl/configure.in: use config.h
* libltdl/ltdl.c: use config.h, support lt_dlopen(NULL)
  (returns a handle for the program itself)
* ltconfig.in: minor reformatting
* ltmain.in: in lt_preloaded_symbols always define
  the program's symbols first, for -export-dynamic list all
  program symbols together, -export-symbols was broken for
  programs, minor reformatting
* mdemo/Makefile.am: renamed mdemo.debug to mdemo.static
* tests/mdemo*: ditto, mdemo.test was completely broken

18 files changed:
ChangeLog
autogen
demo/Makefile.am
doc/libtool.texi
libltdl/configure.in
libltdl/ltdl.c
ltconfig.in
ltmain.in
mdemo/Makefile.am
tests/demo-exec.test
tests/demo-inst.test
tests/demo.test
tests/mdemo-conf.test
tests/mdemo-exec.test
tests/mdemo-inst.test
tests/mdemo-shared.test
tests/mdemo-static.test
tests/mdemo.test

index 5149669076b25c91c722b390b72d4b1af31d9196..df56e0c1ae258875644795432a02547e16b4c834 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+1999-02-11  Thomas Tanner  <tanner@gmx.de>
+
+       * autogen: libltdl needs autoheader
+       * demo/Makefile.am: renamed hell.debug to hell.static
+         (we're demonstrating static linking, not debugging)
+       * tests/demo*: ditto
+       * doc/libtool.texi (libltdl): documented new lt_dlopen(NULL)
+         feature
+       * libltdl/acconfig.h: required for config.h
+       * libltdl/configure.in: use config.h
+       * libltdl/ltdl.c: use config.h, support lt_dlopen(NULL)
+         (returns a handle for the program itself)
+       * ltconfig.in: minor reformatting
+       * ltmain.in: in lt_preloaded_symbols always define
+         the program's symbols first, for -export-dynamic list all
+         program symbols together, -export-symbols was broken for
+         programs, minor reformatting
+       * mdemo/Makefile.am: renamed mdemo.debug to mdemo.static
+       * tests/mdemo*: ditto, mdemo.test was completely broken
+       
 1999-02-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * ltconfig.in (irix5*, irix6*, osf3*, osf4*): do not use
diff --git a/autogen b/autogen
index a33b4c27f335c36a6f94ef269e44844ed101a636..aebb562c760964ff42d782d040c2bf5201c2cb77 100644 (file)
--- a/autogen
+++ b/autogen
@@ -19,6 +19,7 @@ for sub in demo depdemo libltdl mdemo cdemo; do
   rm -f acinclude.m4
   cp ../libtool.m4 acinclude.m4
   aclocal
+  autoheader
   automake --gnits --add-missing
   autoconf
   cd ..
index 4c8cf4d74960fe1bc3cfa018c7a3f457d45893c5..ac93cb6d91193816ba3c5b47bc4a77ebdc49213b 100644 (file)
@@ -20,16 +20,16 @@ else
 BUILD_helldl = 
 endif
 
-bin_PROGRAMS = hell hell.debug $(BUILD_helldl)
+bin_PROGRAMS = hell hell.static $(BUILD_helldl)
 
 # Build hell from main.c and libhello.la
 hell_SOURCES = main.c
 hell_LDADD = libhello.la
 
-# Create an easier-to-debug version of hell.
-hell_debug_SOURCES = main.c
-hell_debug_LDADD = libhello.la
-hell_debug_LDFLAGS = $(STATIC)
+# Create a statically linked version of hell.
+hell_static_SOURCES = main.c
+hell_static_LDADD = libhello.la
+hell_static_LDFLAGS = $(STATIC)
 
 if BINARY_HELLDL
 
index 70daa9c6b18798a4374ca3cf373676a02533d754..2e3c630cf814c18753902284bdc49ca7c99e69e5 100644 (file)
@@ -2612,7 +2612,8 @@ Return 0 on success, otherwise the number of errors.
 @deftypefun lt_dlhandle lt_dlopen (const char *@var{filename})
 Open the module with the file name @var{filename} and return a
 handle for it.  @code{lt_dlopen} is able to open libtool dynamic
-modules, preloaded static modules and native dynamic libraries.  
+modules, preloaded static modules, the program itself and 
+native dynamic libraries.  
 
 Unresolved symbols in the module are resolved using its dependency
 libraries and previously dlopened modules.  If the executable using this
@@ -2621,6 +2622,10 @@ symbols in the executable will also be used to resolve references in the
 module.  Libltdl tries to resolve the symbols immediately and returns
 @code{NULL} if that fails.
  
+If @var{filename} is NULL @code{lt_dlopen} will return a handle
+for the program itself, which can be used to access its symbols 
+if it was linked with @code{-export-dynamic}.
+
 If libltdl cannot find the library and the file name @var{filename} does
 not have a directory component it will additionally search in the
 following search paths for the module (in the order as follows):
index 7b8fe65d49dbb5494310e0dfb68a4bb75d14c31b..39aa2051779a5ea490b33956310cdd6967ff7cbb 100644 (file)
@@ -2,6 +2,7 @@ dnl Process this file with autoconf to create configure.
 dnl Initialize the libltdl package.
 AC_INIT(ltdl.c)
 AM_INIT_AUTOMAKE(libltdl,1.0,-)
+AM_CONFIG_HEADER(config.h)
 
 AM_MAINTAINER_MODE
 
index f53f50bfc8490672a4755ef83d3891c32e733e8f..3e39585132a1b2a89c92b4ece871b56462cdafc2 100644 (file)
@@ -20,6 +20,10 @@ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 #define _LTDL_COMPILE_
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #if HAVE_STRING_H
 #include <string.h>
 #endif
@@ -608,14 +612,19 @@ presym_open (handle, filename)
 {
        lt_dlsymlists_t *lists = preloaded_symbols;
 
-       if (!filename) {
-               last_error = file_not_found_error;
-               return 1;
-       }
        if (!lists) {
                last_error = no_symbols_error;
                return 1;
        }
+       if (!filename) {
+               if (!default_preloaded_symbols) {
+                       last_error = file_not_found_error;
+                       return 1;
+               } else {
+                       handle->handle = (lt_ptr_t) default_preloaded_symbols;
+                       return 0;
+               }
+       }
        while (lists) {
                const lt_dlsymlist *syms = lists->syms;
        
@@ -765,8 +774,14 @@ tryall_dlopen (handle, filename)
        
        /* check whether the module was already opened */
        cur = handles;
-       while (cur && strcmp(cur->filename, filename))
+       while (cur) {
+               if (!cur->filename && !filename)
+                       break;
+               if (cur->filename && filename && 
+                   strcmp(cur->filename, filename))
+                       break;
                cur = cur->next;
+       }
        if (cur) {
                cur->usage++;
                *handle = cur;
@@ -774,18 +789,22 @@ tryall_dlopen (handle, filename)
        }
        
        cur = *handle;
-       cur->filename = strdup(filename);
-       if (!cur->filename) {
-               last_error = memory_error;
-               return 1;
-       }
+       if (filename) {
+               cur->filename = strdup(filename);
+               if (!cur->filename) {
+                       last_error = memory_error;
+                       return 1;
+               }
+       } else
+               cur->filename = 0;
        while (type) {
                if (type->lib_open(cur, filename) == 0)
                        break;
                type = type->next;
        }
        if (!type) {
-               free(cur->filename);
+               if (cur->filename)
+                       free(cur->filename);
                return 1;
        }
        cur->type = type;
@@ -1026,8 +1045,20 @@ lt_dlopen (filename)
        char    *dir = 0, *name = 0;
        
        if (!filename) {
-               last_error = file_not_found_error;
-               return 0;
+               handle = (lt_dlhandle) malloc(sizeof(lt_dlhandle_t));
+               if (!handle) {
+                       last_error = memory_error;
+                       return 0;
+               }
+               handle->usage = 0;
+               newhandle = handle;
+               if (tryall_dlopen(handle, 0) != 0) {
+                       free(newhandle);
+                       return 0;
+               }
+               if (newhandle != handle)
+                       free(newhandle);
+               return handle;
        }
        basename = strrchr(filename, '/');
        if (basename) {
index ca693b783ab44814590af0bbae1e71e99fb8382d..fa1525b8b4528792bb0b7f56d47f61f33ab78d3a 100755 (executable)
@@ -1128,13 +1128,13 @@ else
     allow_undefined_flag=
     if test "$with_gcc" = yes; then
       if strings `${CC} -print-prog-name=collect2` | \
-         grep resolve_lib_name >/dev/null
+        grep resolve_lib_name >/dev/null
       then
-        # We have reworked collect2
-        hardcode_direct=yes
+       # We have reworked collect2
+       hardcode_direct=yes
       else
-        # We have old collect2
-        hardcode_direct=unsupported
+       # We have old collect2
+       hardcode_direct=unsupported
       fi
       archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
     else
index 1761d5ce15fa8d323bef55590fa367ae739ec03f..f0ba67a4bfcc67637c4bf56dd6ea337f01d97ac7 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -431,14 +431,14 @@ compiler."
       # All platforms use -DPIC, to notify preprocessed assembler code.
       command="$base_compile $pic_flag -DPIC $srcfile"
       if test "$build_old_libs" = yes; then
-        lo_libobj="$libobj"
+       lo_libobj="$libobj"
        dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
        if test "X$dir" = "X$libobj"; then
          dir="$objdir"
        else
          dir="$dir/$objdir"
        fi
-        libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+       libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
 
        if test -d "$dir"; then
          $show "$rm $libobj"
@@ -501,7 +501,7 @@ compiler."
       # If we have no pic_flag, then copy the object into place and finish.
       if test -z "$pic_flag" && test "$build_old_libs" = yes; then
        # Rename the .lo from within objdir to obj
-        if test -f $obj; then
+       if test -f $obj; then
          $show $rm $obj
          $run $rm $obj
        fi
@@ -580,8 +580,8 @@ compiler."
       # Create an invalid libtool object if no PIC, so that we do not
       # accidentally link it into a program.
       if test "$build_libtool_libs" != yes; then
-        $show "echo timestamp > $libobj"
-        $run eval "echo timestamp > \$libobj" || exit $?
+       $show "echo timestamp > $libobj"
+       $run eval "echo timestamp > \$libobj" || exit $?
       else
        # Move the .lo from within objdir
        $show "$mv $libobj $lo_libobj"
@@ -748,6 +748,7 @@ compiler."
            exit 1
          fi
          prev=
+         continue
          ;;
        release)
          release="-$arg"
@@ -1390,8 +1391,8 @@ compiler."
 
       # How the heck are we supposed to write a wrapper for a shared library?
       if test -n "$link_against_libtool_libs"; then
-        $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
-        exit 1
+        $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
+        exit 1
       fi
 
       if test -n "$dlfiles$dlprefiles"; then
@@ -1716,7 +1717,7 @@ EOF
                      # but so what?
                      potlib="$potent_lib"
                      while test -h "$potlib" 2>/dev/null; do
-                       potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+                       potliblink=`ls -ld $potlib | sed 's/.* -> //'`
                        case "$potliblink" in
                        /*) potlib="$potliblink";;
                        *) potlib=`$echo "X$potlib" \
@@ -1822,13 +1823,13 @@ EOF
 
        # Ensure that we have .o objects for linkers which dislike .lo
        # (e.g. aix) incase we are running --disable-static
-        for obj in $libobjs; do
-          oldobj=`echo $obj | $Xsed -e "$lo2o"`
-          test -f $oldobj || ${LN_S} $obj $oldobj
-        done
+       for obj in $libobjs; do
+         oldobj=`echo $obj | $Xsed -e "$lo2o"`
+         test -f $oldobj || ${LN_S} $obj $oldobj
+       done
 
        # Use standard objects if they are pic
-        test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+       test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
        if test -n "$whole_archive_flag_spec"; then
          if test -n "$convenience"; then
@@ -2086,11 +2087,6 @@ EOF
        case "$dlsyms" in
        "") ;;
        *.c)
-         if test "$export_dynamic" = yes && test -z "$export_symbols"; then
-           # Add our own program objects to the preloaded list.
-           dlprefiles=`$echo "X$objs $dlprefiles" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
-         fi
-
          # Discover the nlist of each of the dlfiles.
          nlist="$objdir/${output}.nm"
 
@@ -2123,8 +2119,17 @@ extern \"C\" {
 /* External symbol declarations for the compiler. */\
 "
 
-         if test "$export_dynamic" = yes && test -n "$export_symbols"; then
-           sed -e 's/^\(.*\)/\1 \1/' < "$export_symbols" > "$nlist"
+         if test "$export_dynamic" = yes; then
+           if test -n "$export_symbols"; then
+             $run eval 'sed -e "s/^\(.*\)/\1 \1/" < "$export_symbols" > "$nlist"'
+           else
+             # Add our own program objects to the preloaded list.
+             progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+             for arg in $progfiles; do
+               $show "extracting global C symbols from \`$arg'"
+               $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+             done
+           fi
          fi
 
          for arg in $dlprefiles; do
@@ -2169,10 +2174,24 @@ lt_preloaded_symbols[] =
 {\
 "
 
-           if test "$export_dynamic" = yes && test -n "$export_symbols"; then
-             echo >> "$output_objdir/$dlsyms" "\
+           # First entry is always the program itself
+           echo >> "$output_objdir/$dlsyms" "\
   {\"${output}\", (lt_ptr_t) 0},"
-             sed 's/^\(.*\)/  {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms"
+
+           if test "$export_dynamic" = yes; then
+             if test -n "$export_symbols"; then
+               sed 's/^\(.*\)/  {"\1", (lt_ptr_t) \&\1},/' < "$export_symbols" >> "$output_objdir/$dlsyms"
+             else
+               $rm "$nlist"
+               for arg in $progfiles; do
+                 eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+               done
+               if test -f "$nlist"; then
+                 sed 's/^\(.*\) \(.*\)$/  {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms"
+               else
+                 echo '/* NONE */' >> "$output_objdir/$dlsyms"
+               fi
+             fi
            fi
 
            for arg in $dlprefiles; do
@@ -2284,7 +2303,7 @@ static const void *lt_preloaded_setup() {
       fi
 
       if test -n "$runpath_var"; then
-        if test -n "$perm_rpath"; then
+       if test -n "$perm_rpath"; then
          # We should set the runpath_var.
          rpath=
          for dir in $perm_rpath; do
@@ -2292,7 +2311,7 @@ static const void *lt_preloaded_setup() {
          done
          compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
        fi
-        if test -n "$finalize_perm_rpath"; then
+       if test -n "$finalize_perm_rpath"; then
          # We should set the runpath_var.
          rpath=
          for dir in $finalize_perm_rpath; do
index 97ed28be754e779499e499b3e87151c60cc9619e..569000dfb342edd463796c27d5b6421a37f6d1e7 100644 (file)
@@ -16,7 +16,7 @@ libfoo2_la_LDFLAGS = $(LIBADD_M) -module
 
 noinst_HEADERS = foo.h
 
-bin_PROGRAMS = mdemo mdemo.debug
+bin_PROGRAMS = mdemo mdemo.static
 
 ../libltdl/libltdl.la: ../libtool ../libltdl/libtool \
     $(srcdir)/../libltdl/ltdl.c $(srcdir)/../libltdl/ltdl.h
@@ -33,8 +33,8 @@ mdemo_LDFLAGS = -export-dynamic ## FIXME: remove this when libtool and libltdl
 mdemo_LDADD = ../libltdl/libltdl.la "-dlopen" foo1.la "-dlopen" libfoo2.la
 mdemo_DEPENDENCIES = ../libltdl/libltdl.la foo1.la libfoo2.la
 
-# Create an easier-to-debug version of mdemo.
-mdemo_debug_SOURCES = $(mdemo_SOURCES)
-mdemo_debug_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
-mdemo_debug_LDADD = $(mdemo_LDADD)
-mdemo_debug_DEPENDENCIES = $(mdemo_DEPENDENCIES)
+# Create a statically linked version of mdemo.
+mdemo_static_SOURCES = $(mdemo_SOURCES)
+mdemo_static_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
+mdemo_static_LDADD = $(mdemo_LDADD)
+mdemo_static_DEPENDENCIES = $(mdemo_DEPENDENCIES)
index afe5912aece8dada2806ed8bcd79d399c1083c78..bdf61bc07b5bfb503db53d350daf23798d823c3f 100755 (executable)
@@ -20,9 +20,9 @@ fi
 echo "Executing uninstalled programs in ../demo"
 
 status=0
-if ../demo/hell.debug| grep 'Welcome to GNU Hell'; then :
+if ../demo/hell.static| grep 'Welcome to GNU Hell'; then :
 else
-  echo "$0: cannot execute ../demo/hell.debug" 1>&2
+  echo "$0: cannot execute ../demo/hell.static" 1>&2
   status=1
 fi
 
index 3e99e5e7083b07d9a90b2f8cfcb6f8090ef9e115..419cafdfe883ed7e9098bb4d11135a7b7025328c 100755 (executable)
@@ -25,9 +25,9 @@ $make install || exit 1
 
 echo "= Executing installed programs"
 status=0
-if $prefix/bin/hell.debug | grep 'Welcome to GNU Hell'; then :
+if $prefix/bin/hell.static | grep 'Welcome to GNU Hell'; then :
 else
-  echo "$0: cannot execute $prefix/bin/hell.debug" 1>&2
+  echo "$0: cannot execute $prefix/bin/hell.static" 1>&2
   status=1
 fi
 
index 25b0ce8d30ec5f86cd8b08676120f0f2c27ec5ca..072cb680990f1aa9a76c2f9053b576726e821ac8 100644 (file)
@@ -55,7 +55,8 @@ fi
 
 if $prefix/bin/hell | grep 'GNU Hell'; then :
 else
-  echo "$0: warning: cannot execute $prefix/bin/hell" 1>&2
+  echo "$0: cannot execute $prefix/bin/hell" 1>&2
+  exit 1
 fi
 
 echo "= Running make uninstall in ../demo"
index 28c39ff5815ab46f404966898b70d1a9b5a76c90..d74b13563b201945419fa925b68f27a86042a73c 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories
+# mdemo-conf.test - try configuring the ../mdemo subdirectory
 
 # Test script header.
 need_prefix=yes
index d8651f033d3fc3ca9524a0598eac721cdb6ab2e3..a7d241e42b54c848aa6107a65bd921b72e1c3a4b 100755 (executable)
@@ -20,9 +20,9 @@ fi
 echo "Executing uninstalled programs in ../mdemo"
 
 status=0
-if ../mdemo/mdemo.debug ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
+if ../mdemo/mdemo.static ../mdemo/foo1.la ../mdemo/libfoo2.la; then :
 else
-  echo "$0: cannot execute ../mdemo/mdemo.debug" 1>&2
+  echo "$0: cannot execute ../mdemo/mdemo.static" 1>&2
   status=1
 fi
 
index c4fd7fab7a33d46da48d8989ef81d45fe5192f04..fcd4025dfe1f6e39e160cef957438efabed97ed1 100755 (executable)
@@ -26,9 +26,9 @@ $make install || exit 1
 echo "= Executing installed programs"
 
 status=0
-if $prefix/bin/mdemo.debug $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
+if $prefix/bin/mdemo.static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
 else
-  echo "$0: cannot execute $prefix/bin/mdemo.debug" 1>&2
+  echo "$0: cannot execute $prefix/bin/mdemo.static" 1>&2
   status=1
 fi
 
index f1b3feea114ffcd0df560231b9e7e02ceedb1e09..9f1d3a557eba645cb31e6ec0f32a670781c91ef7 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories
+# mdemo-conf.test - try configuring the ../mdemo subdirectory
 
 # Test script header.
 need_prefix=yes
index b063fc5cd05d8530638b8f8a362ad0fc1c561b0d..b6ecb5ec34f5ddec0fd827464a361a2c4531be48 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# mdemo-conf.test - try configuring the ../libltdl and ../mdemo subdirectories
+# mdemo-conf.test - try configuring the ../mdemo subdirectory
 
 # Test script header.
 need_prefix=yes
index 225853b19f54eef39d39c9a9c23d4fbb8e9d80b6..9af96cef7c8e81087b4b26726b6873e8e427b312 100644 (file)
@@ -31,15 +31,15 @@ make || exit 1
 
 # Try running the program.
 echo "= Executing uninstalled programs"
-if ./hell.debug | grep 'GNU Hell'; then :
+if ./mdemo.static foo1.la libfoo2.la; then :
 else
-  echo "$0: cannot execute ./hell.debug" 1>&2
+  echo "$0: cannot execute ./mdemo.static" 1>&2
   exit 1
 fi
 
-if ./hell | grep 'GNU Hell'; then :
+if ./mdemo foo1.la libfoo2.la; then :
 else
-  echo "$0: cannot execute ./hell" 1>&2
+  echo "$0: cannot execute ./mdemo" 1>&2
   exit 1
 fi
 
@@ -47,15 +47,16 @@ echo "= Running make install in ../mdemo"
 make install || exit 1
 
 echo "= Executing installed programs"
-if $prefix/bin/hell.debug | grep 'GNU Hell'; then :
+if $prefix/bin/mdemo.static $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
 else
-  echo "$0: cannot execute $prefix/bin/hell.debug" 1>&2
+  echo "$0: cannot execute $prefix/bin/mdemo.static" 1>&2
   exit 1
 fi
 
-if $prefix/bin/hell | grep 'GNU Hell'; then :
+if $prefix/bin/mdemo $prefix/lib/foo1.la $prefix/lib/libfoo2.la; then :
 else
-  echo "$0: warning: cannot execute $prefix/bin/hell" 1>&2
+  echo "$0: cannot execute $prefix/bin/mdemo" 1>&2
+  exit 1
 fi
 
 echo "= Running make uninstall in ../mdemo"