mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 06:56:14 +01:00
1146c6fbb3
* gstrfuncs.c (g_strccpy, g_strecpy): New functions. * glib.h: Declare and document them. Define the deprecated g_strescape as a macro that calls g_strecpy. * tests/strfunc-test.c (main): Test them. * makefile.{cygwin,msc}.in * tests/makefile.{cygwin,msc}.in: Remove gstack and its test program. * glib.def: Additions and removals. * README.win32: Improve gcc build instructions. * build-dll: Also build import library for MSVC.
48 lines
1.5 KiB
Bash
48 lines
1.5 KiB
Bash
#!/bin/bash
|
|
|
|
# Temporary hack until building dlls or executables with exported
|
|
# entry points is easier with gcc -mno-cygwin ("mingw32").
|
|
|
|
# This is usable with cygwin b20.1 and egcs-2.91.66 19990314
|
|
# (egcs-1.1.2 release) or gcc-2.95 as distributed by Mumit Khan. For
|
|
# other combinations, no idea.
|
|
|
|
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
|
|
*.[ao]) 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
|
|
|
|
# Finally, also build import libraries for the Microsoft linker. You
|
|
# will either need to have some decent version of MSVC, or get lib.exe
|
|
# (and link.exe) from the (freely downloadable) Microsoft Platform SDK.
|
|
|
|
if type -p lib.exe && [ -n "$def" -a "$def" != '-' ]; then
|
|
lib -name:$libname.dll -def:$def -out:$libname.lib
|
|
fi
|
|
|
|
rm $library.base $library.exp 2>/dev/null
|