X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2d35020a8dd1a0908f4e76af323cc0d413d6b8c3..e1983ab58804a0e32ab2d832ded0349af1cc0476:/src/os2/dllar.sh?ds=sidebyside diff --git a/src/os2/dllar.sh b/src/os2/dllar.sh index 8ed5b4fb6b..0d036cf1bb 100644 --- a/src/os2/dllar.sh +++ b/src/os2/dllar.sh @@ -86,7 +86,7 @@ CleanUp() { # Kill result in case of failure as there is just to many stupid make/nmake # things out there which doesn't do this. if [ $# -eq 0 ]; then - rm -f "${outFile}.a" "${outFile}.def" "${outFile}.dll" + rm -f $arcFile $arcFile2 $defFile $dllFile fi } @@ -165,6 +165,7 @@ case $curDirS in esac # Parse commandline libsToLink=0 +omfLinking=0 while [ $1 ]; do case $1 in -ord*) @@ -203,16 +204,27 @@ while [ $1 ]; do -nolxl*) flag_USE_LXLITE=0 ;; - -* | /* | *.dll) + -* | /*) case $1 in -L* | -l*) libsToLink=1 ;; + -Zomf) + omfLinking=1 + ;; *) ;; esac EXTRA_CFLAGS=${EXTRA_CFLAGS}" "$1 ;; + *.dll) + EXTRA_CFLAGS="${EXTRA_CFLAGS} `basnam $1 .dll`" + if [ $omfLinking -eq 1 ]; then + EXTRA_CFLAGS="${EXTRA_CFLAGS}.lib" + else + EXTRA_CFLAGS="${EXTRA_CFLAGS}.a" + fi + ;; *) found=0; if [ $libsToLink -ne 0 ]; then @@ -253,6 +265,7 @@ for file in $inputFiles ; do *.lib) suffix=".lib" AR="emxomfar" + EXTRA_CFLAGS="$EXTRA_CFLAGS -Zomf" ;; *) ;; @@ -269,12 +282,12 @@ for file in $inputFiles ; do doCommand "cd $dirname; $AR x ../$file" cd $curDir found=0; - for subfile in $dirname/*.o ; do + for subfile in $dirname/*.o* ; do if [ -f $subfile ]; then found=1 if [ -s $subfile ]; then # FIXME: This should be: is file size > 32 byte, _not_ > 0! - newInputFiles="$newInputFiles $subname" + newInputFiles="$newInputFiles $subfile" fi fi done @@ -327,11 +340,31 @@ case $outFile in ;; esac defFile="${outFile}.def" -dllFile="${outFile}.dll" arcFile="${outFile}.a" +arcFile2="${outFile}.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 [ $do_backup -ne 0 -a -f $arcFile ] ; then - doCommand "mv $arcFile ${outFile}_s.a" + +if [ $do_backup -ne 0 ] ; then + if [ -f $arcFile ] ; then + doCommand "mv $arcFile ${outFile}_s.a" + fi + if [ -f $arcFile2 ] ; then + doCommand "mv $arcFile2 ${outFile}_s.lib" + fi fi # Extract public symbols from all the object files. @@ -349,8 +382,8 @@ done # Create the def file. rm -f $defFile -libName=`basnam $outFile` -echo "LIBRARY `echo $libName | sed 's/\./_/'` $library_flags" >> $defFile +echo "LIBRARY `basnam $dllFile` $library_flags" >> $defFile +dllFile="$dllFile.dll" if [ -n $description ]; then echo "DESCRIPTION \"${description}\"" >> $defFile fi @@ -393,6 +426,7 @@ for file in $inputFiles ; do esac done doCommand "$CC $CFLAGS -Zdll -o $dllFile $defFile $gccCmdl $EXTRA_CFLAGS" +touch "${outFile}.dll" doCommand "emximp -o $arcFile $defFile" if [ $flag_USE_LXLITE -ne 0 ]; then @@ -402,6 +436,7 @@ if [ $flag_USE_LXLITE -ne 0 ]; then fi doCommand "lxlite -cs -t: -mrn -mln $add_flags $dllFile" fi +doCommand "emxomf -s -l $arcFile" # Successful exit. CleanUp 1