]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
elaboration on the execute example
authorAndreas Jaeger <aj@suse.de>
Sun, 13 May 2001 02:45:50 +0000 (02:45 +0000)
committerBruce Korb <bkorb@gnu.org>
Sun, 13 May 2001 02:45:50 +0000 (02:45 +0000)
exe/lt_base.def
exe/lt_clean.def
exe/lt_compile.def
exe/lt_exe.tpl [deleted file]
exe/lt_execute.def
exe/lt_finish.def
exe/lt_install.def
exe/lt_link.def
exe/ltmain.tpl
exe/ltstr.tpl

index b37389e863d77e51cbb757a98b9aebd87003246c..cc408586e630c406c7bf7c28974e7b1dcfd0ce31 100644 (file)
@@ -7,6 +7,7 @@ string[0] = {
   str-name = base;
 
   text = <<_END_OF_BASE_TEXT_
+[++ AutoGen5 Template ++]
 # Global variables.
 lo2o="s/\\.lo\$/.${objext}/"
 o2lo="s/\\.${objext}\$/.lo/"
index 3ac48282b05e9b932812a9ff714a8056d5ceb466..c9adc94536d6146c221764a5fdb59fd0a43c0d07 100644 (file)
@@ -24,6 +24,7 @@ or program, all the files associated with it are deleted. Otherwise, only
 the file itself is deleted using <command>.\n";
 
   text = << _END_EXECUTE_STRING_
+[++ AutoGen5 Template ++]
     rm="$nonopt"
     files=
     rmforce=
index 5e969bae3af5228b11e56648590db8f5f2ee4b2e..77e7f6dd096b81133ce272b14b9f43555fb34476 100644 (file)
@@ -21,6 +21,7 @@ source file name in the <cmd-arg> list and then substituting the C source
 code suffix `.c' with the library object suffix, `.lo'.\n";
 
   text = << _END_COMPILE_STRING_
+[++ AutoGen5 Template ++]
     # Get the compilation command and the source file.
     base_compile=
     prev=
diff --git a/exe/lt_exe.tpl b/exe/lt_exe.tpl
deleted file mode 100644 (file)
index bfa894b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-[= AutoGen5 Template =]
-  execute)
-    modename="$modename: execute"
-
-    # The first argument is the command name.
-    cmd="$nonopt"
-    [= test-or-exit test = 'test -z "$cmd"'
-       msg  = "you must specify a COMMAND" =]
-[=(shellf "cat > .lttmp.exe <<'END_LTEXE_TEMP'
-[+ AutoGen5 Template +]
-%s\nEND_LTEXE_TEMP"
-          (get "string[EXECUTE_STRING].text")) =][=
-    INCLUDE ".lttmp.exe" =][=
-    `rm -f .lttmp.exe`   =]
-    ;;
index 1b3c8a314ac29123aa3ffcd18dc391d21fafec59..d699556d551ea05ceeb22db1ea44bcd841f0c60d 100644 (file)
@@ -19,18 +19,19 @@ required library directories are added to the library path.\n
 Then, <command> is executed, with  `<cmd-arg>...' as arguments.\n";
 
   text = << _END_EXECUTE_STRING_
+[++ AutoGen5 Template ++]
     # Handle -dlopen flags immediately.
     for file in $execute_dlfiles; do
-      [+ test-or-exit test = 'test ! -f "$file"'
-         msg = "\\`$file' is not a file" +]
+      [++ test-or-exit test = 'test ! -f "$file"'
+         msg = "\\`$file' is not a file" ++]
 
       dir=
       case $file in
       *.la)
        # Check to see that this really is a libtool archive.
-       [+ test-or-exit  invert = yes
+       [++ test-or-exit  invert = yes
           test = "sed -e '2q' $file | egrep \"^# Generated by .*$PACKAGE\""
-          msg  = "\\`$lib' is not a valid libtool archive"  +]
+          msg  = "\\`$lib' is not a valid libtool archive"  ++]
 
        # Read the libtool library.
        dlname=
@@ -52,8 +53,8 @@ Then, <command> is executed, with  `<cmd-arg>...' as arguments.\n";
        dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
        test "X$dir" = "X$file" && dir=.
 
-       [+ test-or-exit test = 'test -f "$dir/$objdir/$dlname"'  invert = yes
-           msg = "cannot find \\`$dlname' in \\`$dir' or \\`$dir/$objdir'" +]
+       [++ test-or-exit test = 'test -f "$dir/$objdir/$dlname"'  invert = yes
+           msg = "cannot find \\`$dlname' in \\`$dir' or \\`$dir/$objdir'" ++]
        dir="$dir/$objdir"
        ;;
 
index 9b75c1926a9a6e6da104651302c1afed2a0b01ad..60825a2b3d904b908bac8ce63a49443eeb4dc675 100644 (file)
@@ -13,6 +13,7 @@ The commands that this mode executes may require superuser privileges.  Use
 the `--dry-run' option if you just want to see what would be executed.\n";
 
   text = << _END_FINISH_STRING_
+[++ AutoGen5 Template ++]
     libdirs="$nonopt"
     admincmds=
 
index ebfa46c5acf91d51d9402ddcd89706632ee41dfe..5ee8946f7d35e56c99c5e9386ac32fd4a01138bd 100644 (file)
@@ -13,6 +13,7 @@ It should be either the `install' or `cp' program.\n
 (only BSD-compatible install options are recognized).\n";
 
   text = << _END_INSTALL_STRING_
+[++ AutoGen5 Template ++]
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
     if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
