Ticket #14796: 0001-toplevel-move-files.patch

File 0001-toplevel-move-files.patch, 61.4 KB (added by felixs, 8 years ago)
  • new file GNUmakefile.am

    From c3257d5c1ac5ee91e0a1588b2e93f3a3cc0b9a99 Mon Sep 17 00:00:00 2001
    From: Felix Salfelder <felix@em.cs.uni-frankfurt.de>
    Date: Thu, 20 Jun 2013 10:23:07 +0200
    Subject: [PATCH 1/2] toplevel: move files
    
    (extra commit, to help git)
    ---
     GNUmakefile.am |  170 ++++++++++++++++++
     Makefile       |  170 ------------------
     build/deps     |  536 --------------------------------------------------------
     deps.in        |  527 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
     sage           |  142 ---------------
     sage.in        |  142 +++++++++++++++
     6 files changed, 839 insertions(+), 848 deletions(-)
     create mode 100644 GNUmakefile.am
     delete mode 100644 Makefile
     delete mode 100644 build/deps
     create mode 100644 deps.in
     delete mode 100755 sage
     create mode 100755 sage.in
    
    diff --git a/GNUmakefile.am b/GNUmakefile.am
    new file mode 100644
    index 0000000..6ac2e34
    - +  
     1# Main Makefile for Sage.
     2
     3# The default target ("all") builds Sage and the whole (HTML) documentation.
     4#
     5# Target "build" just builds Sage.
     6#
     7# See below for targets to build the documentation in other formats,
     8# to run various types of test suites, and to remove parts of the build etc.
     9
     10PIPE = build/pipestatus
     11
     12all: start doc  # indirectly depends on build
     13
     14logs:
     15        mkdir -p $@
     16
     17build: logs
     18        cd build && \
     19        "../$(PIPE)" \
     20                "env SAGE_PARALLEL_SPKG_BUILD='$(SAGE_PARALLEL_SPKG_BUILD)' ./install all 2>&1" \
     21                "tee -a ../logs/install.log"
     22        ./sage -b
     23
     24# ssl: build Sage, and also install pyOpenSSL. This is necessary for
     25# running the secure notebook. This make target requires internet
     26# access. Note that this requires that your system have OpenSSL
     27# libraries and headers installed. See README.txt for more
     28# information.
     29ssl: all
     30        ./sage -i pyopenssl
     31
     32build-serial: SAGE_PARALLEL_SPKG_BUILD = no
     33build-serial: build
     34
     35# Start Sage if the file local/etc/sage-started.txt does not exist
     36# (i.e. when we just installed Sage for the first time).
     37start: build
     38        [ -f local/etc/sage-started.txt ] || local/bin/sage-starts
     39
     40# You can choose to have the built HTML version of the documentation link to
     41# the PDF version. To do so, you need to build both the HTML and PDF versions.
     42# To have the HTML version link to the PDF version, do
     43#
     44# $ ./sage --docbuild all html
     45# $ ./sage --docbuild all pdf
     46#
     47# For more information on the docbuild utility, do
     48#
     49# $ ./sage --docbuild -H
     50doc: doc-html
     51
     52doc-html: build
     53        $(PIPE) "./sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/dochtml.log"
     54
     55doc-html-mathjax: build
     56        $(PIPE) "./sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/dochtml.log"
     57
     58# Keep target 'doc-html-jsmath' for backwards compatibility.
     59doc-html-jsmath: doc-html-mathjax
     60
     61doc-pdf: build
     62        $(PIPE) "./sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/docpdf.log"
     63
     64doc-clean:
     65        @echo "Deleting generated docs..."
     66        rm -rf src/doc/en/reference/*/sage
     67        rm -rf src/doc/en/reference/*/sagenb
     68        rm -rf src/doc/en/reference/sage
     69        rm -rf src/doc/en/reference/sagenb
     70        rm -rf src/doc/output
     71
     72clean:
     73        @echo "Deleting package build directories..."
     74        rm -rf local/var/tmp/sage/build
     75
     76lib-clean:
     77        @echo "Deleting Sage library build artifacts..."
     78        rm -f src/c_lib/.sconsign.dblite
     79        find src/c_lib -name '*.os' -exec rm {} +
     80        find src/c_lib -name '*.so' -exec rm {} +
     81        rm -rf src/build
     82
     83bdist-clean: clean
     84        @echo "Deleting miscellaneous artifacts generated by build system ..."
     85        rm -rf logs
     86        rm -rf dist
     87        rm -rf tmp
     88        rm -f build/Makefile
     89        rm -f .BUILDSTART
     90
     91distclean: clean doc-clean lib-clean bdist-clean
     92        @echo "Deleting all remaining output from build system ..."
     93        rm -rf local
     94
     95micro_release: bdist-clean lib-clean
     96        @echo "Stripping binaries ..."
     97        find local/lib local/bin -type f -exec strip '{}' ';' |& grep -v "File format not recognized" |  grep -v "File truncated" || true
     98
     99TESTPRELIMS = local/bin/sage-starts
     100TESTALL = ./sage -t --all
     101PTESTALL = ./sage -t -p --all
     102
     103test: all # i.e. build and doc
     104        $(TESTPRELIMS)
     105        $(TESTALL) --logfile=logs/test.log
     106
     107check: test
     108
     109testall: all # i.e. build and doc
     110        $(TESTPRELIMS)
     111        $(TESTALL) --optional=all --logfile=logs/testall.log
     112
     113testlong: all # i.e. build and doc
     114        $(TESTPRELIMS)
     115        $(TESTALL) --long --logfile=logs/testlong.log
     116
     117testalllong: all # i.e. build and doc
     118        $(TESTPRELIMS)
     119        $(TESTALL) --long --optional=all --logfile=logs/testalllong.log
     120
     121ptest: all # i.e. build and doc
     122        $(TESTPRELIMS)
     123        $(PTESTALL) --logfile=logs/ptest.log
     124
     125ptestall: all # i.e. build and doc
     126        $(TESTPRELIMS)
     127        $(PTESTALL) --optional=all --logfile=logs/ptestall.log
     128
     129ptestlong: all # i.e. build and doc
     130        $(TESTPRELIMS)
     131        $(PTESTALL) --long --logfile=logs/ptestlong.log
     132
     133ptestalllong: all # i.e. build and doc
     134        $(TESTPRELIMS)
     135        $(PTESTALL) --long --optional=all --logfile=logs/ptestalllong.log
     136
     137
     138testoptional: testall # just an alias
     139
     140testoptionallong: testalllong # just an alias
     141
     142ptestoptional: ptestall # just an alias
     143
     144ptestoptionallong: ptestalllong # just an alias
     145
     146
     147install:
     148        echo "Experimental use only!"
     149        if [ "$(DESTDIR)" = "" ]; then \
     150                echo >&2 "Set the environment variable DESTDIR to the install path."; \
     151                exit 1; \
     152        fi
     153        # Make sure we remove only an existing directory. If $(DESTDIR)/sage is
     154        # a file instead of a directory then the mkdir statement later will fail
     155        if [ -d "$(DESTDIR)"/sage ]; then \
     156                rm -rf "$(DESTDIR)"/sage; \
     157        fi
     158        mkdir -p "$(DESTDIR)"/sage
     159        mkdir -p "$(DESTDIR)"/bin
     160        cp -Rp * "$(DESTDIR)"/sage
     161        rm -f "$(DESTDIR)"/bin/sage
     162        ln -s ../sage/sage "$(DESTDIR)"/bin/sage
     163        "$(DESTDIR)"/bin/sage -c # Run sage-location
     164
     165
     166.PHONY: all build build-serial start install \
     167        doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
     168        doc-clean clean lib-clean bdist-clean distclean micro_release \
     169        test check testoptional testall testlong testoptionallong testallong \
     170        ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong
  • deleted file Makefile

    diff --git a/Makefile b/Makefile
    deleted file mode 100644
    index 6ac2e34..0000000
    + -  
    1 # Main Makefile for Sage.
    2 
    3 # The default target ("all") builds Sage and the whole (HTML) documentation.
    4 #
    5 # Target "build" just builds Sage.
    6 #
    7 # See below for targets to build the documentation in other formats,
    8 # to run various types of test suites, and to remove parts of the build etc.
    9 
    10 PIPE = build/pipestatus
    11 
    12 all: start doc  # indirectly depends on build
    13 
    14 logs:
    15         mkdir -p $@
    16 
    17 build: logs
    18         cd build && \
    19         "../$(PIPE)" \
    20                 "env SAGE_PARALLEL_SPKG_BUILD='$(SAGE_PARALLEL_SPKG_BUILD)' ./install all 2>&1" \
    21                 "tee -a ../logs/install.log"
    22         ./sage -b
    23 
    24 # ssl: build Sage, and also install pyOpenSSL. This is necessary for
    25 # running the secure notebook. This make target requires internet
    26 # access. Note that this requires that your system have OpenSSL
    27 # libraries and headers installed. See README.txt for more
    28 # information.
    29 ssl: all
    30         ./sage -i pyopenssl
    31 
    32 build-serial: SAGE_PARALLEL_SPKG_BUILD = no
    33 build-serial: build
    34 
    35 # Start Sage if the file local/etc/sage-started.txt does not exist
    36 # (i.e. when we just installed Sage for the first time).
    37 start: build
    38         [ -f local/etc/sage-started.txt ] || local/bin/sage-starts
    39 
    40 # You can choose to have the built HTML version of the documentation link to
    41 # the PDF version. To do so, you need to build both the HTML and PDF versions.
    42 # To have the HTML version link to the PDF version, do
    43 #
    44 # $ ./sage --docbuild all html
    45 # $ ./sage --docbuild all pdf
    46 #
    47 # For more information on the docbuild utility, do
    48 #
    49 # $ ./sage --docbuild -H
    50 doc: doc-html
    51 
    52 doc-html: build
    53         $(PIPE) "./sage --docbuild --no-pdf-links all html $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/dochtml.log"
    54 
    55 doc-html-mathjax: build
    56         $(PIPE) "./sage --docbuild --no-pdf-links all html -j $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/dochtml.log"
    57 
    58 # Keep target 'doc-html-jsmath' for backwards compatibility.
    59 doc-html-jsmath: doc-html-mathjax
    60 
    61 doc-pdf: build
    62         $(PIPE) "./sage --docbuild all pdf $(SAGE_DOCBUILD_OPTS) 2>&1" "tee -a logs/docpdf.log"
    63 
    64 doc-clean:
    65         @echo "Deleting generated docs..."
    66         rm -rf src/doc/en/reference/*/sage
    67         rm -rf src/doc/en/reference/*/sagenb
    68         rm -rf src/doc/en/reference/sage
    69         rm -rf src/doc/en/reference/sagenb
    70         rm -rf src/doc/output
    71 
    72 clean:
    73         @echo "Deleting package build directories..."
    74         rm -rf local/var/tmp/sage/build
    75 
    76 lib-clean:
    77         @echo "Deleting Sage library build artifacts..."
    78         rm -f src/c_lib/.sconsign.dblite
    79         find src/c_lib -name '*.os' -exec rm {} +
    80         find src/c_lib -name '*.so' -exec rm {} +
    81         rm -rf src/build
    82 
    83 bdist-clean: clean
    84         @echo "Deleting miscellaneous artifacts generated by build system ..."
    85         rm -rf logs
    86         rm -rf dist
    87         rm -rf tmp
    88         rm -f build/Makefile
    89         rm -f .BUILDSTART
    90 
    91 distclean: clean doc-clean lib-clean bdist-clean
    92         @echo "Deleting all remaining output from build system ..."
    93         rm -rf local
    94 
    95 micro_release: bdist-clean lib-clean
    96         @echo "Stripping binaries ..."
    97         find local/lib local/bin -type f -exec strip '{}' ';' |& grep -v "File format not recognized" |  grep -v "File truncated" || true
    98 
    99 TESTPRELIMS = local/bin/sage-starts
    100 TESTALL = ./sage -t --all
    101 PTESTALL = ./sage -t -p --all
    102 
    103 test: all # i.e. build and doc
    104         $(TESTPRELIMS)
    105         $(TESTALL) --logfile=logs/test.log
    106 
    107 check: test
    108 
    109 testall: all # i.e. build and doc
    110         $(TESTPRELIMS)
    111         $(TESTALL) --optional=all --logfile=logs/testall.log
    112 
    113 testlong: all # i.e. build and doc
    114         $(TESTPRELIMS)
    115         $(TESTALL) --long --logfile=logs/testlong.log
    116 
    117 testalllong: all # i.e. build and doc
    118         $(TESTPRELIMS)
    119         $(TESTALL) --long --optional=all --logfile=logs/testalllong.log
    120 
    121 ptest: all # i.e. build and doc
    122         $(TESTPRELIMS)
    123         $(PTESTALL) --logfile=logs/ptest.log
    124 
    125 ptestall: all # i.e. build and doc
    126         $(TESTPRELIMS)
    127         $(PTESTALL) --optional=all --logfile=logs/ptestall.log
    128 
    129 ptestlong: all # i.e. build and doc
    130         $(TESTPRELIMS)
    131         $(PTESTALL) --long --logfile=logs/ptestlong.log
    132 
    133 ptestalllong: all # i.e. build and doc
    134         $(TESTPRELIMS)
    135         $(PTESTALL) --long --optional=all --logfile=logs/ptestalllong.log
    136 
    137 
    138 testoptional: testall # just an alias
    139 
    140 testoptionallong: testalllong # just an alias
    141 
    142 ptestoptional: ptestall # just an alias
    143 
    144 ptestoptionallong: ptestalllong # just an alias
    145 
    146 
    147 install:
    148         echo "Experimental use only!"
    149         if [ "$(DESTDIR)" = "" ]; then \
    150                 echo >&2 "Set the environment variable DESTDIR to the install path."; \
    151                 exit 1; \
    152         fi
    153         # Make sure we remove only an existing directory. If $(DESTDIR)/sage is
    154         # a file instead of a directory then the mkdir statement later will fail
    155         if [ -d "$(DESTDIR)"/sage ]; then \
    156                 rm -rf "$(DESTDIR)"/sage; \
    157         fi
    158         mkdir -p "$(DESTDIR)"/sage
    159         mkdir -p "$(DESTDIR)"/bin
    160         cp -Rp * "$(DESTDIR)"/sage
    161         rm -f "$(DESTDIR)"/bin/sage
    162         ln -s ../sage/sage "$(DESTDIR)"/bin/sage
    163         "$(DESTDIR)"/bin/sage -c # Run sage-location
    164 
    165 
    166 .PHONY: all build build-serial start install \
    167         doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
    168         doc-clean clean lib-clean bdist-clean distclean micro_release \
    169         test check testoptional testall testlong testoptionallong testallong \
    170         ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong
  • deleted file build/deps

    diff --git a/build/deps b/build/deps
    deleted file mode 100644
    index 34ebb23..0000000
    + -  
    1 ###############################################################################
    2 # This file ($SAGE_ROOT/spkg/standard/deps) will be copied into
    3 # $SAGE_ROOT/spkg/Makefile by $SAGE_ROOT/spkg/install
    4 ###############################################################################
    5 
    6 # Let e.g. SAGE_ROOT/spkg/install pass options to sage-spkg, i.e. currently
    7 # "-f", to force rebuilding dependent packages during an upgrade (#9896).
    8 #
    9 # When upgrading from a 4.x version of Sage, the script "sage-spkg" will be
    10 # found in SAGE_ROOT/local/bin until the new sage_root repo is installed.
    11 # After that, it will be found in SAGE_ROOT/spkg/bin
    12 # (SAGE_ROOT/spkg/bin is added to the PATH in spkg/install).
    13 # Therefore, do not put an explicit path for sage-spkg here.
    14 SAGE_SPKG = sage-spkg $${SAGE_SPKG_OPTS}
    15 PIPE = $(SAGE_ROOT)/build/pipestatus
    16 
    17 # Tell make not to look for files with these names:
    18 .PHONY: all all-sage base toolchain toolchain-deps
    19 
    20 # Make the 4 build phases: base, toolchain, toolchain-deps, all-sage
    21 # During the toolchain build, we export SAGE_BUILD_TOOLCHAIN=yes
    22 # such that packages can do different things when they are built
    23 # as prerequisite of GCC.
    24 all:
    25         $(MAKE) base
    26         env SAGE_BUILD_TOOLCHAIN=yes $(MAKE) toolchain
    27         $(MAKE) toolchain-deps
    28         $(MAKE) all-sage
    29 
    30 # All targets except for the base packages
    31 all-sage: \
    32      $(INST)/$(ATLAS) \
    33      $(INST)/$(BLAS) \
    34      $(INST)/$(BOEHM_GC) \
    35      $(INST)/$(BOOST_CROPPED) \
    36      $(INST)/$(CDDLIB) \
    37      $(INST)/$(CEPHES) \
    38      $(INST)/$(CLIQUER) \
    39      $(INST)/$(CONWAY) \
    40      $(INST)/$(CVXOPT) \
    41      $(INST)/$(CYTHON) \
    42      $(INST)/$(DOCUTILS) \
    43      $(INST)/$(ECL) \
    44      $(INST)/$(ECLIB) \
    45      $(INST)/$(ECM) \
    46      $(INST)/$(ELLIPTIC_CURVES) \
    47      $(INST)/$(FFLASFFPACK) \
    48      $(INST)/$(FLINT) \
    49      $(INST)/$(FLINTQS) \
    50      $(INST)/$(FPLLL) \
    51      $(INST)/$(FREETYPE) \
    52      $(INST)/$(GENUS2REDUCTION) \
    53      $(INST)/$(GAP) \
    54      $(INST)/$(GD) \
    55      $(INST)/$(GDMODULE) \
    56      $(INST)/$(GFAN) \
    57      $(INST)/$(GF2X) \
    58      $(INST)/$(GIVARO) \
    59      $(INST)/$(GIT) \
    60      $(INST)/$(GLPK) \
    61      $(INST)/$(GRAPHS) \
    62      $(INST)/$(GSL) \
    63      $(INST)/$(ICONV) \
    64      $(INST)/$(IML) \
    65      $(INST)/$(IPYTHON) \
    66      $(INST)/$(JINJA2) \
    67      $(INST)/$(JMOL) \
    68      $(INST)/$(LAPACK) \
    69      $(INST)/$(LCALC) \
    70      $(INST)/$(LRCALC) \
    71      $(INST)/$(LIBGAP) \
    72      $(INST)/$(LIBPNG) \
    73      $(INST)/$(LINBOX) \
    74      $(INST)/$(M4RI) \
    75      $(INST)/$(M4RIE) \
    76      $(INST)/$(MATPLOTLIB) \
    77      $(INST)/$(MAXIMA) \
    78      $(INST)/$(MPC) \
    79      $(INST)/$(MPFI) \
    80      $(INST)/$(MPFR) \
    81      $(INST)/$(MPIR) \
    82      $(INST)/$(MPMATH) \
    83      $(INST)/$(NETWORKX) \
    84      $(INST)/$(NTL) \
    85      $(INST)/$(NUMPY) \
    86      $(INST)/$(PALP) \
    87      $(INST)/$(PARI) \
    88      $(INST)/$(PEXPECT) \
    89      $(INST)/$(PIL) \
    90      $(INST)/$(POLYBORI) \
    91      $(INST)/$(POLYTOPES_DB) \
    92      $(INST)/$(PPL) \
    93      $(INST)/$(PYCRYPTO) \
    94      $(INST)/$(PYGMENTS) \
    95      $(INST)/$(PYNAC) \
    96      $(INST)/$(PYTHON) \
    97      $(INST)/$(RATPOINTS) \
    98      $(INST)/$(R) \
    99      $(INST)/$(RPY) \
    100      $(INST)/$(READLINE) \
    101      $(INST)/$(RUBIKS) \
    102      $(INST)/$(SAGENB) \
    103      $(INST)/$(SAGETEX) \
    104      $(INST)/$(SCIPY) \
    105      $(INST)/$(SCONS) \
    106      $(INST)/$(SETUPTOOLS) \
    107      $(INST)/$(SINGULAR) \
    108      $(INST)/$(SPHINX) \
    109      $(INST)/$(SQLALCHEMY) \
    110      $(INST)/$(SQLITE) \
    111      $(INST)/$(SYMMETRICA) \
    112      $(INST)/$(SYMPOW) \
    113      $(INST)/$(SYMPY) \
    114      $(INST)/$(TACHYON) \
    115      $(INST)/$(TERMCAP) \
    116      $(INST)/$(ZLIB) \
    117      $(INST)/$(ZNPOLY) \
    118      scripts \
    119      sage \
    120      csage \
    121      extcode
    122 
    123 # TOOLCHAIN consists of dependencies determined by spkg/install,
    124 # including for example the GCC package.
    125 toolchain: $(TOOLCHAIN)
    126 
    127 # Build all packages that GCC links against serially, otherwise this
    128 # leads to race conditions where some library which is used by GCC gets
    129 # reinstalled. Since system GCCs might use Sage's libraries, we do this
    130 # unconditionally. We still use the dependency checking from $(MAKE),
    131 # so this will not trigger useless rebuilds.
    132 # See #14168 and #14232.
    133 toolchain-deps:
    134         $(MAKE) $(INST)/$(ZLIB)
    135         $(MAKE) $(INST)/$(MPIR)
    136         $(MAKE) $(INST)/$(MPFR)
    137         $(MAKE) $(INST)/$(MPC)
    138         $(MAKE) $(INST)/$(PPL)
    139 
    140 # Everything needed to start up Sage using "./sage".  Of course, not
    141 # every part of Sage will work.  It does not include Maxima for example.
    142 SAGERUNTIME = scripts sage $(INST)/$(SAGENB) $(INST)/$(IPYTHON) $(INST)/$(GAP)
    143 
    144 ###############################################################################
    145 # Building the base system
    146 #
    147 # This consists of packages which are required for the Sage build system
    148 # but not for Sage itself.  Since nothing explicitly depends on these,
    149 # an update of these packages will not trigger a rebuild of every other
    150 # package during an upgrade, see #13415.
    151 ###############################################################################
    152 base: $(INST)/$(PREREQ) $(INST)/$(BZIP2) $(INST)/$(PATCH)
    153 
    154 $(INST)/$(PREREQ):
    155         $(PIPE) "base/$(PREREQ)-install 2>&1" "tee -a $(SAGE_LOGS)/$(PREREQ).log"
    156 
    157 # If we are upgrading from a version 4.x of Sage, don't build bzip2.
    158 # This is because the old sage-spkg script cannot install the new bzip2
    159 # spkg (which is gzip compressed).  We continue using the old bzip2
    160 # installation (which is version 1.0.5 since sage-3.3), which is fine.
    161 $(INST)/$(BZIP2): $(INST)/$(PREREQ)
    162         $(PIPE) "$(SAGE_SPKG) $(BZIP2) 2>&1" "tee -a $(SAGE_LOGS)/$(BZIP2).log"; \
    163 
    164 $(INST)/$(PATCH): $(INST)/$(BZIP2)
    165         +$(PIPE) "$(SAGE_SPKG) $(PATCH) 2>&1" "tee -a $(SAGE_LOGS)/$(PATCH).log"
    166 
    167 ###############################################################################
    168 # Building normal packages
    169 ###############################################################################
    170 
    171 $(INST)/$(ATLAS): $(INST)/$(LAPACK) $(INST)/$(PYTHON)
    172         +$(PIPE) "$(SAGE_SPKG) $(ATLAS) 2>&1" "tee -a $(SAGE_LOGS)/$(ATLAS).log"
    173 
    174 $(INST)/$(BOEHM_GC):
    175         +$(PIPE) "$(SAGE_SPKG) $(BOEHM_GC) 2>&1" "tee -a $(SAGE_LOGS)/$(BOEHM_GC).log"
    176 
    177 $(INST)/$(BOOST_CROPPED):
    178         +$(PIPE) "$(SAGE_SPKG) $(BOOST_CROPPED) 2>&1" "tee -a $(SAGE_LOGS)/$(BOOST_CROPPED).log"
    179 
    180 $(INST)/$(CLIQUER):
    181         +$(PIPE) "$(SAGE_SPKG) $(CLIQUER) 2>&1" "tee -a $(SAGE_LOGS)/$(CLIQUER).log"
    182 
    183 $(INST)/$(TERMCAP):
    184         +$(PIPE) "$(SAGE_SPKG) $(TERMCAP) 2>&1" "tee -a $(SAGE_LOGS)/$(TERMCAP).log"
    185 
    186 $(INST)/$(READLINE): $(INST)/$(TERMCAP)
    187         +$(PIPE) "$(SAGE_SPKG) $(READLINE) 2>&1" "tee -a $(SAGE_LOGS)/$(READLINE).log"
    188 
    189 $(INST)/$(ICONV):
    190         +$(PIPE) "$(SAGE_SPKG) $(ICONV) 2>&1" "tee -a $(SAGE_LOGS)/$(ICONV).log"
    191 
    192 $(INST)/$(DOCUTILS): $(INST)/$(PYTHON)
    193         +$(PIPE) "$(SAGE_SPKG) $(DOCUTILS) 2>&1" "tee -a $(SAGE_LOGS)/$(DOCUTILS).log"
    194 
    195 $(INST)/$(ELLIPTIC_CURVES): $(INST)/$(PYTHON) $(INST)/$(SQLITE)
    196         +$(PIPE) "$(SAGE_SPKG) $(ELLIPTIC_CURVES) 2>&1" "tee -a $(SAGE_LOGS)/$(ELLIPTIC_CURVES).log"
    197 
    198 # CONWAY depends on depends on SAGERUNTIME because it runs Sage code to
    199 # generate a Sage object (.sobj).
    200 $(INST)/$(CONWAY): $(SAGERUNTIME)
    201         +$(PIPE) "$(SAGE_SPKG) $(CONWAY) 2>&1" "tee -a $(SAGE_LOGS)/$(CONWAY).log"
    202 
    203 $(INST)/$(GRAPHS):
    204         +$(PIPE) "$(SAGE_SPKG) $(GRAPHS) 2>&1" "tee -a $(SAGE_LOGS)/$(GRAPHS).log"
    205 
    206 $(INST)/$(GLPK): $(INST)/$(MPIR) $(INST)/$(ZLIB)
    207         +$(PIPE) "$(SAGE_SPKG) $(GLPK) 2>&1" "tee -a $(SAGE_LOGS)/$(GLPK).log"
    208 
    209 # Python links against -lbz2.  Technically speaking, we should add
    210 # BZIP2 as dependency here.  But we don't do that to avoid needless
    211 # recompiles of Python when upgrading.  Since bzip2 is part of the
    212 # "base" target, we are guaranteed anyway that some version of bzip2
    213 # is present.
    214 $(INST)/$(PYTHON): $(INST)/$(ZLIB) \
    215                    $(INST)/$(READLINE) $(INST)/$(SQLITE) $(INST)/$(LIBPNG)
    216         +$(PIPE) "$(SAGE_SPKG) $(PYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(PYTHON).log"
    217 
    218 $(INST)/$(MPIR): $(INST)/$(ICONV)
    219         +$(PIPE) "$(SAGE_SPKG) $(MPIR) 2>&1" "tee -a $(SAGE_LOGS)/$(MPIR).log"
    220 
    221 $(INST)/$(GSL): $(INST)/$(ATLAS)
    222         +$(PIPE) "$(SAGE_SPKG) $(GSL) 2>&1" "tee -a $(SAGE_LOGS)/$(GSL).log"
    223 
    224 $(INST)/$(GF2X):
    225         +$(PIPE) "$(SAGE_SPKG) $(GF2X) 2>&1" "tee -a $(SAGE_LOGS)/$(GF2X).log"
    226 
    227 $(INST)/$(NTL): $(INST)/$(MPIR) $(INST)/$(GF2X)
    228         +$(PIPE) "$(SAGE_SPKG) $(NTL) 2>&1" "tee -a $(SAGE_LOGS)/$(NTL).log"
    229 
    230 $(INST)/$(FPLLL): $(INST)/$(MPIR) $(INST)/$(MPFR)
    231         +$(PIPE) "$(SAGE_SPKG) $(FPLLL) 2>&1" "tee -a $(SAGE_LOGS)/$(FPLLL).log"
    232 
    233 $(INST)/$(PARI): $(INST)/$(READLINE) $(INST)/$(MPIR)
    234         +$(PIPE) "$(SAGE_SPKG) $(PARI) 2>&1" "tee -a $(SAGE_LOGS)/$(PARI).log"
    235 
    236 $(INST)/$(POLYBORI): $(INST)/$(PYTHON) $(INST)/$(IPYTHON) \
    237          $(INST)/$(SCONS) $(INST)/$(BOOST_CROPPED) \
    238          $(INST)/$(M4RI) $(INST)/$(GD)
    239         +$(PIPE) "$(SAGE_SPKG) $(POLYBORI) 2>&1" "tee -a $(SAGE_LOGS)/$(POLYBORI).log"
    240 
    241 $(INST)/$(POLYTOPES_DB):
    242         +$(PIPE) "$(SAGE_SPKG) $(POLYTOPES_DB) 2>&1" "tee -a $(SAGE_LOGS)/$(POLYTOPES_DB).log"
    243 
    244 $(INST)/$(PPL): $(INST)/$(MPIR) $(INST)/$(GLPK)
    245         +$(PIPE) "$(SAGE_SPKG) $(PPL) 2>&1" "tee -a $(SAGE_LOGS)/$(PPL).log"
    246 
    247 $(INST)/$(MPC): $(INST)/$(MPIR) $(INST)/$(MPFR)
    248         +$(PIPE) "$(SAGE_SPKG) $(MPC) 2>&1" "tee -a $(SAGE_LOGS)/$(MPC).log"
    249 
    250 $(INST)/$(MPFR): $(INST)/$(MPIR)
    251         +$(PIPE) "$(SAGE_SPKG) $(MPFR) 2>&1" "tee -a $(SAGE_LOGS)/$(MPFR).log"
    252 
    253 $(INST)/$(MPFI): $(INST)/$(MPIR) $(INST)/$(MPFR)
    254         +$(PIPE) "$(SAGE_SPKG) $(MPFI) 2>&1" "tee -a $(SAGE_LOGS)/$(MPFI).log"
    255 
    256 $(INST)/$(GIVARO): $(INST)/$(MPIR)
    257         +$(PIPE) "$(SAGE_SPKG) $(GIVARO) 2>&1" "tee -a $(SAGE_LOGS)/$(GIVARO).log"
    258 
    259 $(INST)/$(GIT): $(INST)/$(ZLIB) $(INST)/$(PYTHON)
    260         +$(PIPE) "$(SAGE_SPKG) $(GIT) 2>&1" "tee -a $(SAGE_LOGS)/$(GIT).log"
    261 
    262 $(INST)/$(FFLASFFPACK): $(INST)/$(MPIR) $(INST)/$(GIVARO) \
    263         $(INST)/$(GSL) $(INST)/$(ATLAS)
    264         +$(PIPE) "$(SAGE_SPKG) $(FFLASFFPACK) 2>&1" "tee -a $(SAGE_LOGS)/$(FFLASFFPACK).log"
    265 
    266 $(INST)/$(LINBOX): $(INST)/$(MPIR) $(INST)/$(NTL) $(INST)/$(GIVARO) \
    267                    $(INST)/$(MPFR) $(INST)/$(FPLLL) $(INST)/$(IML) \
    268                    $(INST)/$(M4RI) $(INST)/$(M4RIE) $(INST)/$(FFLASFFPACK)
    269         +$(PIPE) "$(SAGE_SPKG) $(LINBOX) 2>&1" "tee -a $(SAGE_LOGS)/$(LINBOX).log"
    270 
    271 $(INST)/$(IML): $(INST)/$(MPIR) $(INST)/$(GSL) $(INST)/$(ATLAS)
    272         +$(PIPE) "$(SAGE_SPKG) $(IML) 2>&1" "tee -a $(SAGE_LOGS)/$(IML).log"
    273 
    274 $(INST)/$(ECLIB): $(INST)/$(MPIR) $(INST)/$(PARI) $(INST)/$(NTL)
    275         +$(PIPE) "$(SAGE_SPKG) $(ECLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(ECLIB).log"
    276 
    277 $(INST)/$(GENUS2REDUCTION): $(INST)/$(PARI)
    278         +$(PIPE) "$(SAGE_SPKG) $(GENUS2REDUCTION) 2>&1" "tee -a $(SAGE_LOGS)/$(GENUS2REDUCTION).log"
    279 
    280 $(INST)/$(PALP):
    281         +$(PIPE) "$(SAGE_SPKG) $(PALP) 2>&1" "tee -a $(SAGE_LOGS)/$(PALP).log"
    282 
    283 $(INST)/$(LCALC): $(INST)/$(PARI) $(INST)/$(MPFR)
    284         +$(PIPE) "$(SAGE_SPKG) $(LCALC) 2>&1" "tee -a $(SAGE_LOGS)/$(LCALC).log"
    285 
    286 $(INST)/$(LRCALC):
    287         +$(PIPE) "$(SAGE_SPKG) $(LRCALC) 2>&1" "tee -a $(SAGE_LOGS)/$(LRCALC).log"
    288 
    289 $(INST)/$(PYNAC): $(INST)/$(PYTHON)
    290         +$(PIPE) "$(SAGE_SPKG) $(PYNAC) 2>&1" "tee -a $(SAGE_LOGS)/$(PYNAC).log"
    291 
    292 $(INST)/$(SYMPOW):
    293         +$(PIPE) "$(SAGE_SPKG) $(SYMPOW) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMPOW).log"
    294 
    295 $(INST)/$(SYMMETRICA):
    296         +$(PIPE) "$(SAGE_SPKG) $(SYMMETRICA) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMMETRICA).log"
    297 
    298 $(INST)/$(GAP): $(INST)/$(TERMCAP) $(INST)/$(READLINE) $(INST)/$(MPIR)
    299         +$(PIPE) "$(SAGE_SPKG) $(GAP) 2>&1" "tee -a $(SAGE_LOGS)/$(GAP).log"
    300 
    301 $(INST)/$(LIBGAP): $(INST)/$(GAP)
    302         +$(PIPE) "$(SAGE_SPKG) $(LIBGAP) 2>&1" "tee -a $(SAGE_LOGS)/$(LIBGAP).log"
    303 
    304 $(INST)/$(IPYTHON): $(INST)/$(PYTHON)
    305         +$(PIPE) "$(SAGE_SPKG) $(IPYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(IPYTHON).log"
    306 
    307 $(INST)/$(PEXPECT): $(INST)/$(PYTHON)
    308         +$(PIPE) "$(SAGE_SPKG) $(PEXPECT) 2>&1" "tee -a $(SAGE_LOGS)/$(PEXPECT).log"
    309 
    310 $(INST)/$(GD): $(INST)/$(LIBPNG) $(INST)/$(FREETYPE) $(INST)/$(ICONV)
    311         +$(PIPE) "$(SAGE_SPKG) $(GD) 2>&1" "tee -a $(SAGE_LOGS)/$(GD).log"
    312 
    313 $(INST)/$(GDMODULE): $(INST)/$(PYTHON) $(INST)/$(GD) $(INST)/$(ICONV)
    314         +$(PIPE) "$(SAGE_SPKG) $(GDMODULE) 2>&1" "tee -a $(SAGE_LOGS)/$(GDMODULE).log"
    315 
    316 $(INST)/$(SCONS): $(INST)/$(PYTHON)
    317         +$(PIPE) "$(SAGE_SPKG) $(SCONS) 2>&1" "tee -a $(SAGE_LOGS)/$(SCONS).log"
    318 
    319 $(INST)/$(RUBIKS):
    320         +$(PIPE) "$(SAGE_SPKG) $(RUBIKS) 2>&1" "tee -a $(SAGE_LOGS)/$(RUBIKS).log"
    321 
    322 $(INST)/$(SQLITE): $(INST)/$(READLINE)
    323         +$(PIPE) "$(SAGE_SPKG) $(SQLITE) 2>&1" "tee -a $(SAGE_LOGS)/$(SQLITE).log"
    324 
    325 # To build SageTeX, you just need Python, but to test (SAGE_CHECK=yes)
    326 # SageTeX, you actually need to run sage, produce plots,...
    327 $(INST)/$(SAGETEX): $(INST)/$(PYTHON) \
    328                     $(SAGERUNTIME) $(INST)/$(MAXIMA) $(INST)/$(SCIPY) \
    329                     $(INST)/$(MATPLOTLIB) $(INST)/$(PIL) $(INST)/$(TACHYON)
    330         +$(PIPE) "$(SAGE_SPKG) $(SAGETEX) 2>&1" "tee -a $(SAGE_LOGS)/$(SAGETEX).log"
    331 
    332 $(INST)/$(SETUPTOOLS): $(INST)/$(PYTHON)
    333         +$(PIPE) "$(SAGE_SPKG) $(SETUPTOOLS) 2>&1" "tee -a $(SAGE_LOGS)/$(SETUPTOOLS).log"
    334 
    335 $(INST)/$(SINGULAR): $(INST)/$(MPIR) $(INST)/$(NTL) \
    336                      $(INST)/$(READLINE) $(INST)/$(MPFR)
    337         +$(PIPE) "$(SAGE_SPKG) $(SINGULAR) 2>&1" "tee -a $(SAGE_LOGS)/$(SINGULAR).log"
    338 
    339 $(INST)/$(PYCRYPTO): $(INST)/$(PYTHON)
    340         +$(PIPE) "$(SAGE_SPKG) $(PYCRYPTO) 2>&1" "tee -a $(SAGE_LOGS)/$(PYCRYPTO).log"
    341 
    342 $(INST)/$(NETWORKX): $(INST)/$(PYTHON)
    343         +$(PIPE) "$(SAGE_SPKG) $(NETWORKX) 2>&1" "tee -a $(SAGE_LOGS)/$(NETWORKX).log"
    344 
    345 $(INST)/$(MPMATH): $(INST)/$(PYTHON)
    346         +$(PIPE) "$(SAGE_SPKG) $(MPMATH) 2>&1" "tee -a $(SAGE_LOGS)/$(MPMATH).log"
    347 
    348 $(INST)/$(ZLIB):
    349         +$(PIPE) "$(SAGE_SPKG) $(ZLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(ZLIB).log"
    350 
    351 $(INST)/$(JMOL): $(INST)/$(SAGENB)
    352         +$(PIPE) "$(SAGE_SPKG) $(JMOL) 2>&1" "tee -a $(SAGE_LOGS)/$(JMOL).log"
    353 
    354 $(INST)/$(FREETYPE):
    355         +$(PIPE) "$(SAGE_SPKG) $(FREETYPE) 2>&1" "tee -a $(SAGE_LOGS)/$(FREETYPE).log"
    356 
    357 $(INST)/$(LIBPNG): $(INST)/$(ZLIB)
    358         +$(PIPE) "$(SAGE_SPKG) $(LIBPNG) 2>&1" "tee -a $(SAGE_LOGS)/$(LIBPNG).log"
    359 
    360 $(INST)/$(MATPLOTLIB): $(INST)/$(PYTHON) $(INST)/$(NUMPY) \
    361                        $(INST)/$(FREETYPE) $(INST)/$(LIBPNG) \
    362                        $(INST)/$(GDMODULE)
    363         +$(PIPE) "$(SAGE_SPKG) $(MATPLOTLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(MATPLOTLIB).log"
    364 
    365 $(INST)/$(CDDLIB): $(INST)/$(MPIR)
    366         +$(PIPE) "$(SAGE_SPKG) $(CDDLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(CDDLIB).log"
    367 
    368 $(INST)/$(GFAN): $(INST)/$(MPIR) $(INST)/$(CDDLIB)
    369         +$(PIPE) "$(SAGE_SPKG) $(GFAN) 2>&1" "tee -a $(SAGE_LOGS)/$(GFAN).log"
    370 
    371 $(INST)/$(TACHYON): $(INST)/$(LIBPNG)
    372         +$(PIPE) "$(SAGE_SPKG) $(TACHYON) 2>&1" "tee -a $(SAGE_LOGS)/$(TACHYON).log"
    373 
    374 $(INST)/$(ECM): $(INST)/$(MPIR)
    375         +$(PIPE) "$(SAGE_SPKG) $(ECM) 2>&1" "tee -a $(SAGE_LOGS)/$(ECM).log"
    376 
    377 $(INST)/$(RATPOINTS): $(INST)/$(MPIR)
    378         +$(PIPE) "$(SAGE_SPKG) $(RATPOINTS) 2>&1" "tee -a $(SAGE_LOGS)/$(RATPOINTS).log"
    379 
    380 $(INST)/$(ECL): $(INST)/$(MPIR) $(INST)/$(READLINE) $(INST)/$(BOEHM_GC)
    381         +$(PIPE) "$(SAGE_SPKG) $(ECL) 2>&1" "tee -a $(SAGE_LOGS)/$(ECL).log"
    382 
    383 $(INST)/$(MAXIMA): $(INST)/$(ECL)
    384         +$(PIPE) "$(SAGE_SPKG) $(MAXIMA) 2>&1" "tee -a $(SAGE_LOGS)/$(MAXIMA).log"
    385 
    386 $(INST)/$(R): $(INST)/$(ATLAS) $(INST)/$(ICONV) $(INST)/$(READLINE)
    387         +$(PIPE) "$(SAGE_SPKG) $(R) 2>&1" "tee -a $(SAGE_LOGS)/$(R).log"
    388 
    389 $(INST)/$(RPY): $(INST)/$(PYTHON) $(INST)/$(R)
    390         +$(PIPE) "$(SAGE_SPKG) $(RPY) 2>&1" "tee -a $(SAGE_LOGS)/$(RPY).log"
    391 
    392 $(INST)/$(SYMPY): $(INST)/$(PYTHON)
    393         +$(PIPE) "$(SAGE_SPKG) $(SYMPY) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMPY).log"
    394 
    395 $(INST)/$(CYTHON): $(INST)/$(PYTHON)
    396         +$(PIPE) "$(SAGE_SPKG) $(CYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(CYTHON).log"
    397 
    398 $(INST)/$(FLINTQS): $(INST)/$(MPIR)
    399         +$(PIPE) "$(SAGE_SPKG) $(FLINTQS) 2>&1" "tee -a $(SAGE_LOGS)/$(FLINTQS).log"
    400 
    401 $(INST)/$(FLINT): $(INST)/$(MPIR) $(INST)/$(MPFR) $(INST)/$(NTL)
    402         +$(PIPE) "$(SAGE_SPKG) $(FLINT) 2>&1" "tee -a $(SAGE_LOGS)/$(FLINT).log"
    403 
    404 $(INST)/$(M4RI): $(INST)/$(LIBPNG)
    405         +$(PIPE) "$(SAGE_SPKG) $(M4RI) 2>&1" "tee -a $(SAGE_LOGS)/$(M4RI).log"
    406 
    407 $(INST)/$(M4RIE): $(INST)/$(M4RI) $(INST)/$(GIVARO) $(INST)/$(NTL)
    408         +$(PIPE) "$(SAGE_SPKG) $(M4RIE) 2>&1" "tee -a $(SAGE_LOGS)/$(M4RIE).log"
    409 
    410 # zn_poly really does depend on Python, despite this is far from obvious.
    411 # The 'configure' script in zn_poly calls Python to make a 'makefile'.
    412 $(INST)/$(ZNPOLY): $(INST)/$(MPIR) $(INST)/$(PYTHON)
    413         +$(PIPE) "$(SAGE_SPKG) $(ZNPOLY) 2>&1" "tee -a $(SAGE_LOGS)/$(ZNPOLY).log"
    414 
    415 $(INST)/$(SAGENB): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(PEXPECT) \
    416                    $(INST)/$(JINJA2) $(INST)/$(SPHINX) $(INST)/$(DOCUTILS)
    417         +$(PIPE) "$(SAGE_SPKG) $(SAGENB) 2>&1" "tee -a $(SAGE_LOGS)/$(SAGENB).log"
    418 
    419 $(INST)/$(SQLALCHEMY): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS)
    420         +$(PIPE) "$(SAGE_SPKG) $(SQLALCHEMY) 2>&1" "tee -a $(SAGE_LOGS)/$(SQLALCHEMY).log"
    421 
    422 $(INST)/$(SPHINX): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(DOCUTILS) \
    423                    $(INST)/$(JINJA2) $(INST)/$(PYGMENTS)
    424         +$(PIPE) "$(SAGE_SPKG) $(SPHINX) 2>&1" "tee -a $(SAGE_LOGS)/$(SPHINX).log"
    425 
    426 $(INST)/$(JINJA2): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(DOCUTILS) \
    427 
    428         +$(PIPE) "$(SAGE_SPKG) $(JINJA2) 2>&1" "tee -a $(SAGE_LOGS)/$(JINJA2).log"
    429 
    430 $(INST)/$(PYGMENTS): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS)
    431         +$(PIPE) "$(SAGE_SPKG) $(PYGMENTS) 2>&1" "tee -a $(SAGE_LOGS)/$(PYGMENTS).log"
    432 
    433 # List all *build-time* dependencies of the Sage library.  These are,
    434 # on the one hand, programs needed for the build/install process of the
    435 # Sage library (e.g. JINJA2), and on the
    436 # other hand all dependencies for Cython files (e.g. PARI, NTL, MPIR).
    437 sage: \
    438                  $(INST)/$(ATLAS) \
    439                  $(INST)/$(CEPHES) \
    440                  $(INST)/$(CLIQUER) \
    441                  $(INST)/$(CYTHON) \
    442                  $(INST)/$(ECL) \
    443                  $(INST)/$(ECLIB) \
    444                  $(INST)/$(ECM) \
    445                  $(INST)/$(FLINT) \
    446                  $(INST)/$(FPLLL) \
    447                  $(INST)/$(GD) \
    448                  $(INST)/$(GIVARO) \
    449                  $(INST)/$(GLPK) \
    450                  $(INST)/$(GSL) \
    451                  $(INST)/$(IML) \
    452                  $(INST)/$(JINJA2) \
    453                  $(INST)/$(LCALC) \
    454                  $(INST)/$(LIBGAP) \
    455                  $(INST)/$(LIBPNG) \
    456                  $(INST)/$(LINBOX) \
    457                  $(INST)/$(M4RI) \
    458                  $(INST)/$(M4RIE) \
    459                  $(INST)/$(MPC) \
    460                  $(INST)/$(MPFI) \
    461                  $(INST)/$(MPFR) \
    462                  $(INST)/$(MPIR) \
    463                  $(INST)/$(NTL) \
    464                  $(INST)/$(NUMPY) \
    465                  $(INST)/$(PARI) \
    466                  $(INST)/$(POLYBORI) \
    467                  $(INST)/$(PPL) \
    468                  $(INST)/$(PYNAC) \
    469                  $(INST)/$(PYTHON) \
    470                  $(INST)/$(RATPOINTS) \
    471                  $(INST)/$(READLINE) \
    472                  $(INST)/$(SINGULAR) \
    473                  $(INST)/$(SYMMETRICA) \
    474                  $(INST)/$(ZNPOLY) \
    475                  csage
    476         +$(PIPE) "{ if [ -z $(SAGE_INSTALL_FETCH_ONLY) ]; then  cd $(SAGE_SRC) && . ./bin/sage-env && time python setup.py install; fi; } 2>&1" "tee -a $(SAGE_LOGS)/sage-$(SAGE_VERSION).log"
    477 
    478 scripts: $(SCRIPT_TARGETS)
    479 
    480 extcode: $(EXTCODE_TARGETS)
    481 
    482 csage: $(INST)/$(SCONS) \
    483        $(INST)/$(MPIR) \
    484        $(INST)/$(NTL) \
    485        $(INST)/$(PARI) \
    486        $(INST)/$(POLYBORI) \
    487        $(INST)/$(PYNAC) \
    488        $(INST)/$(PYTHON)
    489         +$(PIPE) "{ if [ -z $(SAGE_INSTALL_FETCH_ONLY) ]; then cd $(SAGE_SRC)/c_lib && . ../bin/sage-env && time scons -Q install; fi; } 2>&1" "tee -a $(SAGE_LOGS)/csage-$(SAGE_VERSION).log"
    490 
    491 $(INST)/ccache: $(BASE) $(INST)/$(ZLIB)
    492         +$(PIPE) "$(SAGE_SPKG) ccache 2>&1" "tee -a $(SAGE_LOGS)/ccache.log"
    493         touch $(INST)/ccache
    494 
    495 $(INST)/$(GCC): $(INST)/$(MPIR) $(INST)/$(MPFR) $(INST)/$(MPC) \
    496                 $(INST)/$(ZLIB)
    497         +$(PIPE) "$(SAGE_SPKG) $(GCC) 2>&1" "tee -a $(SAGE_LOGS)/$(GCC).log"
    498 
    499 $(INST)/$(PIL): $(INST)/$(PYTHON)
    500         +$(PIPE) "$(SAGE_SPKG) $(PIL) 2>&1" "tee -a $(SAGE_LOGS)/$(PIL).log"
    501 
    502 # Lapack depends on SAGE_ROOT_REPO because it *executes* Fortran code at
    503 # build time.  Therefore, it needs an up-to-date version of sage-env
    504 # which adds $SAGE_LOCAL/lib64 to the LD_LIBRARY_PATH.
    505 $(INST)/$(LAPACK): $(INST)/$(SAGE_ROOT_REPO)
    506         +$(PIPE) "$(SAGE_SPKG) $(LAPACK) 2>&1" "tee -a $(SAGE_LOGS)/$(LAPACK).log"
    507 
    508 $(INST)/$(BLAS):
    509         +$(PIPE) "$(SAGE_SPKG) $(BLAS) 2>&1" "tee -a $(SAGE_LOGS)/$(BLAS).log"
    510 
    511 $(INST)/$(NUMPY): $(INST)/$(PYTHON) \
    512                   $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(ATLAS)
    513         +$(PIPE) "$(SAGE_SPKG) $(NUMPY) 2>&1" "tee -a $(SAGE_LOGS)/$(NUMPY).log"
    514 
    515 $(INST)/$(SCIPY): $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(NUMPY)
    516         +$(PIPE) "$(SAGE_SPKG) $(SCIPY) 2>&1" "tee -a $(SAGE_LOGS)/$(SCIPY).log"
    517 
    518 # matplotlib is needed to test cvxopt (i.e., if SAGE_CHECK=yes). See #12742.
    519 $(INST)/$(CVXOPT): \
    520                    $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(NUMPY) \
    521                    $(INST)/$(ATLAS) $(INST)/$(CEPHES) \
    522                    $(INST)/$(GSL) $(INST)/$(GLPK) $(INST)/$(MATPLOTLIB)
    523         +$(PIPE) "$(SAGE_SPKG) $(CVXOPT) 2>&1" "tee -a $(SAGE_LOGS)/$(CVXOPT).log"
    524 
    525 $(INST)/$(CEPHES):
    526         +$(PIPE) "$(SAGE_SPKG) $(CEPHES) 2>&1" "tee -a $(SAGE_LOGS)/$(CEPHES).log"
    527 
    528 ###############################################################################
    529 
    530 # setuptools forgets to update easy-install.pth during parallel
    531 # builds, so we build the relevant packages serially.
    532 
    533 $(INST)/$(PYGMENTS): $(INST)/$(SQLALCHEMY)
    534 $(INST)/$(JINJA2): $(INST)/$(PYGMENTS)
    535 $(INST)/$(SPHINX): $(INST)/$(JINJA2)
    536 $(INST)/$(SAGENB): $(INST)/$(SPHINX)
  • new file deps.in

    diff --git a/deps.in b/deps.in
    new file mode 100644
    index 0000000..478b398
    - +  
     1###############################################################################
     2# This file ($SAGE_ROOT/spkg/standard/deps) will be copied into
     3# $SAGE_ROOT/spkg/Makefile by $SAGE_ROOT/spkg/install
     4###############################################################################
     5
     6# Let e.g. SAGE_ROOT/spkg/install pass options to sage-spkg, i.e. currently
     7# "-f", to force rebuilding dependent packages during an upgrade (#9896).
     8#
     9# When upgrading from a 4.x version of Sage, the script "sage-spkg" will be
     10# found in SAGE_ROOT/local/bin until the new sage_root repo is installed.
     11# After that, it will be found in SAGE_ROOT/spkg/bin
     12# (SAGE_ROOT/spkg/bin is added to the PATH in spkg/install).
     13# Therefore, do not put an explicit path for sage-spkg here.
     14SAGE_SPKG = sage-spkg $${SAGE_SPKG_OPTS}
     15PIPE = $(SAGE_ROOT)/build/pipestatus
     16
     17# Tell make not to look for files with these names:
     18.PHONY: all all-sage base toolchain toolchain-deps
     19
     20# Make the 4 build phases: base, toolchain, toolchain-deps, all-sage
     21# During the toolchain build, we export SAGE_BUILD_TOOLCHAIN=yes
     22# such that packages can do different things when they are built
     23# as prerequisite of GCC.
     24all:
     25        $(MAKE) base
     26        env SAGE_BUILD_TOOLCHAIN=yes $(MAKE) toolchain
     27        $(MAKE) toolchain-deps
     28        $(MAKE) all-sage
     29
     30# All targets except for the base packages
     31all-sage: \
     32     $(INST)/$(ATLAS) \
     33     $(INST)/$(BLAS) \
     34     $(INST)/$(BOEHM_GC) \
     35     $(INST)/$(BOOST_CROPPED) \
     36     $(INST)/$(CDDLIB) \
     37     $(INST)/$(CEPHES) \
     38     $(INST)/$(CLIQUER) \
     39     $(INST)/$(CONWAY) \
     40     $(INST)/$(CVXOPT) \
     41     $(INST)/$(CYTHON) \
     42     $(INST)/$(DOCUTILS) \
     43     $(INST)/$(ECL) \
     44     $(INST)/$(ECLIB) \
     45     $(INST)/$(ECM) \
     46     $(INST)/$(ELLIPTIC_CURVES) \
     47     $(INST)/$(FFLASFFPACK) \
     48     $(INST)/$(FLINT) \
     49     $(INST)/$(FLINTQS) \
     50     $(INST)/$(FPLLL) \
     51     $(INST)/$(FREETYPE) \
     52     $(INST)/$(GENUS2REDUCTION) \
     53     $(INST)/$(GAP) \
     54     $(INST)/$(GD) \
     55     $(INST)/$(GDMODULE) \
     56     $(INST)/$(GFAN) \
     57     $(INST)/$(GIVARO) \
     58     $(INST)/$(GIT) \
     59     $(INST)/$(GLPK) \
     60     $(INST)/$(GRAPHS) \
     61     $(INST)/$(GSL) \
     62     $(INST)/$(ICONV) \
     63     $(INST)/$(IML) \
     64     $(INST)/$(IPYTHON) \
     65     $(INST)/$(JINJA2) \
     66     $(INST)/$(JMOL) \
     67     $(INST)/$(LAPACK) \
     68     $(INST)/$(LCALC) \
     69     $(INST)/$(LRCALC) \
     70     $(INST)/$(LIBGAP) \
     71     $(INST)/$(LIBPNG) \
     72     $(INST)/$(LINBOX) \
     73     $(INST)/$(M4RI) \
     74     $(INST)/$(M4RIE) \
     75     $(INST)/$(MATPLOTLIB) \
     76     $(INST)/$(MAXIMA) \
     77     $(INST)/$(MPC) \
     78     $(INST)/$(MPFI) \
     79     $(INST)/$(MPFR) \
     80     $(INST)/$(MPIR) \
     81     $(INST)/$(MPMATH) \
     82     $(INST)/$(NETWORKX) \
     83     $(INST)/$(NTL) \
     84     $(INST)/$(NUMPY) \
     85     $(INST)/$(PALP) \
     86     $(INST)/$(PARI) \
     87     $(INST)/$(PEXPECT) \
     88     $(INST)/$(PIL) \
     89     $(INST)/$(POLYBORI) \
     90     $(INST)/$(POLYTOPES_DB) \
     91     $(INST)/$(PPL) \
     92     $(INST)/$(PYCRYPTO) \
     93     $(INST)/$(PYGMENTS) \
     94     $(INST)/$(PYNAC) \
     95     $(INST)/$(PYTHON) \
     96     $(INST)/$(RATPOINTS) \
     97     $(INST)/$(R) \
     98     $(INST)/$(RPY) \
     99     $(INST)/$(READLINE) \
     100     $(INST)/$(RUBIKS) \
     101     $(INST)/$(SAGENB) \
     102     $(INST)/$(SAGETEX) \
     103     $(INST)/$(SCIPY) \
     104     $(INST)/$(SCONS) \
     105     $(INST)/$(SETUPTOOLS) \
     106     $(INST)/$(SINGULAR) \
     107     $(INST)/$(SPHINX) \
     108     $(INST)/$(SQLALCHEMY) \
     109     $(INST)/$(SQLITE) \
     110     $(INST)/$(SYMMETRICA) \
     111     $(INST)/$(SYMPOW) \
     112     $(INST)/$(SYMPY) \
     113     $(INST)/$(TACHYON) \
     114     $(INST)/$(TERMCAP) \
     115     $(INST)/$(ZLIB) \
     116     $(INST)/$(ZNPOLY) \
     117     scripts \
     118     sage \
     119     csage \
     120     extcode
     121
     122# TOOLCHAIN consists of dependencies determined by spkg/install,
     123# including for example the GCC package.
     124toolchain: $(TOOLCHAIN)
     125
     126# Build all packages that GCC links against serially, otherwise this
     127# leads to race conditions where some library which is used by GCC gets
     128# reinstalled. Since system GCCs might use Sage's libraries, we do this
     129# unconditionally. We still use the dependency checking from $(MAKE),
     130# so this will not trigger useless rebuilds.
     131# See http://trac.sagemath.org/sage_trac/ticket/14168
     132toolchain-deps:
     133        $(MAKE) $(INST)/$(ZLIB)
     134        $(MAKE) $(INST)/$(MPIR)
     135        $(MAKE) $(INST)/$(MPFR)
     136        $(MAKE) $(INST)/$(MPC)
     137
     138# Everything needed to start up Sage using "./sage".  Of course, not
     139# every part of Sage will work.  It does not include Maxima for example.
     140SAGERUNTIME = scripts sage $(INST)/$(SAGENB) $(INST)/$(IPYTHON) $(INST)/$(GAP)
     141
     142###############################################################################
     143# Building the base system
     144#
     145# This consists of packages which are required for the Sage build system
     146# but not for Sage itself.  Since nothing explicitly depends on these,
     147# an update of these packages will not trigger a rebuild of every other
     148# package during an upgrade, see #13415.
     149###############################################################################
     150base: $(INST)/$(PREREQ) $(INST)/$(BZIP2) $(INST)/$(PATCH)
     151
     152$(INST)/$(PREREQ):
     153        $(PIPE) "base/$(PREREQ)-install 2>&1" "tee -a $(SAGE_LOGS)/$(PREREQ).log"
     154
     155# If we are upgrading from a version 4.x of Sage, don't build bzip2.
     156# This is because the old sage-spkg script cannot install the new bzip2
     157# spkg (which is gzip compressed).  We continue using the old bzip2
     158# installation (which is version 1.0.5 since sage-3.3), which is fine.
     159$(INST)/$(BZIP2): $(INST)/$(PREREQ)
     160        $(PIPE) "$(SAGE_SPKG) $(BZIP2) 2>&1" "tee -a $(SAGE_LOGS)/$(BZIP2).log"; \
     161
     162$(INST)/$(PATCH): $(INST)/$(BZIP2)
     163        +$(PIPE) "$(SAGE_SPKG) $(PATCH) 2>&1" "tee -a $(SAGE_LOGS)/$(PATCH).log"
     164
     165###############################################################################
     166# Building normal packages
     167###############################################################################
     168$(INST)/$(ATLAS): $(INST)/$(LAPACK) $(INST)/$(PYTHON)
     169        +$(PIPE) "$(SAGE_SPKG) $(ATLAS) 2>&1" "tee -a $(SAGE_LOGS)/$(ATLAS).log"
     170
     171$(INST)/$(BOEHM_GC):
     172        +$(PIPE) "$(SAGE_SPKG) $(BOEHM_GC) 2>&1" "tee -a $(SAGE_LOGS)/$(BOEHM_GC).log"
     173
     174$(INST)/$(BOOST_CROPPED):
     175        +$(PIPE) "$(SAGE_SPKG) $(BOOST_CROPPED) 2>&1" "tee -a $(SAGE_LOGS)/$(BOOST_CROPPED).log"
     176
     177$(INST)/$(CLIQUER):
     178        +$(PIPE) "$(SAGE_SPKG) $(CLIQUER) 2>&1" "tee -a $(SAGE_LOGS)/$(CLIQUER).log"
     179
     180$(INST)/$(TERMCAP):
     181        +$(PIPE) "$(SAGE_SPKG) $(TERMCAP) 2>&1" "tee -a $(SAGE_LOGS)/$(TERMCAP).log"
     182
     183$(INST)/$(READLINE): $(INST)/$(TERMCAP)
     184        +$(PIPE) "$(SAGE_SPKG) $(READLINE) 2>&1" "tee -a $(SAGE_LOGS)/$(READLINE).log"
     185
     186$(INST)/$(ICONV):
     187        +$(PIPE) "$(SAGE_SPKG) $(ICONV) 2>&1" "tee -a $(SAGE_LOGS)/$(ICONV).log"
     188
     189$(INST)/$(DOCUTILS): $(INST)/$(PYTHON)
     190        +$(PIPE) "$(SAGE_SPKG) $(DOCUTILS) 2>&1" "tee -a $(SAGE_LOGS)/$(DOCUTILS).log"
     191
     192$(INST)/$(ELLIPTIC_CURVES): $(INST)/$(PYTHON) $(INST)/$(SQLITE)
     193        +$(PIPE) "$(SAGE_SPKG) $(ELLIPTIC_CURVES) 2>&1" "tee -a $(SAGE_LOGS)/$(ELLIPTIC_CURVES).log"
     194
     195# CONWAY depends on depends on SAGERUNTIME because it runs Sage code to
     196# generate a Sage object (.sobj).
     197$(INST)/$(CONWAY): $(SAGERUNTIME)
     198        +$(PIPE) "$(SAGE_SPKG) $(CONWAY) 2>&1" "tee -a $(SAGE_LOGS)/$(CONWAY).log"
     199
     200$(INST)/$(GRAPHS):
     201        +$(PIPE) "$(SAGE_SPKG) $(GRAPHS) 2>&1" "tee -a $(SAGE_LOGS)/$(GRAPHS).log"
     202
     203$(INST)/$(GLPK): $(INST)/$(MPIR) $(INST)/$(ZLIB)
     204        +$(PIPE) "$(SAGE_SPKG) $(GLPK) 2>&1" "tee -a $(SAGE_LOGS)/$(GLPK).log"
     205
     206# Python links against -lbz2.  Technically speaking, we should add
     207# BZIP2 as dependency here.  But we don't do that to avoid needless
     208# recompiles of Python when upgrading.  Since bzip2 is part of the
     209# "base" target, we are guaranteed anyway that some version of bzip2
     210# is present.
     211$(INST)/$(PYTHON): $(INST)/$(ZLIB) \
     212                   $(INST)/$(READLINE) $(INST)/$(SQLITE) $(INST)/$(LIBPNG)
     213        +$(PIPE) "$(SAGE_SPKG) $(PYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(PYTHON).log"
     214
     215$(INST)/$(MPIR): $(INST)/$(ICONV)
     216        +$(PIPE) "$(SAGE_SPKG) $(MPIR) 2>&1" "tee -a $(SAGE_LOGS)/$(MPIR).log"
     217
     218$(INST)/$(GSL): $(INST)/$(ATLAS)
     219        +$(PIPE) "$(SAGE_SPKG) $(GSL) 2>&1" "tee -a $(SAGE_LOGS)/$(GSL).log"
     220
     221$(INST)/$(NTL): $(INST)/$(MPIR)
     222        +$(PIPE) "$(SAGE_SPKG) $(NTL) 2>&1" "tee -a $(SAGE_LOGS)/$(NTL).log"
     223
     224$(INST)/$(FPLLL): $(INST)/$(MPIR) $(INST)/$(MPFR)
     225        +$(PIPE) "$(SAGE_SPKG) $(FPLLL) 2>&1" "tee -a $(SAGE_LOGS)/$(FPLLL).log"
     226
     227$(INST)/$(PARI): $(INST)/$(READLINE) $(INST)/$(MPIR)
     228        +$(PIPE) "$(SAGE_SPKG) $(PARI) 2>&1" "tee -a $(SAGE_LOGS)/$(PARI).log"
     229
     230$(INST)/$(POLYBORI): $(INST)/$(PYTHON) $(INST)/$(IPYTHON) \
     231         $(INST)/$(SCONS) $(INST)/$(BOOST_CROPPED) \
     232         $(INST)/$(M4RI) $(INST)/$(GD)
     233        +$(PIPE) "$(SAGE_SPKG) $(POLYBORI) 2>&1" "tee -a $(SAGE_LOGS)/$(POLYBORI).log"
     234
     235$(INST)/$(POLYTOPES_DB):
     236        +$(PIPE) "$(SAGE_SPKG) $(POLYTOPES_DB) 2>&1" "tee -a $(SAGE_LOGS)/$(POLYTOPES_DB).log"
     237
     238$(INST)/$(PPL): $(INST)/$(MPIR)
     239        +$(PIPE) "$(SAGE_SPKG) $(PPL) 2>&1" "tee -a $(SAGE_LOGS)/$(PPL).log"
     240
     241$(INST)/$(MPC): $(INST)/$(MPIR) $(INST)/$(MPFR)
     242        +$(PIPE) "$(SAGE_SPKG) $(MPC) 2>&1" "tee -a $(SAGE_LOGS)/$(MPC).log"
     243
     244$(INST)/$(MPFR): $(INST)/$(MPIR)
     245        +$(PIPE) "$(SAGE_SPKG) $(MPFR) 2>&1" "tee -a $(SAGE_LOGS)/$(MPFR).log"
     246
     247$(INST)/$(MPFI): $(INST)/$(MPIR) $(INST)/$(MPFR)
     248        +$(PIPE) "$(SAGE_SPKG) $(MPFI) 2>&1" "tee -a $(SAGE_LOGS)/$(MPFI).log"
     249
     250$(INST)/$(GIVARO): $(INST)/$(MPIR)
     251        +$(PIPE) "$(SAGE_SPKG) $(GIVARO) 2>&1" "tee -a $(SAGE_LOGS)/$(GIVARO).log"
     252
     253$(INST)/$(GIT): $(INST)/$(ZLIB) $(INST)/$(PYTHON)
     254        +$(PIPE) "$(SAGE_SPKG) $(GIT) 2>&1" "tee -a $(SAGE_LOGS)/$(GIT).log"
     255
     256$(INST)/$(FFLASFFPACK): $(INST)/$(MPIR) $(INST)/$(GIVARO) \
     257        $(INST)/$(GSL) $(INST)/$(ATLAS)
     258        +$(PIPE) "$(SAGE_SPKG) $(FFLASFFPACK) 2>&1" "tee -a $(SAGE_LOGS)/$(FFLASFFPACK).log"
     259
     260$(INST)/$(LINBOX): $(INST)/$(MPIR) $(INST)/$(NTL) $(INST)/$(GIVARO) \
     261                   $(INST)/$(MPFR) $(INST)/$(FPLLL) $(INST)/$(IML) \
     262                   $(INST)/$(M4RI) $(INST)/$(M4RIE) $(INST)/$(FFLASFFPACK)
     263        +$(PIPE) "$(SAGE_SPKG) $(LINBOX) 2>&1" "tee -a $(SAGE_LOGS)/$(LINBOX).log"
     264
     265$(INST)/$(IML): $(INST)/$(MPIR) $(INST)/$(GSL) $(INST)/$(ATLAS)
     266        +$(PIPE) "$(SAGE_SPKG) $(IML) 2>&1" "tee -a $(SAGE_LOGS)/$(IML).log"
     267
     268$(INST)/$(ECLIB): $(INST)/$(MPIR) $(INST)/$(PARI) $(INST)/$(NTL)
     269        +$(PIPE) "$(SAGE_SPKG) $(ECLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(ECLIB).log"
     270
     271$(INST)/$(GENUS2REDUCTION): $(INST)/$(PARI)
     272        +$(PIPE) "$(SAGE_SPKG) $(GENUS2REDUCTION) 2>&1" "tee -a $(SAGE_LOGS)/$(GENUS2REDUCTION).log"
     273
     274$(INST)/$(PALP):
     275        +$(PIPE) "$(SAGE_SPKG) $(PALP) 2>&1" "tee -a $(SAGE_LOGS)/$(PALP).log"
     276
     277$(INST)/$(LCALC): $(INST)/$(PARI) $(INST)/$(MPFR)
     278        +$(PIPE) "$(SAGE_SPKG) $(LCALC) 2>&1" "tee -a $(SAGE_LOGS)/$(LCALC).log"
     279
     280$(INST)/$(LRCALC):
     281        +$(PIPE) "$(SAGE_SPKG) $(LRCALC) 2>&1" "tee -a $(SAGE_LOGS)/$(LRCALC).log"
     282
     283$(INST)/$(PYNAC): $(INST)/$(PYTHON)
     284        +$(PIPE) "$(SAGE_SPKG) $(PYNAC) 2>&1" "tee -a $(SAGE_LOGS)/$(PYNAC).log"
     285
     286$(INST)/$(SYMPOW):
     287        +$(PIPE) "$(SAGE_SPKG) $(SYMPOW) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMPOW).log"
     288
     289$(INST)/$(SYMMETRICA):
     290        +$(PIPE) "$(SAGE_SPKG) $(SYMMETRICA) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMMETRICA).log"
     291
     292$(INST)/$(GAP): $(INST)/$(TERMCAP) $(INST)/$(READLINE) $(INST)/$(MPIR)
     293        +$(PIPE) "$(SAGE_SPKG) $(GAP) 2>&1" "tee -a $(SAGE_LOGS)/$(GAP).log"
     294
     295$(INST)/$(LIBGAP): $(INST)/$(GAP)
     296        +$(PIPE) "$(SAGE_SPKG) $(LIBGAP) 2>&1" "tee -a $(SAGE_LOGS)/$(LIBGAP).log"
     297
     298$(INST)/$(IPYTHON): $(INST)/$(PYTHON)
     299        +$(PIPE) "$(SAGE_SPKG) $(IPYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(IPYTHON).log"
     300
     301$(INST)/$(PEXPECT): $(INST)/$(PYTHON)
     302        +$(PIPE) "$(SAGE_SPKG) $(PEXPECT) 2>&1" "tee -a $(SAGE_LOGS)/$(PEXPECT).log"
     303
     304$(INST)/$(GD): $(INST)/$(LIBPNG) $(INST)/$(FREETYPE) $(INST)/$(ICONV)
     305        +$(PIPE) "$(SAGE_SPKG) $(GD) 2>&1" "tee -a $(SAGE_LOGS)/$(GD).log"
     306
     307$(INST)/$(GDMODULE): $(INST)/$(PYTHON) $(INST)/$(GD) $(INST)/$(ICONV)
     308        +$(PIPE) "$(SAGE_SPKG) $(GDMODULE) 2>&1" "tee -a $(SAGE_LOGS)/$(GDMODULE).log"
     309
     310$(INST)/$(SCONS): $(INST)/$(PYTHON)
     311        +$(PIPE) "$(SAGE_SPKG) $(SCONS) 2>&1" "tee -a $(SAGE_LOGS)/$(SCONS).log"
     312
     313$(INST)/$(RUBIKS):
     314        +$(PIPE) "$(SAGE_SPKG) $(RUBIKS) 2>&1" "tee -a $(SAGE_LOGS)/$(RUBIKS).log"
     315
     316$(INST)/$(SQLITE): $(INST)/$(READLINE)
     317        +$(PIPE) "$(SAGE_SPKG) $(SQLITE) 2>&1" "tee -a $(SAGE_LOGS)/$(SQLITE).log"
     318
     319# To build SageTeX, you just need Python, but to test (SAGE_CHECK=yes)
     320# SageTeX, you actually need to run sage, produce plots,...
     321$(INST)/$(SAGETEX): $(INST)/$(PYTHON) \
     322                    $(SAGERUNTIME) $(INST)/$(MAXIMA) $(INST)/$(SCIPY) \
     323                    $(INST)/$(MATPLOTLIB) $(INST)/$(PIL) $(INST)/$(TACHYON)
     324        +$(PIPE) "$(SAGE_SPKG) $(SAGETEX) 2>&1" "tee -a $(SAGE_LOGS)/$(SAGETEX).log"
     325
     326$(INST)/$(SETUPTOOLS): $(INST)/$(PYTHON)
     327        +$(PIPE) "$(SAGE_SPKG) $(SETUPTOOLS) 2>&1" "tee -a $(SAGE_LOGS)/$(SETUPTOOLS).log"
     328
     329$(INST)/$(SINGULAR): $(INST)/$(MPIR) $(INST)/$(NTL) \
     330                     $(INST)/$(READLINE) $(INST)/$(MPFR)
     331        +$(PIPE) "$(SAGE_SPKG) $(SINGULAR) 2>&1" "tee -a $(SAGE_LOGS)/$(SINGULAR).log"
     332
     333$(INST)/$(PYCRYPTO): $(INST)/$(PYTHON)
     334        +$(PIPE) "$(SAGE_SPKG) $(PYCRYPTO) 2>&1" "tee -a $(SAGE_LOGS)/$(PYCRYPTO).log"
     335
     336$(INST)/$(NETWORKX): $(INST)/$(PYTHON)
     337        +$(PIPE) "$(SAGE_SPKG) $(NETWORKX) 2>&1" "tee -a $(SAGE_LOGS)/$(NETWORKX).log"
     338
     339$(INST)/$(MPMATH): $(INST)/$(PYTHON)
     340        +$(PIPE) "$(SAGE_SPKG) $(MPMATH) 2>&1" "tee -a $(SAGE_LOGS)/$(MPMATH).log"
     341
     342$(INST)/$(ZLIB):
     343        +$(PIPE) "$(SAGE_SPKG) $(ZLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(ZLIB).log"
     344
     345$(INST)/$(JMOL): $(INST)/$(SAGENB)
     346        +$(PIPE) "$(SAGE_SPKG) $(JMOL) 2>&1" "tee -a $(SAGE_LOGS)/$(JMOL).log"
     347
     348$(INST)/$(FREETYPE):
     349        +$(PIPE) "$(SAGE_SPKG) $(FREETYPE) 2>&1" "tee -a $(SAGE_LOGS)/$(FREETYPE).log"
     350
     351$(INST)/$(LIBPNG): $(INST)/$(ZLIB)
     352        +$(PIPE) "$(SAGE_SPKG) $(LIBPNG) 2>&1" "tee -a $(SAGE_LOGS)/$(LIBPNG).log"
     353
     354$(INST)/$(MATPLOTLIB): $(INST)/$(PYTHON) $(INST)/$(NUMPY) \
     355                       $(INST)/$(FREETYPE) $(INST)/$(LIBPNG) \
     356                       $(INST)/$(GDMODULE)
     357        +$(PIPE) "$(SAGE_SPKG) $(MATPLOTLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(MATPLOTLIB).log"
     358
     359$(INST)/$(CDDLIB): $(INST)/$(MPIR)
     360        +$(PIPE) "$(SAGE_SPKG) $(CDDLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(CDDLIB).log"
     361
     362$(INST)/$(GFAN): $(INST)/$(MPIR) $(INST)/$(CDDLIB)
     363        +$(PIPE) "$(SAGE_SPKG) $(GFAN) 2>&1" "tee -a $(SAGE_LOGS)/$(GFAN).log"
     364
     365$(INST)/$(TACHYON): $(INST)/$(LIBPNG)
     366        +$(PIPE) "$(SAGE_SPKG) $(TACHYON) 2>&1" "tee -a $(SAGE_LOGS)/$(TACHYON).log"
     367
     368$(INST)/$(ECM): $(INST)/$(MPIR)
     369        +$(PIPE) "$(SAGE_SPKG) $(ECM) 2>&1" "tee -a $(SAGE_LOGS)/$(ECM).log"
     370
     371$(INST)/$(RATPOINTS): $(INST)/$(MPIR)
     372        +$(PIPE) "$(SAGE_SPKG) $(RATPOINTS) 2>&1" "tee -a $(SAGE_LOGS)/$(RATPOINTS).log"
     373
     374$(INST)/$(ECL): $(INST)/$(MPIR) $(INST)/$(READLINE) $(INST)/$(BOEHM_GC)
     375        +$(PIPE) "$(SAGE_SPKG) $(ECL) 2>&1" "tee -a $(SAGE_LOGS)/$(ECL).log"
     376
     377$(INST)/$(MAXIMA): $(INST)/$(ECL)
     378        +$(PIPE) "$(SAGE_SPKG) $(MAXIMA) 2>&1" "tee -a $(SAGE_LOGS)/$(MAXIMA).log"
     379
     380$(INST)/$(R): $(INST)/$(ATLAS) $(INST)/$(ICONV) $(INST)/$(READLINE)
     381        +$(PIPE) "$(SAGE_SPKG) $(R) 2>&1" "tee -a $(SAGE_LOGS)/$(R).log"
     382
     383$(INST)/$(RPY): $(INST)/$(PYTHON) $(INST)/$(R)
     384        +$(PIPE) "$(SAGE_SPKG) $(RPY) 2>&1" "tee -a $(SAGE_LOGS)/$(RPY).log"
     385
     386$(INST)/$(SYMPY): $(INST)/$(PYTHON)
     387        +$(PIPE) "$(SAGE_SPKG) $(SYMPY) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMPY).log"
     388
     389$(INST)/$(CYTHON): $(INST)/$(PYTHON)
     390        +$(PIPE) "$(SAGE_SPKG) $(CYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(CYTHON).log"
     391
     392$(INST)/$(FLINTQS): $(INST)/$(MPIR)
     393        +$(PIPE) "$(SAGE_SPKG) $(FLINTQS) 2>&1" "tee -a $(SAGE_LOGS)/$(FLINTQS).log"
     394
     395$(INST)/$(FLINT): $(INST)/$(MPIR) $(INST)/$(MPFR) $(INST)/$(NTL)
     396        +$(PIPE) "$(SAGE_SPKG) $(FLINT) 2>&1" "tee -a $(SAGE_LOGS)/$(FLINT).log"
     397
     398$(INST)/$(M4RI): $(INST)/$(LIBPNG)
     399        +$(PIPE) "$(SAGE_SPKG) $(M4RI) 2>&1" "tee -a $(SAGE_LOGS)/$(M4RI).log"
     400
     401$(INST)/$(M4RIE): $(INST)/$(M4RI) $(INST)/$(GIVARO) $(INST)/$(NTL)
     402        +$(PIPE) "$(SAGE_SPKG) $(M4RIE) 2>&1" "tee -a $(SAGE_LOGS)/$(M4RIE).log"
     403
     404# zn_poly really does depend on Python, despite this is far from obvious.
     405# The 'configure' script in zn_poly calls Python to make a 'makefile'.
     406$(INST)/$(ZNPOLY): $(INST)/$(MPIR) $(INST)/$(PYTHON)
     407        +$(PIPE) "$(SAGE_SPKG) $(ZNPOLY) 2>&1" "tee -a $(SAGE_LOGS)/$(ZNPOLY).log"
     408
     409$(INST)/$(SAGENB): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(PEXPECT) \
     410                   $(INST)/$(JINJA2) $(INST)/$(SPHINX) $(INST)/$(DOCUTILS)
     411        +$(PIPE) "$(SAGE_SPKG) $(SAGENB) 2>&1" "tee -a $(SAGE_LOGS)/$(SAGENB).log"
     412
     413$(INST)/$(SQLALCHEMY): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS)
     414        +$(PIPE) "$(SAGE_SPKG) $(SQLALCHEMY) 2>&1" "tee -a $(SAGE_LOGS)/$(SQLALCHEMY).log"
     415
     416$(INST)/$(SPHINX): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(DOCUTILS) \
     417                   $(INST)/$(JINJA2) $(INST)/$(PYGMENTS)
     418        +$(PIPE) "$(SAGE_SPKG) $(SPHINX) 2>&1" "tee -a $(SAGE_LOGS)/$(SPHINX).log"
     419
     420$(INST)/$(JINJA2): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(DOCUTILS) \
     421
     422        +$(PIPE) "$(SAGE_SPKG) $(JINJA2) 2>&1" "tee -a $(SAGE_LOGS)/$(JINJA2).log"
     423
     424$(INST)/$(PYGMENTS): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS)
     425        +$(PIPE) "$(SAGE_SPKG) $(PYGMENTS) 2>&1" "tee -a $(SAGE_LOGS)/$(PYGMENTS).log"
     426
     427# List all *build-time* dependencies of the Sage library.  These are,
     428# on the one hand, programs needed for the build/install process of the
     429# Sage library (e.g. JINJA2), and on the
     430# other hand all dependencies for Cython files (e.g. PARI, NTL, MPIR).
     431sage: \
     432                 $(INST)/$(ATLAS) \
     433                 $(INST)/$(CEPHES) \
     434                 $(INST)/$(CLIQUER) \
     435                 $(INST)/$(CYTHON) \
     436                 $(INST)/$(ECL) \
     437                 $(INST)/$(ECLIB) \
     438                 $(INST)/$(ECM) \
     439                 $(INST)/$(FLINT) \
     440                 $(INST)/$(FPLLL) \
     441                 $(INST)/$(GD) \
     442                 $(INST)/$(GIVARO) \
     443                 $(INST)/$(GLPK) \
     444                 $(INST)/$(GSL) \
     445                 $(INST)/$(IML) \
     446                 $(INST)/$(JINJA2) \
     447                 $(INST)/$(LCALC) \
     448                 $(INST)/$(LIBGAP) \
     449                 $(INST)/$(LIBPNG) \
     450                 $(INST)/$(LINBOX) \
     451                 $(INST)/$(M4RI) \
     452                 $(INST)/$(M4RIE) \
     453                 $(INST)/$(MPC) \
     454                 $(INST)/$(MPFI) \
     455                 $(INST)/$(MPFR) \
     456                 $(INST)/$(MPIR) \
     457                 $(INST)/$(NTL) \
     458                 $(INST)/$(NUMPY) \
     459                 $(INST)/$(PARI) \
     460                 $(INST)/$(POLYBORI) \
     461                 $(INST)/$(PPL) \
     462                 $(INST)/$(PYNAC) \
     463                 $(INST)/$(PYTHON) \
     464                 $(INST)/$(RATPOINTS) \
     465                 $(INST)/$(READLINE) \
     466                 $(INST)/$(SINGULAR) \
     467                 $(INST)/$(SYMMETRICA) \
     468                 $(INST)/$(ZNPOLY) \
     469                 csage
     470        +$(PIPE) "{ if [ -z $(SAGE_INSTALL_FETCH_ONLY) ]; then  cd $(SAGE_SRC) && . ./bin/sage-env && time python setup.py install; fi; } 2>&1" "tee -a $(SAGE_LOGS)/sage-$(SAGE_VERSION).log"
     471
     472scripts: $(SCRIPT_TARGETS)
     473
     474extcode: $(EXTCODE_TARGETS)
     475
     476csage: $(INST)/$(SCONS) \
     477       $(INST)/$(MPIR) \
     478       $(INST)/$(NTL) \
     479       $(INST)/$(PARI) \
     480       $(INST)/$(POLYBORI) \
     481       $(INST)/$(PYNAC) \
     482       $(INST)/$(PYTHON)
     483        +$(PIPE) "{ if [ -z $(SAGE_INSTALL_FETCH_ONLY) ]; then cd $(SAGE_SRC)/c_lib && . ../bin/sage-env && time scons -Q install; fi; } 2>&1" "tee -a $(SAGE_LOGS)/csage-$(SAGE_VERSION).log"
     484
     485$(INST)/ccache: $(BASE) $(INST)/$(ZLIB)
     486        +$(PIPE) "$(SAGE_SPKG) ccache 2>&1" "tee -a $(SAGE_LOGS)/ccache.log"
     487        touch $(INST)/ccache
     488
     489$(INST)/$(GCC): $(INST)/$(MPIR) $(INST)/$(MPFR) $(INST)/$(MPC) \
     490                $(INST)/$(ZLIB)
     491        +$(PIPE) "$(SAGE_SPKG) $(GCC) 2>&1" "tee -a $(SAGE_LOGS)/$(GCC).log"
     492
     493$(INST)/$(PIL): $(INST)/$(PYTHON)
     494        +$(PIPE) "$(SAGE_SPKG) $(PIL) 2>&1" "tee -a $(SAGE_LOGS)/$(PIL).log"
     495
     496$(INST)/$(LAPACK):
     497        +$(PIPE) "$(SAGE_SPKG) $(LAPACK) 2>&1" "tee -a $(SAGE_LOGS)/$(LAPACK).log"
     498
     499$(INST)/$(BLAS):
     500        +$(PIPE) "$(SAGE_SPKG) $(BLAS) 2>&1" "tee -a $(SAGE_LOGS)/$(BLAS).log"
     501
     502$(INST)/$(NUMPY): $(INST)/$(PYTHON) \
     503                  $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(ATLAS)
     504        +$(PIPE) "$(SAGE_SPKG) $(NUMPY) 2>&1" "tee -a $(SAGE_LOGS)/$(NUMPY).log"
     505
     506$(INST)/$(SCIPY): $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(NUMPY)
     507        +$(PIPE) "$(SAGE_SPKG) $(SCIPY) 2>&1" "tee -a $(SAGE_LOGS)/$(SCIPY).log"
     508
     509# matplotlib is needed to test cvxopt (i.e., if SAGE_CHECK=yes). See #12742.
     510$(INST)/$(CVXOPT): \
     511                   $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(NUMPY) \
     512                   $(INST)/$(ATLAS) $(INST)/$(CEPHES) \
     513                   $(INST)/$(GSL) $(INST)/$(GLPK) $(INST)/$(MATPLOTLIB)
     514        +$(PIPE) "$(SAGE_SPKG) $(CVXOPT) 2>&1" "tee -a $(SAGE_LOGS)/$(CVXOPT).log"
     515
     516$(INST)/$(CEPHES):
     517        +$(PIPE) "$(SAGE_SPKG) $(CEPHES) 2>&1" "tee -a $(SAGE_LOGS)/$(CEPHES).log"
     518
     519###############################################################################
     520
     521# setuptools forgets to update easy-install.pth during parallel
     522# builds, so we build the relevant packages serially.
     523
     524$(INST)/$(PYGMENTS): $(INST)/$(SQLALCHEMY)
     525$(INST)/$(JINJA2): $(INST)/$(PYGMENTS)
     526$(INST)/$(SPHINX): $(INST)/$(JINJA2)
     527$(INST)/$(SAGENB): $(INST)/$(SPHINX)
  • deleted file sage

    diff --git a/sage b/sage
    deleted file mode 100755
    index 46c69ba..0000000
    + -  
    1 #!/usr/bin/env bash
    2 #
    3 # Sage: a free open-source mathematics software system
    4 #
    5 # This program is free software; you can redistribute it and/or
    6 # modify it under the terms of the GNU General Public License
    7 # as published by the Free Software Foundation; either version 2
    8 # of the License, or (at your option) any later version.
    9 #
    10 # This program is distributed in the hope that it will be useful,
    11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
    12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13 # GNU General Public License for more details.
    14 #
    15 # You should have received a copy of the GNU General Public License
    16 # along with this program; if not, write to the Free Software
    17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    18 
    19 
    20 # Set SAGE_ROOT to the location of the sage install, i.e. the directory
    21 # containing this shell script.  If unset, we will try to figure it out
    22 # automatically.
    23 #SAGE_ROOT=/path/to/sage-version
    24 
    25 
    26 
    27 # Resolve all symbolic links in a filename.  This more or less behaves
    28 # like "readlink -f" except that it does not convert the filename to an
    29 # absolute path (a relative path remains relative), nor does it treat
    30 # "." or ".." specially.  See Trac ticket #5852.
    31 resolvelinks() {
    32     # $in is what still needs to be converted (normally has no starting slash)
    33     in="$1"
    34     # $out is the part which is converted (normally ends with trailing slash)
    35     out="./"
    36 
    37     # Move stuff from $in to $out
    38     while [ -n "$in" ]; do
    39         # Normalize $in by replacing consecutive slashes by one slash
    40         while { in_single_slash=${in//\/\//\/}; [ "$in" != "$in_single_slash" ]; }; do
    41             in=$in_single_slash
    42         done
    43 
    44         # If $in starts with a slash, remove it and set $out to the root
    45         in_without_slash=${in/#\//}
    46         if [ "$in" != "$in_without_slash" ]; then
    47             in=$in_without_slash
    48             out="/"
    49             continue
    50         fi
    51 
    52         # Check that the directory $out exists by trying to cd to it.
    53         # If this fails, then cd will show an error message (unlike
    54         # test -d "$out"), so no need to be more verbose.
    55         ( cd "$out" ) || return $?
    56 
    57 
    58         # Get the first component of $in
    59         f=${in%%/*}
    60 
    61         # If it is not a symbolic link, simply move it to $out
    62         if [ ! -L "$out$f" ]; then
    63             in=${in#"$f"}
    64             out="$out$f"
    65 
    66             # If the new $in starts with a slash, move it to $out
    67             in_without_slash=${in/#\//}
    68             if [ "$in" != "$in_without_slash" ]; then
    69                 in=$in_without_slash
    70                 out="$out/"
    71             fi
    72             continue
    73         fi
    74 
    75         # Now resolve the symbolic link "$f"
    76         f_resolved=`readlink -n "$out$f" 2>/dev/null`
    77         status=$?
    78         # status 127 means readlink could not be found.
    79         if [ $status -eq 127 ]; then
    80             # We don't have "readlink", try a stupid "ls" hack instead.
    81             # This will fail if we have filenames like "a -> b".
    82             fls=`ls -l "$out$f" 2>/dev/null`
    83             status=$?
    84             f_resolved=${fls##*-> }
    85 
    86             # If $fls equals $f_resolved, then certainly
    87             # something is wrong
    88             if [ $status -eq 0 -a "$fls" = "$f_resolved" ]; then
    89                 echo >&2 "Cannot parse output from ls -l '$out$f'"
    90                 return 1
    91             fi
    92         fi
    93         if [ $status -ne 0 ]; then
    94             echo >&2 "Cannot read symbolic link '$out$f'"
    95             return $status
    96         fi
    97 
    98         # In $in, replace $f by $f_resolved (leave $out alone)
    99         in=${in/#"$f"/"$f_resolved"}
    100     done
    101 
    102     # Return $out
    103     echo "$out"
    104 }
    105 
    106 # If SAGE_ROOT is not given, find it out from $0
    107 if [ -z "$SAGE_ROOT" ];  then
    108     # Get the path to $0 (this shell script) with all symbolic links
    109     # resolved
    110     SAGE_ROOT=`resolvelinks "$0"` || \
    111     SAGE_ROOT="$0"
    112 
    113     # Get the directory component
    114     SAGE_ROOT="${SAGE_ROOT%/*}"
    115 fi
    116 
    117 # Make SAGE_ROOT absolute
    118 SAGE_ROOT=`cd "$SAGE_ROOT" && pwd -P`
    119 if [ $? -ne 0 ]; then
    120     echo >&2 "$0: cannot determine SAGE_ROOT directory"
    121     exit 1
    122 fi
    123 
    124 export SAGE_ROOT
    125 
    126 # Run the actual Sage script
    127 if [ -x "$SAGE_ROOT/src/bin/sage" ]; then
    128     "$SAGE_ROOT/src/bin/sage" "$@"
    129 elif [ -x "$SAGE_ROOT/local/bin/sage" ]; then # if in a striped binary
    130     "$SAGE_ROOT/local/bin/sage" "$@"
    131 else
    132     echo >&2 "$0: no Sage installation found in \$SAGE_ROOT=$SAGE_ROOT"
    133     exit 1
    134 fi
    135 
    136 # Kill all processes in the current process group.  In practice, this
    137 # means all child processes not running their own pty.
    138 # Uncomment this if you have trouble with orphans.
    139 # We do this in the background after waiting 10 seconds to give the
    140 # various processes (including this shell script) some time to exit
    141 # cleanly.
    142 # { sleep 10; kill -9 -$$ 2>/dev/null; } &
  • new file sage.in

    diff --git a/sage.in b/sage.in
    new file mode 100755
    index 0000000..46c69ba
    - +  
     1#!/usr/bin/env bash
     2#
     3# Sage: a free open-source mathematics software system
     4#
     5# This program is free software; you can redistribute it and/or
     6# modify it under the terms of the GNU General Public License
     7# as published by the Free Software Foundation; either version 2
     8# of the License, or (at your option) any later version.
     9#
     10# This program is distributed in the hope that it will be useful,
     11# but WITHOUT ANY WARRANTY; without even the implied warranty of
     12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13# GNU General Public License for more details.
     14#
     15# You should have received a copy of the GNU General Public License
     16# along with this program; if not, write to the Free Software
     17# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     18
     19
     20# Set SAGE_ROOT to the location of the sage install, i.e. the directory
     21# containing this shell script.  If unset, we will try to figure it out
     22# automatically.
     23#SAGE_ROOT=/path/to/sage-version
     24
     25
     26
     27# Resolve all symbolic links in a filename.  This more or less behaves
     28# like "readlink -f" except that it does not convert the filename to an
     29# absolute path (a relative path remains relative), nor does it treat
     30# "." or ".." specially.  See Trac ticket #5852.
     31resolvelinks() {
     32    # $in is what still needs to be converted (normally has no starting slash)
     33    in="$1"
     34    # $out is the part which is converted (normally ends with trailing slash)
     35    out="./"
     36
     37    # Move stuff from $in to $out
     38    while [ -n "$in" ]; do
     39        # Normalize $in by replacing consecutive slashes by one slash
     40        while { in_single_slash=${in//\/\//\/}; [ "$in" != "$in_single_slash" ]; }; do
     41            in=$in_single_slash
     42        done
     43
     44        # If $in starts with a slash, remove it and set $out to the root
     45        in_without_slash=${in/#\//}
     46        if [ "$in" != "$in_without_slash" ]; then
     47            in=$in_without_slash
     48            out="/"
     49            continue
     50        fi
     51
     52        # Check that the directory $out exists by trying to cd to it.
     53        # If this fails, then cd will show an error message (unlike
     54        # test -d "$out"), so no need to be more verbose.
     55        ( cd "$out" ) || return $?
     56
     57
     58        # Get the first component of $in
     59        f=${in%%/*}
     60
     61        # If it is not a symbolic link, simply move it to $out
     62        if [ ! -L "$out$f" ]; then
     63            in=${in#"$f"}
     64            out="$out$f"
     65
     66            # If the new $in starts with a slash, move it to $out
     67            in_without_slash=${in/#\//}
     68            if [ "$in" != "$in_without_slash" ]; then
     69                in=$in_without_slash
     70                out="$out/"
     71            fi
     72            continue
     73        fi
     74
     75        # Now resolve the symbolic link "$f"
     76        f_resolved=`readlink -n "$out$f" 2>/dev/null`
     77        status=$?
     78        # status 127 means readlink could not be found.
     79        if [ $status -eq 127 ]; then
     80            # We don't have "readlink", try a stupid "ls" hack instead.
     81            # This will fail if we have filenames like "a -> b".
     82            fls=`ls -l "$out$f" 2>/dev/null`
     83            status=$?
     84            f_resolved=${fls##*-> }
     85
     86            # If $fls equals $f_resolved, then certainly
     87            # something is wrong
     88            if [ $status -eq 0 -a "$fls" = "$f_resolved" ]; then
     89                echo >&2 "Cannot parse output from ls -l '$out$f'"
     90                return 1
     91            fi
     92        fi
     93        if [ $status -ne 0 ]; then
     94            echo >&2 "Cannot read symbolic link '$out$f'"
     95            return $status
     96        fi
     97
     98        # In $in, replace $f by $f_resolved (leave $out alone)
     99        in=${in/#"$f"/"$f_resolved"}
     100    done
     101
     102    # Return $out
     103    echo "$out"
     104}
     105
     106# If SAGE_ROOT is not given, find it out from $0
     107if [ -z "$SAGE_ROOT" ];  then
     108    # Get the path to $0 (this shell script) with all symbolic links
     109    # resolved
     110    SAGE_ROOT=`resolvelinks "$0"` || \
     111    SAGE_ROOT="$0"
     112
     113    # Get the directory component
     114    SAGE_ROOT="${SAGE_ROOT%/*}"
     115fi
     116
     117# Make SAGE_ROOT absolute
     118SAGE_ROOT=`cd "$SAGE_ROOT" && pwd -P`
     119if [ $? -ne 0 ]; then
     120    echo >&2 "$0: cannot determine SAGE_ROOT directory"
     121    exit 1
     122fi
     123
     124export SAGE_ROOT
     125
     126# Run the actual Sage script
     127if [ -x "$SAGE_ROOT/src/bin/sage" ]; then
     128    "$SAGE_ROOT/src/bin/sage" "$@"
     129elif [ -x "$SAGE_ROOT/local/bin/sage" ]; then # if in a striped binary
     130    "$SAGE_ROOT/local/bin/sage" "$@"
     131else
     132    echo >&2 "$0: no Sage installation found in \$SAGE_ROOT=$SAGE_ROOT"
     133    exit 1
     134fi
     135
     136# Kill all processes in the current process group.  In practice, this
     137# means all child processes not running their own pty.
     138# Uncomment this if you have trouble with orphans.
     139# We do this in the background after waiting 10 seconds to give the
     140# various processes (including this shell script) some time to exit
     141# cleanly.
     142# { sleep 10; kill -9 -$$ 2>/dev/null; } &