From 57cce7a409724a261c6dae6c979496a630167742 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Dec 2009 16:55:37 -0700 Subject: mklib: put usage info into usage() function --- bin/mklib | 60 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 27 deletions(-) (limited to 'bin') diff --git a/bin/mklib b/bin/mklib index 486f27fb49..fb160a2aae 100755 --- a/bin/mklib +++ b/bin/mklib @@ -69,6 +69,36 @@ contents_of_archives() { } +# Print usage info. +usage() { + echo 'Usage: mklib [options] objects' + echo 'Create a shared library from object files.' + echo ' -o LIBRARY specifies the name of the resulting library, without' + echo ' the leading "lib" or any suffix.' + echo ' (eg: "-o GL" might result in "libGL.so" being made)' + echo ' -major N specifies major version number (default is 1)' + echo ' -minor N specifies minor version number (default is 0)' + echo ' -patch N specifies patch version number (default is 0)' + echo ' -lLIBRARY specifies a dependency on LIBRARY' + echo ' -LDIR search in DIR for library dependencies at build time' + echo ' -RDIR search in DIR for library dependencies at run time' + echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)' + echo ' Not observed on all systems at this time.' + echo ' -ldflags OPT specify any additional linker flags in OPT' + echo ' -cplusplus link with C++ runtime' + echo ' -static make a static library (default is dynamic/shared)' + echo ' -dlopen make a shared library suitable for dynamic loading' + echo ' -install DIR put resulting library file(s) in DIR' + echo ' -arch ARCH override using `uname` to determine host system' + echo ' -archopt OPT specify an extra achitecture-specific option OPT' + echo ' -altopts OPTS alternate options to override all others' + echo " -noprefix don't prefix library name with 'lib' nor add any suffix" + echo ' -exports FILE only export the symbols listed in FILE' + echo ' -id NAME Sets the id of the dylib (Darwin)' + echo ' -h, --help display this information and exit' +} + + # # Option defaults # @@ -96,31 +126,7 @@ while true do case $1 in '-h' | '--help') - echo 'Usage: mklib [options] objects' - echo 'Create a shared library from object files.' - echo ' -o LIBRARY specifies the name of the resulting library, without' - echo ' the leading "lib" or any suffix.' - echo ' (eg: "-o GL" might result in "libGL.so" being made)' - echo ' -major N specifies major version number (default is 1)' - echo ' -minor N specifies minor version number (default is 0)' - echo ' -patch N specifies patch version number (default is 0)' - echo ' -lLIBRARY specifies a dependency on LIBRARY' - echo ' -LDIR search in DIR for library dependencies at build time' - echo ' -RDIR search in DIR for library dependencies at run time' - echo ' -linker L explicity specify the linker program to use (eg: gcc, g++)' - echo ' Not observed on all systems at this time.' - echo ' -ldflags OPT specify any additional linker flags in OPT' - echo ' -cplusplus link with C++ runtime' - echo ' -static make a static library (default is dynamic/shared)' - echo ' -dlopen make a shared library suitable for dynamic loading' - echo ' -install DIR put resulting library file(s) in DIR' - echo ' -arch ARCH override using `uname` to determine host system' - echo ' -archopt OPT specify an extra achitecture-specific option OPT' - echo ' -altopts OPTS alternate options to override all others' - echo " -noprefix don't prefix library name with 'lib' nor add any suffix" - echo ' -exports FILE only export the symbols listed in FILE' - echo ' -id NAME Sets the id of the dylib (Darwin)' - echo ' -h, --help display this information and exit' + usage exit 1 ;; '-o') @@ -241,11 +247,11 @@ fi # Error checking # if [ "x${LIBNAME}" = "x" ] ; then - echo "mklib: Error: no library name specified" + echo "mklib: Error: no library name specified (-h for help)" exit 1 fi if [ "x${OBJECTS}" = "x" ] ; then - echo "mklib: Error: no object files specified" + echo "mklib: Error: no object files specified (-h for help)" exit 1 fi -- cgit v1.2.3