From: Andreas Jaeger Date: Sun, 13 May 2001 16:44:40 +0000 (+0000) Subject: Move all the text strings into separate templates. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd62d2cae4ee145d10e171d87fb8b65f8e81e453;p=thirdparty%2Flibtool.git Move all the text strings into separate templates. Delete the individual modal definition files --- diff --git a/exe/lt_base.def b/exe/base-txt.tpl similarity index 76% rename from exe/lt_base.def rename to exe/base-txt.tpl index cc408586e..60667a611 100644 --- a/exe/lt_base.def +++ b/exe/base-txt.tpl @@ -1,12 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define BASE_STRING 0 - -string[0] = { - str-name = base; - - text = <<_END_OF_BASE_TEXT_ [++ AutoGen5 Template ++] # Global variables. lo2o="s/\\.lo\$/.${objext}/" @@ -34,13 +25,3 @@ fi if test "${LANG+set}" = set; then save_LANG="$LANG"; LANG=C; export LANG fi -_END_OF_BASE_TEXT_; -}; - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_base.def ends here */ diff --git a/exe/lt_clean.def b/exe/clean-txt.tpl similarity index 83% rename from exe/lt_clean.def rename to exe/clean-txt.tpl index c9adc9453..2895adff5 100644 --- a/exe/lt_clean.def +++ b/exe/clean-txt.tpl @@ -1,29 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define UNINSTALL_STRING 7 - -string[UNINSTALL_STRING] = { - str-name = uninstall; - use_explain = clean; - use_cmd = clean; -}; - - -#define CLEAN_STRING 1 - -string[CLEAN_STRING] = { - str-name = clean; - explain = " - is the name of the program to use to delete files associated with -each FILE (typically `/bin/rm'). `-s' are options (such as `-f') -to be passed to . - -If one of the arguments specifies the removal of a libtool library, object -or program, all the files associated with it are deleted. Otherwise, only -the file itself is deleted using .\n"; - - text = << _END_EXECUTE_STRING_ [++ AutoGen5 Template ++] rm="$nonopt" files= @@ -178,14 +152,3 @@ the file itself is deleted using .\n"; $run rmdir $dir >/dev/null 2>&1 fi done -_END_EXECUTE_STRING_; -}; - - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_clean.def ends here */ diff --git a/exe/lt_compile.def b/exe/compile-txt.tpl similarity index 92% rename from exe/lt_compile.def rename to exe/compile-txt.tpl index 77e7f6dd0..bebe7ff46 100644 --- a/exe/lt_compile.def +++ b/exe/compile-txt.tpl @@ -1,26 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define COMPILE_STRING 2 - -string[COMPILE_STRING] = { - str-name = compile; - call-proc = emitCompile; - - explain = " -Compile a source file into a libtool library object.\n -This mode accepts the following additional options:\n - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a `.o' file suitable for static linking\n - is a command to be used in creating a `standard' object file -from the source file in the list.\n -The output file name is determined by removing the directory component from -source file name in the 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= @@ -497,13 +474,3 @@ EOF if test "$need_locks" != no; then $run $rm "$lockfile" fi -_END_COMPILE_STRING_; -}; - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_compile.def ends here */ diff --git a/exe/lt_execute.def b/exe/execute-txt.tpl similarity index 78% rename from exe/lt_execute.def rename to exe/execute-txt.tpl index d699556d5..25b89d578 100644 --- a/exe/lt_execute.def +++ b/exe/execute-txt.tpl @@ -1,24 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define EXECUTE_STRING 3 - -string[EXECUTE_STRING] = { - str-name = execute; - call-proc = emitExecute; - - explain = " -Automatically set library path, then run a program.\n -This mode accepts the following additional options:\n - -dlopen FILE add the directory containing FILE to the library path\n -This mode sets the library path environment variable, -according to `-dlopen' flags.\n -If any of the are libtool executable wrappers, then they are -translated into their corresponding uninstalled binary, and any of their -required library directories are added to the library path.\n -Then, is executed, with `...' as arguments.\n"; - - text = << _END_EXECUTE_STRING_ [++ AutoGen5 Template ++] # Handle -dlopen flags immediately. for file in $execute_dlfiles; do @@ -139,13 +118,3 @@ Then, is executed, with `...' as arguments.\n"; $echo "$cmd$args" exit 0 fi -_END_EXECUTE_STRING_; -}; - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_execute.def ends here */ diff --git a/exe/lt_finish.def b/exe/finish-txt.tpl similarity index 79% rename from exe/lt_finish.def rename to exe/finish-txt.tpl index 60825a2b3..a16135ef6 100644 --- a/exe/lt_finish.def +++ b/exe/finish-txt.tpl @@ -1,18 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define FINISH_STRING 4 - -string[FINISH_STRING] = { - str-name = finish; - explain = " -Complete the installation of libtool libraries.\n -The -s must actually be directories that contain -libtool libraries.\n -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= @@ -82,13 +67,3 @@ the `--dry-run' option if you just want to see what would be executed.\n"; echo "See any operating system documentation about shared libraries for" echo "more information, such as the ld(1) and ld.so(8) manual pages." echo "----------------------------------------------------------------------" -_END_FINISH_STRING_; -}; - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_finish.def ends here */ diff --git a/exe/lt_install.def b/exe/install-txt.tpl similarity index 95% rename from exe/lt_install.def rename to exe/install-txt.tpl index 5ee8946f7..f10d5a337 100644 --- a/exe/lt_install.def +++ b/exe/install-txt.tpl @@ -1,18 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define INSTALL_STRING 5 - -string[INSTALL_STRING] = { - str-name = install; - explain = " -Install executables or libraries.\n - is the installation command. -It should be either the `install' or `cp' program.\n --s are interpreted as arguments to that command -(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). @@ -454,13 +439,3 @@ It should be either the `install' or `cp' program.\n exec $SHELL $0 --finish$current_libdirs exit 1 fi -_END_INSTALL_STRING_; -}; - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_install.def ends here */ diff --git a/exe/lt_link.def b/exe/link-txt.tpl similarity index 97% rename from exe/lt_link.def rename to exe/link-txt.tpl index ecd05b233..15210827b 100644 --- a/exe/lt_link.def +++ b/exe/link-txt.tpl @@ -1,52 +1,3 @@ - -AutoGen Definitions ltmain.tpl; - -#define LINK_STRING 6 - -string[LINK_STRING] = { - str-name = link; - explain = " -Link object files or libraries together to form another library, -or to create an executable program.\n - is a command using the C compiler that you would use to create -a program from several object files.\n -The following -s are treated specially:\n - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE `-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0]\n -All other options (arguments beginning with `-') are ignored.\n -Every other argument is treated as a filename. Files ending in `.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files.\n -If the OUTPUT-FILE ends in `.la', then a libtool library is created, -only library objects (`.lo' files) may be specified, and `-rpath' is -required, except when creating a convenience library.\n -If OUTPUT-FILE ends in `.a' or `.lib', then a standard library is created -using `ar' and `ranlib', or on Windows using `lib'.\n -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*) @@ -3635,13 +3586,3 @@ relink_command=\"$relink_command\"" $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? ;; esac -_END_LINK_STRING_; -}; - -/* - * Local Variables: - * mode:shell-script - * sh-indentation:2 - * End: - * - * lt_link.def ends here */ diff --git a/exe/ltmain.mk b/exe/ltmain.mk index 0f444bdfe..f434d7bab 100644 --- a/exe/ltmain.mk +++ b/exe/ltmain.mk @@ -1,8 +1,10 @@ -SRC = ltmain.c ltopts.c ltstr.c ltcompile.c ltexe.c ltversion.c -OBJ = $(SRC:.c=.o) -GENED = ltmain.in ltstr.[ch] ltopts.[ch] -CC = cc -I/usr/local/include -g +SRC = ltmain.c ltopts.c ltstr.c ltcompile.c ltexe.c ltversion.c +OBJ = $(SRC:.c=.o) +GENED = ltmain.in ltstr.[ch] ltopts.[ch] +CC = cc -I/usr/local/include -g +TXTTPL = base-txt.tpl clean-txt.tpl compile-txt.tpl execute-txt.tpl \ + finish-txt.tpl install-txt.tpl link-txt.tpl default : ltmain.in @@ -15,28 +17,22 @@ ltmain : $(OBJ) clean : rm -f lt*.o ltmain $(GENED) *~ -STRDEFS = ltstr.def \ - lt_base.def lt_clean.def lt_compile.def lt_execute.def \ - lt_finish.def lt_install.def lt_link.def - -ltmain.in : $(STRDEFS) ltmain.tpl ltmacros.tpl +ltmain.in : $(TXTTPL) ltstr.def autogen -T ltmain.tpl -l ltmacros.tpl ltstr.def +ltstr.c : ltstr.def ltstr.tpl ltmacros.tpl + autogen -T ltstr.tpl -l ltmacros.tpl ltstr.def + +ltstr.h : ltstr.c + @-: + ltopts.c : ltopts.def autogen ltopts.def +ltopts.h : ltopts.h + @-: + ltopts.o : ltopts.c $(CC) -c -o ltopts.o -I/usr/local/include ltopts.c -ltstr.c : $(STRDEFS) ltstr.tpl ltmacros.tpl - autogen -T ltstr.tpl -l ltmacros.tpl ltstr.def - gen : ltmain.in ltstr.c ltopts.c - -zip : - @ [ -f ltmain ] && mv -f ltmain ltmain.sav ; \ - mkdir ltmain ; \ - cp -fp *.def *.tpl ltmain.c ltmain.mk ltmain/ - tar cvf - ltmain | gzip --best > ltmain.tgz - @ rm -rf ltmain ; \ - if [ -f ltmain.sav ] ; then mv -f ltmain.sav ltmain ; fi diff --git a/exe/ltmain.tpl b/exe/ltmain.tpl index c99c3c943..334f0618b 100644 --- a/exe/ltmain.tpl +++ b/exe/ltmain.tpl @@ -65,11 +65,7 @@ TIMESTAMP="@TIMESTAMP@" default_mode= help="Try \`$progname --help' for more information." -[= (out-push-new ".lt.tmp") =][= - string[BASE_STRING].text =][= - (out-pop) =][= - INCLUDE ".lt.tmp" =][= - `rm -f .lt.tmp` =] +[= INCLUDE "base-txt.tpl" =] if test "$LTCONFIG_VERSION" != "$VERSION"; then echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 @@ -289,10 +285,7 @@ if test -z "$show_help"; then # libtool compile mode compile) modename="$modename: compile" -[= (out-push-new ".lt.tmp") =][= - string[COMPILE_STRING].text =][= - (out-pop) =][= - INCLUDE ".lt.tmp" =] +[= INCLUDE "compile-txt.tpl" =] exit 0 ;; @@ -300,10 +293,7 @@ if test -z "$show_help"; then # libtool link mode link | relink) modename="$modename: link" -[= (out-push-new ".lt.tmp") =][= - string[LINK_STRING].text =][= - (out-pop) =][= - INCLUDE ".lt.tmp" =] +[= INCLUDE "link-txt.tpl" =] exit 0 ;; @@ -311,10 +301,7 @@ if test -z "$show_help"; then install) modename="$modename: install" -[= (out-push-new ".lt.tmp") =][= - string[INSTALL_STRING].text =][= - (out-pop) =][= - INCLUDE ".lt.tmp" =] +[= INCLUDE "install-txt.tpl" =] exit 0 ;; @@ -322,10 +309,7 @@ if test -z "$show_help"; then # libtool finish mode finish) modename="$modename: finish" -[= (out-push-new ".lt.tmp") =][= - string[FINISH_STRING].text =][= - (out-pop) =][= - INCLUDE ".lt.tmp" =] +[= INCLUDE "finish-txt.tpl" =] exit 0 ;; @@ -337,20 +321,13 @@ if test -z "$show_help"; then 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" =] +[= INCLUDE "execute-txt.tpl" =] ;; # libtool clean and uninstall mode clean | uninstall) modename="$modename: $mode" -[= (out-push-new ".lt.tmp") =][= - string[CLEAN_STRING].text =][= - (out-pop) =][= - INCLUDE ".lt.tmp" =][= - `rm -f .lt.tmp` =] +[= INCLUDE "clean-txt.tpl" =] exit $exit_status ;; diff --git a/exe/ltstr.def b/exe/ltstr.def index 00ee61fb6..7a9b85d35 100644 --- a/exe/ltstr.def +++ b/exe/ltstr.def @@ -1,13 +1,141 @@ AutoGen Definitions ltmain.tpl; -#include lt_base.def -#include lt_clean.def -#include lt_compile.def -#include lt_execute.def -#include lt_finish.def -#include lt_install.def -#include lt_link.def +#define BASE_STRING 0 + +string[0] = { + str-name = base; +}; + +#define CLEAN_STRING 1 + +string[CLEAN_STRING] = { + str-name = clean; + explain = " + is the name of the program to use to delete files associated with +each FILE (typically `/bin/rm'). `-s' are options (such as `-f') +to be passed to . + +If one of the arguments specifies the removal of a libtool library, object +or program, all the files associated with it are deleted. Otherwise, only +the file itself is deleted using .\n"; +}; + +#define COMPILE_STRING 2 + +string[COMPILE_STRING] = { + str-name = compile; + call-proc = emitCompile; + + explain = " +Compile a source file into a libtool library object.\n +This mode accepts the following additional options:\n + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -prefer-pic try to building PIC objects only + -prefer-non-pic try to building non-PIC objects only + -static always build a `.o' file suitable for static linking\n + is a command to be used in creating a `standard' object file +from the source file in the list.\n +The output file name is determined by removing the directory component from +source file name in the list and then substituting the C source +code suffix `.c' with the library object suffix, `.lo'.\n"; +}; + +#define EXECUTE_STRING 3 + +string[EXECUTE_STRING] = { + str-name = execute; + call-proc = emitExecute; + + explain = " +Automatically set library path, then run a program.\n +This mode accepts the following additional options:\n + -dlopen FILE add the directory containing FILE to the library path\n +This mode sets the library path environment variable, +according to `-dlopen' flags.\n +If any of the are libtool executable wrappers, then they are +translated into their corresponding uninstalled binary, and any of their +required library directories are added to the library path.\n +Then, is executed, with `...' as arguments.\n"; +}; + +#define FINISH_STRING 4 + +string[FINISH_STRING] = { + str-name = finish; + explain = " +Complete the installation of libtool libraries.\n +The -s must actually be directories that contain +libtool libraries.\n +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] = { + str-name = install; + explain = " +Install executables or libraries.\n + is the installation command. +It should be either the `install' or `cp' program.\n +-s are interpreted as arguments to that command +(only BSD-compatible install options are recognized).\n"; +}; + +#define LINK_STRING 6 + +string[LINK_STRING] = { + str-name = link; + explain = " +Link object files or libraries together to form another library, +or to create an executable program.\n + is a command using the C compiler that you would use to create +a program from several object files.\n +The following -s are treated specially:\n + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE `-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0]\n +All other options (arguments beginning with `-') are ignored.\n +Every other argument is treated as a filename. Files ending in `.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files.\n +If the OUTPUT-FILE ends in `.la', then a libtool library is created, +only library objects (`.lo' files) may be specified, and `-rpath' is +required, except when creating a convenience library.\n +If OUTPUT-FILE ends in `.a' or `.lib', then a standard library is created +using `ar' and `ranlib', or on Windows using `lib'.\n +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] = { + str-name = uninstall; + use_explain = clean; + use_cmd = clean; +}; #define ECHO_STRING 8 diff --git a/exe/ltstr.tpl b/exe/ltstr.tpl index ea1554295..e0f48f6ea 100644 --- a/exe/ltstr.tpl +++ b/exe/ltstr.tpl @@ -55,6 +55,7 @@ ELSE not h suffix =] #include "[=(. hdr-name)=]" [= +(define tpl-name "") =][= FOR string @@ -64,27 +65,25 @@ FOR string */[= - IF (exist? "explain") + IF (exist? "explain") =] tSCC zExplain[=(string-capitalize! (get "str_name"))=][ [= (+ 1 (len "explain")) =] ] = [=(kr-string (get "explain"))=];[= + ENDIF =][= - IF (exist? "text") =] + IF (set! tpl-name (string-append (get "str_name") "-txt.tpl")) + (access? tpl-name R_OK) =][= -[= ENDIF =][= - ENDIF =][= + IF (exist? "explain") =] - IF (exist? "text") =] -tSCC z[= (string-capitalize! (get "str_name")) =]Cmd[] = -[= (out-push-new ".lt.tpl") =][= - text =][= +[= ENDIF =] +tSCC z[= (string-capitalize! (get "str_name")) =]Cmd[] =[= + (out-push-new ".lt.sh") =][= + INCLUDE (. tpl-name) =][= (out-pop) - (out-push-new ".lt.xxx") =][= - INCLUDE ".lt.tpl" =][= - (out-pop) - (kr-string (shell "cat .lt.xxx ; rm -f .lt.*")) =]; + (kr-string (shell "cat .lt.sh ; rm -f .lt.sh")) =]; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */[= ENDIF =][=