Ticket #14096: gsl-1.15.p1.diff

File gsl-1.15.p1.diff, 11.3 KB (added by jpflori, 8 years ago)

Spkg diff, for review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    4444   (It comes with its own CBLAS implementation that is e.g. used when running
    4545   the GSL test suite during installation; however, the Sage library only
    4646   uses it as a fall-back, if e.g. ATLAS's CBLAS library is not present.)
    47    
     47
    4848== Special Update/Build Instructions ==
    49  * Currently, nothing special to be done.
     49 * Make sure the following patch still apply or remove it if integrated
     50   upstream.
     51
     52=== Patches ===
     53 * cygwin.patch: patch build system so that it builds a shared library on
     54   Cygwin.
    5055
    5156== Changelog ==
    5257
     58=== gsl-1.15.p1 (Jean-Pierre Flori, 12 February 2013) ===
     59 * #14096: let GSL build a shared library on Cygwin.
     60
    5361=== gsl-1.15.p0 (Simon King, 11th December 2011) ===
    5462 * #12131: Use --libdir, to make this package work on openSUSE
    5563
  • new file patches/cygwin.patch

    diff --git a/patches/cygwin.patch b/patches/cygwin.patch
    new file mode 100644
    - +  
     1diff -druN src.orig/configure.ac src/configure.ac
     2--- src.orig/configure.ac       2011-05-04 23:09:27.000000000 +0200
     3+++ src/configure.ac    2013-02-12 19:58:27.138570268 +0100
     4@@ -147,13 +147,19 @@
     5 
     6 dnl Checks for typedefs, structures, and compiler characteristics.
     7 
     8-case "$host_os" in
     9-     *mingw*)
     10-       MINGW=true
     11-       ;;
     12+case $host in
     13+  *-*-cygwin* | *-*-mingw* )
     14+  if test "$enable_shared" = yes; then
     15+    GSLCBLAS_LDFLAGS="$GSLCBLAS_LDFLAGS -no-undefined"
     16+    GSL_LDFLAGS="$GSL_LDFLAGS -no-undefined"
     17+    GSL_LIBADD="cblas/libgslcblas.la"
     18+  fi
     19+  ;;
     20 esac
     21 
     22-AM_CONDITIONAL(MINGW32_HOST, test "$MINGW" = "true")
     23+AC_SUBST(GSLCBLAS_LDFLAGS)
     24+AC_SUBST(GSL_LDFLAGS)
     25+AC_SUBST(GSL_LIBADD)
     26 
     27 dnl Checks for library functions.
     28 
     29--- src.orig/configure  2011-05-04 23:10:35.000000000 +0200
     30+++ src/configure       2013-02-12 19:58:27.146570192 +0100
     31@@ -630,8 +630,9 @@
     32 HAVE_GNUM68K_IEEE_INTERFACE
     33 HAVE_GNUSPARC_IEEE_INTERFACE
     34 LIBOBJS
     35-MINGW32_HOST_FALSE
     36-MINGW32_HOST_TRUE
     37+GSL_LIBADD
     38+GSL_LDFLAGS
     39+GSLCBLAS_LDFLAGS
     40 GSL_LIBM
     41 GSL_LIBS
     42 GSL_CFLAGS
     43@@ -11840,19 +11841,18 @@
     44 
     45 
     46 
     47-case "$host_os" in
     48-     *mingw*)
     49-       MINGW=true
     50-       ;;
     51+case $host in
     52+  *-*-cygwin* | *-*-mingw* )
     53+  if test "$enable_shared" = yes; then
     54+    GSLCBLAS_LDFLAGS="$GSLCBLAS_LDFLAGS -no-undefined"
     55+    GSL_LDFLAGS="$GSL_LDFLAGS -no-undefined"
     56+    GSL_LIBADD="cblas/libgslcblas.la"
     57+  fi
     58+  ;;
     59 esac
     60 
     61- if test "$MINGW" = "true"; then
     62-  MINGW32_HOST_TRUE=
     63-  MINGW32_HOST_FALSE='#'
     64-else
     65-  MINGW32_HOST_TRUE='#'
     66-  MINGW32_HOST_FALSE=
     67-fi
     68+
     69+
     70 
     71 
     72 
     73@@ -12775,10 +12775,6 @@
     74   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
     75 Usually this means the macro was only invoked conditionally." "$LINENO" 5
     76 fi
     77-if test -z "${MINGW32_HOST_TRUE}" && test -z "${MINGW32_HOST_FALSE}"; then
     78-  as_fn_error $? "conditional \"MINGW32_HOST\" was never defined.
     79-Usually this means the macro was only invoked conditionally." "$LINENO" 5
     80-fi
     81 
     82 : "${CONFIG_STATUS=./config.status}"
     83 ac_write_fail=0
     84diff -druN src.orig/Makefile.am src/Makefile.am
     85--- src.orig/Makefile.am        2011-04-14 17:13:48.000000000 +0200
     86+++ src/Makefile.am     2013-02-12 19:58:27.146570192 +0100
     87@@ -19,16 +19,10 @@
     88 
     89 lib_LTLIBRARIES = libgsl.la
     90 libgsl_la_SOURCES = version.c
     91-libgsl_la_LIBADD = $(SUBLIBS)
     92-libgsl_la_LDFLAGS = -version-info $(GSL_LT_VERSION)
     93+libgsl_la_LIBADD = $(GSL_LIBADD) $(SUBLIBS)
     94+libgsl_la_LDFLAGS = $(GSL_LDFLAGS) -version-info $(GSL_LT_VERSION)
     95 noinst_HEADERS = templates_on.h templates_off.h build.h
     96 
     97-MINGW32_HOST = @MINGW32_HOST@
     98-if MINGW32_HOST
     99-libgsl_la_LIBADD += cblas/libgslcblas.la
     100-libgsl_la_LDFLAGS += -no-undefined
     101-endif
     102-
     103 m4datadir = $(datadir)/aclocal
     104 m4data_DATA = gsl.m4
     105 
     106diff -druN src.orig/Makefile.in src/Makefile.in
     107--- src.orig/Makefile.in        2011-05-04 23:10:41.000000000 +0200
     108+++ src/Makefile.in     2013-02-12 19:58:27.150570154 +0100
     109@@ -40,8 +40,6 @@
     110 POST_UNINSTALL = :
     111 build_triplet = @build@
     112 host_triplet = @host@
     113-@MINGW32_HOST_TRUE@am__append_1 = cblas/libgslcblas.la
     114-@MINGW32_HOST_TRUE@am__append_2 = -no-undefined
     115 bin_PROGRAMS = gsl-randist$(EXEEXT) gsl-histogram$(EXEEXT)
     116 subdir = .
     117 DIST_COMMON = README $(am__configure_deps) $(noinst_HEADERS) \
     118@@ -86,7 +84,8 @@
     119        "$(DESTDIR)$(bindir)" "$(DESTDIR)$(m4datadir)" \
     120        "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgincludedir)"
     121 LTLIBRARIES = $(lib_LTLIBRARIES)
     122-libgsl_la_DEPENDENCIES = $(SUBLIBS) $(am__append_1)
     123+am__DEPENDENCIES_1 =
     124+libgsl_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(SUBLIBS)
     125 am_libgsl_la_OBJECTS = version.lo
     126 libgsl_la_OBJECTS = $(am_libgsl_la_OBJECTS)
     127 libgsl_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
     128@@ -197,7 +196,10 @@
     129 EXEEXT = @EXEEXT@
     130 FGREP = @FGREP@
     131 GREP = @GREP@
     132+GSLCBLAS_LDFLAGS = @GSLCBLAS_LDFLAGS@
     133 GSL_CFLAGS = @GSL_CFLAGS@
     134+GSL_LDFLAGS = @GSL_LDFLAGS@
     135+GSL_LIBADD = @GSL_LIBADD@
     136 GSL_LIBM = @GSL_LIBM@
     137 GSL_LIBS = @GSL_LIBS@
     138 GSL_LT_CBLAS_VERSION = @GSL_LT_CBLAS_VERSION@
     139@@ -340,10 +342,9 @@
     140 EXTRA_DIST = autogen.sh gsl-config.in gsl.pc.in configure.ac THANKS BUGS gsl.spec.in gsl.m4 test_gsl_histogram.sh pkgconfig.test
     141 lib_LTLIBRARIES = libgsl.la
     142 libgsl_la_SOURCES = version.c
     143-libgsl_la_LIBADD = $(SUBLIBS) $(am__append_1)
     144-libgsl_la_LDFLAGS = -version-info $(GSL_LT_VERSION) $(am__append_2)
     145+libgsl_la_LIBADD = $(GSL_LIBADD) $(SUBLIBS)
     146+libgsl_la_LDFLAGS = $(GSL_LDFLAGS) -version-info $(GSL_LT_VERSION)
     147 noinst_HEADERS = templates_on.h templates_off.h build.h
     148-MINGW32_HOST = @MINGW32_HOST@
     149 m4datadir = $(datadir)/aclocal
     150 m4data_DATA = gsl.m4
     151 gsl_randist_SOURCES = gsl-randist.c
     152diff -druN src.orig/cblas/Makefile.am src/cblas/Makefile.am
     153--- src.orig/cblas/Makefile.am  2010-12-26 18:57:08.000000000 +0100
     154+++ src/cblas/Makefile.am       2013-02-12 19:58:27.150570154 +0100
     155@@ -1,10 +1,5 @@
     156 lib_LTLIBRARIES = libgslcblas.la
     157-libgslcblas_la_LDFLAGS = -version-info $(GSL_LT_CBLAS_VERSION)
     158-
     159-MINGW32_HOST = @MINGW32_HOST@
     160-if MINGW32_HOST
     161-libgslcblas_la_LDFLAGS += -no-undefined
     162-endif
     163+libgslcblas_la_LDFLAGS = $(GSLCBLAS_LDFLAGS) -version-info $(GSL_LT_CBLAS_VERSION)
     164 
     165 pkginclude_HEADERS = gsl_cblas.h
     166 
     167diff -druN src.orig/cblas/Makefile.in src/cblas/Makefile.in
     168--- src.orig/cblas/Makefile.in  2011-05-04 23:10:36.000000000 +0200
     169+++ src/cblas/Makefile.in       2013-02-12 19:58:27.150570154 +0100
     170@@ -35,7 +35,6 @@
     171 POST_UNINSTALL = :
     172 build_triplet = @build@
     173 host_triplet = @host@
     174-@MINGW32_HOST_TRUE@am__append_1 = -no-undefined
     175 check_PROGRAMS = test$(EXEEXT)
     176 subdir = cblas
     177 DIST_COMMON = $(noinst_HEADERS) $(pkginclude_HEADERS) \
     178@@ -163,7 +162,10 @@
     179 EXEEXT = @EXEEXT@
     180 FGREP = @FGREP@
     181 GREP = @GREP@
     182+GSLCBLAS_LDFLAGS = @GSLCBLAS_LDFLAGS@
     183 GSL_CFLAGS = @GSL_CFLAGS@
     184+GSL_LDFLAGS = @GSL_LDFLAGS@
     185+GSL_LIBADD = @GSL_LIBADD@
     186 GSL_LIBM = @GSL_LIBM@
     187 GSL_LIBS = @GSL_LIBS@
     188 GSL_LT_CBLAS_VERSION = @GSL_LT_CBLAS_VERSION@
     189@@ -278,9 +280,7 @@
     190 top_builddir = @top_builddir@
     191 top_srcdir = @top_srcdir@
     192 lib_LTLIBRARIES = libgslcblas.la
     193-libgslcblas_la_LDFLAGS = -version-info $(GSL_LT_CBLAS_VERSION) \
     194-       $(am__append_1)
     195-MINGW32_HOST = @MINGW32_HOST@
     196+libgslcblas_la_LDFLAGS = $(GSLCBLAS_LDFLAGS) -version-info $(GSL_LT_CBLAS_VERSION)
     197 pkginclude_HEADERS = gsl_cblas.h
     198 INCLUDES = -I$(top_srcdir)
     199 libgslcblas_la_SOURCES = sasum.c saxpy.c scasum.c scnrm2.c scopy.c \
     200diff -druN src.orig/configure src/configure
  • spkg-check

    diff --git a/spkg-check b/spkg-check
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ -z "$SAGE_LOCAL" ] ; then
    4    echo "SAGE_LOCAL undefined ... exiting";
    5    echo "Maybe run 'sage -sh'?"
    6    exit 1
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
     5    echo >&2 "Maybe run 'sage -sh'?"
     6    exit 1
    77fi
    88
    9 # Let the user set an environment variable CFLAG64 to
    10 # indicate the C compiler flag for 64-bit builds. By
    11 # default this will be -m64. IBM's compiler on AIX
    12 # and HP's on HP-UX do NOT use -m64. 
    13 
    14 if [ -z "$CFLAG64" ] ; then
    15    CFLAG64=-m64
    16 fi
    17 
    18 # There is no C++ code in GSL, so no need to do likewise
    19 # with CXXFLAG64.
    20 
    21 if [ "x$SAGE64" = xyes ]; then
    22    echo "Building a 64-bit version of the GNU Scientific Library (GSL)"
    23    CFLAGS="$CFLAGS $CFLAG64"
    24    CPPFLAGS="$CPPFLAGS $CFLAG64" ; export CPPFLAGS
    25    LDFLAGS="$LDFLAGS $CFLAG64" ; export LDFLAGS
    26 fi
    27 
    28 if [ "x$SAGE_DEBUG" = xyes ] ; then
    29   CFLAGS="$CFLAGS -g -O0" # No optimisation, aids debugging.
    30 else
    31   CFLAGS="$CFLAGS -g -O2" # Normal optimisation.
    32 fi
    33 
    34 export CFLAGS
    35 
    369cd src
    3710
     11echo "Running GSL testsuite..."
    3812$MAKE check
    39 
    4013if [ $? -ne 0 ]; then
    41     echo "Error: make check for GSL failed"
     14    echo >&2 "Error: make check for GSL failed."
    4215    exit 1
    4316fi
    44 echo "The self-tests of GSL were successfully passed"
    45 
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    11#!/usr/bin/env bash
    22
    3 if [ -z "$SAGE_LOCAL" ] ; then
    4    echo "SAGE_LOCAL undefined ... exiting";
    5    echo "Maybe run 'sage -sh'?"
    6    exit 1
     3if [ -z "$SAGE_LOCAL" ]; then
     4    echo >&2 "Error: SAGE_LOCAL undefined - exiting..."
     5    echo >&2 "Maybe run 'sage -sh'?"
     6    exit 1
    77fi
    88
    99# Let the user set an environment variable CFLAG64 to
    10 # indicate the C compiler flag for 64-bit builds. By
    11 # default this will be -m64. IBM's compiler on AIX
    12 # and HP's on HP-UX do NOT use -m64. 
    13 
    14 if [ -z "$CFLAG64" ] ; then
    15    CFLAG64=-m64
     10# indicate the C compiler flag for 64-bit builds. By
     11# default this will be -m64. IBM's compiler on AIX
     12# and HP's on HP-UX do NOT use -m64.
     13if [ -z "$CFLAG64" ] ; then
     14    CFLAG64=-m64
    1615fi
    1716
    1817# There is no C++ code in GSL, so no need to do likewise
    19 # with CXXFLAG64.
    20 
    21 if [ "x$SAGE64" = xyes ]; then
    22    echo "Building a 64-bit version of the GNU Scientific Library (GSL)"
    23    CFLAGS="$CFLAGS $CFLAG64"
    24    CPPFLAGS="$CPPFLAGS $CFLAG64" ; export CPPFLAGS
    25    LDFLAGS="$LDFLAGS $CFLAG64" ; export LDFLAGS
     18# with CXXFLAG64.
     19if [ "$SAGE64" = "yes" ]; then
     20    echo "Building a 64-bit version of the GNU Scientific Library (GSL)"
     21    CFLAGS="$CFLAGS $CFLAG64"
     22    CPPFLAGS="$CPPFLAGS $CFLAG64" ; export CPPFLAGS
     23    LDFLAGS="$LDFLAGS $CFLAG64" ; export LDFLAGS
    2624fi
    2725
    28 if [ "x$SAGE_DEBUG" = xyes ] ; then
    29   CFLAGS="$CFLAGS -g -O0" # No optimisation, aids debugging. 
     26if [ "$SAGE_DEBUG" = "yes" ] ; then
     27  CFLAGS="$CFLAGS -g -O0" # No optimisation, aids debugging.
    3028else
    31   CFLAGS="$CFLAGS -g -O2" # Normal optimisation. 
     29  CFLAGS="$CFLAGS -g -O2" # Normal optimisation.
    3230fi
    3331
    3432export CFLAGS
    3533
    36 # An error "/bin/rm: cannot remove `libtoolT': No such file or directory"
    37 # often resulted. The following web site suggests export RM to "rm -f"
    38 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=523750
    39 # which solved the problem.
    40 
    41 export RM="rm -f" 
    42 
    4334cd src
    4435
     36echo "Applying patches to upstream sources..."
     37for patch in ../patches/*.patch; do
     38    patch -p1 <"$patch"
     39    if [ $? -ne 0 ]; then
     40        echo >&2 "Error: '$patch' failed to apply."
     41        exit 1
     42    fi
     43done
     44
     45echo "Configuring GSL..."
    4546./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib"
    46 
    4747if [ $? -ne 0 ]; then
    48     echo "Error configuring GSL"
     48    echo >&2 "Error configuring GSL."
    4949    exit 1
    5050fi
    5151
     52echo "Building GSL..."
    5253$MAKE
    53 
    5454if [ $? -ne 0 ]; then
    55     echo "Error building GSL"
     55    echo >&2 "Error building GSL."
    5656    exit 1
    5757fi
    5858
     59echo "Installing GSL..."
    5960$MAKE install
    60 
    6161if [ $? -ne 0 ]; then
    62     echo "Error installing GSL"
     62    echo >&2 "Error installing GSL."
    6363    exit 1
    6464fi
    65