#!/bin/sh rm -f *.o *.dll temp.a static.a lib/*.o lib/*.a lib/*.dll cp ../libgphobos.a . #Explode Static library ar x libgphobos.a #Grab Duplicate names ar xN 1 libgphobos.a zlib.o mv zlib.o zlib_d.o ar xN 2 libgphobos.a zlib.o #Grab Duplicate names ar xN 1 libgphobos.a crc32.o mv crc32.o crc_32_d.o ar xN 2 libgphobos.a crc32.o #Grab Duplicate names ar xN 1 libgphobos.a syserror.o mv syserror.o syserror_d.o ar xN 2 libgphobos.a syserror.o mkdir -p lib #Remove static only items mv cmain.o lib/_cmain.o mv dgccmain2.o lib/_dgccmain2.o rm rundmain.o # W/o this a error occurs when loading dlls mv moduleinit.o lib/_moduleinit.o # this may cause some errors. Necessary so dynamically loaded objects can init themselves w/o doin everyone else mv object.o lib/_object.o # this may cause some errors. Causes dll load acces violation if i dont #Build Temp lib ar r static.a 'lib/*.o' #Build DLL gcc -shared -Wl,--export-all-symbols -o gphobos.dll -Wl,--out-implib=temp.a *.o -lstdc++ -lws2_32 -luuid static.a cp gphobos.dll /mingw/bin cd lib #Extract DLL Library so we only need one phobos library ar x ../temp.a ar r libgphobos.a '*.o' cd .. cp lib/libgphobos.a ../lib