Haha,

It appears my patches were completely broken anyway with a broken
if/else logic and a typo in an autotool var.
This is now fixed and confirmed to correctly work.
In case anyone cares, patches are attached here.

Best,

2014-11-05 10:17 GMT+01:00 Jean-Pierre Flori <[email protected]>:
> 2014-11-04 17:30 GMT+01:00 Marco Atzeri <[email protected]>:
>> On 11/4/2014 5:11 PM, Jean-Pierre Flori wrote:
>>>
>>> Hey,
>>>
>>> I agree, but they may also end up being passed to the linker.
>>
>>
>> Not that I am aware of. Libtool is correctly calling the linker.
>>
> Sure, but some evil software mix libtool with direct calls to the
> compiler and linker.
>
>>> And some of them choke when given flags they don't recognize.
>>> IIRC I had this kind of issues with packages using gcc to link files.
>>>
>>> In fact, I just found the following of yours :)
>>> http://cygwin.com/ml/cygwin/2013-07/msg00414.html
>>
>>
>> It is the reason why in the patch that portion is at the end of the
>> configure.ac otherwise it will be used by autoconf tests
>>
> And that's the reason why using lib*_la_LDFLAGS can help.
> Of course it's not generic, so must be customized for each package and
> therefore requires more work.
> So it perfectly makes sense for someone maintaining a lot of cygwin packages.
> In case of one particular upstream project, the other solution can be safer.
> Please don't understand I say your solution is wrong, both have pros
> and cons, that's all.
>
> And as I said, as long as something gets merged into GLPK, I'll be happy.
>
> Best,
>
> --
> Jean-Pierre Flori



-- 
Jean-Pierre Flori
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:44:48.656143563 -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/configure glpk-4.55.new/configure
--- glpk-4.55.orig/configure	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/configure	2014-11-12 07:45:13.146196370 -0800
@@ -636,6 +636,7 @@
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+LIBGLPK_LDFLAGS
 CPP
 OTOOL64
 OTOOL
@@ -646,8 +647,6 @@
 RANLIB
 ac_ct_AR
 AR
-DLLTOOL
-OBJDUMP
 LN_S
 NM
 ac_ct_DUMPBIN
@@ -666,6 +665,9 @@
 build_cpu
 build
 LIBTOOL
+OBJDUMP
+DLLTOOL
+AS
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -3773,7 +3775,7 @@
 
 
 macro_version='2.4'
-macro_revision='1.3294'
+macro_revision='1.3293'
 
 
 
@@ -4657,7 +4659,7 @@
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
@@ -4961,9 +4963,6 @@
 
 
 
-
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
 $as_echo_n "checking how to recognize dependent libraries... " >&6; }
 if ${lt_cv_deplibs_check_method+:} false; then :
@@ -5308,9 +5307,6 @@
 
 
 
-
-
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
 $as_echo_n "checking how to associate runtime and link libraries... " >&6; }
 if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
@@ -7314,13 +7310,311 @@
 
 
 # Set options
+enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AS="as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AS" = x; then
+    AS="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
+  fi
+else
+  AS="$ac_cv_prog_AS"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+  ;;
+esac
+
+test -z "$AS" && AS=as
+
+
+
+
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
 
 
 
-        enable_dlopen=no
 
 
-  enable_win32_dll=no
+
+        enable_dlopen=no
+
 
 
             # Check whether --enable-shared was given.
@@ -11408,6 +11702,79 @@
 $as_echo "no" >&6; }
 fi
 
+
+case $host_os in
+  cygwin* | mingw*)
+   if test "$enable_shared" = yes; then
+     LIBGLPK_LDFLAGS="$LIBGLPK_LDFLAGS -no-undefined"
+     if test "$with_gmp" = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLL/static GMP" >&5
+$as_echo_n "checking for DLL/static GMP... " >&6; }
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include "gmp.h"
+#if !__GMP_LIBGMP_DLL
+# error "Dead man"
+error
+#endif
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: DLL" >&5
+$as_echo "DLL" >&6; }
+else
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+    as_fn_error $? "gmp.h isn't a DLL: use --enable-static --disable-shared" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+     fi
+   fi
+   if test "$enable_static" = yes; then
+     if test "$with_gmp" = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLL/static GMP" >&5
+$as_echo_n "checking for DLL/static GMP... " >&6; }
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include "gmp.h"
+#if __GMP_LIBGMP_DLL
+# error "Dead man"
+error
+#endif
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: static" >&5
+$as_echo "static" >&6; }
+else
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: DLL" >&5
+$as_echo "DLL" >&6; }
+    as_fn_error $? "gmp.h is a DLL: use --disable-static --enable-shared" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+  fi
+  ;;
+esac
+
 case $host_os in
    darwin* | macosx*)
       LIBIODBC="libiodbc.dylib"