index aab67e29530e58f1fea571f5bf468b087bbc1493..ac672d6b7538daf5eda7db90254a91d84032519e 100644 (file)
@@ -47,6 +47,7 @@ If OUTPUT-FILE ends in `.lo' or `.${objext}', then a reloadable object file
 is created, otherwise an executable program is created.\n";
 
   text = << _END_LINK_STRING_
+[++ AutoGen5 Template ++]
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
       # It is impossible to link a dll without this setting, and
index 1719d6c067cb6990d969c988f1ee36b712b958dd..4120e9bf1a9378d2a21c330e56f2a5ec3cc6e0dc 100644 (file)
@@ -1,9 +1,10 @@
 [= AutoGen5 Template in=ltmain.in =]
 [=( dne "# " "# " )=][=
 
-DEFINE test-or-exit =]
-if ([=test=]) > /dev/null 2>&1 ; then
-[=    invert "  :\nelse"=]
+DEFINE test-or-exit
+
+=]if ([=test=]) > /dev/null 2>&1 ; then[=
+  invert "  :\nelse"=]
   $echo "$modename: [=msg=]" 1>&2
   $echo "$help" 1>&2
   exit 1
@@ -75,7 +76,11 @@ TIMESTAMP="@TIMESTAMP@"
 default_mode=
 help="Try \`$progname --help' for more information."
 
-[=string[BASE_STRING].text=]
+[= (out-push-new ".lt.tmp")    =][=
+   string[BASE_STRING].text    =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =][=
+   `rm -f .lt.tmp`             =]
 
 if test "$LTCONFIG_VERSION" != "$VERSION"; then
   echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
@@ -295,7 +300,10 @@ if test -z "$show_help"; then
   # libtool compile mode
   compile)
     modename="$modename: compile"
-[=string[COMPILE_STRING].text=]
+[= (out-push-new ".lt.tmp")    =][=
+   string[COMPILE_STRING].text =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =]
 
     exit 0
     ;;
@@ -303,7 +311,10 @@ if test -z "$show_help"; then
   # libtool link mode
   link | relink)
     modename="$modename: link"
-[=string[LINK_STRING].text=]
+[= (out-push-new ".lt.tmp")    =][=
+   string[LINK_STRING].text    =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =]
     exit 0
     ;;
 
@@ -311,7 +322,10 @@ if test -z "$show_help"; then
   install)
     modename="$modename: install"
 
-[=string[INSTALL_STRING].text=]
+[= (out-push-new ".lt.tmp")    =][=
+   string[INSTALL_STRING].text =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =]
 
     exit 0
     ;;
@@ -319,17 +333,35 @@ if test -z "$show_help"; then
   # libtool finish mode
   finish)
     modename="$modename: finish"
-[=string[FINISH_STRING].text=]
+[= (out-push-new ".lt.tmp")    =][=
+   string[FINISH_STRING].text  =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =]
     exit 0
     ;;
 
   # libtool execute mode
-[= include "lt_exe.tpl" =]
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    [= test-or-exit test = 'test -z "$cmd"'
+       msg  = "you must specify a COMMAND" =]
+[= (out-push-new ".lt.tmp")    =][=
+   string[EXECUTE_STRING].text =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =]
+    ;;
 
   # libtool clean and uninstall mode
   clean | uninstall)
     modename="$modename: $mode"
-[=string[CLEAN_STRING].text=]
+[= (out-push-new ".lt.tmp")    =][=
+   string[CLEAN_STRING].text   =][=
+   (out-pop)                   =][=
+   INCLUDE ".lt.tmp"           =][=
+   `rm -f .lt.tmp`             =]
     exit $exit_status
     ;;
 
index 523ecc8bca897e2cf9e0703744e796093ce12ae5..b82efd512d3e370b65e04033b2cef21daa5450bc 100644 (file)
@@ -7,6 +7,17 @@
 
 IF (== (suffix) "h") =][=
 
+DEFINE test-or-exit
+
+=]if ([=test=]) > /dev/null 2>&1 ; then[=
+  invert "  :\nelse"=]
+  $echo "$modename: [=msg=]" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+fi[=
+
+ENDDEF  =][=
+
   (define guard (string-append "HDRGRD_" (string-upcase!
                 (string->c-name! (out-name)) )))
   (define hdr-name (out-name)) =]
@@ -77,20 +88,17 @@ tSCC zExplain[=(string-capitalize! (get "str_name"))=][ [=
   IF (exist? "text")
 
 =][=
-    IF (== (suffix) "h") =]
-#define [=(string-upcase! (get "str_name"))=]_CMD_SIZE [=(+ 1 (len "text"))=]
-extern [=
-    ELSE =]
-[=  ENDIF
-=]tCC z[=(string-capitalize! (get "str_name"))
-             =]Cmd[ [=(string-upcase! (get "str_name"))=]_CMD_SIZE ][=
-    IF (== (suffix) "c") =] =
-[=(kr-string (get "text"))=][=
-    ENDIF =];[=
-
-  ENDIF =]
-[=
-  IF (== (suffix) "c") =]
+    IF (== (suffix) "c") =]
+tSCC z[= (string-capitalize! (get "str_name")) =]Cmd[] =
+[= (out-push-new ".lt.tpl") =][=
+   text                     =][=
+   (out-pop)
+   (out-push-new ".lt.xxx") =][=
+   INCLUDE ".lt.tpl"        =][=
+   (out-pop)
+   (kr-string (shell "cat .lt.xxx ; rm -f .lt.*")) =][=
+    ENDIF =];
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */[=
   ENDIF =][=