#!/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=`mingw32 --get-path as` OBJS= grep "#define HAVE_DOSISH_SYSTEM" ../config.h if [ $? = 1 ]; then exit fi for i in $(ls ../cipher/*.o); do OBJS="$OBJS $i" done for i in $(ls ../mpi/*.o); do OBJS="$OBJS $i" done for i in $(ls ../src/*.o); do OBJS="$OBJS $i" done # add asm code which is postfixed with .lo OBJS="$OBJS ../mpi/mpih-sub1.lo ../mpi/mpih-add1.lo ../mpi/mpih-lshift.lo" OBJS="$OBJS ../mpi/mpih-mul2.lo ../mpi/mpih-mul1.lo ../mpi/mpih-rshift.lo" OBJS="$OBJS ../mpi/mpih-mul3.lo" echo 'running dlltool the first time' >&2 mingw32 dlltool --nodelete \ --as $AS \ --def libgcrypt.def \ --output-exp libgcrypt.exp \ --output-lib libgcrypt.imp \ --dllname libgcrypt.dll $OBJS echo 'doing dummy link to create the base file' >&2 mingw32 gcc -mdll -Wl,--base-file -Wl,libgcrypt.base \ -o libgcrypt.dll libgcrypt.exp $OBJS echo 'running dlltool the second time' >&2 mingw32 dlltool --nodelete \ --as $AS \ --def libgcrypt.def \ --output-exp libgcrypt.exp \ --output-lib libgcrypt.imp \ --base-file libgcrypt.base \ --dllname libgcrypt.dll $OBJS echo 'doing final link' >&2 mingw32 gcc -mdll -o libgcrypt.dll libgcrypt.exp $OBJS mingw32 strip libgcrypt.dll mingw32 dlltool --def libgcrypt.def \ --as $AS \ --dllname libgcrypt.dll \ --output-lib libgcrypt.lib echo 'clean up' rm -f dh.o dh.s dt.o dt.s rm -f libgcrypt.base libgcrypt.exp libgcrypt.imp tlibgcrypt.exp