glib/build-dll
Tor Lillqvist c22cf34e92 glib.h New functions for conversion between UTF-8 and the encoding
2000-02-01  Tor Lillqvist  <tml@iki.fi>

* glib.h
* gstrfuncs.c (g_filename_to_utf8, g_filename_from_utf8): New
functions for conversion between UTF-8 and the encoding expected
by C runtime functions like open() and stat(), and returned by
readdir().

Implement them on Win32 where we use the system "ANSI" codepage,
which might be single-byte or double-byte. On Unix, just skip the
issue for now and provide dummy implementations that return a copy
of the argument.

* README.win32
* build-dll
* glib.def: Minor updates.
2000-02-02 23:39:32 +00:00

48 lines
1.5 KiB
Bash

#!/bin/bash
# Temporary hack until building dlls 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(.2) 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 -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 -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