Ticket #9722: trac_9722-pari-2.3.5.p3-p4.patch

File trac_9722-pari-2.3.5.p3-p4.patch, 22.9 KB (added by leif, 11 years ago)

SPKG patch, now a proper Mercurial changeset. Apply to pari-2.3.5.p3.spkg. (Further improvements w.r.t. graphics support; some clean-up.)

  • .hgignore

    # HG changeset patch
    # User Leif Leonhardy <not.really@online.de>
    # Date 1282558041 -7200
    # Node ID 1794934d9072f0d31310620f4ef056c4ed7e1dac
    # Parent  dc34abfbcf0e74b75c09b1db5f3504cf207dfde4
    #9722: pari-2.3.5.p4: Further improvements wrt. graphics support, some clean-up. (See also #9343.)
    
    === pari-2.3.5.p4 (Leif Leonhardy, August 23th 2010) ===
     * #9722: "--graphic=none" is now respected by PARI. We still look
       for graphics libraries, but don't use them in that case (see below,
       too).
     * #9722: Improved patch to config/get_fltk (makes sure the header
       files are present, too, if the FLTK library was found - fixes
       compiler error on IMHO misconfigured installations).
       We still look for FLTK components even if "--graphic=none" was
       specified, and print appropriate messages, but then simply do not
       use them.
     * #9722: New patch to config/get_X11:
       - Added/corrected/clarified messages regarding what was (not) found,
         and if this is really relevant.
       - An X11 library in */lib64/* will be found now, too (if we do a
         64-bit build); on Fedora, libX11.so is located in /usr/lib64.
       - Added comments.
     * spkg-install:
       - Clear (unset) lots of variables that might (unintentionally) be
         used by PARI; perhaps upstream should initialize them.
       - Clear GP_INSTALL_PREFIX, which is interpreted by PARI.
       - Added help & informational message regarding PARI_EXTRA_OPTS; in
         addition, allow the user to override Sage's "--graphic=none"
         since this now works (see above; we don't want to annoy users
         that perhaps previously made use of GP's plotting support).
     * Clean-up in spkg-install:
       - Quote more environment variables (including SAGE_LOCAL).
       - Consistently use $UNAME instead of `uname` (set in sage-env).
       - Always use $MAKE instead of "make" (changed once, for install-data).
       - Added some comments.
     * NOTE: At least some of these changes should be incorporated into
       our PARI 2.4.3 (svn 12577, see #9343), and/or reported upstream.
       I haven't changed config/get_Qt. It seems Qt support is broken on
       newer systems (because Qt <=3 is expected), but this doesn't break
       the build, only Qt will not be used.
    
    diff -r dc34abfbcf0e -r 1794934d9072 .hgignore
    a b  
    11src/
     2patches/get_fltk.patch.p3
  • SPKG.txt

    diff -r dc34abfbcf0e -r 1794934d9072 SPKG.txt
    a b  
    6565
    6666== Changelog ==
    6767
     68=== pari-2.3.5.p4 (Leif Leonhardy, August 23th 2010) ===
     69 * #9722: "--graphic=none" is now respected by PARI. We still look
     70   for graphics libraries, but don't use them in that case (see below,
     71   too).
     72 * #9722: Improved patch to config/get_fltk (makes sure the header
     73   files are present, too, if the FLTK library was found - fixes
     74   compiler error on IMHO misconfigured installations).
     75   We still look for FLTK components even if "--graphic=none" was
     76   specified, and print appropriate messages, but then simply do not
     77   use them.
     78 * #9722: New patch to config/get_X11:
     79   - Added/corrected/clarified messages regarding what was (not) found,
     80     and if this is really relevant.
     81   - An X11 library in */lib64/* will be found now, too (if we do a
     82     64-bit build); on Fedora, libX11.so is located in /usr/lib64.
     83   - Added comments.
     84 * spkg-install:
     85   - Clear (unset) lots of variables that might (unintentionally) be
     86     used by PARI; perhaps upstream should initialize them.
     87   - Clear GP_INSTALL_PREFIX, which is interpreted by PARI.
     88   - Added help & informational message regarding PARI_EXTRA_OPTS; in
     89     addition, allow the user to override Sage's "--graphic=none"
     90     since this now works (see above; we don't want to annoy users
     91     that perhaps previously made use of GP's plotting support).
     92 * Clean-up in spkg-install:
     93   - Quote more environment variables (including SAGE_LOCAL).
     94   - Consistently use $UNAME instead of `uname` (set in sage-env).
     95   - Always use $MAKE instead of "make" (changed once, for install-data).
     96   - Added some comments.
     97 * NOTE: At least some of these changes should be incorporated into
     98   our PARI 2.4.3 (svn 12577, see #9343), and/or reported upstream.
     99   I haven't changed config/get_Qt. It seems Qt support is broken on
     100   newer systems (because Qt <=3 is expected), but this doesn't break
     101   the build, only Qt will not be used.
     102
    68103=== pari-2.3.5.p3 (Leif Leonhardy, August 11th 2010) ===
    69104 * #9722: Explicitly link against libstdc++ if FLTK is used, to support
    70105   Fedora 13.
     
    75110   so I believe this error is due to a broken/invalid FLTK installation on
    76111   the machines at ETH Zurich. (One could add an extra test for presence of
    77112   the FLTK include directory to make the build more robust.)
    78    
    79113
    80114=== pari-2.3.5.p2 (Mitesh Patel, July 26th 2010) ===
    81115 * #9597: Clean up first line of spkg-install.  Also, use
  • new file patches/get_X11

    diff -r dc34abfbcf0e -r 1794934d9072 patches/get_X11
    - +  
     1tdir=$osname-$arch-X11$$
     2mkdir $tdir; cp Imakefile $tdir; cd $tdir
     3if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
     4  echo "Using 'xmkmf' to locate X11 headers and libraries..."
     5  eval `make gp-X11 2> /dev/null | grep -v make`
     6  x11pth="$usrlibdir $libdir";
     7else
     8  echo "'xmkmf' seems not to be available..."
     9fi
     10cd ..; rm -rf $tdir
     11
     12# DEBUG (leif):
     13echo "... (\$Xincroot after xmkmf attempt is \"$Xincroot\".)"
     14echo "... (\$x11pth after xmkmf attempt is \"$x11pth\".)"
     15
     16# Check xmkmf answer
     17# X11 -- Headers
     18if test ! -f $Xincroot/X11/Xos.h; then
     19  x11pth="\
     20    /usr/openwin/share/lib\
     21    /usr/openwin/lib\
     22    /usr/X11R6/lib       /usr/X11R5/lib       /usr/X11R4/lib\
     23    /usr/lib/X11R6       /usr/lib/X11R5       /usr/lib/X11R4\
     24    /usr/local/X11R6/lib /usr/local/X11R5/lib /usr/local/X11R4/lib\
     25    /usr/local/lib/X11R6 /usr/local/lib/X11R5 /usr/local/lib/X11R4\
     26    /usr/X11/lib\
     27    /usr/lib/X11\
     28    /usr/local/X11/lib\
     29    /usr/local/lib/X11\
     30    /usr/XFree86/lib/X11\
     31    /usr/lib\
     32    /usr/local/lib\
     33    /usr/athena/lib\
     34  ";
     35  pth=`echo $x11pth | sed 's,/lib,/include,g'`
     36  x=`./locate X11/Xos.h '' $pth`
     37  case $x in
     38   /*) Xincroot=`echo $x | sed 's,/X11/Xos.h,,'`
     39       echo "...Found X11 header files in \"$Xincroot/X11\".";;
     40   *)  Xincroot=""
     41       echo "### Could not find X11 header files."
     42       case $which_graphic_lib in
     43         none)
     44           echo "(This is just informational - no graphics support was requested anyway.)";;
     45       esac
     46       ;;
     47  esac
     48else
     49  echo "...Found X11 header files in \"$Xincroot/X11\"."
     50fi
     51
     52# X11 -- Lib
     53pth=$x11pth
     54lib=X11; . ./locatelib
     55# Comment by leif:
     56# The above doesn't find a libX11.so in, e.g., /usr/lib64 (Fedora 13),
     57# so try again if we are on a 64-bit system (added by me):
     58if test -z "$X11" -a "$sizeof_long" -eq 8; then
     59  echo "...libX11.so not yet found, searching 64-bit directories..."
     60  pth=`echo $x11pth | sed 's,/lib,/lib64,g'`
     61  lib=X11; . ./locatelib
     62fi
     63
     64if test -f $Xincroot/X11/Xos.h -a -n "$X11"; then
     65  case $which_graphic_lib in
     66    auto) which_graphic_lib=X11;;
     67  esac
     68  echo ..."Found X11 header files in $Xincroot/X11"
     69  echo ..."Found X11 library in $X11"
     70  test -n "$extralib" && echo ..."Extra Libraries are $extralib"
     71  X11_LIBS="-L$X11 -lX11 $extralib"
     72  X11_INC="-I$Xincroot"
     73else
     74  echo "### Not all necessary parts of X11 found"
     75  case $which_graphic_lib in
     76    none)
     77      echo "(This is just informational - no graphics support was requested anyway.)";;
     78  esac
     79  X11=
     80fi
     81
  • new file patches/get_X11.patch

    diff -r dc34abfbcf0e -r 1794934d9072 patches/get_X11.patch
    - +  
     1--- ../src/config/get_X11       2008-03-31 13:43:59.000000000 +0200
     2+++ get_X11     2010-08-23 08:04:45.000000000 +0200
     3@@ -1,11 +1,18 @@
     4 tdir=$osname-$arch-X11$$
     5 mkdir $tdir; cp Imakefile $tdir; cd $tdir
     6 if (xmkmf) >/dev/null 2>&1 && test -f Makefile; then
     7+  echo "Using 'xmkmf' to locate X11 headers and libraries..."
     8   eval `make gp-X11 2> /dev/null | grep -v make`
     9   x11pth="$usrlibdir $libdir";
     10+else
     11+  echo "'xmkmf' seems not to be available..."
     12 fi
     13 cd ..; rm -rf $tdir
     14 
     15+# DEBUG (leif):
     16+echo "... (\$Xincroot after xmkmf attempt is \"$Xincroot\".)"
     17+echo "... (\$x11pth after xmkmf attempt is \"$x11pth\".)"
     18+
     19 # Check xmkmf answer
     20 # X11 -- Headers
     21 if test ! -f $Xincroot/X11/Xos.h; then
     22@@ -28,22 +35,47 @@
     23   pth=`echo $x11pth | sed 's,/lib,/include,g'`
     24   x=`./locate X11/Xos.h '' $pth`
     25   case $x in
     26-   /*) Xincroot=`echo $x | sed 's,/X11/Xos.h,,'`;;
     27-   *)  Xincroot=;;
     28+   /*) Xincroot=`echo $x | sed 's,/X11/Xos.h,,'`
     29+       echo "...Found X11 header files in \"$Xincroot/X11\".";;
     30+   *)  Xincroot=""
     31+       echo "### Could not find X11 header files."
     32+       case $which_graphic_lib in
     33+         none)
     34+           echo "(This is just informational - no graphics support was requested anyway.)";;
     35+       esac
     36+       ;;
     37   esac
     38+else
     39+  echo "...Found X11 header files in \"$Xincroot/X11\"."
     40 fi
     41+
     42 # X11 -- Lib
     43 pth=$x11pth
     44 lib=X11; . ./locatelib
     45+# Comment by leif:
     46+# The above doesn't find a libX11.so in, e.g., /usr/lib64 (Fedora 13),
     47+# so try again if we are on a 64-bit system (added by me):
     48+if test -z "$X11" -a "$sizeof_long" -eq 8; then
     49+  echo "...libX11.so not yet found, searching 64-bit directories..."
     50+  pth=`echo $x11pth | sed 's,/lib,/lib64,g'`
     51+  lib=X11; . ./locatelib
     52+fi
     53+
     54 if test -f $Xincroot/X11/Xos.h -a -n "$X11"; then
     55   case $which_graphic_lib in
     56     auto) which_graphic_lib=X11;;
     57   esac
     58   echo ..."Found X11 header files in $Xincroot/X11"
     59+  echo ..."Found X11 library in $X11"
     60   test -n "$extralib" && echo ..."Extra Libraries are $extralib"
     61   X11_LIBS="-L$X11 -lX11 $extralib"
     62   X11_INC="-I$Xincroot"
     63 else
     64-  echo "### X11 not found"
     65+  echo "### Not all necessary parts of X11 found"
     66+  case $which_graphic_lib in
     67+    none)
     68+      echo "(This is just informational - no graphics support was requested anyway.)";;
     69+  esac
     70   X11=
     71 fi
     72+
  • patches/get_fltk

    diff -r dc34abfbcf0e -r 1794934d9072 patches/get_fltk
    a b  
    22  case "$which_graphic_lib" in
    33    fltk) with_fltk=yes;;
    44  esac
     5  # (Just the) Comment by leif:
     6  # In case not all necessary parts of X11 (headers *and* lib)
     7  # were found, look for FLTK:
    58  if test -z "$X11"; then with_fltk=yes; fi
    69fi
    710if test -n "$with_fltk"; then
     11  orig_which_graphic_lib=$which_graphic_lib
    812  which_graphic_lib=fltk
    913  FLTKDIR=
    1014  case "$with_fltk" in
     
    1519     fi
    1620     ;;
    1721  *) if test ! -d "$with_fltk"; then
    18       echo "### FLTK directory '$with_fltk' not found"
     22      echo "### Specified FLTK directory '$with_fltk' not found."
    1923    else
    2024      FLTKDIR=$with_fltk
    2125    fi;;
    2226  esac
    2327  if test -n "$FLTKDIR"; then
    24     case "$FLTKDIR" in /) FLTKDIR=;; esac
    25     echo "Using FLTK library, FLTKDIR = $FLTKDIR"
     28    case "$FLTKDIR" in /) FLTKDIR=;; esac # leif: ???
     29    case "$orig_which_graphic_lib" in
     30      none)
     31        # echo "...Found FLTK library in \"$FLTKDIR\"."
     32        if test -n "$fltk"; then
     33          echo "...Found FLTK library in \"$fltk\"."
     34        else
     35          echo "...Assuming FLTK library is in specified directory \"$FLTKDIR\"."
     36        fi
     37        if test -d "$FLTKDIR/include/FL"; then
     38          echo "...Found FLTK header files in \"$FLTKDIR/include/FL\"."
     39        else
     40          echo "...But FLTK header files/include directory not found."
     41        fi
     42        which_graphic_lib=none # =$orig_which_graphic_lib
     43        ;;
     44      *)
     45        if test -d "$FLTKDIR/include/FL"; then
     46          echo "Using FLTK library, FLTKDIR = \"$FLTKDIR\"."
     47        else
     48          echo "### Found FLTK library, but not the necessary headers."
     49          echo "### Building without FLTK support."
     50          which_graphic_lib=none
     51        fi
     52        ;;
     53    esac
    2654  else
    27     echo "### FLTK not found. Building without FLTK support"
     55    echo "### FLTK not found. Building without FLTK support."
     56    case "$orig_which_graphic_lib" in
     57      none)
     58        echo "(This is just informational - no graphics support was requested anyway.)"
     59        ;;
     60    esac
    2861    which_graphic_lib=none
    2962  fi
    3063  case "$osname" in
  • patches/get_fltk.patch

    diff -r dc34abfbcf0e -r 1794934d9072 patches/get_fltk.patch
    a b  
    11--- ../src/config/get_fltk      2008-03-31 13:43:59.000000000 +0200
    2 +++ get_fltk    2010-08-11 19:13:17.000000000 +0200
    3 @@ -30,6 +30,6 @@
     2+++ get_fltk    2010-08-23 08:39:45.000000000 +0200
     3@@ -2,9 +2,13 @@
     4   case "$which_graphic_lib" in
     5     fltk) with_fltk=yes;;
     6   esac
     7+  # (Just the) Comment by leif:
     8+  # In case not all necessary parts of X11 (headers *and* lib)
     9+  # were found, look for FLTK:
     10   if test -z "$X11"; then with_fltk=yes; fi
     11 fi
     12 if test -n "$with_fltk"; then
     13+  orig_which_graphic_lib=$which_graphic_lib
     14   which_graphic_lib=fltk
     15   FLTKDIR=
     16   case "$with_fltk" in
     17@@ -15,21 +19,50 @@
     18      fi
     19      ;;
     20   *) if test ! -d "$with_fltk"; then
     21-      echo "### FLTK directory '$with_fltk' not found"
     22+      echo "### Specified FLTK directory '$with_fltk' not found."
     23     else
     24       FLTKDIR=$with_fltk
     25     fi;;
     26   esac
     27   if test -n "$FLTKDIR"; then
     28-    case "$FLTKDIR" in /) FLTKDIR=;; esac
     29-    echo "Using FLTK library, FLTKDIR = $FLTKDIR"
     30+    case "$FLTKDIR" in /) FLTKDIR=;; esac # leif: ???
     31+    case "$orig_which_graphic_lib" in
     32+      none)
     33+        # echo "...Found FLTK library in \"$FLTKDIR\"."
     34+        if test -n "$fltk"; then
     35+          echo "...Found FLTK library in \"$fltk\"."
     36+        else
     37+          echo "...Assuming FLTK library is in specified directory \"$FLTKDIR\"."
     38+        fi
     39+        if test -d "$FLTKDIR/include/FL"; then
     40+          echo "...Found FLTK header files in \"$FLTKDIR/include/FL\"."
     41+        else
     42+          echo "...But FLTK header files/include directory not found."
     43+        fi
     44+        which_graphic_lib=none # =$orig_which_graphic_lib
     45+        ;;
     46+      *)
     47+        if test -d "$FLTKDIR/include/FL"; then
     48+          echo "Using FLTK library, FLTKDIR = \"$FLTKDIR\"."
     49+        else
     50+          echo "### Found FLTK library, but not the necessary headers."
     51+          echo "### Building without FLTK support."
     52+          which_graphic_lib=none
     53+        fi
     54+        ;;
     55+    esac
     56   else
     57-    echo "### FLTK not found. Building without FLTK support"
     58+    echo "### FLTK not found. Building without FLTK support."
     59+    case "$orig_which_graphic_lib" in
     60+      none)
     61+        echo "(This is just informational - no graphics support was requested anyway.)"
     62+        ;;
     63+    esac
     64     which_graphic_lib=none
     65   fi
    466   case "$osname" in
    567     cygwin) FLTK_LIBS="-lgdi32 -lole32 -luuid -lwsock32 -lsupc++" ;;
    668     darwin) FLTK_LIBS="-framework Carbon -lsupc++" ;;
  • spkg-install

    diff -r dc34abfbcf0e -r 1794934d9072 spkg-install
    a b  
    99# needs to be if using gcc. I assume the equivalent will be needed on
    1010# other compilers.
    1111
    12 if [ `uname` = "SunOS" ]; then
     12if [ "$UNAME" = "SunOS" ]; then
    1313    sed 's/-fomit-frame-pointer/-fomit-frame-pointer -fPIC/g' src/config/get_cc > src/config/get_cc.$$
    1414    mv src/config/get_cc.$$ src/config/get_cc
    1515fi
     
    1919cp "$TOP"/patches/get_dlld config/
    2020
    2121# mabshoff: This patch is to get around problem in PPC 32-bit Linux build
    22 # (but it is ok on any other machine)
     22#           (but it is ok on any other machine)
     23# leif: And also on MacOS X 10.4 (Tiger, at least on PPC),
     24#       which in addition needs "-fno-common".
    2325cp "$TOP"/patches/get_dlcflags config/
    2426
    2527# pjeremy: fix for FreeBSD: #7825
     
    3335
    3436# Minh Van Nguyen: copy over patched get_cc (see ticket #7092). It's
    3537# reported that 32-bit Fedora 11 would fail to build otherwise.
    36 if [ `uname` = "Linux" ]; then
     38if [ "$UNAME" = "Linux" ]; then
    3739    cp "$TOP"/patches/get_cc config/get_cc
    3840fi
    3941
    40 # leif: Add libstdc++ for Fedora 13 (if FLTK is present, see #9722):
     42# leif: Add libstdc++ for Fedora 13 (if FLTK is present, see #9722),
     43# and in addition make sure the necessary FLTK include directory is
     44# really there, since on some sites otherwise a compiler error might
     45# break the build. Also respect "--graphic=none":
    4146cp "$TOP"/patches/get_fltk config/
    4247
     48# leif: Clarify PARI's "X11 not found" message (see #9722, too),
     49#       add some messages. Also search */lib64/* directories if
     50#       we are doing a 64-bit build, and respect "--graphic=none":
     51cp "$TOP"/patches/get_X11 config/
     52
    4353# This is needed or there are weird locale problems involving rpath
    4454# with building Sage.
    4555LC_ALL=C
     
    5161{
    5262    #  add the proper flags for 64-bit build mode on OS X and Open Solaris x64
    5363    if [ "x$SAGE64" = xyes ]; then
    54         CFLAGS="-g -m64 " && export CFLAGS
     64        echo "Building a 64-bit version of PARI/GP"
     65        CFLAGS="$CFLAGS -g -m64" && export CFLAGS
    5566    fi
    5667
    5768    CUR=`pwd`
     
    6475    unset AS
    6576
    6677    if [ "$PARI_EXTRA_OPTS" = "" ]; then
    67         PARI_EXTRA_OPTS=" --graphic=none "
     78        echo "============================================================"
     79        echo "Configuring PARI/GP without graphics support (for plotting)."
     80        echo "If you need it, pass the appropriate option(s) to PARI by"
     81        echo "setting and exporting \$PARI_EXTRA_OPTS prior to building"
     82        echo "Sage (or at least before you build/install the PARI spkg),"
     83        echo "e.g. by typing at the shell prompt:"
     84        echo "    export PARI_EXTRA_OPTS=\"--graphic=auto\""
     85        echo "or"
     86        echo "    export PARI_EXTRA_OPTS=\"--with-fltk\""
     87        echo "Please consult the PARI documentation for further details."
     88        echo "============================================================"
     89
     90        PARI_EXTRA_OPTS="--graphic=none"
     91    else
     92        echo "============================================================"
     93        echo "Configuring PARI/GP with additional user-specified options:"
     94        echo "    PARI_EXTRA_OPTS=\"$PARI_EXTRA_OPTS\""
     95
     96        # Do NOT add "--graphic=none" if the user provided one of these:
     97        if ! (echo "$PARI_EXTRA_OPTS" | egrep -- "--with-fltk|--with-qt") >/dev/null; then
     98          echo "To avoid unexpected behavior, we prepend \"--graphic=none\":"
     99          PARI_EXTRA_OPTS="--graphic=none $PARI_EXTRA_OPTS"
     100          echo "    \"$PARI_EXTRA_OPTS\""
     101          echo "(Disabling graphics can be overridden by user settings.)"
     102        fi
     103        echo "============================================================"
    68104    fi
    69105
    70     ./Configure $PARI_EXTRA_OPTS --prefix=$SAGE_LOCAL --with-readline=$SAGE_LOCAL --with-gmp=$SAGE_LOCAL --kernel=gmp --graphic=none
     106    unset GP_INSTALL_PREFIX # we do not want this to be set by the user
     107
     108    # In addition, a lot of variables used (internally) by PARI might un-
     109    # intentionally get their values from the "global" environment, so it's
     110    # safer to clear them here (not further messing up PARI's scripts):
     111    unset static tune timing_fun error
     112    unset with_fltk with_qt
     113    unset with_ncurses_lib
     114    unset with_readline_include with_readline_lib without_readline
     115    unset with_gmp_include with_gmp_lib without_gmp
     116    unset dfltbindir dfltdatadir dfltemacsdir dfltincludedir
     117    unset dfltlibdir dfltmandir dfltsysdatadir dfltobjdir
     118    # The following get set because we pass the respective parameters:
     119    # prefix kernel with_gmp with_readline
     120   
     121
     122    # echo "Configuring PARI/GP..." # already said above
     123    ./Configure $PARI_EXTRA_OPTS --prefix="$SAGE_LOCAL" --with-readline="$SAGE_LOCAL" \
     124        --with-gmp="$SAGE_LOCAL" --kernel=gmp
    71125
    72126    if [ $? -ne 0 ]; then
    73         echo "ERROR - configure PARI with readline and gmp failed."
     127        echo "ERROR: Configuring PARI with readline and gmp failed."
    74128        exit 1
    75129    fi
    76130
    77131    if [ ! -f Makefile ]; then
    78         echo "Unable to configure PARI."
     132        echo "ERROR: Unable to configure PARI: No Makefile generated!"
    79133        exit 1
    80134    fi
    81135
    82     echo "Building and install PARI"
     136    echo "Building and installing PARI..."
    83137    if [ "$UNAME" = "CYGWIN" ]; then
    84138        # There are weird bugs in PARI's build process on Windows XP
    85139        # under Cygwin.
     
    115169    # Instead of "make install" we do the following, to avoid building
    116170    # the PARI documentation (which requires latex; or more precisely,
    117171    # *hangs* under a default cygwin with latex, since some fonts are missing).
    118     cd `config/objdir`
     172    cd "`config/objdir`"
    119173    $MAKE install-include
    120174
    121175    if [ $? -ne 0 ]; then
     
    123177        exit 1
    124178    fi
    125179
    126     cp -f libpari* $SAGE_LOCAL/lib/
     180    cp -f libpari* "$SAGE_LOCAL/lib/"
    127181    cd "$CUR"
    128182
    129183    # On CYGWIN, need the dll for PARI to be in the same
     
    148202            exit 1
    149203        fi
    150204
    151         cd `config/objdir`
    152         cp -f libpari* $SAGE_LOCAL/lib
     205        cd "`config/objdir`"
     206        cp -f libpari* "$SAGE_LOCAL/lib"
    153207        cd "$CUR"
    154208
    155209        # Also another patch since paripriv.h won't compile right on OS X
    156210        # when used by client Sage code.  So we replace it by a slightly
    157211        # modified version.
    158         cp -pf "$TOP"/patches/paripriv-osx.h $SAGE_LOCAL/include/pari/paripriv.h
     212        cp -pf "$TOP"/patches/paripriv-osx.h "$SAGE_LOCAL/include/pari/paripriv.h"
    159213    fi
    160214    # Like on OS X (see above), the Sage library would not build
    161215    # without some changes. Though on Solaris the changes are much simpler than
    162216    # on OS X.
    163     if [ `uname` = "SunOS" ]; then
     217    if [ "$UNAME" = "SunOS" ]; then
    164218       set -e
    165219       echo "Patching include/pari/paripriv.h so it works on Solaris"
    166220       echo "The changes are much smaller than needed on OS X"
    167        cp  "$TOP"/patches/paripriv-Solaris.h $SAGE_LOCAL/include/pari/paripriv.h
     221       cp  "$TOP"/patches/paripriv-Solaris.h "$SAGE_LOCAL/include/pari/paripriv.h"
    168222       set +e
    169223    elif [ "$UNAME" = "CYGWIN" ]; then
    170224       # We need to the same thing on Cygwin that we have to do on Solaris
    171        cp  "$TOP"/patches/paripriv-Solaris.h $SAGE_LOCAL/include/pari/paripriv.h
     225       cp  "$TOP"/patches/paripriv-Solaris.h "$SAGE_LOCAL/include/pari/paripriv.h"
    172226    fi
    173227
    174228    echo "Installing extra Galois groups data."
    175     make install-data
     229    $MAKE install-data
    176230    if [ $? -ne 0 ]; then
    177         echo "Error installing extra galois groups data."
     231        echo "Error installing extra Galois groups data."
    178232        exit 1
    179233    fi
    180234}
    181235
    182236build
    183237
     238# leif: This is redundant, and will never occur since we would have exited earlier:
    184239if [ $? -ne 0 ]; then
    185240    echo "Error building PARI."
    186241    exit 1
    187242fi
    188243
    189 if [ $UNAME="Darwin" -a -f $SAGE_LOCAL/lib/libpari.dylib ]; then
     244if [ "$UNAME"="Darwin" -a -f "$SAGE_LOCAL/lib/libpari.dylib" ]; then
    190245    exit 0
    191246fi
    192247
    193 if [ -f $SAGE_LOCAL/lib/libpari.so ]; then
     248if [ -f "$SAGE_LOCAL/lib/libpari.so" ]; then
    194249    exit 0
    195250fi
    196251
     252# leif: This is redundant, again:
    197253if [ $? -ne 0 ]; then
    198254    echo "Error building PARI."
    199255    exit 1