X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ed165c67aa030f0a4cd1d8b359dfb9cfb382ebe0..89352653828ae50feab93f5e0fce628ea840927e:/src/os2/dllar.sh?ds=sidebyside diff --git a/src/os2/dllar.sh b/src/os2/dllar.sh index 8f49a04c41..2dd495b9b6 100644 --- a/src/os2/dllar.sh +++ b/src/os2/dllar.sh @@ -92,7 +92,8 @@ CleanUp() { # Print usage and exit script with rc=1. PrintHelp() { - echo 'Usage: dllar [-o[utput] output_file] [-i[mport] importlib_name]' + echo 'Usage: dllar.sh [-o[utput] output_file] [-i[mport] importlib_name]' + echo ' [-name-mangler-script script.sh]' echo ' [-d[escription] "dll descrption"] [-cc "CC"] [-f[lags] "CFLAGS"]' echo ' [-ord[inals]] -ex[clude] "symbol(s)"' echo ' [-libf[lags] "{INIT|TERM}{GLOBAL|INSTANCE}"] [-nocrt[dll]] [-nolxl[ite]]' @@ -106,6 +107,13 @@ PrintHelp() { echo ' This name is used as the import library name and may be longer and' echo ' more descriptive than the DLL name which has to follow the old ' echo ' 8.3 convention of FAT.' + echo '*> "script.sh may be given to override the output_file name by a' + echo ' different name. It is mainly useful if the regular make process' + echo ' of some package does not take into account OS/2 restriction of' + echo ' DLL name lengths. It takes the importlib name as input and is' + echo ' supposed to procude a shorter name as output. The script should' + echo ' expect to get importlib_name without extension and should produce' + echo ' a (max.) 8 letter name without extension.' echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)' echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)' echo ' These flags will be put at the start of GCC command line.' @@ -155,6 +163,7 @@ cmdLine=$* outFile="" outimpFile="" inputFiles="" +renameScript="" description="" CC=gcc.exe CFLAGS="-s -Zcrtdll" @@ -187,6 +196,10 @@ while [ $1 ]; do shift outimpFile=$1 ;; + -name-mangler-script) + shift + renameScript=$1 + ;; -d*) shift description=$1 @@ -369,19 +382,11 @@ arcFile="${outimpFile}.a" arcFile2="${outimpFile}.lib" #create $dllFile as something matching 8.3 restrictions, -dllFile="$outFile" -case $dllFile in -*wx_base_*) - dllFile=`echo $dllFile | sed 's/base_\(...\)/b\1/'` - ;; -*wx_*_*) - dllFile=`echo $dllFile | sed 's/_\(..\)[^_]*_\(..\)[^-]*-/\1\2/'` - ;; -*) - ;; -esac -dllFile="`echo $dllFile | sed 's/\.//' | sed 's/_//' | sed 's/-//'`" - +if [ -z $renameScript ] ; then + dllFile="$outFile" +else + dllFile=`$renameScript $outimpFile` +fi if [ $do_backup -ne 0 ] ; then if [ -f $arcFile ] ; then @@ -400,7 +405,9 @@ for file in $inputFiles ; do *!) ;; *) - doCommand "emxexp -u $file >> $tmpdefFile" + # we do not want to export weak symbols in general, so we filter + # those out using grep. + doCommand "emxexp -u $file >> $tmpdefFile || true" ;; esac done @@ -408,7 +415,7 @@ done # Create the def file. rm -f $defFile echo "LIBRARY `basnam $dllFile` $library_flags" >> $defFile -dllFile="$dllFile.dll" +dllFile="${dllFile}.dll" if [ ! -z $description ]; then echo "DESCRIPTION \"${description}\"" >> $defFile fi @@ -459,9 +466,19 @@ if [ $flag_USE_LXLITE -ne 0 ]; then if [ $EXPORT_BY_ORDINALS -ne 0 ]; then add_flags="-ynd" fi - doCommand "lxlite -cs -t: -mrn -mln $add_flags $dllFile" + doCommand "lxlite -cs -t: $add_flags `echo $dllFile | sed 's/\//\\\\/g'`" fi -doCommand "emxomf -s -l $arcFile" + +#New version of emxomf do no longer want the "-l" flag +case `emxomf` in +emxomf\ 0.6*) + omflibflag="" + ;; +*) + omflibflag=" -l" + ;; +esac +doCommand "emxomf -s$omflibflag $arcFile" # Successful exit. CleanUp 1