Newest version of script(s) for creating DLLs - now divided in two,
main script takes additional argument for script generating DLL name, new script generates DLL names from (too long) library names. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30207 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -92,7 +92,8 @@ CleanUp() {
|
|||||||
|
|
||||||
# Print usage and exit script with rc=1.
|
# Print usage and exit script with rc=1.
|
||||||
PrintHelp() {
|
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 ' [-d[escription] "dll descrption"] [-cc "CC"] [-f[lags] "CFLAGS"]'
|
||||||
echo ' [-ord[inals]] -ex[clude] "symbol(s)"'
|
echo ' [-ord[inals]] -ex[clude] "symbol(s)"'
|
||||||
echo ' [-libf[lags] "{INIT|TERM}{GLOBAL|INSTANCE}"] [-nocrt[dll]] [-nolxl[ite]]'
|
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 ' 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 ' more descriptive than the DLL name which has to follow the old '
|
||||||
echo ' 8.3 convention of FAT.'
|
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 '*> "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 '*> "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.'
|
echo ' These flags will be put at the start of GCC command line.'
|
||||||
@@ -155,6 +163,7 @@ cmdLine=$*
|
|||||||
outFile=""
|
outFile=""
|
||||||
outimpFile=""
|
outimpFile=""
|
||||||
inputFiles=""
|
inputFiles=""
|
||||||
|
renameScript=""
|
||||||
description=""
|
description=""
|
||||||
CC=gcc.exe
|
CC=gcc.exe
|
||||||
CFLAGS="-s -Zcrtdll"
|
CFLAGS="-s -Zcrtdll"
|
||||||
@@ -187,6 +196,10 @@ while [ $1 ]; do
|
|||||||
shift
|
shift
|
||||||
outimpFile=$1
|
outimpFile=$1
|
||||||
;;
|
;;
|
||||||
|
-name-mangler-script)
|
||||||
|
shift
|
||||||
|
renameScript=$1
|
||||||
|
;;
|
||||||
-d*)
|
-d*)
|
||||||
shift
|
shift
|
||||||
description=$1
|
description=$1
|
||||||
@@ -369,19 +382,13 @@ arcFile="${outimpFile}.a"
|
|||||||
arcFile2="${outimpFile}.lib"
|
arcFile2="${outimpFile}.lib"
|
||||||
|
|
||||||
#create $dllFile as something matching 8.3 restrictions,
|
#create $dllFile as something matching 8.3 restrictions,
|
||||||
dllFile="$outFile"
|
if [ -z $renameScript ] ; then
|
||||||
case $dllFile in
|
dllFile="$outFile"
|
||||||
*wx_base_*)
|
echo "using outFile as dllFile ($outFile)".
|
||||||
dllFile=`echo $dllFile | sed 's/base_\(...\)/b\1/'`
|
else
|
||||||
;;
|
dllFile=`$renameScript $outimpFile`
|
||||||
*wx_*_*)
|
echo "modified $outimpFile to $dllFile"
|
||||||
dllFile=`echo $dllFile | sed 's/_\(..\)[^_]*_\(..\)[^-]*-/\1\2/'`
|
fi
|
||||||
;;
|
|
||||||
*)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
dllFile="`echo $dllFile | sed 's/\.//' | sed 's/_//' | sed 's/-//'`"
|
|
||||||
|
|
||||||
|
|
||||||
if [ $do_backup -ne 0 ] ; then
|
if [ $do_backup -ne 0 ] ; then
|
||||||
if [ -f $arcFile ] ; then
|
if [ -f $arcFile ] ; then
|
||||||
@@ -408,7 +415,8 @@ done
|
|||||||
# Create the def file.
|
# Create the def file.
|
||||||
rm -f $defFile
|
rm -f $defFile
|
||||||
echo "LIBRARY `basnam $dllFile` $library_flags" >> $defFile
|
echo "LIBRARY `basnam $dllFile` $library_flags" >> $defFile
|
||||||
dllFile="$dllFile.dll"
|
dllFile="${dllFile}.dll"
|
||||||
|
echo "dllFile now $dllFile";
|
||||||
if [ ! -z $description ]; then
|
if [ ! -z $description ]; then
|
||||||
echo "DESCRIPTION \"${description}\"" >> $defFile
|
echo "DESCRIPTION \"${description}\"" >> $defFile
|
||||||
fi
|
fi
|
||||||
|
21
src/os2/dllnames.sh
Normal file
21
src/os2/dllnames.sh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# dllnames - a tool to form short DLL names for wxWindows
|
||||||
|
#
|
||||||
|
# This script will accept an import library name and create
|
||||||
|
# a short(er) DLL name from it.
|
||||||
|
|
||||||
|
dllFile="$1"
|
||||||
|
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/-//'`"
|
||||||
|
echo $dllFile
|
||||||
|
exit 0
|
Reference in New Issue
Block a user