Ticket #13351: lcalc.diff

File lcalc.diff, 17.8 KB (added by jpflori, 9 years ago)

Spkg diff, for review only.

  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    9292
    9393== Changelog ==
    9494
     95=== lcalc-1.23.p11 (Jean-Pierre Flori, 8 August 2012) ===
     96 * #13351: modify Makefile to define binaries and libraries extension
     97           according to host system. As a side effect, this let
     98           sage.libs.lcalc.lcal_Lfunction be imported on Cygwin.
     99
    95100=== lcalc-1.23.p10 (Leif Leonhardy, March 17th 2012) ===
    96101 * #12681: Fix hard-coded 'g++'.
    97102   The (patched) Makefile now uses $(CXX) (which *defaults* to 'g++')
  • patches/Makefile.patch

    diff --git a/patches/Makefile.patch b/patches/Makefile.patch
    a b  
    1 --- src/src/Makefile    2009-07-14 20:23:17.000000000 +0200
    2 +++ src/src/Makefile    2012-03-17 08:16:53.346311160 +0100
     1--- src.orig/src/Makefile       2012-08-08 23:21:56.274799100 +0200
     2+++ src/src/Makefile    2012-08-08 23:21:45.430581000 +0200
    33@@ -13,7 +13,7 @@
    44 # elliptic curve routines. Doing so disables the -e option.
    55 # g++ with -DINCLUDE_PARI sends a #define INCLUDE_PARI to the preprocessor.
     
    99 #PREPROCESSOR_DEFINE = -DUSE_LONG_DOUBLE
    1010 
    1111 #OPENMP_FLAG = -fopenmp
    12 @@ -29,7 +29,15 @@
     12@@ -29,7 +29,17 @@
    1313 
    1414 OS_NAME := $(shell uname)
    1515 
    1616-CC = g++
     17+ifneq (,$(findstring CYGWIN,$(OS_NAME)))
     18+  OS_NAME := CYGWIN
     19+endif
     20+
    1721+#CC = g++
    1822+# Note: I've also changed various rules to use $CXX instead of $CC,
    1923+# since we mostly compile C++, not C, and $CC is by convention
    2024+# used for the *C* compiler.
    21 +# I've kept the [name] CCFLAGS though, which we add $CXXFLAGS to.
    22 +# -leif (03/2012)
    2325+CC ?= gcc
    2426+CXX ?= g++
    2527+
    2628 #cc = /home/mrubinst/local/bin/gcc
    2729 #CC = /home/mrubinst/local/bin/g++
    2830 #LD = /home/mrubinst/local/bin/g++
    29 @@ -58,9 +66,7 @@
     31@@ -58,9 +68,7 @@
    3032    #MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m64
    3133 endif
    3234 
    3335-CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
    3436-#CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG)  $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
    3537-#CCFLAGS =  -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
    36 +CCFLAGS =  $(CXXFLAGS) -O3  $(OPENMP_FLAG)  $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
     38+CXXFLAGS := -O3 $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA) $(CXXFLAGS)
    3739 
    3840 #warning- O2 doesn't help with -DUSE_LONG_DOUBLE on mac, and actually seems to hurt, making runtime longer
    3941 #by a factor of 1.5
    40 @@ -68,12 +74,12 @@
     42@@ -68,12 +76,12 @@
    4143 
    4244 ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
    4345     #location of pari.h.
     
    5254 else
    5355     #supplied as a dummy so as to avoid more ifeq's below
    5456     LOCATION_PARI_H = .
    55 @@ -88,26 +94,12 @@
     57@@ -88,26 +96,12 @@
    5658 #For Mac os x we omit shared library options
    5759 
    5860 ifeq ($(OS_NAME),Darwin)
     
    7678-else
    7779-    LDFLAGS = $(LDFLAGS2)
    7880-endif
    79 +LDFLAGS = -L$(LOCATION_PARI_LIBRARY) -lpari -lgmp
     81+LDFLAGS := -L$(LOCATION_PARI_LIBRARY) -lpari -lgmp $(LDFLAGS)
    8082 
    8183 
    8284 
    83 @@ -129,7 +121,7 @@
     85@@ -129,47 +123,64 @@
    8486 #become clear which libraries the computer can find.
    8587 
    8688 
    8789-INSTALL_DIR= /usr/local
    8890+INSTALL_DIR ?= /usr/local
     91+
     92+#binary and library files extensions
     93+LIBEXT := .so
     94+EXEEXT :=
     95+
     96+ifeq ($(OS_NAME),Darwin)
     97+    LIBEXT := .dylib
     98+    EXEEXT :=
     99+endif
     100+
     101+ifeq ($(OS_NAME),CYGWIN)
     102+    LIBEXT := .dll
     103+    EXEEXT := .exe
     104+endif
    89105 
    90106 #object files for the libLfunction library
    91107 OBJ_L = Lglobals.o Lgamma.o Lriemannsiegel.o Lriemannsiegel_blfi.o Ldokchitser.o
    92 @@ -140,34 +132,37 @@
     108 
     109 #object files for the command line program
     110-OBJ2=$(OBJ_L) Lcommandline_globals.o Lcommandline_misc.o Lcommandline_numbertheory.o Lcommandline_values_zeros.o
     111-OBJ3=$(OBJ2) Lcommandline_elliptic.o Lcommandline_twist.o Lcommandline.o cmdline.o
     112+OBJ2 = $(OBJ_L) Lcommandline_globals.o Lcommandline_misc.o Lcommandline_numbertheory.o Lcommandline_values_zeros.o
     113+OBJ3 = $(OBJ2) Lcommandline_elliptic.o Lcommandline_twist.o Lcommandline.o cmdline.o
    93114 OBJECTS = $(OBJ3)
    94115 
    95116 all:
     
    100121-#      make find_L
    101122-#      make test
    102123+#      $(MAKE) print_vars
    103 +       $(MAKE) libLfunction.so
    104 +       $(MAKE) lcalc
     124+       $(MAKE) libLfunction$(LIBEXT)
     125+       $(MAKE) lcalc$(EXEEXT)
    105126+       $(MAKE) examples
    106127+#      $(MAKE) find_L
    107128+#      $(MAKE) test
     
    109130 print_vars:
    110131        @echo OS_NAME = $(OS_NAME)
    111132 
    112  lcalc: $(OBJECTS)
     133-lcalc: $(OBJECTS)
    113134-       $(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)
    114 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)
     135+lcalc$(EXEEXT): $(OBJECTS)
     136+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc$(EXEEXT) $(GMP_FLAGS)
    115137 
    116138 examples:
    117139-       $(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.so -o example_programs/example $(GMP_FLAGS)
    118 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.so -o example_programs/example $(GMP_FLAGS)
     140+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction$(LIBEXT) -o example_programs/example$(EXEEXT) $(GMP_FLAGS)
     141+
    119142 
     143+proc$(EXEEXT):
     144+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) example_programs/proc.cc libLfunction$(LIBEXT) -o example_programs/proc$(EXEEXT) $(GMP_FLAGS)
    120145 
    121  proc:
     146-proc:
    122147-       $(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/proc.cc libLfunction.so -o example_programs/proc $(GMP_FLAGS)
    123 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) example_programs/proc.cc libLfunction.so -o example_programs/proc $(GMP_FLAGS)
     148+test$(EXEEXT):
     149+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) example_programs/test.cc libLfunction$(LIBEXT) -o example_programs/test$(EXEEXT) $(GMP_FLAGS)
    124150 
    125  test:
     151-test:
    126152-       $(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/test.cc libLfunction.so -o example_programs/test $(GMP_FLAGS)
    127 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) example_programs/test.cc libLfunction.so -o example_programs/test $(GMP_FLAGS)
     153+find_L$(EXEEXT):
     154+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) find_L_functions/find_L_functions.cc libLfunction$(LIBEXT) -o find_L_functions/find_L$(EXEEXT) $(GMP_FLAGS)
    128155 
    129  find_L:
     156-find_L:
    130157-       $(CC) $(CCFLAGS) $(INCLUDEFILES) find_L_functions/find_L_functions.cc libLfunction.so -o find_L_functions/find_L $(GMP_FLAGS)
    131 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) find_L_functions/find_L_functions.cc libLfunction.so -o find_L_functions/find_L $(GMP_FLAGS)
    132 +
    133158 
    134159 .cc.o:
    135160-       $(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<
    136 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) -c $<
     161+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) -c $<
    137162+
    138 +# Warning: We (Sage) add $CXXFLAGS to CCFLAGS above.
     163+# Warning: We (Sage) add $CXXFLAGS to CXXFLAGS above.
    139164 .c.o:
    140         $(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<
     165-       $(CC) $(CCFLAGS) $(INCLUDEFILES) -c $<
     166+       $(CC) $(CXXFLAGS) $(INCLUDEFILES) -c $<
    141167 
    142 @@ -227,7 +222,7 @@
     168 
     169 Lglobals.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h
     170@@ -227,7 +238,7 @@
    143171 Lcommandline_elliptic.o: ../include/Lvalue.h ../include/Lfind_zeros.h
    144172 Lcommandline_elliptic.o: ../include/Lcommandline_numbertheory.h
    145173 Lcommandline_elliptic.o: ../include/Lcommandline_globals.h
    146174-       $(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_elliptic.cc
    147 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_elliptic.cc
     175+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_elliptic.cc
    148176 
    149177 Lcommandline_twist.o: ../include/Lcommandline_twist.h ../include/L.h
    150178 Lcommandline_twist.o: ../include/Lglobals.h ../include/Lcommon.h ../include/Lcomplex.h ../include/Lnumeric.h ../include/Lint_complex.h
    151 @@ -239,7 +234,7 @@
     179@@ -239,10 +250,10 @@
    152180 Lcommandline_twist.o: ../include/Lcommandline_numbertheory.h
    153181 Lcommandline_twist.o: ../include/Lcommandline_globals.h
    154182 Lcommandline_twist.o: ../include/Lcommandline_elliptic.h
    155183-       $(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_twist.cc
    156 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_twist.cc
     184+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline_twist.cc
    157185 
    158186 cmdline.o: ../include/cmdline.h ../include/getopt.h
    159  #$(CC) $(CCFLAGS) $(INCLUDEFILES) -DHAVE_LONG_LONG -c cmdline.c
    160 @@ -258,11 +253,11 @@
     187-#$(CC) $(CCFLAGS) $(INCLUDEFILES) -DHAVE_LONG_LONG -c cmdline.c
     188+#$(CC) $(CXXFLAGS) $(INCLUDEFILES) -DHAVE_LONG_LONG -c cmdline.c
     189 
     190 
     191 Lcommandline.o: ../include/Lcommandline.h ../include/L.h
     192@@ -258,21 +269,21 @@
    161193 Lcommandline.o: ../include/Lcommandline_elliptic.h
    162194 Lcommandline.o: ../include/Lcommandline_twist.h
    163195 Lcommandline.o: ../include/Lcommandline_values_zeros.h
    164196-       $(CC) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline.cc
    165 +       $(CXX) $(CCFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline.cc
     197+       $(CXX) $(CXXFLAGS) $(INCLUDEFILES) -I$(LOCATION_PARI_H) $(PARI_DEFINE) -c Lcommandline.cc
    166198 
    167199 
    168  libLfunction.so: $(OBJ_L)
     200-libLfunction.so: $(OBJ_L)
    169201-       g++ -$(DYN_OPTION)  -o libLfunction.so $(OBJ_L)
    170 +       $(CXX) -$(DYN_OPTION) $(CXXFLAG64) -o libLfunction.so $(OBJ_L)
     202+libLfunction$(LIBEXT): $(OBJ_L)
     203+       $(CXX) -$(DYN_OPTION) $(CXXFLAG64) -o libLfunction$(LIBEXT) $(OBJ_L)
    171204 
    172205 clean:
    173         rm -f *.o lcalc libLfunction.so example_programs/example
     206-       rm -f *.o lcalc libLfunction.so example_programs/example
     207+       rm -f *.o lcalc libLfunction$(LIBEXT) example_programs/example
     208 
     209 install:
     210-       cp -f lcalc $(INSTALL_DIR)/bin/.
     211-       cp -f libLfunction.so $(INSTALL_DIR)/lib/.
     212-       cp -rf ../include $(INSTALL_DIR)/include/Lfunction
     213+       cp -f lcalc$(EXEEXT) $(INSTALL_DIR)/bin/.
     214+       cp -f libLfunction$(LIBEXT) $(INSTALL_DIR)/lib/.
     215+       cp -rf ../include $(INSTALL_DIR)/include/libLfunction
     216 
     217 
     218 SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c
     219 depend:
     220-       makedepend -f depends -- $(CCFLAGS) -Y../include -- $(SRCS)
     221+       makedepend -f depends -- $(CXXFLAGS) -Y../include -- $(SRCS)
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    66    exit 1
    77fi
    88
    9 # Add a sensible default optimisation flag. Change if necessary.
    10 OPTIMIZATION_FLAGS="-O3"
    11 
    12 # Most packages do not need all these set, but it is better to do them all
    13 # each time, rather than omit a flag by mistake:
    14 
    15 CFLAGS="$OPTIMIZATION_FLAGS $CFLAGS"
    16 CXXFLAGS="$OPTIMIZATION_FLAGS $CXXFLAGS"
    17 FCFLAGS="$OPTIMIZATION_FLAGS $FCFLAGS"
    18 F77FLAGS="$OPTIMIZATION_FLAGS $F77FLAGS"
    19 CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
    20 LDFLAGS="-L$SAGE_LOCAL/lib $LDFLAGS"
    21 
    22 
    23 # Compile for 64-bit if SAGE64 is set to 'yes':
    249if [ "x$SAGE64" = xyes ]; then
    25     echo >&2 "Building a 64-bit version of lcalc"
     10    echo "Building a 64-bit version of lcalc"
    2611
    2712    # Both Sun and GNU compilers use -m64 to build 64-bit code, but compilers
    2813    # from IBM (on AIX), and HP (on HP-UX) do not. So allow the environment
     
    3520    if [ -z "$CXXFLAG64" ]; then
    3621        CXXFLAG64="$CFLAG64" # default to that of the C compiler
    3722    fi
    38     export CFLAG64
    39     export CXXFLAG64
    4023
    4124    CFLAGS="$CFLAGS $CFLAG64"
    4225    CXXFLAGS="$CXXFLAGS $CXXFLAG64"
    43     FCFLAGS="$FCFLAGS $CXXFLAG64" # XXX Does this make sense?
    44     F77FLAGS="$F77FLAGS $CXXFLAG64"
    45     # Some packages may need LDFLAGS and/or ABI set here.
    46     # LDFLAGS="$LDFLAGS $CFLAG64" # XXX Perhaps should use some LDFLAG64.
    47     # ABI=64
    48     # Normally one would just add this to CXXFLAGS, but since the Makefile
    49     # does not import CXXFLAGS properly, and it would take a major change to
    50     # sort out the Makefile properly, the variable can just be added here,
    51     # and ${CXXFLAG64} added at the right point in the Makefile for 64-bit
    52     # builds.
    53     # (The last sentence apparently refers to CXXFLAG64 only. -leif)
    5426fi
    5527
    5628# If SAGE_DEBUG is set to 'yes', add debugging information.  Since both
    5729# the Sun and GNU compilers accept -g to give debugging information,
    5830# there is no need to do anything specific to one compiler or the other.
     31if [ "x$SAGE_DEBUG" = xyes ]; then
     32    echo "Code will be built with debugging information present. Unset 'SAGE_DEBUG'"
     33    echo "or set it to 'no' if you don't want that."
    5934
    60 if [ "x$SAGE_DEBUG" = xyes ]; then
    61     echo >&2 "Code will be built with debugging information present. Unset 'SAGE_DEBUG'"
    62     echo >&2 "or set it to 'no' if you don't want that."
    63 
    64     CFLAGS="$CFLAGS -g"
    65     CXXFLAGS="$CXXFLAGS -g"
    66     FCFLAGS="$FCFLAGS -g"
    67     F77FLAGS="$F77FLAGS -g"
     35    CFLAGS="$CFLAGS -O0 -g"
     36    CXXFLAGS="$CXXFLAGS -O0 -g"
    6837else
    69     echo >&2 "No debugging information will be used during the build of this package."
    70     echo >&2 "Set 'SAGE_DEBUG' to 'yes' if you want debugging information present (-g added)."
     38    echo "No debugging information will be used during the build of this package."
     39    echo "Set 'SAGE_DEBUG' to 'yes' if you want debugging information present (-g added)."
    7140fi
    7241
    73 # Add appropriate flag(s) to show all warnings.
    74 # This test of a compiler is not perfect by any means, but is better than
    75 # nothing:
    76 
    77 if $CC -flags >/dev/null 2>&1; then
    78     SUN_COMPILER=1
    79     # The Sun compilers are fussy, and adding extra
    80     # warnings will just show too many.
    81 else
    82     # Assume gcc if not the Sun C compiler.
    83     GNU_COMPILER=1
    84     # Add -Wall to show all warnings.
    85     CFLAGS="-Wall $CFLAGS"
    86     CXXFLAGS="-Wall $CXXFLAGS"
    87     FCFLAGS="-Wall $FCFLAGS"
    88     F77FLAGS="-Wall $F77FLAGS"
    89 fi
    90 
    91 # Determine if the C++ compiler is the Sun or GNU compiler,
    92 # just to check we are not mixing GNU and non-GNU:
    93 if $CXX -flags >/dev/null 2>&1; then
    94     SUN_COMPILER=1
    95 else
    96     # Assume gcc/g++ if not the Sun C++ compiler.
    97     GNU_COMPILER=1
    98 fi
    99 
    100 # Determine if the Fortran compiler is the Sun or GNU compiler:
    101 if [ -z "$SAGE_FORTRAN" ]; then
    102     echo >&2 "No Fortran compiler has been defined. This is not normally a problem."
    103 else
    104     if $SAGE_FORTRAN -flags >/dev/null 2>&1; then
    105         SUN_COMPILER=1
    106     else
    107         GNU_COMPILER=1
    108     fi
    109 fi
    110 
    111 # Check if SAGE_FORTRAN_LIB is defined, that the file actually exists.
    112 # SAGE_FORTRAN_LIB does not always need to be defined, but if it is defined,
    113 # then the file should exist.
    114 if [ -n "$SAGE_FORTRAN_LIB" ] && [ ! -r "$SAGE_FORTRAN_LIB" ]; then
    115     echo >&2 "Error: SAGE_FORTRAN_LIB is defined as '$SAGE_FORTRAN_LIB',"
    116     echo >&2 "but that file does not exist (or isn't readable)."
    117     exit 1
    118 fi
    119 
    120 # Checks that the user is not mixing the Sun and GNU compilers. This problem
    121 # has been seen on code built with the aid of SCons, but in general could
    122 # happen with any code if the user has specified a C compiler but not a C++ one.
    123 # This problem is even more likely to occur with the Fortran compiler - I've
    124 # done it myself when building Sage!
    125 if [ "x$SUN_COMPILER" = "x1" ] && [ "x$GNU_COMPILER" = "x1" ]; then
    126     echo >&2 "Error: You are mixing the Sun and GNU C/C++/Fortran compilers."
    127     echo >&2 "Such a combination will lead to problems."
    128     echo >&2 "Check the environment variables CC, CXX & SAGE_FORTRAN carefully."
    129     echo >&2 "Exiting ..."
    130     exit 1
    131 fi
    132 
    133 echo "The following environment variables will be exported:"
    134 
    135 # These are all used by GNU to specify compilers:
    136 echo "Using CC=$CC"
    137 echo "Using CXX=$CXX"
    138 echo "Using FC=$FC"
    139 echo "Using F77=$F77"
    140 
    141 # Usually, one would add LD here, too.
    142 echo "Using MAKE=$MAKE"
    143 
    144 # Used by Sage in connection with Fortran:
    145 echo "Using SAGE_FORTRAN=$SAGE_FORTRAN"
    146 echo "Using SAGE_FORTRAN_LIB=$SAGE_FORTRAN_LIB"
    147 
    148 # Flags which may be set:
    149 echo "Using CFLAG64=$CFLAG64"
    150 echo "Using CXXFLAG64=$CXXFLAG64"
    151 echo "Using CFLAGS=$CFLAGS"
    152 echo "Using CXXFLAGS=$CXXFLAGS"
    153 echo "Using FCFLAGS=$FCFLAGS"
    154 echo "Using F77FLAGS=$F77FLAGS"
    155 echo "Using CPPFLAGS=$CPPFLAGS"
    156 echo "Using LDFLAGS=$LDFLAGS"
    157 echo "Using ABI=$ABI"
    158 echo "'configure' scripts and/or makefiles might override these later."
    159 echo " "
    160 
    16142# Export everything. Probably not necessary in most cases.
    16243export CFLAGS
    16344export CXXFLAGS
    164 export FCFLAGS
    165 export F77FLAGS
    166 export CPPFLAGS
    167 export LDFLAGS
    168 export ABI
    169 # (Variables like CC, CXX etc. have already been exported by 'sage-env'.)
    170 
    171 # End of pretty general spkg-install file.
    172 # Now do the specific things needed for this package (lcalc).
    17345
    17446success() {
    17547    if [ $? -ne 0 ]; then
     
    18052
    18153export DEFINES=""
    18254
     55# Set installation directory
     56export INSTALL_DIR="$SAGE_LOCAL/"
     57
    18358cd src
    18459
    18560# Apply Sage-specific patches: (See SPKG.txt for details on the patches.)
    186 echo >&2 "Patching the upstream source code for Sage..."
     61echo "Patching the upstream source code for Sage..."
    18762for patch in ../patches/*.patch; do
    188     patch -p1 <"$patch"
     63    patch -p1 < "$patch"
    18964    success "patch $patch failed to apply"
    19065done
    19166
     
    19570cd src   # Now we are in src/src.
    19671
    19772# Build everything:
    198 echo >&2 "Now building lcalc, example programs and the shared library..."
     73echo "Now building lcalc, example programs and the shared library..."
    19974$MAKE
    200 success 'make'
     75success "$MAKE"
    20176
    202 echo >&2 "Now copying over lcalc binary..."
    203 cp lcalc "$SAGE_LOCAL"/bin
    204 success 'copying binary'
    205 
    206 echo >&2 "Now copying over lcalc library..."
    207 
    208 # Remove next few lines when MacOS X 10.4 (Darwin 8) is no longer supported.
    209 # 10.4 does not seem to compile with .so extension in the library files.
    210 if [ "$UNAME" = "Darwin" ]; then
    211     if [ `sysctl -n kern.osrelease | cut -d . -f 1` -lt 9 ]; then
    212         cp libLfunction.so "$SAGE_LOCAL"/lib/libLfunction.dylib
    213         success "copying libLfunction.dylib"
    214     fi
    215 fi # End of MacOS X 10.4 specific instructions
    216 
    217 
    218 if [ "$UNAME" = "CYGWIN" ]; then
    219     cp libLfunction.so "$SAGE_LOCAL"/lib/libLfunction.dll
    220 else
    221     cp libLfunction.so "$SAGE_LOCAL"/lib/
    222 fi
    223 success "copying libLfunction.so"
    224 
    225 echo >&2 "Now copying over lcalc library header files..."
    226 rm -fr "$SAGE_LOCAL"/include/lcalc
    227 mkdir -p "$SAGE_LOCAL"/include/lcalc
    228 cp ../include/* "$SAGE_LOCAL"/include/lcalc
    229 success 'copying header files'
     77# Install everything
     78echo "Now installing lcalc binary, library and header files..."
     79rm -fr "$SAGE_LOCAL"/include/libLfunction
     80$MAKE install
     81success "$MAKE install"