@@ -12072,7 +12439,7 @@
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C)  Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
@@ -12199,6 +12566,9 @@
 delay_variable_subst='$delay_variable_subst'
 macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
 macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
 enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
@@ -12229,12 +12599,10 @@
 lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
 reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
 reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
-OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
 deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
 file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
 file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
 want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
-DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
 sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
 AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
 AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
@@ -12341,7 +12709,10 @@
 }
 
 # Quote evaled strings.
-for var in SHELL \
+for var in AS \
+DLLTOOL \
+OBJDUMP \
+SHELL \
 ECHO \
 SED \
 GREP \
@@ -12353,12 +12724,10 @@
 lt_SP2NL \
 lt_NL2SP \
 reload_flag \
-OBJDUMP \
 deplibs_check_method \
 file_magic_cmd \
 file_magic_glob \
 want_nocaseglob \
-DLLTOOL \
 sharedlib_from_linklib_cmd \
 AR \
 AR_FLAGS \
@@ -13226,6 +13595,15 @@
 macro_version=$macro_version
 macro_revision=$macro_revision
 
+# Assembler program.
+AS=$lt_AS
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Object dumper program.
+OBJDUMP=$lt_OBJDUMP
+
 # Whether or not to build shared libraries.
 build_libtool_libs=$enable_shared
 
@@ -13299,9 +13677,6 @@
 # convert \$build files to toolchain format.
 to_tool_file_cmd=$lt_cv_to_tool_file_cmd
 
-# An object symbol dumper.
-OBJDUMP=$lt_OBJDUMP
-
 # Method to check whether dependent libraries are shared objects.
 deplibs_check_method=$lt_deplibs_check_method
 
@@ -13314,9 +13689,6 @@
 # Find potential files using nocaseglob when deplibs_check_method = "file_magic".
 want_nocaseglob=$lt_want_nocaseglob
 
-# DLL creation program.
-DLLTOOL=$lt_DLLTOOL
-
 # Command to associate shared and link libraries.
 sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
 
diff -druN glpk-4.55.orig/examples/Makefile.in glpk-4.55.new/examples/Makefile.in
--- glpk-4.55.orig/examples/Makefile.in	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/examples/Makefile.in	2014-11-12 07:45:14.846200037 -0800
@@ -97,6 +97,7 @@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
+AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -126,6 +127,7 @@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
+LIBGLPK_LDFLAGS = @LIBGLPK_LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
diff -druN glpk-4.55.orig/ltmain.sh glpk-4.55.new/ltmain.sh
--- glpk-4.55.orig/ltmain.sh	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/ltmain.sh	2014-11-12 07:45:10.706191109 -0800
@@ -81,7 +81,7 @@
 PACKAGE=libtool
 VERSION=2.4
 TIMESTAMP=""
-package_revision=1.3294
+package_revision=1.3293
 
 # Be Bourne compatible
 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -5066,41 +5066,6 @@
 }
 # end: func_emit_cwrapperexe_src
 
-# func_emit_exe_manifest
-# emit a Win32 UAC manifest for executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_exe_manifest ()
-{
-    cat <<EOF
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-  <assemblyIdentity version="1.0.0.0"
-EOF
-
-    case $host in
-    i?86-*-* )   echo '     processorArchitecture="x86"' ;;
-    ia64-*-* )   echo '     processorArchitecture="ia64"' ;;
-    x86_64-*-* ) echo '     processorArchitecture="amd64"' ;;
-    *)           echo '     processorArchitecture="*"' ;;
-    esac
-
-    cat <<EOF
-     name="$host_os.$PROGRAM.$outputname"
-     type="win32"/>
-
-  <!-- Identify the application security requirements. -->
-  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
-    <security>
-      <requestedPrivileges>
-        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
-      </requestedPrivileges>
-    </security>
-  </trustInfo>
-</assembly>
-EOF
-}
-
 # func_win32_import_lib_p ARG
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
@@ -5873,14 +5838,9 @@
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
       # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-      # -{shared,static}-libgcc, -static-{libgfortran|libstdc++}
