mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
d6c6eb3d92
* README.win32: More editing. * build-dll: Use gcc, not ld to link. * glib.h: On native Win32 use _unlink(). * gscanner.c: Use corrent NATIVE_WIN32 feature test macro, not _MSC_VER. * gstring.c: Include <io.h> on Win32 for _read prototype. * gutils.c: Remove old IO channel code (was in #if 0). * makefile.cygwin: Don't need to link with kernel32 and msvcrt explicitly, they are included anyway.
37 lines
1.0 KiB
Bash
37 lines
1.0 KiB
Bash
#!/bin/sh
|
|
|
|
# Temporary hack until building dlls or executables with exported
|
|
# entry points is easier with gcc -mno-cygwin.
|
|
|
|
#LD=ld
|
|
GCC=gcc
|
|
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
|
|
|
|
$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
|
|
$DLLTOOL --as=$AS --dllname $dllfile $defswitch --output-lib lib$libname.a $objs
|
|
|
|
rm $library.base $library.exp 2>/dev/null
|