diff options
Diffstat (limited to 'w32-dll/build-dll')
-rwxr-xr-x | w32-dll/build-dll | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/w32-dll/build-dll b/w32-dll/build-dll new file mode 100755 index 00000000..11618d7e --- /dev/null +++ b/w32-dll/build-dll @@ -0,0 +1,58 @@ +#!/bin/sh +# Run this to generate the libgcrypt W32 DLL +# +# Copyright (C) 2001, 2002 Free Software Foundation, Inc. +# +# This file is free software; as a special exception the author gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +AS=i586-mingw32msvc-as +OBJS= + +grep "#define HAVE_DOSISH_SYSTEM" ../config.h +if [ $? = 1 ]; then + exit +fi + +for i in $(ls ../gpgme/*.o); do + OBJS="$OBJS $i" +done +OBJS="$OBJS /home/twoaday/w32root/lib/libgpg-error.a" +OBJS="$OBJS ../gpgme/stpcpy.o ../gpgme/vasprintf.o" + +echo 'running dlltool the first time' >&2 +mingw32 dlltool --nodelete \ + --as $AS \ + --def gpgme.def \ + --output-exp gpgme.exp \ + --output-lib gpgme.imp \ + --dllname gpgme.dll $OBJS +echo 'doing dummy link to create the base file' >&2 +mingw32 gcc -mdll -Wl,--base-file -Wl,gpgme.base \ + -o gpgme.dll gpgme.exp $OBJS +echo 'running dlltool the second time' >&2 +mingw32 dlltool --nodelete \ + --as $AS \ + --def gpgme.def \ + --output-exp gpgme.exp \ + --output-lib gpgme.imp \ + --base-file gpgme.base \ + --dllname gpgme.dll $OBJS + +echo 'doing final link' >&2 +mingw32 gcc -mdll -o gpgme.dll gpgme.exp $OBJS +mingw32 strip gpgme.dll + +mingw32 dlltool --def gpgme.def \ + --as $AS \ + --dllname gpgme.dll \ + --output-lib gpgme.lib + +echo 'clean up' +rm -f dh.o dh.s dt.o dt.s +rm -f gpgme.base gpgme.exp gpgme.imp tgpgme.exp
\ No newline at end of file |