-      #                      link against specified runtime library
-      # -fstack-protector*   stack protector flags for GCC
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin| \
-      -shared-libgcc|-static-libgcc|-static-libgfortran|-static-libstdc++| \
-      -fstack-protector*)
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
         func_quote_for_eval "$arg"
 	arg="$func_quote_for_eval_result"
         func_append compile_command " $arg"
@@ -9066,7 +9026,7 @@
 	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
 	    cwrapper="$output_path/$output_name.exe"
 	    $RM $cwrappersource $cwrapper
-	    trap "$RM $cwrappersource $cwrapper $cwrapper.manifest; exit $EXIT_FAILURE" 1 2 15
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
 	    func_emit_cwrapperexe_src > $cwrappersource
 
@@ -9086,16 +9046,6 @@
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
 	      if test "x$build" = "x$host" ; then
-		# Create the UAC manifests first if necessary (but the
-		# manifest files must have executable permission regardless).
-		case $output_name in
-		  *instal*|*patch*|*setup*|*update*)
-		    func_emit_exe_manifest > $cwrapper.manifest
-		    func_emit_exe_manifest > $output_path/$objdir/$output_name.exe.manifest
-		    chmod +x $cwrapper.manifest
-		    chmod +x $output_path/$objdir/$output_name.exe.manifest
-		  ;;
-		esac
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9616,9 +9566,8 @@
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
 	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    func_append rmfiles " ${name}.manifest $objdir/${name}.manifest"
 	    if test "$fast_install" = yes && test -n "$relink_command"; then
-	      func_append rmfiles " $odir/lt-$name $objdir/lt-${name}.manifest"
+	      func_append rmfiles " $odir/lt-$name"
 	    fi
 	    if test "X$noexename" != "X$name" ; then
 	      func_append rmfiles " $odir/lt-${noexename}.c"
diff -druN glpk-4.55.orig/m4/libtool.m4 glpk-4.55.new/m4/libtool.m4
--- glpk-4.55.orig/m4/libtool.m4	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/m4/libtool.m4	2014-11-12 07:45:10.776191262 -0800
@@ -1639,7 +1639,7 @@
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
 	      test $i != 17 # 1/2 MB should be enough
       do
diff -druN glpk-4.55.orig/m4/ltversion.m4 glpk-4.55.new/m4/ltversion.m4
--- glpk-4.55.orig/m4/ltversion.m4	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/m4/ltversion.m4	2014-11-12 07:45:10.886191498 -0800
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3294 ltversion.m4
+# serial 3293 ltversion.m4
 # This file is part of GNU Libtool
 
 m4_define([LT_PACKAGE_VERSION], [2.4])
-m4_define([LT_PACKAGE_REVISION], [1.3294])
+m4_define([LT_PACKAGE_REVISION], [1.3293])
 
 AC_DEFUN([LTVERSION_VERSION],
 [macro_version='2.4'
-macro_revision='1.3294'
+macro_revision='1.3293'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff -druN glpk-4.55.orig/Makefile.in glpk-4.55.new/Makefile.in
--- glpk-4.55.orig/Makefile.in	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/Makefile.in	2014-11-12 07:45:14.786199907 -0800
@@ -53,7 +53,8 @@
 DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
 	$(srcdir)/Makefile.in $(srcdir)/config.h.in \
 	$(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
-	THANKS config.guess config.sub install-sh ltmain.sh missing
+	THANKS config.guess config.sub depcomp install-sh ltmain.sh \
+	missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
 	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -135,6 +136,7 @@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
+AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -164,6 +166,7 @@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
+LIBGLPK_LDFLAGS = @LIBGLPK_LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
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:44:48.656143563 -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 \
diff -druN glpk-4.55.orig/src/Makefile.in glpk-4.55.new/src/Makefile.in
--- glpk-4.55.orig/src/Makefile.in	2014-08-21 23:00:00.000000000 -0700
+++ glpk-4.55.new/src/Makefile.in	2014-11-12 07:45:15.416201266 -0800
@@ -189,6 +189,7 @@
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AR = @AR@
+AS = @AS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -218,6 +219,7 @@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
+LIBGLPK_LDFLAGS = @LIBGLPK_LDFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
@@ -315,7 +317,8 @@
 
 libglpk_la_LDFLAGS = \
 -version-info 37:2:1 \
--export-symbols-regex '^glp_*'
+-export-symbols-regex '^glp_*' \
+$(LIBGLPK_LDFLAGS)
 
 libglpk_la_SOURCES = \
 avl.c \
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 \
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to