Build import library for mingw
authorTimothy Gu <timothygu99@gmail.com>
Sat, 17 May 2014 23:21:21 +0000 (16:21 -0700)
committerTimothy Gu <timothygu99@gmail.com>
Fri, 23 May 2014 01:06:26 +0000 (18:06 -0700)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Makefile.install
exports/Makefile
exports/dllinit.c

index 6fcbcc3..d40bdd4 100644 (file)
@@ -80,6 +80,7 @@ ifeq ($(OSNAME), Darwin)
 endif
 ifeq ($(OSNAME), WINNT)
        @-cp $(LIBDLLNAME) $(OPENBLAS_BINARY_DIR)
+       @-cp $(LIBDLLNAME).a $(OPENBLAS_LIBRARY_DIR)
 endif
 ifeq ($(OSNAME), CYGWIN_NT)
        @-cp $(LIBDLLNAME) $(OPENBLAS_BINARY_DIR)
index e09b3c3..ce28ab5 100644 (file)
@@ -83,15 +83,9 @@ dll  : ../$(LIBDLLNAME)
 # For more details see: https://github.com/xianyi/OpenBLAS/issues/127.
 ../$(LIBDLLNAME) : ../$(LIBNAME) libopenblas.def dllinit.$(SUFFIX)
        $(RANLIB) ../$(LIBNAME)
-ifeq ($(BINARY32), 1)
-       $(DLLWRAP) -o ../$(LIBDLLNAME) --def libopenblas.def \
-       --entry _dllinit@12 -s dllinit.$(SUFFIX) --dllname $(@F) ../$(LIBNAME) $(EXTRALIB)
-       -lib /machine:i386 /def:libopenblas.def
-else
-       $(DLLWRAP) -o ../$(LIBDLLNAME) --def libopenblas.def \
-       --entry $(FU)dllinit    -s dllinit.$(SUFFIX) --dllname $(@F) ../$(LIBNAME) $(EXTRALIB)
-       -lib /machine:X64 /def:libopenblas.def 
-endif
+       $(CC) $(CFLAGS) $(LDFLAGS) libopenblas.def dllinit.$(SUFFIX) \
+       -shared -o ../$(LIBDLLNAME) -Wl,--out-implib,../$(LIBDLLNAME).a \
+       -Wl,--whole-archive ../$(LIBNAME) -Wl,--no-whole-archive $(FEXTRALIB)
 
 libopenblas.def : gensymbol
        perl ./gensymbol win2k    $(ARCH) dummy $(EXPRECISION) $(NO_CBLAS) $(NO_LAPACK) $(NO_LAPACKE) $(NEED2UNDERSCORES) $(ONLY_CBLAS) > $(@F)
index 54ec1c3..0f25824 100644 (file)
@@ -41,7 +41,7 @@
 void gotoblas_init(void);
 void gotoblas_quit(void);
 
-BOOL APIENTRY dllinit(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
+BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
 
   if (reason == DLL_PROCESS_ATTACH) {
     gotoblas_init();