1999-04-24 15:52:51 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
1999-04-25 22:52:42 +02:00
|
|
|
# Temporary hack until building dlls or executables with exported
|
|
|
|
# entry points is easier with gcc -mno-cygwin.
|
1999-04-24 15:52:51 +02:00
|
|
|
|
1999-04-25 22:52:42 +02:00
|
|
|
#LD=ld
|
|
|
|
GCC=gcc
|
1999-04-24 15:52:51 +02:00
|
|
|
DLLTOOL=dlltool
|
|
|
|
AS=as
|
|
|
|
|
|
|
|
library=$1; shift
|
|
|
|
version=$1; shift;
|
|
|
|
def=$1; shift
|
|
|
|
ldargs="$*"
|
|
|
|
|
|
|
|
defswitch=""
|
|
|
|
[ -n "$def" -a "$def" != '-' ] && defswitch="--def $def"
|
|
|
|
|
|
|
|
libname=$library
|
|
|
|
[ $version != '-' ] && libname=$library-$version
|
|
|
|
dllfile=$libname.dll
|
|
|
|
|
|
|
|
for F in $ldargs; do
|
|
|
|
case $F in
|
|
|
|
*.o) objs="$objs $F";;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
1999-04-25 22:52:42 +02:00
|
|
|
$GCC -s -mdll -mno-cygwin -Wl,--base-file,$library.base -o $dllfile $ldargs
|
|
|
|
$DLLTOOL --as=$AS --dllname $dllfile $defswitch --base-file $library.base --output-exp $library.exp $objs &&
|
|
|
|
$GCC -s -mdll -mno-cygwin -Wl,--base-file,$library.base,$library.exp -o $dllfile $ldargs
|
|
|
|
$DLLTOOL --as=$AS --dllname $dllfile $defswitch --base-file $library.base --output-exp $library.exp $objs &&
|
|
|
|
$GCC -mdll -mno-cygwin -Wl,$library.exp -o $dllfile $ldargs
|
1999-04-24 15:52:51 +02:00
|
|
|
$DLLTOOL --as=$AS --dllname $dllfile $defswitch --output-lib lib$libname.a $objs
|
1999-04-25 22:52:42 +02:00
|
|
|
|
|
|
|
rm $library.base $library.exp 2>/dev/null
|