From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12321 invoked by alias); 7 Jul 2007 23:16:08 -0000 Received: (qmail 12310 invoked by uid 22791); 7 Jul 2007 23:16:07 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0506.google.com (HELO wx-out-0506.google.com) (66.249.82.227) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 07 Jul 2007 23:16:01 +0000 Received: by wx-out-0506.google.com with SMTP id i30so541512wxd for ; Sat, 07 Jul 2007 16:15:59 -0700 (PDT) Received: by 10.90.116.6 with SMTP id o6mr1088009agc.1183850159714; Sat, 07 Jul 2007 16:15:59 -0700 (PDT) Received: by 10.90.28.10 with HTTP; Sat, 7 Jul 2007 16:15:59 -0700 (PDT) Message-ID: <645d17210707071615m9ad98b9j2776a0a63213dc51@mail.gmail.com> Date: Sat, 07 Jul 2007 23:16:00 -0000 From: "Jonathan Underwood" To: gsl-discuss@sources.redhat.com Subject: Patch for compilation for a mingw32 host MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_63915_16470665.1183850159681" Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2007-q3/txt/msg00008.txt.bz2 ------=_Part_63915_16470665.1183850159681 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 2812 Hi, I have recently been cross compiling GSL shared libraries (DLLs) on a linux machine for a mingw32msvc host, and needed to use the attached patch to make this work. I believe this patch would also be useful/needed if you were simply compiling inside MSYS/mingw32, or with cygwin and the -mno-cygwin option - I haven't tried either of these things though. Without this patch it is not possible to build a shared library for this host. n explanation follows. The following are specific to mingw32 (i.e. Windows) hosts. Windows does not allow DLLs with undefined symbols and so we need the -no-undefined options for GCC. We also need to link against the gslcblas library to resolve the cblas symbols. This means it is then probably not possible to drop in a replacement cblas library at runtime. To use a different cblas library, it is probably necessary to link it at build time unless the alternative library is ABI compatible. Note that in principle, libtool should add the -no-undefined option if it detects mingw is the host arch, but at this point in time libtool doesn't (at least for 1.5.22) and the libtool developers recommend adding it manually. I expect this will get fixed in a later release of libtool. These patches have (hopefully) been put together in such a way as they won't impact building for any other host arch. Best wishes, Jonathan. diff -ru gsl-1.9/cblas/Makefile.am gsl-1.9-mingw/cblas/Makefile.am --- gsl-1.9/cblas/Makefile.am 2004-09-11 14:45:09.000000000 +0100 +++ gsl-1.9-mingw/cblas/Makefile.am 2007-07-08 00:05:00.000000000 +0100 @@ -1,6 +1,11 @@ lib_LTLIBRARIES = libgslcblas.la libgslcblas_la_LDFLAGS = -version-info $(GSL_LT_CBLAS_VERSION) +MINGW32_HOST = @MINGW32_HOST@ +if MINGW32_HOST +libgslcblas_la_LDFLAGS += -no-undefined +endif + pkginclude_HEADERS = gsl_cblas.h INCLUDES= -I$(top_srcdir) diff -ru gsl-1.9/configure.ac gsl-1.9-mingw/configure.ac --- gsl-1.9/configure.ac 2007-02-20 13:08:16.000000000 +0000 +++ gsl-1.9-mingw/configure.ac 2007-07-08 00:04:38.000000000 +0100 @@ -89,6 +89,14 @@ dnl Checks for typedefs, structures, and compiler characteristics. +case "$host_os" in + *mingw*) + MINGW=true + ;; +esac + +AM_CONDITIONAL(MINGW32_HOST, test "$MINGW" = "true") + dnl Checks for library functions. dnl AC_FUNC_ALLOCA diff -ru gsl-1.9/Makefile.am gsl-1.9-mingw/Makefile.am --- gsl-1.9/Makefile.am 2006-11-02 17:50:01.000000000 +0000 +++ gsl-1.9-mingw/Makefile.am 2007-07-08 00:04:45.000000000 +0100 @@ -21,6 +21,12 @@ libgsl_la_LDFLAGS = -version-info $(GSL_LT_VERSION) noinst_HEADERS = templates_on.h templates_off.h +MINGW32_HOST = @MINGW32_HOST@ +if MINGW32_HOST +libgsl_la_LIBADD += cblas/libgslcblas.la +libgsl_la_LDFLAGS += -no-undefined +endif + m4datadir = $(datadir)/aclocal m4data_DATA = gsl.m4 ------=_Part_63915_16470665.1183850159681 Content-Type: text/x-patch; name=gsl-1.9-mingw-host.patch; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_f3upsul9 Content-Disposition: attachment; filename="gsl-1.9-mingw-host.patch" Content-length: 1936 ZGlmZiAtcnUgZ3NsLTEuOS9jYmxhcy9NYWtlZmlsZS5hbSBnc2wtMS45LW1p bmd3L2NibGFzL01ha2VmaWxlLmFtCi0tLSBnc2wtMS45L2NibGFzL01ha2Vm aWxlLmFtCTIwMDQtMDktMTEgMTQ6NDU6MDkuMDAwMDAwMDAwICswMTAwCisr KyBnc2wtMS45LW1pbmd3L2NibGFzL01ha2VmaWxlLmFtCTIwMDctMDctMDgg MDA6MDU6MDAuMDAwMDAwMDAwICswMTAwCkBAIC0xLDYgKzEsMTEgQEAKIGxp Yl9MVExJQlJBUklFUyA9IGxpYmdzbGNibGFzLmxhCiBsaWJnc2xjYmxhc19s YV9MREZMQUdTID0gLXZlcnNpb24taW5mbyAkKEdTTF9MVF9DQkxBU19WRVJT SU9OKQogCitNSU5HVzMyX0hPU1QgPSBATUlOR1czMl9IT1NUQAoraWYgTUlO R1czMl9IT1NUCitsaWJnc2xjYmxhc19sYV9MREZMQUdTICs9IC1uby11bmRl ZmluZWQKK2VuZGlmCisKIHBrZ2luY2x1ZGVfSEVBREVSUyA9IGdzbF9jYmxh cy5oCiAKIElOQ0xVREVTPSAtSSQodG9wX3NyY2RpcikKZGlmZiAtcnUgZ3Ns LTEuOS9jb25maWd1cmUuYWMgZ3NsLTEuOS1taW5ndy9jb25maWd1cmUuYWMK LS0tIGdzbC0xLjkvY29uZmlndXJlLmFjCTIwMDctMDItMjAgMTM6MDg6MTYu MDAwMDAwMDAwICswMDAwCisrKyBnc2wtMS45LW1pbmd3L2NvbmZpZ3VyZS5h YwkyMDA3LTA3LTA4IDAwOjA0OjM4LjAwMDAwMDAwMCArMDEwMApAQCAtODks NiArODksMTQgQ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