]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
fix the command string and command proc pointers
authorAndreas Jaeger <aj@suse.de>
Sun, 13 May 2001 17:41:27 +0000 (17:41 +0000)
committerBruce Korb <bkorb@gnu.org>
Sun, 13 May 2001 17:41:27 +0000 (17:41 +0000)
exe/ltmain.mk
exe/ltopts.def
exe/ltstr.def
exe/ltstr.tpl

index f434d7bab4ac17d78409b5523a1f447f2a7a9dbd..beb73c8a193342d9f9103e03a758ecc017dc9e50 100644 (file)
@@ -15,7 +15,7 @@ ltmain : $(OBJ)
        $(CC) -o ltmain $(OBJ) -lopts
 
 clean :
-       rm -f lt*.o ltmain $(GENED) *~
+       rm -rf .libs lt*.o ltmain libtool $(GENED) *~
 
 ltmain.in : $(TXTTPL) ltstr.def
        autogen -T ltmain.tpl -l ltmacros.tpl ltstr.def
@@ -36,3 +36,6 @@ ltopts.o : ltopts.c
        $(CC) -c -o ltopts.o -I/usr/local/include ltopts.c
 
 gen : ltmain.in ltstr.c ltopts.c
+
+libtool : ltmain
+       ./ltmain --mode=link $(CC) -o $@ $(OBJ) -lopts
index 1a6ef93cb96606d1d741c500040276038060fbfa..d07776c1b35ff9b524777f6b20034bf8c3ee8b68 100644 (file)
@@ -58,18 +58,16 @@ flag = {
     descrip   = "ltmain's operational mode";
 
     /*
-     *  BEWARE:  these *must* enumerate to the values #define-d in the
-     *           lt_*.def files!!
+     *  Extract the keyword list from the defined list of modes.
+     *  This comes from that definition file.  This ensures that
+     *  the ordering is the same, too.  It omits 'base'.
      */
-    keyword   =    /* 0 -> UNDEFINED */
-        clean,     /* 1 */
-        compile,   /* 2 */
-        execute,   /* 3 */
-        finish,    /* 4 */
-        install,   /* 5 */
-        link,      /* 6 */
-        uninstall, /* 7 */
-        echo;      /* 8 */
+#shell
+    echo keyword =
+       egrep -i '^[    ]*str-name' ltstr.def | \
+    sed '/base/d;s/.*=//;s/;.*/,/;$s/,/;/'
+#endshell
+
     doc =
     "This enumerates all of the libtool operational modes.\n"
     "If this option is not specified, then this program tries to infer\n"
index 7a9b85d3556bf37be5f590e39c914c47022b0f45..25caa6b6ac027ff9e0ecb84e3c04608d51c90e0e 100644 (file)
@@ -1,15 +1,11 @@
 
 AutoGen Definitions ltmain.tpl;
 
-#define BASE_STRING 0
-
-string[0] = {
+string = {
   str-name = base;
 };
 
-#define CLEAN_STRING 1
-
-string[CLEAN_STRING] = {
+string = {
   str-name = clean;
   explain = "
 <command> is the name of the program to use to delete files associated with
@@ -21,9 +17,7 @@ or program, all the files associated with it are deleted. Otherwise, only
 the file itself is deleted using <command>.\n";
 };
 
-#define COMPILE_STRING 2
-
-string[COMPILE_STRING] = {
+string = {
   str-name = compile;
   call-proc = emitCompile;
 
@@ -41,9 +35,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";
 };
 
-#define EXECUTE_STRING 3
-
-string[EXECUTE_STRING] = {
+string = {
   str-name  = execute;
   call-proc = emitExecute;
 
@@ -59,9 +51,7 @@ required library directories are added to the library path.\n
 Then, <command> is executed, with  `<cmd-arg>...' as arguments.\n";
 };
 
-#define FINISH_STRING 4
-
-string[FINISH_STRING] = {
+string = {
   str-name = finish;
   explain = "
 Complete the installation of libtool libraries.\n
@@ -71,9 +61,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";
 };
 
-#define INSTALL_STRING 5
-
-string[INSTALL_STRING] = {
+string = {
   str-name = install;
   explain = "
 Install executables or libraries.\n
@@ -83,9 +71,7 @@ It should be either the `install' or `cp' program.\n
 (only BSD-compatible install options are recognized).\n";
 };
 
-#define LINK_STRING 6
-
-string[LINK_STRING] = {
+string = {
   str-name = link;
   explain  = "
 Link object files or libraries together to form another library,
@@ -129,17 +115,13 @@ If OUTPUT-FILE ends in `.lo' or `.${objext}', then a reloadable object file
 is created, otherwise an executable program is created.\n";
 };
 
-#define UNINSTALL_STRING 7
-
-string[UNINSTALL_STRING] = {
+string = {
   str-name = uninstall;
   use_explain = clean;
   use_cmd = clean;
 };
 
-#define ECHO_STRING 8
-
-string[ECHO_STRING] = {
+string = {
   str-name = echo;
   explain = "
 This is a reimplementation of the echo command.
index e0f48f6ea2d05f94ee437d6a782de71c40fc67d7..cd7528e8b84e2e2772a74ae3936c461a3e4e0093 100644 (file)
@@ -55,9 +55,14 @@ ELSE  not h suffix
 =]
 #include "[=(. hdr-name)=]"
 [=
-(define tpl-name "") =][=
+(define tpl-name  "")
+(define cmd-list  "")
+(define proc-list "")
+(define Cmd-Name  "") =][=
 
-FOR string
+FOR string           =][=
+
+  (set! Cmd-Name (string-capitalize! (get "str_name")))
 
 =]
 /*
@@ -68,7 +73,7 @@ FOR string
    IF (exist? "explain")
 
 =]
-tSCC zExplain[=(string-capitalize! (get "str_name"))=][ [=
+tSCC zExplain[=(. Cmd-Name)=][ [=
   (+ 1 (len "explain")) =] ] =
 [=(kr-string (get "explain"))=];[=
    ENDIF   =][=
@@ -79,13 +84,20 @@ tSCC zExplain[=(string-capitalize! (get "str_name"))=][ [=
       IF (exist? "explain")     =]
 
 [=    ENDIF                     =]
-tSCC z[= (string-capitalize! (get "str_name")) =]Cmd[] =[=
+tSCC z[= (. Cmd-Name) =]Cmd[] =[=
    (out-push-new ".lt.sh")      =][=
    INCLUDE (. tpl-name)         =][=
    (out-pop)
-   (kr-string (shell "cat .lt.sh ; rm -f .lt.sh")) =];
+   (set! cmd-list (string-append cmd-list "z" Cmd-Name "Cmd\n"))
+   (kr-string (shell "cat .lt.sh ; rm -f .lt.sh"))
+   =];
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */[=
+   ELIF (exist? "use_cmd")      =][=
+      (set! cmd-list (string-append cmd-list "z"
+            (string-capitalize! (get "use_cmd")) "Cmd\n"))  =][=
+   ELSE  =][=
+      (set! cmd-list (string-append cmd-list "(tCC*)NULL\n" )) =][=
    ENDIF =][=
 
 ENDFOR =][=
@@ -112,17 +124,8 @@ ENDIF =];
 
 [=IF (== (suffix) "h")=]extern [=
   ENDIF=]tCC* apz_mode_cmd[     MODE_CT ][=
-IF (== (suffix) "c") =] = {[=
-
-  FOR string , =]
-    [=
-    IF   (exist? "use_cmd")
-          =]z[=(string-capitalize! (get "use_cmd"))=]Cmd[=
-    ELIF (exist? "text")
-          =]z[=(string-capitalize! (get "str_name"))=]Cmd[=
-    ELSE  =](tCC*)NULL[=
-    ENDIF =][=
-  ENDFOR  =]
+IF (== (suffix) "c") =] = {
+[=(shellf "columns -I4 -S, <<_EOF_\n%s_EOF_" cmd-list) =]
 }[=
 ENDIF =];
 
@@ -131,11 +134,7 @@ ENDIF =];
 IF (== (suffix) "c") =] = {[=
 
   FOR string , =]
-    [=
-    IF (or (exist? "use_cmd") (exist? "text"))
-          =][=?% call-proc "%s" emitScript=][=
-    ELSE  =](emitScriptProc*)NULL[=
-    ENDIF =][=
+    [=?% call-proc "%s" emitScript=][=
   ENDFOR  =]
 };[=