diff -druN glpk-4.55.orig/configure.ac glpk-4.55.new/configure.ac --- glpk-4.55.orig/configure.ac 2014-08-21 23:00:00.000000000 -0700 +++ glpk-4.55.new/configure.ac 2014-11-12 07:37:15.595164337 -0800 @@ -54,7 +54,7 @@ dnl Check for programs AC_PROG_CC AC_PROG_INSTALL -AC_PROG_LIBTOOL +LT_INIT([win32-dll]) dnl Check for math library AC_CHECK_LIB([m], [exp]) @@ -98,6 +98,43 @@ AC_MSG_RESULT([no]) fi +dnl Configs for Windows DLLs. +dnl libtool requires "-no-undefined" for win32 dll +AC_SUBST(LIBGLPK_LDFLAGS) +case $host_os in + cygwin* | mingw*) + if test "$enable_shared" = yes; then + LIBGLPK_LDFLAGS="$LIBGLPK_LDFLAGS -no-undefined" + if test "$with_gmp" = yes; then + AC_MSG_CHECKING(for DLL/static GMP) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include "gmp.h" +#if !__GMP_LIBGMP_DLL +# error "Dead man" +error +#endif + ]], [[]])],[AC_MSG_RESULT(DLL)],[ + AC_MSG_RESULT(static) + AC_MSG_ERROR([gmp.h isn't a DLL: use --enable-static --disable-shared]) ]) + fi + fi + if test "$enable_static" = yes; then + if test "$with_gmp" = yes; then + AC_MSG_CHECKING(for DLL/static GMP) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include "gmp.h" +#if __GMP_LIBGMP_DLL +# error "Dead man" +error +#endif + ]], [[]])],[AC_MSG_RESULT(static)],[ + AC_MSG_RESULT(DLL) + AC_MSG_ERROR([gmp.h is a DLL: use --disable-static --enable-shared]) ]) + fi + fi + ;; +esac + case $host_os in darwin* | macosx*) LIBIODBC="libiodbc.dylib" diff -druN glpk-4.55.orig/src/Makefile.am glpk-4.55.new/src/Makefile.am --- glpk-4.55.orig/src/Makefile.am 2014-08-21 23:00:00.000000000 -0700 +++ glpk-4.55.new/src/Makefile.am 2014-11-12 07:35:06.064883533 -0800 @@ -18,7 +18,8 @@ libglpk_la_LDFLAGS = \ -version-info 37:2:1 \ --export-symbols-regex '^glp_*' +-export-symbols-regex '^glp_*' \ +$(LIBGLPK_LDFLAGS) libglpk_la_SOURCES = \ avl.c \