Ticket #14796: 0002-toplevel-build-system.patch

File 0002-toplevel-build-system.patch, 90.7 KB (added by felixs, 8 years ago)
  • GNUmakefile.am

    From f8ab766c3cb5a6f219e957d009cebcc88dc1b66c Mon Sep 17 00:00:00 2001
    From: Felix Salfelder <felix@salfelder.org>
    Date: Fri, 17 May 2013 19:14:17 +0200
    Subject: [PATCH 2/2] toplevel: build system
    
    - GNUmakefile.am, configure.ac
    - autogen.sh
    - empty NEWS, AUTHORS, ChangeLog
    - move README.txt to README
    - find GNU tar
    - core module build rules
    - gcc check
    - newest_version (from install.in)
    - skip "prereq" stuff (for now?)
    - change variable names to something more useful
    - urlgrabber
    - wrapper Makefile
    - deps.in
    - dist helpers (install, make)
    - foreign package en/disable (m4)
    - ...
    ---
     GNUmakefile.am                |  225 ++++++++++--
     Makefile                      |   15 +
     README                        |  383 ++++++++++++++++++++
     README.txt                    |  383 --------------------
     TODO                          |   19 +
     autogen.sh                    |   20 +-
     configure.ac                  |  350 +++++++++++++++++++
     deps.in                       |  772 ++++++++++++++++++++++-------------------
     dist/bin/sage-dist-install.in |  141 ++++++++
     dist/bin/sage-dist-make.in    |    3 +
     dist/etc/env.sh.in            |   93 +++++
     m4/ac_foreign.m4              |   42 +++
     sage.in                       |   15 +-
     13 files changed, 1680 insertions(+), 781 deletions(-)
     create mode 100644 AUTHORS
     create mode 100644 ChangeLog
     create mode 100644 Makefile
     create mode 100644 NEWS
     create mode 100644 README
     delete mode 100644 README.txt
     create mode 100644 TODO
     create mode 100644 configure.ac
     create mode 100644 dist/bin/sage-dist-install.in
     create mode 100644 dist/bin/sage-dist-make.in
     create mode 100644 dist/etc/env.sh.in
     create mode 100644 m4/ac_foreign.m4
    
    diff --git a/AUTHORS b/AUTHORS
    new file mode 100644
    index 0000000..e69de29
    diff --git a/ChangeLog b/ChangeLog
    new file mode 100644
    index 0000000..e69de29
    diff --git a/GNUmakefile.am b/GNUmakefile.am
    index 6ac2e34..5ea40c1 100644
    a b  
    66#
    77# See below for targets to build the documentation in other formats,
    88# to run various types of test suites, and to remove parts of the build etc.
     9#
     10SUBDIRS = dist build
     11
     12# just pkgs?
     13PKGSDIR=build/pkgs
    914
    10 PIPE = build/pipestatus
     15PIPE = $(abs_top_srcdir)/build/pipestatus
     16V_ = 0 # $(AM_DEFAULT_VERBOSITY)
     17V_0 = 0
     18V_1 = 1
     19
     20# need absolute path, passed to other build scripts.
     21SAGE_LOGS=@abs_top_builddir@/pkgs/logs
    1122
    1223all: start doc  # indirectly depends on build
    1324
     25CORE_MODULES=src/c_lib src/sage src/doc src/bin src/ext # src/mac-app src/whatever
     26CORE_ENV=LDFLAGS="-L$(prefix)/lib $$LDFLAGS" PATH="$(exec_prefix)/bin:$$PATH"
     27CORE_OPTS=--prefix="@prefix@"
     28
     29### CORE_MODULE build implementation ###
     30# FIXME: treat all modules the same?
     31
     32$(CORE_MODULES:%=%-configure): %-configure: %-configure-stamp
     33$(CORE_MODULES:%=%-configure-stamp): %-configure-stamp: $(abs_srcdir)/%/configure
     34        -mkdir -p $*
     35        cd $*; $(abs_top_srcdir)/$*/configure $(CORE_OPTS) $(CORE_ENV)
     36        touch $@
     37
     38$(CORE_MODULES:%=%-build): %-build: %-build-stamp
     39$(CORE_MODULES:%=%-build-stamp): %-build-stamp: %-configure-stamp
     40        export $(CORE_ENV); \
     41        $(MAKE) -C$* V=$(V_$(V))
     42        touch $@
     43
     44$(CORE_MODULES:%=%-install-stamp): %-install-stamp: %-install
     45        touch $@
     46
     47$(CORE_MODULES:%=%-install): %-install: %-build-stamp
     48        $(MAKE) -C$* install
     49
     50# distribute core modules as tarballs
     51# (probably unneeded)
     52EXTRA_DIST=$(CORE_MODULES:%=%-builtin.tar.gz)
     53$(CORE_MODULES:%=%-builtin.tar.gz): %-builtin.tar.gz: %-configure-stamp
     54        $(MAKE) -C$* dist PACKAGE=internal VERSION=builtin
     55        mv $*/internal-builtin.tar.gz $*-builtin.tar.gz
     56
     57# add submodule contents to dist (much better)
     58@distdir_subs@
     59
     60### core module rules ###
     61# FIXME: build src/sage out of tree
     62# in src/build/sage/cythonized?!
     63
     64.PHONY: $(CORE_MODULES:%=%-configure) \
     65        $(CORE_MODULES:%=%-build) \
     66        $(CORE_MODULES:%=%-install)
     67
     68### core module dependencies ###
     69
     70src/doc-configure-stamp: # src/sage-install-stamp
     71src/sage-configure-stamp: # src/c_lib-build-stamp
     72
     73PYTHON ?= $(abs_top_builddir)/local/bin/python
     74
     75src/sage-configure-stamp: CORE_ENV+= CPPFLAGS="-I$(abs_builddir)/local/include -I$(abs_builddir)/src/c_lib/include $$CPPFLAGS"
     76src/sage-configure-stamp: CORE_ENV+= PYTHON="$(PYTHON)"
     77src/sage-configure-stamp: CORE_ENV+= PKG_CONFIG_LIBDIR="$(abs_top_builddir)/local/lib/pkgconfig"
     78src/sage-configure-stamp: CORE_ENV+= LD_LIBRARY_PATH="$(abs_builddir)/local/lib:$$LD_LIBRARY_PATH"
     79
     80src/c_lib-configure-stamp: CORE_ENV+= CPPFLAGS="-I$(abs_builddir)/local/include -I$(abs_builddir)/src/c_lib/include $$CPPFLAGS"
     81src/c_lib-configure-stamp: CORE_ENV+= PYTHON="$(PYTHON)"
     82src/c_lib-configure-stamp: CORE_ENV+= PKG_CONFIG_LIBDIR="$(abs_top_builddir)/local/lib/pkgconfig"
     83src/c_lib-configure-stamp: CORE_ENV+= LD_LIBRARY_PATH="$(abs_builddir)/local/lib:$$LD_LIBRARY_PATH"
     84
     85src/bin-configure-stamp: CORE_OPTS+= --sysconfdir=@prefix@/etc
     86
     87# --path-paranoia?
     88@SAGE_ONLY_TRUE@src/bin-configure-stamp: CORE_OPTS+= --enable-path_redundancy
     89
     90src/sage-build-stamp: CORE_ENV+= LD_LIBRARY_PATH="$(abs_builddir)/local/lib:$$LD_LIBRARY_PATH"
     91
     92#c_lib depends from deps.in
     93src/c_lib-configure-stamp: @DEP_mpir@ @DEP_ntl@ @DEP_pari@ @DEP_polybori@ \
     94                           @DEP_pynac@ @DEP_python@
     95
     96BIN=src/bin-install-stamp
     97CSAGE=src/c_lib-install-stamp
     98SAGE=src/sage-install-stamp
     99
     100sage-stuff: $(SAGE)
     101
     102## install the core library parts
     103core-install: $(CORE_MODULES:%=%-install)
     104
     105## foreign module stuff
     106
     107# this is the install-stamp location
     108INST = local/var/lib/sage/installed
     109
     110LOCKFILE=$(abs_builddir)/.dllock
     111
     112packagename = $(firstword $(subst -, ,$1))
     113unat = echo "$1"; $1
     114
     115define downloadit
     116        @set -C; \
     117        trap 'rm -f $(LOCKFILE); exit $?' INT TERM EXIT;\
     118        until 2> /dev/null > $(LOCKFILE); do :; done
     119        mkdir -p @UPSTREAM@; cd @UPSTREAM@;\
     120        $(call unat,@URL_GRABBER@ @DOWNLOAD_URL@/$(call packagename,$*)/$(notdir $@))
     121endef
     122
     123@UPSTREAM@/%.bz2:
     124        $(downloadit)
     125
     126@UPSTREAM@/%.gz:
     127        $(downloadit)
     128
     129@dotPRECIOUS@: @UPSTREAM@/%.bz2 @UPSTREAM@/%.gz
     130
     131# FIXME: decruft environment!!!1
     132# this apparently is *not* prefix
     133SAGE_LOCAL=@abs_top_builddir@/local
     134
     135### generic build stamp rule
     136# FIXME: use more env.sh
     137# FIXME: pass FILELIST
     138.SECONDEXPANSION:
     139$(INST)/%: $(PKGSDIR)/$$(firstword $$(subst -, ,$$*))/src | $(SAGE_LOGS) $(INST) $(PKGSDIR)
     140        path=$(PKGSDIR)/$(firstword $(subst -, ,$*)); \
     141        [ -d $$path/patches -o -h $$path/patches ] || ln -s $(abs_top_srcdir)/$$path/patches $$path;\
     142        export CC="@CC@" CFLAGS="@CFLAGS@" \
     143               MAKE=$(MAKE) UNAME="@UNAME@" \
     144               srcdir="$(abs_top_srcdir)/$$path" \
     145               PYTHONHOME="$(abs_builddir)/local" \
     146               PYTHONPATH="$(abs_builddir)/$$path" \
     147               SINGULARPATH="$(SAGE_LOCAL)/share/singular" \
     148               SINGULAR_EXECUTABLE="$(SAGE_LOCAL)/bin/Singular"; \
     149        source dist/etc/env.sh; \
     150        cd $$path; \
     151        echo "$(abs_top_srcdir)/$$path/spkg-install" ;\
     152        $(PIPE) "$(abs_top_srcdir)/$$path/spkg-install" 'tee -a $(SAGE_LOGS)/$*.log'
     153        touch $@
     154
     155
     156p=%
     157define unpack
     158        @echo unpacking $@
     159# hmm, call clean?
     160        rm -rf $(PKGSDIR)/$*/src $(PKGSDIR)/$*/*-stamp
     161        mkdir -p $(PKGSDIR)/$*
     162        cd $(PKGSDIR)/$*; tar -xf $(abs_top_builddir)/$|
     163        @a="$(FP_$*)"; shopt -s extglob; \
     164          $(call unat,mv $(PKGSDIR)/$*/$${a%.p[0-9]?([0-9])} $@)
     165endef
     166
     167.SECONDEXPANSION:
     168$(PKGSDIR)/%/src: | @UPSTREAM@/$$(shell a=$$(FP_$$*) && shopt -s extglob && echo "$$$${a$$(p).p[0-9]?([0-9])}" ).tar.bz2 \
     169                  $$(shell echo >&2 $$* to2 $$(FP_$$*))
     170        $(unpack)
     171
     172.SECONDEXPANSION:
     173$(PKGSDIR)/%/src: | @UPSTREAM@/$$(shell a=$$(FP_$$*) && shopt -s extglob && echo "$$$$a" ).tar.gz \
     174                  $$(shell echo >&2 $$* to3 $$(FP_$$*))
     175        $(unpack)
     176
     177$(INST):
     178        mkdir -p $@
     179
     180$(INST)/:
     181        mkdir -p $@
     182
     183$(SAGE_LOGS):
     184        mkdir -p $@
     185
    14186logs:
    15187        mkdir -p $@
    16188
    17189build: logs
     190
     191$(PKGSDIR):
     192        mkdir -p $@
     193
     194build:
    18195        cd build && \
    19196        "../$(PIPE)" \
    20197                "env SAGE_PARALLEL_SPKG_BUILD='$(SAGE_PARALLEL_SPKG_BUILD)' ./install all 2>&1" \
    build: logs 
    26203# access. Note that this requires that your system have OpenSSL
    27204# libraries and headers installed. See README.txt for more
    28205# information.
     206# FIXME: move to configure.ac
    29207ssl: all
    30208        ./sage -i pyopenssl
    31209
    doc-pdf: build 
    63241
    64242doc-clean:
    65243        @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
     244        make -Csrc/doc clean
    71245
    72 clean:
     246clean-local:
    73247        @echo "Deleting package build directories..."
    74248        rm -rf local/var/tmp/sage/build
    75249
    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
     250        make -C src/c_lib clean
     251        make -C src/sage clean
     252# FIXME:
     253# also remove foreign package src
    82254
    83255bdist-clean: clean
    84256        @echo "Deleting miscellaneous artifacts generated by build system ..."
    85257        rm -rf logs
    86         rm -rf dist
     258        rm -rf distFIXME
    87259        rm -rf tmp
    88260        rm -f build/Makefile
    89261        rm -f .BUILDSTART
    90262
    91 distclean: clean doc-clean lib-clean bdist-clean
     263distclean-local:
     264        -for i in $(CORE_MODULES); do \
     265          [ -f $$i/config.status ] && $(MAKE) -C $$i distclean; \
     266        done
    92267        @echo "Deleting all remaining output from build system ..."
    93         rm -rf local
     268        rm -rf $(top_builddir)/local
    94269
    95270micro_release: bdist-clean lib-clean
    96271        @echo "Stripping binaries ..."
    ptestoptional: ptestall # just an alias 
    143318
    144319ptestoptionallong: ptestalllong # just an alias
    145320
    146 
    147 install:
     321# this is pretty much 'incomplete'.
     322install-broken:
    148323        echo "Experimental use only!"
    149324        if [ "$(DESTDIR)" = "" ]; then \
    150325                echo >&2 "Set the environment variable DESTDIR to the install path."; \
    151326                exit 1; \
    152327        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
     328# Make sure we remove only an existing directory. If $(DESTDIR)/sage is
     329# a file instead of a directory then the mkdir statement later will fail
    155330        if [ -d "$(DESTDIR)"/sage ]; then \
    156331                rm -rf "$(DESTDIR)"/sage; \
    157332        fi
    install: 
    162337        ln -s ../sage/sage "$(DESTDIR)"/bin/sage
    163338        "$(DESTDIR)"/bin/sage -c # Run sage-location
    164339
    165 
    166340.PHONY: all build build-serial start install \
    167341        doc doc-html doc-html-jsmath doc-html-mathjax doc-pdf \
    168342        doc-clean clean lib-clean bdist-clean distclean micro_release \
    169343        test check testoptional testall testlong testoptionallong testallong \
    170         ptest ptestoptional ptestall ptestlong ptestoptionallong ptestallong
     344        PTESt ptestoptional ptestall ptestlong ptestoptionallong ptestallong
     345
     346@dotPRECIOUS@: local/var/lib/sage/installed/%
     347
     348include deps.in
     349
     350uninstall-local:
     351        rm -rf src/*-stamp
  • new file Makefile

    diff --git a/Makefile b/Makefile
    new file mode 100644
    index 0000000..6b361c6
    - +  
     1# this file is part of Sage
     2# (c) 2013 Felix Salfelder
     3# license: gplv3+
     4#
     5
     6# provide old, static build interface
     7
     8all: check
     9        ./configure # creates GNUmakefile
     10        $(MAKE) -f GNUmakefile
     11
     12check:
     13        @$(MAKE) --version | grep -q GNU
     14
     15.PHONY: check
  • new file README

    diff --git a/NEWS b/NEWS
    new file mode 100644
    index 0000000..e69de29
    diff --git a/README b/README
    new file mode 100644
    index 0000000..eb614bd
    - +  
     1    Sage: Open Source Mathematical Software
     2
     3       "Creating a Viable Open Source Alternative to
     4          Magma, Maple, Mathematica, and MATLAB"
     5
     6    Copyright (C) 2005-2012 William Stein and the Sage Development Team
     7
     8        http://www.sagemath.org
     9
     10    Over 200 people have contributed code to Sage. Please see the
     11    following web page for a list:
     12
     13        http://www.sagemath.org/development-map.html
     14
     15    In many cases, documentation for modules and functions list the
     16    authors.
     17
     18
     19GETTING STARTED
     20---------------
     21
     22This README.txt contains build instructions for Sage. If you downloaded
     23a binary, you do not need to do anything; just execute:
     24
     25    ./sage
     26
     27from the command line. If you downloaded the sources, please read below
     28on how to build Sage and work around common issues.
     29
     30If you have questions or encounter problems, please do not hesitate
     31to email the sage-support mailing list:
     32
     33    http://groups.google.com/group/sage-support
     34
     35
     36SUPPORTED PLATFORMS
     37-------------------
     38
     39Sage fully supports several Linux distributions, recent versions of
     40Mac OS X, as well as a number of Solaris and OpenSolaris releases.
     41
     42There should be no serious bugs in an officially released version of
     43Sage on any of the fully supported platforms, but any major issues with
     44a particular release will be documented on an errata page:
     45
     46    http://wiki.sagemath.org/errata
     47
     48Ports are in progress to some other, less common platforms. The list of
     49supported platforms and their current statuses are given at the
     50following web page:
     51
     52    http://wiki.sagemath.org/SupportedPlatforms
     53
     54If you are interested in helping port Sage to a new platform, please let
     55us know at the sage-devel mailing list:
     56
     57    http://groups.google.com/group/sage-devel
     58
     59
     60QUICK INSTRUCTIONS TO BUILD FROM SOURCE
     61---------------------------------------
     62
     63The following steps briefly outline the process of building Sage from
     64source. More detailed instructions, including how to build faster on
     65multicore machines are contained later in this README and in the
     66Installation Guide:
     67
     68    http://www.sagemath.org/doc/installation
     69
     701. Make sure you have the dependencies and 3 GB of free disk space.
     71
     72   Linux: gcc, make, m4, perl, ranlib, and tar.
     73   (install these using your package manager)
     74   On recent Debian or Ubuntu systems (in particular Ubuntu 12.04
     75   "Precise"), you need the dpkg-dev package.
     76
     77   OS X: Xcode. Make sure you have installed the most recent version
     78   of Xcode. For pre-Lion versions of OS X, you can download Xcode
     79   from http://developer.apple.com/downloads/. For OS X Lion, you can
     80   install it using the App Store. With Xcode 4.3 or later, you need
     81   to install the "Command Line Tools": from the File menu, choose
     82   "Preferences", then the "Downloads" tab, and then "Install" the
     83   Command Line Tools.
     84
     85   Other platforms: See detailed instructions below.
     86
     872. Extract the tarball:
     88
     89       tar xvf sage-*.tar
     90
     913. cd into the Sage directory and type make:
     92
     93       cd sage-*/
     94       make
     95
     96   That's it! Everything is automatic and non-interactive. The build
     97   should work fine on all fully supported platforms. If it does not, we
     98   want to know!
     99
     100
     101ENVIRONMENT VARIABLES
     102---------------------
     103
     104There are a lot of environment variables which control the install
     105process of Sage, see:
     106
     107    http://sagemath.org/doc/installation/source.html#environment-variables
     108
     109
     110SELINUX
     111--------
     112
     113On Linux, if you get this error message:
     114
     115    Error: cannot restore segment prot after reloc: Permission denied
     116
     117the problem is probably related to SELinux. See the following URL for
     118further information:
     119
     120    http://www.exelisvis.com/Support/HelpArticleDetail/ArticleId/3092.aspx
     121
     122
     123IMPLEMENTATION
     124--------------
     125
     126Sage has significant components written in the following languages:
     127C/C++, Python, Cython, Lisp, and Fortran. Lisp (ECL), Python, and Cython
     128are built as part of Sage and a GNU Fortran (gfortran) binary is
     129included (OS X only), so you do not need them in order to build Sage.
     130
     131
     132MORE DETAILED INSTRUCTIONS TO BUILD FROM SOURCE
     133-----------------------------------------------
     134
     1351. Make sure you have about 3 GB of free disk space.
     136
     1372. Install build dependencies.
     138
     139   Linux: See quick instructions above.
     140
     141   OS X: Make sure you have XCode version >= 2.4, i.e. "gcc -v" should
     142   output build >= 5363. If you don't, go to:
     143
     144       http://developer.apple.com/
     145
     146   sign up, and download the free XCode package. Only OS X >= 10.4 is
     147   supported.
     148
     149   Solaris and OpenSolaris: Building Sage on these platforms is more
     150   tricky than on Linux or OS X. For details on how to build Sage on
     151   these platforms, see:
     152
     153       http://wiki.sagemath.org/solaris
     154
     155   Windows: Not supported. A solution is to download and install
     156   VirtualBox, install Linux into it, etc.
     157
     158   NOTE: On some operating systems, it might be necessary to install
     159   gas/as, gld/ld, gnm/nm. On most platforms, these are automatically
     160   installed when you install the programs listed above.
     161
     1623. Extract the Sage source tarball and cd into a directory with no
     163   spaces in it. If you have a machine with 4 processors, say, type
     164   the following to configure the build script to perform a parallel
     165   compilation of Sage using 4 jobs:
     166
     167       export MAKE="make -j4"
     168
     169   (With 4 processors, you might also consider "-j5" or "-j6" --
     170   building with more jobs than CPU cores can speed things up.)
     171   You might in addition pass a "-l" flag to "make": this
     172   sets a load limit, so for example if you execute
     173
     174       export MAKE="make -j4 -l5.5"
     175
     176   then "make" won't start more than one job at a time if the system
     177   load average is above 5.5.  See
     178   http://www.gnu.org/software/make/manual/make.html#Options-Summary
     179   and http://www.gnu.org/software/make/manual/make.html#Parallel.
     180
     181   If you want to run the test suite for each individual spkg as it is
     182   installed, type:
     183
     184       export SAGE_CHECK="yes"
     185
     186   before starting the Sage build. This will run each test suite and
     187   will raise an error if any failures occur. Python's test suite has
     188   been disabled by default, because it causes failures on most
     189   systems. To renable the Python testsuite, set the environment
     190   variable SAGE_CHECK_PACKAGES to "python".
     191
     192   To start the build, type:
     193
     194       make
     195
     1964. Wait about 1 hour to 14 days, depending on your computer (it took
     197   about 2 weeks to build Sage on the T-Mobile G1 Android cell phone).
     198
     1995. Type "./sage" to try it out.
     200
     2016. OPTIONAL: Start Sage and run the command
     202
     203       install_scripts("/usr/local/bin/")   # change /usr/local/bin/
     204
     205   Type "install_scripts?" in Sage for more details about what this
     206   command does.
     207
     2087. OPTIONAL: Type "make ptest" to test all examples in the documentation
     209   (over 93,000 lines of input!) -- this takes from 30 minutes to
     210   several hours. Don't get too disturbed if there are 2 to 3 failures,
     211   but always feel free to email the section of logs/ptest.log that
     212   contains errors to the sage-support mailing list. If there are
     213   numerous failures, there was a serious problem with your build.
     214
     2158. OPTIONAL: If you want to (try to) build the documentation, run:
     216
     217       sage --docbuild --help
     218
     219   for instructions. The HTML version of the documentation is built
     220   during the compilation process of Sage and resides in the directory:
     221
     222       $SAGE_ROOT/devel/sage/doc/output/html/
     223
     224   LaTeX is required to build the PDF version of the documentation.
     225
     2269. OPTIONAL: It is highly recommended that you install the optional GAP
     227   database by typing:
     228
     229       ./sage --optional
     230
     231   then installing (with "./sage -i") the package whose name begins with
     232   database_gap. This will download the package from
     233   sage.math.washington.edu and install it. While you're at it, you
     234   might install other databases of interest to you.
     235
     23610. OPTIONAL: It is recommended that you have both LaTeX and the
     237    ImageMagick tools (e.g. the "convert" command) installed since some
     238    plotting functionality benefits from it.
     239
     24011. OPTIONAL: Read this if you are intending to run a Sage notebook
     241    server for multiple users. For security (i.e., to run
     242    "notebook(secure=True)") you may wish users to access the server
     243    using the HTTPS protocol. You also may want to use OpenID for user
     244    authentication. The first of these requires you to install
     245    pyOpenSSL, and they both require OpenSSL. If you have OpenSSL and
     246    the OpenSSL development headers installed on your system, you can
     247    install pyOpenSSL by building Sage and then typing
     248
     249        ./sage -i pyopenssl
     250
     251    Note that this command requires internet access.  Alternatively,
     252    "make ssl" builds Sage and installs pyOpenSSL.  If you are missing
     253    either OpenSSL or OpenSSL's development headers, you can install a
     254    local copy of both into your Sage installation first. Ideally,
     255    this should be done before installing Sage; otherwise, you should
     256    at least rebuild Sage's Python, and ideally any part of Sage
     257    relying on it. So the procedure is as follows (again, with a
     258    computer connected to the internet). Starting from a fresh Sage
     259    tarball:
     260
     261        ./sage -i patch
     262        ./sage -i openssl
     263        make ssl
     264
     265    Alternatively, if you've already built Sage:
     266
     267        ./sage -i openssl
     268        ./sage -f python   # rebuilds Python
     269        SAGE_UPGRADING=yes make ssl
     270
     271    The third line will rebuild all parts of Sage that depend on
     272    Python; this can take a while.
     273
     274PROBLEMS
     275--------
     276
     277If you have problems building Sage, check the Sage Installation Guide,
     278and also note the following.  Each separate component of Sage is
     279contained in an spkg; these are stored in spkg/standard/.  As each one
     280is built, a build log is stored in logs/pkgs/, so you can browse these
     281to find error messages.  If an spkg fails to build, the whole build
     282process will stop soon after, so check the most recent log files
     283first, or run
     284
     285   grep -li "^Error" logs/pkgs/*
     286
     287from the top-level Sage directory to find log files with error
     288messages in them.  Send (a small part of) the relevant log file to the
     289sage-devel mailing list, making sure to include at least some of the
     290error messages; probably someone there will have some helpful
     291suggestions.
     292
     293
     294SUPPORTED COMPILERS
     295-------------------
     296
     297Sage includes a GCC (GNU Compiler Collection) package. In order to
     298build Sage, you need a C compiler which can build GCC and its
     299prerequisites. gcc version 4.0.1 or later should probably work. On
     300Solaris or OpenSolaris, building with the Sun compiler should also work.
     301
     302The GCC package in Sage is not always installed. It is determined
     303automatically whether it needs to be installed. You can override this
     304by setting the environment variable SAGE_INSTALL_GCC=yes (to force
     305installation of GCC) or SAGE_INSTALL_GCC=no (to disable installation of
     306GCC). If you don't want to install GCC, you need to have recent
     307versions of gcc, g++ and gfortran; moreover, the versions must be equal.
     308
     309There are some known problems with old assemblers, in particular when
     310building the ECM package. You should ensure that your assembler
     311understands all instructions for your processor. On Linux, this means
     312you need a recent version of binutils; on OS X you need a recent version
     313of XCode.
     314
     315
     316RELOCATION
     317----------
     318
     319You *should* be able to move the sage-x.y.z/ directory anywhere you
     320want. If you copy the sage script or make a symbolic link to it, you
     321should modify the script to reflect this (as instructed at the top of
     322the script). It is best if the path to Sage does not have any spaces in
     323it.
     324
     325For a system-wide installation, as root you can move the sage-x.y.z/
     326directory to a system-wide directory. Afterwards, you need to start up
     327Sage as root at least once prior to using the system-wide Sage as a
     328normal user. See the Installation Guide for further information on
     329performing a system-wide installation:
     330
     331    http://www.sagemath.org/doc/installation/source.html#installation-in-a-multiuser-environment
     332
     333If you find anything that doesn't work correctly after you moved the
     334directory, please email the sage-support mailing list.
     335
     336
     337REDISTRIBUTION
     338--------------
     339
     340Your local Sage install is almost exactly the same as any "developer"
     341install. You can make changes to documentation, source, etc., and very
     342easily package the complete results up for redistribution just like we
     343do.
     344
     3451. To make your own source tarball (sage-x.y.z.tar) of Sage, type:
     346
     347       sage --sdist x.y.z
     348
     349   where the version is whatever you want.
     350
     3512. To make a binary distribution with your currently installed packages,
     352   type:
     353
     354       sage --bdist x.y.z
     355
     3563. To make a binary that will run on the widest range of target
     357   machines, set the SAGE_FAT_BINARY environment variable to "yes"
     358   before building Sage:
     359
     360       export SAGE_FAT_BINARY="yes"
     361       make
     362       ./sage --bdist x.y.z-fat
     363
     364In all cases, the result is placed in the directory "$SAGE_ROOT/dist/".
     365
     366
     367CHANGES TO INCLUDED SOFTWARE
     368----------------------------
     369
     370All software included with Sage is copyrighted by the respective authors
     371and released under an open source license that is "GPL version 3 or
     372later" compatible. See the file COPYING.txt for more details.
     373
     374Almost every spkg in $SAGE_ROOT/spkg/standard/ is a bzip2-compressed
     375tarball (currently, the only exception is the bzip2 spkg itself, which
     376is gzip-compressed). You can extract it with:
     377
     378    tar xvf name-*.spkg
     379
     380Inside the spkg, there is a file SPKG.txt that details all changes made
     381to the given package for inclusion with Sage. The inclusion of such a
     382file detailing changes is specifically required by some of the packages
     383included with Sage (e.g. for GAP).
  • deleted file README.txt

    diff --git a/README.txt b/README.txt
    deleted file mode 100644
    index eb614bd..0000000
    + -  
    1     Sage: Open Source Mathematical Software
    2 
    3        "Creating a Viable Open Source Alternative to
    4           Magma, Maple, Mathematica, and MATLAB"
    5 
    6     Copyright (C) 2005-2012 William Stein and the Sage Development Team
    7 
    8         http://www.sagemath.org
    9 
    10     Over 200 people have contributed code to Sage. Please see the
    11     following web page for a list:
    12 
    13         http://www.sagemath.org/development-map.html
    14 
    15     In many cases, documentation for modules and functions list the
    16     authors.
    17 
    18 
    19 GETTING STARTED
    20 ---------------
    21 
    22 This README.txt contains build instructions for Sage. If you downloaded
    23 a binary, you do not need to do anything; just execute:
    24 
    25     ./sage
    26 
    27 from the command line. If you downloaded the sources, please read below
    28 on how to build Sage and work around common issues.
    29 
    30 If you have questions or encounter problems, please do not hesitate
    31 to email the sage-support mailing list:
    32 
    33     http://groups.google.com/group/sage-support
    34 
    35 
    36 SUPPORTED PLATFORMS
    37 -------------------
    38 
    39 Sage fully supports several Linux distributions, recent versions of
    40 Mac OS X, as well as a number of Solaris and OpenSolaris releases.
    41 
    42 There should be no serious bugs in an officially released version of
    43 Sage on any of the fully supported platforms, but any major issues with
    44 a particular release will be documented on an errata page:
    45 
    46     http://wiki.sagemath.org/errata
    47 
    48 Ports are in progress to some other, less common platforms. The list of
    49 supported platforms and their current statuses are given at the
    50 following web page:
    51 
    52     http://wiki.sagemath.org/SupportedPlatforms
    53 
    54 If you are interested in helping port Sage to a new platform, please let
    55 us know at the sage-devel mailing list:
    56 
    57     http://groups.google.com/group/sage-devel
    58 
    59 
    60 QUICK INSTRUCTIONS TO BUILD FROM SOURCE
    61 ---------------------------------------
    62 
    63 The following steps briefly outline the process of building Sage from
    64 source. More detailed instructions, including how to build faster on
    65 multicore machines are contained later in this README and in the
    66 Installation Guide:
    67 
    68     http://www.sagemath.org/doc/installation
    69 
    70 1. Make sure you have the dependencies and 3 GB of free disk space.
    71 
    72    Linux: gcc, make, m4, perl, ranlib, and tar.
    73    (install these using your package manager)
    74    On recent Debian or Ubuntu systems (in particular Ubuntu 12.04
    75    "Precise"), you need the dpkg-dev package.
    76 
    77    OS X: Xcode. Make sure you have installed the most recent version
    78    of Xcode. For pre-Lion versions of OS X, you can download Xcode
    79    from http://developer.apple.com/downloads/. For OS X Lion, you can
    80    install it using the App Store. With Xcode 4.3 or later, you need
    81    to install the "Command Line Tools": from the File menu, choose
    82    "Preferences", then the "Downloads" tab, and then "Install" the
    83    Command Line Tools.
    84 
    85    Other platforms: See detailed instructions below.
    86 
    87 2. Extract the tarball:
    88 
    89        tar xvf sage-*.tar
    90 
    91 3. cd into the Sage directory and type make:
    92 
    93        cd sage-*/
    94        make
    95 
    96    That's it! Everything is automatic and non-interactive. The build
    97    should work fine on all fully supported platforms. If it does not, we
    98    want to know!
    99 
    100 
    101 ENVIRONMENT VARIABLES
    102 ---------------------
    103 
    104 There are a lot of environment variables which control the install
    105 process of Sage, see:
    106 
    107     http://sagemath.org/doc/installation/source.html#environment-variables
    108 
    109 
    110 SELINUX
    111 --------
    112 
    113 On Linux, if you get this error message:
    114 
    115     Error: cannot restore segment prot after reloc: Permission denied
    116 
    117 the problem is probably related to SELinux. See the following URL for
    118 further information:
    119 
    120     http://www.exelisvis.com/Support/HelpArticleDetail/ArticleId/3092.aspx
    121 
    122 
    123 IMPLEMENTATION
    124 --------------
    125 
    126 Sage has significant components written in the following languages:
    127 C/C++, Python, Cython, Lisp, and Fortran. Lisp (ECL), Python, and Cython
    128 are built as part of Sage and a GNU Fortran (gfortran) binary is
    129 included (OS X only), so you do not need them in order to build Sage.
    130 
    131 
    132 MORE DETAILED INSTRUCTIONS TO BUILD FROM SOURCE
    133 -----------------------------------------------
    134 
    135 1. Make sure you have about 3 GB of free disk space.
    136 
    137 2. Install build dependencies.
    138 
    139    Linux: See quick instructions above.
    140 
    141    OS X: Make sure you have XCode version >= 2.4, i.e. "gcc -v" should
    142    output build >= 5363. If you don't, go to:
    143 
    144        http://developer.apple.com/
    145 
    146    sign up, and download the free XCode package. Only OS X >= 10.4 is
    147    supported.
    148 
    149    Solaris and OpenSolaris: Building Sage on these platforms is more
    150    tricky than on Linux or OS X. For details on how to build Sage on
    151    these platforms, see:
    152 
    153        http://wiki.sagemath.org/solaris
    154 
    155    Windows: Not supported. A solution is to download and install
    156    VirtualBox, install Linux into it, etc.
    157 
    158    NOTE: On some operating systems, it might be necessary to install
    159    gas/as, gld/ld, gnm/nm. On most platforms, these are automatically
    160    installed when you install the programs listed above.
    161 
    162 3. Extract the Sage source tarball and cd into a directory with no
    163    spaces in it. If you have a machine with 4 processors, say, type
    164    the following to configure the build script to perform a parallel
    165    compilation of Sage using 4 jobs:
    166 
    167        export MAKE="make -j4"
    168 
    169    (With 4 processors, you might also consider "-j5" or "-j6" --
    170    building with more jobs than CPU cores can speed things up.)
    171    You might in addition pass a "-l" flag to "make": this
    172    sets a load limit, so for example if you execute
    173 
    174        export MAKE="make -j4 -l5.5"
    175 
    176    then "make" won't start more than one job at a time if the system
    177    load average is above 5.5.  See
    178    http://www.gnu.org/software/make/manual/make.html#Options-Summary
    179    and http://www.gnu.org/software/make/manual/make.html#Parallel.
    180 
    181    If you want to run the test suite for each individual spkg as it is
    182    installed, type:
    183 
    184        export SAGE_CHECK="yes"
    185 
    186    before starting the Sage build. This will run each test suite and
    187    will raise an error if any failures occur. Python's test suite has
    188    been disabled by default, because it causes failures on most
    189    systems. To renable the Python testsuite, set the environment
    190    variable SAGE_CHECK_PACKAGES to "python".
    191 
    192    To start the build, type:
    193 
    194        make
    195 
    196 4. Wait about 1 hour to 14 days, depending on your computer (it took
    197    about 2 weeks to build Sage on the T-Mobile G1 Android cell phone).
    198 
    199 5. Type "./sage" to try it out.
    200 
    201 6. OPTIONAL: Start Sage and run the command
    202 
    203        install_scripts("/usr/local/bin/")   # change /usr/local/bin/
    204 
    205    Type "install_scripts?" in Sage for more details about what this
    206    command does.
    207 
    208 7. OPTIONAL: Type "make ptest" to test all examples in the documentation
    209    (over 93,000 lines of input!) -- this takes from 30 minutes to
    210    several hours. Don't get too disturbed if there are 2 to 3 failures,
    211    but always feel free to email the section of logs/ptest.log that
    212    contains errors to the sage-support mailing list. If there are
    213    numerous failures, there was a serious problem with your build.
    214 
    215 8. OPTIONAL: If you want to (try to) build the documentation, run:
    216 
    217        sage --docbuild --help
    218 
    219    for instructions. The HTML version of the documentation is built
    220    during the compilation process of Sage and resides in the directory:
    221 
    222        $SAGE_ROOT/devel/sage/doc/output/html/
    223 
    224    LaTeX is required to build the PDF version of the documentation.
    225 
    226 9. OPTIONAL: It is highly recommended that you install the optional GAP
    227    database by typing:
    228 
    229        ./sage --optional
    230 
    231    then installing (with "./sage -i") the package whose name begins with
    232    database_gap. This will download the package from
    233    sage.math.washington.edu and install it. While you're at it, you
    234    might install other databases of interest to you.
    235 
    236 10. OPTIONAL: It is recommended that you have both LaTeX and the
    237     ImageMagick tools (e.g. the "convert" command) installed since some
    238     plotting functionality benefits from it.
    239 
    240 11. OPTIONAL: Read this if you are intending to run a Sage notebook
    241     server for multiple users. For security (i.e., to run
    242     "notebook(secure=True)") you may wish users to access the server
    243     using the HTTPS protocol. You also may want to use OpenID for user
    244     authentication. The first of these requires you to install
    245     pyOpenSSL, and they both require OpenSSL. If you have OpenSSL and
    246     the OpenSSL development headers installed on your system, you can
    247     install pyOpenSSL by building Sage and then typing
    248 
    249         ./sage -i pyopenssl
    250 
    251     Note that this command requires internet access.  Alternatively,
    252     "make ssl" builds Sage and installs pyOpenSSL.  If you are missing
    253     either OpenSSL or OpenSSL's development headers, you can install a
    254     local copy of both into your Sage installation first. Ideally,
    255     this should be done before installing Sage; otherwise, you should
    256     at least rebuild Sage's Python, and ideally any part of Sage
    257     relying on it. So the procedure is as follows (again, with a
    258     computer connected to the internet). Starting from a fresh Sage
    259     tarball:
    260 
    261         ./sage -i patch
    262         ./sage -i openssl
    263         make ssl
    264 
    265     Alternatively, if you've already built Sage:
    266 
    267         ./sage -i openssl
    268         ./sage -f python   # rebuilds Python
    269         SAGE_UPGRADING=yes make ssl
    270 
    271     The third line will rebuild all parts of Sage that depend on
    272     Python; this can take a while.
    273 
    274 PROBLEMS
    275 --------
    276 
    277 If you have problems building Sage, check the Sage Installation Guide,
    278 and also note the following.  Each separate component of Sage is
    279 contained in an spkg; these are stored in spkg/standard/.  As each one
    280 is built, a build log is stored in logs/pkgs/, so you can browse these
    281 to find error messages.  If an spkg fails to build, the whole build
    282 process will stop soon after, so check the most recent log files
    283 first, or run
    284 
    285    grep -li "^Error" logs/pkgs/*
    286 
    287 from the top-level Sage directory to find log files with error
    288 messages in them.  Send (a small part of) the relevant log file to the
    289 sage-devel mailing list, making sure to include at least some of the
    290 error messages; probably someone there will have some helpful
    291 suggestions.
    292 
    293 
    294 SUPPORTED COMPILERS
    295 -------------------
    296 
    297 Sage includes a GCC (GNU Compiler Collection) package. In order to
    298 build Sage, you need a C compiler which can build GCC and its
    299 prerequisites. gcc version 4.0.1 or later should probably work. On
    300 Solaris or OpenSolaris, building with the Sun compiler should also work.
    301 
    302 The GCC package in Sage is not always installed. It is determined
    303 automatically whether it needs to be installed. You can override this
    304 by setting the environment variable SAGE_INSTALL_GCC=yes (to force
    305 installation of GCC) or SAGE_INSTALL_GCC=no (to disable installation of
    306 GCC). If you don't want to install GCC, you need to have recent
    307 versions of gcc, g++ and gfortran; moreover, the versions must be equal.
    308 
    309 There are some known problems with old assemblers, in particular when
    310 building the ECM package. You should ensure that your assembler
    311 understands all instructions for your processor. On Linux, this means
    312 you need a recent version of binutils; on OS X you need a recent version
    313 of XCode.
    314 
    315 
    316 RELOCATION
    317 ----------
    318 
    319 You *should* be able to move the sage-x.y.z/ directory anywhere you
    320 want. If you copy the sage script or make a symbolic link to it, you
    321 should modify the script to reflect this (as instructed at the top of
    322 the script). It is best if the path to Sage does not have any spaces in
    323 it.
    324 
    325 For a system-wide installation, as root you can move the sage-x.y.z/
    326 directory to a system-wide directory. Afterwards, you need to start up
    327 Sage as root at least once prior to using the system-wide Sage as a
    328 normal user. See the Installation Guide for further information on
    329 performing a system-wide installation:
    330 
    331     http://www.sagemath.org/doc/installation/source.html#installation-in-a-multiuser-environment
    332 
    333 If you find anything that doesn't work correctly after you moved the
    334 directory, please email the sage-support mailing list.
    335 
    336 
    337 REDISTRIBUTION
    338 --------------
    339 
    340 Your local Sage install is almost exactly the same as any "developer"
    341 install. You can make changes to documentation, source, etc., and very
    342 easily package the complete results up for redistribution just like we
    343 do.
    344 
    345 1. To make your own source tarball (sage-x.y.z.tar) of Sage, type:
    346 
    347        sage --sdist x.y.z
    348 
    349    where the version is whatever you want.
    350 
    351 2. To make a binary distribution with your currently installed packages,
    352    type:
    353 
    354        sage --bdist x.y.z
    355 
    356 3. To make a binary that will run on the widest range of target
    357    machines, set the SAGE_FAT_BINARY environment variable to "yes"
    358    before building Sage:
    359 
    360        export SAGE_FAT_BINARY="yes"
    361        make
    362        ./sage --bdist x.y.z-fat
    363 
    364 In all cases, the result is placed in the directory "$SAGE_ROOT/dist/".
    365 
    366 
    367 CHANGES TO INCLUDED SOFTWARE
    368 ----------------------------
    369 
    370 All software included with Sage is copyrighted by the respective authors
    371 and released under an open source license that is "GPL version 3 or
    372 later" compatible. See the file COPYING.txt for more details.
    373 
    374 Almost every spkg in $SAGE_ROOT/spkg/standard/ is a bzip2-compressed
    375 tarball (currently, the only exception is the bzip2 spkg itself, which
    376 is gzip-compressed). You can extract it with:
    377 
    378     tar xvf name-*.spkg
    379 
    380 Inside the spkg, there is a file SPKG.txt that details all changes made
    381 to the given package for inclusion with Sage. The inclusion of such a
    382 file detailing changes is specifically required by some of the packages
    383 included with Sage (e.g. for GAP).
  • new file TODO

    diff --git a/TODO b/TODO
    new file mode 100644
    index 0000000..147fec5
    - +  
     1
     2FC is required (should not)
     3
     4paths are suboptimal.
     5/build/pkgs should be /pkgs
     6/build/etc should be /dist/etc (done?)
     7/build/bin should be /dist/bin (done?)
     8
     9dependencies should be where packages are, not in "deps"
     10
     11PYTHON dependency, currently using SAGE_LOCAL/bin/python unconditionally
     12
     13CORE_MODULES should be built with VPATH.
     14
     15uninstall before fresh install
     16
     17src must be <packagename>-<version> or src-<version>, hmmm #17495
     18
     19remove this file
  • autogen.sh

    diff --git a/autogen.sh b/autogen.sh
    index 656b6cc..7bebb9f 100755
    a b  
    44# license: gplv3+
    55#
    66
    7 MODULES=src/c_lib
     7MODULES="src/sage src/c_lib src/bin src/doc src/ext"
     8
     9# for now avoid using bash as not everyone has that installed
     10CONFIG_SHELL=/bin/sh
     11export CONFIG_SHELL
     12ACLOCAL_FLAGS=-Im4
     13
     14echo "Running aclocal..."
     15aclocal $ACLOCAL_FLAGS || exit 1
     16
     17echo "Running automake..."
     18automake -a -c --gnu --add-missing  || exit 1
     19
     20echo "Running autoconf..."
     21autoconf || exit 1
     22
     23if test "x$1" = xhere; then
     24        exit 0;
     25fi
    826
    927for i in $MODULES; do
    1028        ( cd $i;
  • new file configure.ac

    diff --git a/configure.ac b/configure.ac
    new file mode 100644
    index 0000000..43cfc4a
    - +  
     1#                                               -*- Autoconf -*-
     2# Process this file with autoconf to produce a configure script.
     3
     4AC_PREREQ([2.69])
     5AC_INIT([sage], [5.9-autotools], [sage-devel@googlegroups.com])
     6AM_INIT_AUTOMAKE([-Wall -Werror -Wno-portability silent-rules])
     7AC_CONFIG_SRCDIR([README])
     8AC_CONFIG_MACRO_DIR([m4])
     9
     10# `pwd` resolves $abs_top_builddir
     11# abs_top_builddir is not available here.
     12AC_PREFIX_DEFAULT(`pwd`/local)
     13
     14# Checks for programs.
     15AC_PROG_CXX
     16AC_PROG_CC
     17AC_PROG_CPP
     18AC_PROG_FC       # FIXME: not required, just check.
     19AC_PROG_INSTALL
     20AC_PROG_LN_S
     21AC_PROG_MAKE_SET
     22AC_PROG_GREP     # required to build singular
     23AC_PROG_SED      # used here and there.
     24
     25# misc
     26AC_SUBST(dotPRECIOUS, .PRECIOUS)
     27AC_SUBST(UNAME, `uname`)
     28
     29# install GCC when needed.
     30# FIXME: override this (former SAGE_INSTALL_GCC environment)
     31CHK_gcc=positive
     32
     33# Check whether $CC is some version of GCC.  If it's a different
     34# compiler, install GCC locally.
     35# CCtype=`testcc.sh $CC`
     36if test ! "$CC" = gcc; then
     37  AC_MSG_NOTICE([Installing GCC because your '$CC' isn't GCC (GNU CC) but $CC.])
     38  CHK_gcc=negative
     39else
     40  # $CC points to some version of GCC, find out which version.
     41  GCCVERSION=`$CC -dumpversion`
     42  case $GCCVERSION in
     43      [0-3].*|4.[0-3]|4.[0-3].*)
     44          # Install our own GCC if the system-provided one is older than gcc-4.4.
     45          # * gcc-4.2.4 compiles a slow IML:
     46          # https://groups.google.com/forum/?fromgroups#!topic/sage-devel/Ux3t0dW2FSI
     47          # * gcc-4.3 might have trouble building ATLAS:
     48          # https://groups.google.com/forum/?fromgroups#!topic/sage-devel/KCeFqQ_w2FE
     49          AC_MSG_NOTICE([Installing GCC because you have $CC version $GCCVERSION, which is quite old.])
     50          CHK_gcc=negative;;
     51      4.4*|4.5*)
     52          # GCC 4.4.x and GCC 4.5.x fail to compile PARI/GP on ia64:
     53          # * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46044
     54          if test x`uname -m` = xia64; then
     55              AC_MSG_NOTICE([Installing GCC because you have $CC version $GCCVERSION on ia64.])
     56              AC_MSG_NOTICE([gcc <= 4.5 fails to compile PARI/GP on ia64.])
     57              CHK_gcc=negative
     58          fi;;
     59      4.6.[01])
     60          # Also install GCC if we have version 4.6.0 or 4.6.1, which is
     61          # known to give trouble within Sage:
     62          # * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48702
     63          # * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48774
     64          AC_MSG_NOTICE([Installing GCC because you have $CC version $GCCVERSION.])
     65          AC_MSG_NOTICE([gcc-4.6.0 and gcc-4.6.1 have known bugs affecting Sage.])
     66          CHK_gcc=negative;;
     67      4.6*)
     68          # GCC 4.6.x doesn't compile ECL on Cygwin:
     69          # * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52061
     70          if uname | grep CYGWIN >/dev/null; then
     71              AC_MSG_NOTICE([Installing GCC because you have $CC version $GCCVERSION on Cygwin.])
     72              AC_MSG_NOTICE([gcc-4.6.x fails to compile ECL on Cygwin.])
     73              CHK_gcc=negative
     74          fi;;
     75      4.7.0)
     76          # GCC 4.7.0 is very broken on ia64, see
     77          # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48496
     78          # This is fixed in GCC 4.7.1.
     79          if test x`uname -m` = xia64; then
     80              AC_MSG_NOTICE([Installing GCC because you have $CC version $GCCVERSION on ia64.])
     81              AC_MSG_NOTICE([gcc-4.7.0 has a serious bug on ia64.])
     82              CHK_gcc=negative
     83          fi;;
     84  esac
     85fi
     86
     87# try to guess SAGE_* stuff
     88sage_local=$prefix
     89if test "x$prefix" = xNONE; then
     90    sage_local=$ac_default_prefix
     91else
     92    AC_MSG_ERROR([custom prefix is not implementable yet.])
     93fi
     94
     95AC_SUBST(SAGE_LOCAL, $sage_local)
     96
     97# Check C++ and Fortran compilers.
     98if test -z "$CXX"; then
     99  echo >&2 "Installing GCC because a C++ compiler is missing."
     100  need_to_install_gcc=yes
     101fi
     102
     103if test -z "$FC"; then
     104  echo >&2 "Installing GCC because a Fortran compiler is missing."
     105  need_to_install_gcc=yes
     106fi
     107
     108if test "$need_to_install_gcc" = yes -o -x "$sage_local/bin/gfortran"; then
     109    FC=gfortran
     110    unset SAGE_FORTRAN_LIB
     111fi
     112
     113# FIXME: what is this trying to implement?
     114# (it's deprecated anyway)
     115# Make the fortran library symlink if requested
     116#if [ -f "$SAGE_FORTRAN_LIB" ]; then
     117#    ( cd "$SAGE_LOCAL/lib" && ln -sf "$SAGE_FORTRAN_LIB" . )
     118#fi
     119
     120AC_MSG_CHECKING(GNU tar)
     121AC_PATH_PROGS_FEATURE_CHECK(
     122  [TAR], [tar gtar],
     123  [[tarout=`$ac_path_TAR --version 2>&1 | grep GNU`
     124    test -n "$tarout" && ac_cv_path_TAR=$ac_path_TAR ac_path_TAR_found=:]],
     125  [ AC_MSG_RESULT([no]);
     126    AC_MSG_ERROR([could not find GNU tar])
     127  ]
     128)
     129AC_MSG_RESULT([$ac_cv_path_TAR])
     130AC_SUBST([TAR], [$ac_cv_path_TAR])
     131
     132AC_MSG_CHECKING(GNU make)
     133AC_PATH_PROGS_FEATURE_CHECK(
     134  [GMAKE], [make gmake],
     135  [[makeout=`$ac_path_GMAKE --version 2>&1 | grep GNU`
     136    test -n "$makeout" && ac_cv_path_GMAKE=$ac_path_GMAKE ac_path_GMAKE_found=:]],
     137  [ AC_MSG_RESULT([no]);
     138    AC_MSG_ERROR([could not find GNU make])
     139  ]
     140)
     141AC_MSG_RESULT([$ac_cv_path_GMAKE])
     142AC_SUBST([GMAKE], [$ac_cv_path_GMAKE])
     143
     144# download tool (to make dist*)
     145
     146# (FIXME, later)
     147AC_SUBST(URL_GRABBER, "wget -c")
     148AC_SUBST(DOWNLOAD_URL, "http://www.sagemath.org/packages/upstream")
     149AC_SUBST(UPSTREAM, upstream)
     150
     151# SAGE_ROOT contains .BUILDSTART, so it must translate to $abs_top_builddir
     152# and $abs_top_builddir is just `pwd`
     153AC_SUBST(SAGE_ROOT, `pwd`)
     154
     155# Checks for header files.
     156
     157# Checks for typedefs, structures, and compiler characteristics.
     158AC_CHECK_HEADER_STDBOOL
     159AC_TYPE_UID_T
     160AC_C_INLINE
     161AC_TYPE_MODE_T
     162AC_TYPE_OFF_T
     163AC_TYPE_PID_T
     164AC_C_RESTRICT
     165AC_TYPE_SIZE_T
     166AC_CHECK_MEMBERS([struct stat.st_blksize])
     167AC_STRUCT_ST_BLOCKS
     168AC_CHECK_MEMBERS([struct stat.st_rdev])
     169AC_TYPE_UINT32_T
     170
     171# Checks for library functions.
     172AC_FUNC_ALLOCA
     173AC_FUNC_CHOWN
     174AC_FUNC_ERROR_AT_LINE
     175AC_FUNC_FORK
     176AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
     177AC_FUNC_MALLOC
     178AC_FUNC_MKTIME
     179AC_FUNC_REALLOC
     180AC_CHECK_FUNCS([endgrent endpwent floor getcwd inet_ntoa memset mkdir pathconf setenv sqrt strchr strdup strstr uname utime])
     181
     182## sage foreign package in/exclusion
     183# base packages
     184# checks for packages
     185AC_MSG_CHECKING([whether iconv is required])
     186case "$UNAME" in
     187    CYGWIN|HP-UX|SunOS)
     188        AC_MSG_RESULT([yes])
     189        CHK_iconv=negative
     190        ;;
     191    *)
     192        AC_MSG_RESULT([no])
     193        CHK_iconv=positive
     194        ;;
     195esac
     196
     197AC_ARG_VAR([FOREIGN_DEFAULT])
     198FOREIGN_DEFAULT=${FOREIGN_DEFAULT:-auto}
     199
     200FOREIGN_AVAILABLE=
     201FOREIGN_DISABLED=
     202FOREIGN_ENABLED=
     203
     204AC_FOREIGN_PACKAGE([atlas])
     205AC_FOREIGN_PACKAGE([cliquer])
     206AC_FOREIGN_PACKAGE([blas])
     207AC_FOREIGN_PACKAGE([boehm_gc])
     208AC_FOREIGN_PACKAGE([boost_cropped])
     209AC_FOREIGN_PACKAGE([cddlib])
     210AC_FOREIGN_PACKAGE([cephes])
     211AC_FOREIGN_PACKAGE([cliquer])
     212AC_FOREIGN_PACKAGE([conway_polynomials])
     213AC_FOREIGN_PACKAGE([cvxopt])
     214AC_FOREIGN_PACKAGE([cython])
     215AC_FOREIGN_PACKAGE([docutils])
     216AC_FOREIGN_PACKAGE([ecl])
     217AC_FOREIGN_PACKAGE([eclib])
     218AC_FOREIGN_PACKAGE([ecm])
     219AC_FOREIGN_PACKAGE([elliptic_curves])
     220AC_FOREIGN_PACKAGE([fflas_ffpack])
     221AC_FOREIGN_PACKAGE([flint])
     222AC_FOREIGN_PACKAGE([flintqs])
     223AC_FOREIGN_PACKAGE([libfplll])
     224AC_FOREIGN_PACKAGE([freetype])
     225AC_FOREIGN_PACKAGE([genus2reduction])
     226AC_FOREIGN_PACKAGE([gap])
     227AC_FOREIGN_PACKAGE([gcc])
     228AC_FOREIGN_PACKAGE([gd])
     229AC_FOREIGN_PACKAGE([gdmodule])
     230AC_FOREIGN_PACKAGE([gfan])
     231AC_FOREIGN_PACKAGE([givaro])
     232AC_FOREIGN_PACKAGE([git])
     233AC_FOREIGN_PACKAGE([glpk])
     234AC_FOREIGN_PACKAGE([graphs])
     235AC_FOREIGN_PACKAGE([gsl])
     236AC_FOREIGN_PACKAGE([iconv])
     237AC_FOREIGN_PACKAGE([iml])
     238AC_FOREIGN_PACKAGE([ipython])
     239AC_FOREIGN_PACKAGE([jinja2])
     240AC_FOREIGN_PACKAGE([jmol])
     241AC_FOREIGN_PACKAGE([lapack])
     242AC_FOREIGN_PACKAGE([lcalc])
     243AC_FOREIGN_PACKAGE([lrcalc])
     244AC_FOREIGN_PACKAGE([libgap])
     245AC_FOREIGN_PACKAGE([libpng])
     246AC_FOREIGN_PACKAGE([linbox])
     247AC_FOREIGN_PACKAGE([libm4ri])
     248AC_FOREIGN_PACKAGE([libm4rie])
     249AC_FOREIGN_PACKAGE([matplotlib])
     250AC_FOREIGN_PACKAGE([maxima])
     251AC_FOREIGN_PACKAGE([mpc])
     252AC_FOREIGN_PACKAGE([mpfi])
     253AC_FOREIGN_PACKAGE([mpfr])
     254AC_FOREIGN_PACKAGE([mpir])
     255AC_FOREIGN_PACKAGE([mpmath])
     256AC_FOREIGN_PACKAGE([networkx])
     257AC_FOREIGN_PACKAGE([ntl])
     258AC_FOREIGN_PACKAGE([numpy])
     259AC_FOREIGN_PACKAGE([palp])
     260AC_FOREIGN_PACKAGE([pari])
     261AC_FOREIGN_PACKAGE([pexpect])
     262AC_FOREIGN_PACKAGE([pil])
     263AC_FOREIGN_PACKAGE([polybori])
     264AC_FOREIGN_PACKAGE([polytopes_db])
     265AC_FOREIGN_PACKAGE([ppl])
     266AC_FOREIGN_PACKAGE([pycrypto])
     267AC_FOREIGN_PACKAGE([pygments])
     268AC_FOREIGN_PACKAGE([pynac])
     269AC_FOREIGN_PACKAGE([python])
     270AC_FOREIGN_PACKAGE([ratpoints])
     271AC_FOREIGN_PACKAGE([r])
     272AC_FOREIGN_PACKAGE([rpy2])
     273AC_FOREIGN_PACKAGE([readline])
     274AC_FOREIGN_PACKAGE([rubiks])
     275AC_FOREIGN_PACKAGE([sagenb])
     276AC_FOREIGN_PACKAGE([sagetex])
     277AC_FOREIGN_PACKAGE([scipy])
     278AC_FOREIGN_PACKAGE([scons])
     279AC_FOREIGN_PACKAGE([setuptools])
     280AC_FOREIGN_PACKAGE([singular])
     281AC_FOREIGN_PACKAGE([sphinx])
     282AC_FOREIGN_PACKAGE([sqlalchemy])
     283AC_FOREIGN_PACKAGE([sqlite])
     284AC_FOREIGN_PACKAGE([symmetrica])
     285AC_FOREIGN_PACKAGE([sympow])
     286AC_FOREIGN_PACKAGE([sympy])
     287AC_FOREIGN_PACKAGE([tachyon])
     288AC_FOREIGN_PACKAGE([termcap])
     289AC_FOREIGN_PACKAGE([zlib])
     290AC_FOREIGN_PACKAGE([znpoly])
     291
     292# include submodules in dist tarball
     293distdir_subs='distdir: DIST_SUBDIRS+=$(CORE_MODULES)'
     294AC_SUBST([distdir_subs])
     295AM_SUBST_NOTMAKE([distdir_subs])
     296
     297AC_CONFIG_FILES([GNUmakefile
     298                 deps
     299                 dist/spkg.mk
     300                 dist/bin/Makefile
     301                 dist/Makefile
     302                 dist/etc/env.sh])
     303
     304AC_CONFIG_FILES([dist/bin/sage-dist-install],
     305       [chmod +x dist/bin/sage-dist-install])
     306AC_CONFIG_FILES([dist/bin/sage-dist-make],
     307       [chmod +x dist/bin/sage-dist-make])
     308AC_CONFIG_FILES([dist/bin/sage_fortran],
     309       [chmod +x dist/bin/sage_fortran])
     310
     311# this is currently not needed.
     312AC_CONFIG_FILES([sage],
     313       [chmod +x sage])
     314
     315# not a good idea. packages are not installed yet.
     316# AC_CONFIG_SUBDIRS([src/bin])
     317
     318AC_OUTPUT
     319
     320if test $FOREIGN_DEFAULT = yes; then
     321   packageinfo="installing all packages"
     322   if test -n "$FOREIGN_DISABLED"; then
     323      packageinfo+=" except$FOREIGN_DISABLED"
     324   fi
     325elif test $FOREIGN_DEFAULT = no; then
     326   packageinfo="installing no foreign packages"
     327   if test -n "$FOREIGN_ENABLED"; then
     328      packageinfo+=" except$FOREIGN_ENABLED"
     329   fi
     330else
     331   packageinfo="classic (automatic) mode"
     332   if test -n "$FOREIGN_AVAILABLE"; then
     333      packageinfo+=", unnecessary:$FOREIGN_AVAILABLE"
     334   fi
     335   if test -n "$FOREIGN_DISABLED"; then
     336      packageinfo+=", also skipping$FOREIGN_DISABLED"
     337   fi
     338   if test -n "$FOREIGN_ENABLED"; then
     339      packageinfo+=", installing anyway$FOREIGN_ENABLED"
     340   fi
     341fi
     342
     343AC_MSG_RESULT([
     344** Configuration summary for $PACKAGE $VERSION:
     345
     346   prefix:     $prefix
     347   $packageinfo
     348])
     349
     350# vim:et
  • deps.in

    diff --git a/deps.in b/deps.in
    index 478b398..7d2b1ef 100644
    a b  
    11###############################################################################
    2 # This file ($SAGE_ROOT/spkg/standard/deps) will be copied into
    3 # $SAGE_ROOT/spkg/Makefile by $SAGE_ROOT/spkg/install
     2# This file (deps.in) is included by the toplevel makefile template
    43###############################################################################
     4#
     5# FIXME: move package dependencies to packages
     6#
     7
     8# compilation/install output will be teed to here
    59
    610# Let e.g. SAGE_ROOT/spkg/install pass options to sage-spkg, i.e. currently
    711# "-f", to force rebuilding dependent packages during an upgrade (#9896).
     
    1216# (SAGE_ROOT/spkg/bin is added to the PATH in spkg/install).
    1317# Therefore, do not put an explicit path for sage-spkg here.
    1418SAGE_SPKG = sage-spkg $${SAGE_SPKG_OPTS}
    15 PIPE = $(SAGE_ROOT)/build/pipestatus
    1619
    1720# Tell make not to look for files with these names:
    1821.PHONY: all all-sage base toolchain toolchain-deps
    PIPE = $(SAGE_ROOT)/build/pipestatus 
    2124# During the toolchain build, we export SAGE_BUILD_TOOLCHAIN=yes
    2225# such that packages can do different things when they are built
    2326# as prerequisite of GCC.
    24 all:
     27all-old:
    2528        $(MAKE) base
    2629        env SAGE_BUILD_TOOLCHAIN=yes $(MAKE) toolchain
    2730        $(MAKE) toolchain-deps
    2831        $(MAKE) all-sage
    2932
     33# Base packages
     34FP_prereq = $(call newest_version_base,prereq)
     35
     36# Usage: newest_version_base $pkg
     37# Print version number of latest (according to modification time)
     38# base package $pkg
     39# As a fallback, we also look at the latest installed package.
     40define newest_version_base
     41$(shell \
     42    PKG="$(1)";\
     43    for FILE in `{ ls -1t @abs_top_srcdir@/build/base/$$PKG-*-install; ls -1t installed/$$PKG-*; } 2>/dev/null`;\
     44    do\
     45        ANS=`echo "$$FILE" | sed 's|.*/||; s|-install||'`;\
     46        if test -n "$$ANS"; then\
     47            echo "$$ANS";\
     48            exit 0;\
     49        fi;\
     50    done;\
     51    echo >&2 "Cannot determine latest version of $$PKG.";\
     52    echo "$$PKG"; )
     53endef
     54
     55# Usage: newest_version $pkg
     56# Print version number of latest standard package $pkg
     57define newest_version
     58$(shell \
     59    PKG="$(1)";\
     60    if [ -f "@abs_top_srcdir@/build/pkgs/$$PKG/package-version.txt" ]; then\
     61        echo -n $$PKG-;\
     62        cat "@abs_top_srcdir@/build/pkgs/$$PKG/package-version.txt";\
     63    else\
     64        echo >&2 "Cannot determine latest version of $$PKG.";\
     65        echo -n "$$PKG-unknown";\
     66    fi;)
     67endef
     68
     69# Standard foreign packages
     70# FIXME: autogenerate
     71FP_atlas=$(call newest_version,atlas)
     72FP_blas=$(call newest_version,blas)
     73FP_boehm_gc=$(call newest_version,boehm_gc)
     74FP_boost_cropped=$(call newest_version,boost_cropped)
     75FP_bzip2=$(call newest_version,bzip2)
     76FP_cddlib=$(call newest_version,cddlib)
     77FP_cephes=$(call newest_version,cephes)
     78FP_cliquer=$(call newest_version,cliquer)
     79FP_conway_polynomials=$(call newest_version,conway_polynomials)
     80FP_cvxopt=$(call newest_version,cvxopt)
     81FP_cython=$(call newest_version,cython)
     82FP_docutils=$(call newest_version,docutils)
     83FP_ecl=$(call newest_version,ecl)
     84FP_eclib=$(call newest_version,eclib)
     85FP_ecm=$(call newest_version,ecm)
     86FP_elliptic_curves=$(call newest_version,elliptic_curves)
     87FP_fflas_ffpack=$(call newest_version,fflas_ffpack)
     88FP_flint=$(call newest_version,flint)
     89FP_flintqs=$(call newest_version,flintqs)
     90FP_libfplll=$(call newest_version,libfplll)
     91FP_freetype=$(call newest_version,freetype)
     92FP_gap=$(call newest_version,gap)
     93FP_gcc=$(call newest_version,gcc)
     94FP_gd=$(call newest_version,gd)
     95FP_gdmodule=$(call newest_version,gdmodule)
     96FP_genus2reduction=$(call newest_version,genus2reduction)
     97FP_gfan=$(call newest_version,gfan)
     98FP_git=$(call newest_version,git)
     99FP_givaro=$(call newest_version,givaro)
     100FP_glpk=$(call newest_version,glpk)
     101FP_graphs=$(call newest_version,graphs)
     102FP_gsl=$(call newest_version,gsl)
     103FP_iconv=$(call newest_version,iconv)
     104FP_iml=$(call newest_version,iml)
     105FP_ipython=$(call newest_version,ipython)
     106FP_jinja2=$(call newest_version,jinja2)
     107FP_jmol=$(call newest_version,jmol)
     108FP_lapack=$(call newest_version,lapack)
     109FP_lcalc=$(call newest_version,lcalc)
     110FP_lrcalc=$(call newest_version,lrcalc)
     111FP_libgap=$(call newest_version,libgap)
     112FP_libpng=$(call newest_version,libpng)
     113FP_linbox=$(call newest_version,linbox)
     114FP_libm4ri=$(call newest_version,libm4ri)
     115FP_libm4rie=$(call newest_version,libm4rie)
     116FP_matplotlib=$(call newest_version,matplotlib)
     117FP_maxima=$(call newest_version,maxima)
     118FP_mpc=$(call newest_version,mpc)
     119FP_mpfi=$(call newest_version,mpfi)
     120FP_mpfr=$(call newest_version,mpfr)
     121FP_mpir=$(call newest_version,mpir)
     122FP_mpmath=$(call newest_version,mpmath)
     123FP_networkx=$(call newest_version,networkx)
     124FP_ntl=$(call newest_version,ntl)
     125FP_numpy=$(call newest_version,numpy)
     126FP_palp=$(call newest_version,palp)
     127FP_pari=$(call newest_version,pari)
     128FP_patch=$(call newest_version,patch)
     129FP_pexpect=$(call newest_version,pexpect)
     130FP_pil=$(call newest_version,pil)
     131FP_polybori=$(call newest_version,polybori)
     132FP_polytopes_db=$(call newest_version,polytopes_db)
     133FP_ppl=$(call newest_version,ppl)
     134FP_pycrypto=$(call newest_version,pycrypto)
     135FP_pygments=$(call newest_version,pygments)
     136FP_pynac=$(call newest_version,pynac)
     137FP_python=$(call newest_version,python)
     138FP_r=$(call newest_version,r)
     139FP_rpy2=$(call newest_version,rpy2)
     140FP_ratpoints=$(call newest_version,ratpoints)
     141FP_readline=$(call newest_version,readline)
     142FP_rubiks=$(call newest_version,rubiks)
     143FP_sagenb=$(call newest_version,sagenb)
     144FP_sagetex=$(call newest_version,sagetex)
     145FP_scipy=$(call newest_version,scipy)
     146FP_scons=$(call newest_version,scons)
     147FP_setuptools=$(call newest_version,setuptools)
     148FP_singular=$(call newest_version,singular)
     149FP_sphinx=$(call newest_version,sphinx)
     150FP_sqlalchemy=$(call newest_version,sqlalchemy)
     151FP_sqlite=$(call newest_version,sqlite)
     152FP_symmetrica=$(call newest_version,symmetrica)
     153FP_sympow=$(call newest_version,sympow)
     154FP_sympy=$(call newest_version,sympy)
     155FP_tachyon=$(call newest_version,tachyon)
     156FP_termcap=$(call newest_version,termcap)
     157FP_zlib=$(call newest_version,zlib)
     158FP_zn_poly=$(call newest_version,zn_poly)
     159
    30160# 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)/$(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 \
     161# ... generate from configure.ac.
     162INSTALL_FP_NAMES = \
     163     atlas \
     164     blas \
     165     boehm_gc \
     166     boost_cropped \
     167     cddlib \
     168     cephes \
     169     cliquer \
     170     conway_polynomials \
     171     cvxopt \
     172     cython \
     173     docutils \
     174     ecl \
     175     eclib \
     176     ecm \
     177     elliptic_curves \
     178     fflas_ffpack \
     179     flint \
     180     flintqs \
     181     libfplll \
     182     freetype \
     183     genus2reduction \
     184     gap \
     185     gd \
     186     gdmodule \
     187     gfan \
     188     givaro \
     189     git \
     190     glpk \
     191     graphs \
     192     gsl \
     193     iconv \
     194     iml \
     195     ipython \
     196     jinja2 \
     197     jmol \
     198     lapack \
     199     lcalc \
     200     lrcalc \
     201     libgap \
     202     libpng \
     203     linbox \
     204     libm4ri \
     205     libm4rie \
     206     matplotlib \
     207     maxima \
     208     mpc \
     209     mpfi \
     210     mpfr \
     211     mpir \
     212     mpmath \
     213     networkx \
     214     ntl \
     215     numpy \
     216     palp \
     217     pari \
     218     pexpect \
     219     pil \
     220     polybori \
     221     polytopes_db \
     222     ppl \
     223     pycrypto \
     224     pygments \
     225     pynac \
     226     python \
     227     ratpoints \
     228     r \
     229     rpy2 \
     230     readline \
     231     rubiks \
     232     sagenb \
     233     sagetex \
     234     scipy \
     235     scons \
     236     setuptools \
     237     singular \
     238     sphinx \
     239     sqlalchemy \
     240     sqlite \
     241     symmetrica \
     242     sympow \
     243     sympy \
     244     tachyon \
     245     termcap \
     246     zlib \
     247     znpoly
     248
     249#doesnt work!
     250# INSTALL_FP_STAMPS=$(INST)/$(INSTALL_FP_NAMES:%=$$(FP_%))
     251
     252scripts: $(BIN)
     253
     254sage-all: $(INSTALL_FP_NAMES:%=%-install) \
     255     $(BIN) \
     256     $(SAGE) \
     257     $(CSAGE) \
    120258     extcode
    121259
    122260# TOOLCHAIN consists of dependencies determined by spkg/install,
    toolchain: $(TOOLCHAIN) 
    129267# unconditionally. We still use the dependency checking from $(MAKE),
    130268# so this will not trigger useless rebuilds.
    131269# See http://trac.sagemath.org/sage_trac/ticket/14168
     270# FIXME, serial rule!
    132271toolchain-deps:
    133         $(MAKE) $(INST)/$(ZLIB)
    134         $(MAKE) $(INST)/$(MPIR)
    135         $(MAKE) $(INST)/$(MPFR)
    136         $(MAKE) $(INST)/$(MPC)
     272        test -n @DEP_zlib@ && $(MAKE) @DEP_zlib@
     273        test -n @DEP_mpir@ && $(MAKE) @DEP_mpir@
     274        test -n @DEP_mpfr@ && $(MAKE) @DEP_mpfr@
     275        test -n @DEP_mpc@ && $(MAKE) @DEP_mpc@
    137276
    138277# Everything needed to start up Sage using "./sage".  Of course, not
    139278# every part of Sage will work.  It does not include Maxima for example.
    140 SAGERUNTIME = scripts sage $(INST)/$(SAGENB) $(INST)/$(IPYTHON) $(INST)/$(GAP)
     279SAGERUNTIME = $(SCRIPTS) sage @DEP_sagenb@ @DEP_ipython@ @DEP_gap@
    141280
    142281###############################################################################
    143282# Building the base system
    SAGERUNTIME = scripts sage $(INST)/$(SAGENB) $(INST)/$(IPYTHON) $(INST)/$(GAP) 
    147286# an update of these packages will not trigger a rebuild of every other
    148287# package during an upgrade, see #13415.
    149288###############################################################################
    150 base: $(INST)/$(PREREQ) $(INST)/$(BZIP2) $(INST)/$(PATCH)
     289base: $(INST)/$(FP_prereq) @DEP_bzip2@ @DEP_patch@
     290
     291$(INST)/$(FP_prereq):
     292        @echo "don't know what this is about. skipping $@"
     293        touch $@
     294#       $(PIPE) "base/$(PREREQ)-install 2>&1" "tee -a $(SAGE_LOGS)/$(PREREQ).log"
    151295
    152 $(INST)/$(PREREQ):
    153         $(PIPE) "base/$(PREREQ)-install 2>&1" "tee -a $(SAGE_LOGS)/$(PREREQ).log"
     296# skipped packages could now be added to a rule like
     297#$(SKIPPED:%=$(INST)/%/%):
     298#       touch $@
     299# to satisfy dependencies...
    154300
    155301# If we are upgrading from a version 4.x of Sage, don't build bzip2.
    156302# This is because the old sage-spkg script cannot install the new bzip2
    157303# spkg (which is gzip compressed).  We continue using the old bzip2
    158304# 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"; \
     305$(INST)/$(FP_bzip2): $(INST)/$(FP_prereq)
    161306
    162 $(INST)/$(PATCH): $(INST)/$(BZIP2)
    163         +$(PIPE) "$(SAGE_SPKG) $(PATCH) 2>&1" "tee -a $(SAGE_LOGS)/$(PATCH).log"
     307$(INST)/$(FP_patch): @DEP_bzip2@
    164308
    165309###############################################################################
    166310# Building normal packages
    167311###############################################################################
    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"
     312$(INST)/$(FP_atlas): @DEP_lapack@ @DEP_python@
    173313
    174 $(INST)/$(BOOST_CROPPED):
    175         +$(PIPE) "$(SAGE_SPKG) $(BOOST_CROPPED) 2>&1" "tee -a $(SAGE_LOGS)/$(BOOST_CROPPED).log"
     314$(INST)/$(FP_readline): @DEP_termcap@
    176315
    177 $(INST)/$(CLIQUER):
    178         +$(PIPE) "$(SAGE_SPKG) $(CLIQUER) 2>&1" "tee -a $(SAGE_LOGS)/$(CLIQUER).log"
     316$(INST)/$(FP_docutils): @DEP_python@
    179317
    180 $(INST)/$(TERMCAP):
    181         +$(PIPE) "$(SAGE_SPKG) $(TERMCAP) 2>&1" "tee -a $(SAGE_LOGS)/$(TERMCAP).log"
     318$(INST)/$(FP_elliptic_curves): @DEP_python@ @DEP_sqlite@
    182319
    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
     320# CONWAY depends on SAGERUNTIME because it runs Sage code to
    196321# 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"
     322$(INST)/$(FP_conway_polynomials): $(SAGERUNTIME)
    202323
    203 $(INST)/$(GLPK): $(INST)/$(MPIR) $(INST)/$(ZLIB)
    204         +$(PIPE) "$(SAGE_SPKG) $(GLPK) 2>&1" "tee -a $(SAGE_LOGS)/$(GLPK).log"
     324$(INST)/$(FP_glpk): @DEP_mpir@ @DEP_zlib@
    205325
    206326# Python links against -lbz2.  Technically speaking, we should add
    207327# BZIP2 as dependency here.  But we don't do that to avoid needless
    208328# recompiles of Python when upgrading.  Since bzip2 is part of the
    209329# "base" target, we are guaranteed anyway that some version of bzip2
    210330# 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"
     331$(INST)/$(FP_python): @DEP_zlib@ @DEP_readline@ @DEP_sqlite@ @DEP_libpng@
    214332
    215 $(INST)/$(MPIR): $(INST)/$(ICONV)
    216         +$(PIPE) "$(SAGE_SPKG) $(MPIR) 2>&1" "tee -a $(SAGE_LOGS)/$(MPIR).log"
     333$(INST)/$(FP_mpir): @DEP_iconv@
    217334
    218 $(INST)/$(GSL): $(INST)/$(ATLAS)
    219         +$(PIPE) "$(SAGE_SPKG) $(GSL) 2>&1" "tee -a $(SAGE_LOGS)/$(GSL).log"
     335$(INST)/$(FP_gsl): @DEP_atlas@
    220336
    221 $(INST)/$(NTL): $(INST)/$(MPIR)
    222         +$(PIPE) "$(SAGE_SPKG) $(NTL) 2>&1" "tee -a $(SAGE_LOGS)/$(NTL).log"
     337$(INST)/$(FP_ntl): @DEP_mpir@
    223338
    224 $(INST)/$(FPLLL): $(INST)/$(MPIR) $(INST)/$(MPFR)
    225         +$(PIPE) "$(SAGE_SPKG) $(FPLLL) 2>&1" "tee -a $(SAGE_LOGS)/$(FPLLL).log"
     339$(INST)/$(FP_libfplll): @DEP_mpir@ @DEP_mpfr@
    226340
    227 $(INST)/$(PARI): $(INST)/$(READLINE) $(INST)/$(MPIR)
    228         +$(PIPE) "$(SAGE_SPKG) $(PARI) 2>&1" "tee -a $(SAGE_LOGS)/$(PARI).log"
     341$(INST)/$(FP_pari): @DEP_readline@ @DEP_mpir@
    229342
    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"
     343$(INST)/$(FP_polybori): @DEP_python@ @DEP_ipython@ @DEP_scons@ @DEP_boost_cropped@ \
     344                   @DEP_libm4ri@ @DEP_gd@
    234345
    235 $(INST)/$(POLYTOPES_DB):
    236         +$(PIPE) "$(SAGE_SPKG) $(POLYTOPES_DB) 2>&1" "tee -a $(SAGE_LOGS)/$(POLYTOPES_DB).log"
     346$(INST)/$(FP_polytopes_db):
    237347
    238 $(INST)/$(PPL): $(INST)/$(MPIR)
    239         +$(PIPE) "$(SAGE_SPKG) $(PPL) 2>&1" "tee -a $(SAGE_LOGS)/$(PPL).log"
     348$(INST)/$(FP_ppl): @DEP_mpir@
    240349
    241 $(INST)/$(MPC): $(INST)/$(MPIR) $(INST)/$(MPFR)
    242         +$(PIPE) "$(SAGE_SPKG) $(MPC) 2>&1" "tee -a $(SAGE_LOGS)/$(MPC).log"
     350$(INST)/$(FP_mpc): @DEP_mpir@ @DEP_mpfr@
    243351
    244 $(INST)/$(MPFR): $(INST)/$(MPIR)
    245         +$(PIPE) "$(SAGE_SPKG) $(MPFR) 2>&1" "tee -a $(SAGE_LOGS)/$(MPFR).log"
     352$(INST)/$(FP_mpfr): @DEP_mpir@
    246353
    247 $(INST)/$(MPFI): $(INST)/$(MPIR) $(INST)/$(MPFR)
    248         +$(PIPE) "$(SAGE_SPKG) $(MPFI) 2>&1" "tee -a $(SAGE_LOGS)/$(MPFI).log"
     354$(INST)/$(FP_mpfi): @DEP_mpir@ @DEP_mpfr@
    249355
    250 $(INST)/$(GIVARO): $(INST)/$(MPIR)
    251         +$(PIPE) "$(SAGE_SPKG) $(GIVARO) 2>&1" "tee -a $(SAGE_LOGS)/$(GIVARO).log"
     356$(INST)/$(FP_givaro): @DEP_mpir@
    252357
    253 $(INST)/$(GIT): $(INST)/$(ZLIB) $(INST)/$(PYTHON)
    254         +$(PIPE) "$(SAGE_SPKG) $(GIT) 2>&1" "tee -a $(SAGE_LOGS)/$(GIT).log"
     358$(INST)/$(FP_git): @DEP_zlib@ @DEP_python@
    255359
    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"
     360$(INST)/$(FP_fflas_ffpack): @DEP_mpir@ @DEP_givaro@ @DEP_gsl@ @DEP_atlas@
    259361
    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"
     362$(INST)/$(FP_linbox): @DEP_mpir@ @DEP_ntl@ @DEP_givaro@ \
     363                 @DEP_mpfr@ @DEP_libfplll@ @DEP_iml@ \
     364                 @DEP_libm4ri@ @DEP_libm4rie@ @DEP_fflas_ffpack@
    264365
    265 $(INST)/$(IML): $(INST)/$(MPIR) $(INST)/$(GSL) $(INST)/$(ATLAS)
    266         +$(PIPE) "$(SAGE_SPKG) $(IML) 2>&1" "tee -a $(SAGE_LOGS)/$(IML).log"
     366$(INST)/$(FP_iml): @DEP_mpir@ @DEP_gsl@ @DEP_atlas@
    267367
    268 $(INST)/$(ECLIB): $(INST)/$(MPIR) $(INST)/$(PARI) $(INST)/$(NTL)
    269         +$(PIPE) "$(SAGE_SPKG) $(ECLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(ECLIB).log"
     368$(INST)/$(FP_eclib): @DEP_mpir@ @DEP_pari@ @DEP_ntl@
    270369
    271 $(INST)/$(GENUS2REDUCTION): $(INST)/$(PARI)
    272         +$(PIPE) "$(SAGE_SPKG) $(GENUS2REDUCTION) 2>&1" "tee -a $(SAGE_LOGS)/$(GENUS2REDUCTION).log"
     370$(INST)/$(FP_genus2reduction): @DEP_pari@
    273371
    274 $(INST)/$(PALP):
    275         +$(PIPE) "$(SAGE_SPKG) $(PALP) 2>&1" "tee -a $(SAGE_LOGS)/$(PALP).log"
     372$(INST)/$(FP_lcalc): @DEP_pari@ @DEP_mpfr@
    276373
    277 $(INST)/$(LCALC): $(INST)/$(PARI) $(INST)/$(MPFR)
    278         +$(PIPE) "$(SAGE_SPKG) $(LCALC) 2>&1" "tee -a $(SAGE_LOGS)/$(LCALC).log"
     374$(INST)/$(FP_pynac): @DEP_python@
    279375
    280 $(INST)/$(LRCALC):
    281         +$(PIPE) "$(SAGE_SPKG) $(LRCALC) 2>&1" "tee -a $(SAGE_LOGS)/$(LRCALC).log"
     376$(INST)/$(FP_gap): @DEP_termcap@ @DEP_readline@ @DEP_mpir@
    282377
    283 $(INST)/$(PYNAC): $(INST)/$(PYTHON)
    284         +$(PIPE) "$(SAGE_SPKG) $(PYNAC) 2>&1" "tee -a $(SAGE_LOGS)/$(PYNAC).log"
     378$(INST)/$(FP_libgap): @DEP_gap@
    285379
    286 $(INST)/$(SYMPOW):
    287         +$(PIPE) "$(SAGE_SPKG) $(SYMPOW) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMPOW).log"
     380$(INST)/$(FP_ipython): @DEP_python@
    288381
    289 $(INST)/$(SYMMETRICA):
    290         +$(PIPE) "$(SAGE_SPKG) $(SYMMETRICA) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMMETRICA).log"
     382$(INST)/$(FP_pexpect): @DEP_python@
    291383
    292 $(INST)/$(GAP): $(INST)/$(TERMCAP) $(INST)/$(READLINE) $(INST)/$(MPIR)
    293         +$(PIPE) "$(SAGE_SPKG) $(GAP) 2>&1" "tee -a $(SAGE_LOGS)/$(GAP).log"
     384$(INST)/$(FP_gd): @DEP_libpng@ @DEP_freetype@ @DEP_iconv@
    294385
    295 $(INST)/$(LIBGAP): $(INST)/$(GAP)
    296         +$(PIPE) "$(SAGE_SPKG) $(LIBGAP) 2>&1" "tee -a $(SAGE_LOGS)/$(LIBGAP).log"
     386$(INST)/$(FP_gdmodule): @DEP_python@ @DEP_gd@ @DEP_iconv@
    297387
    298 $(INST)/$(IPYTHON): $(INST)/$(PYTHON)
    299         +$(PIPE) "$(SAGE_SPKG) $(IPYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(IPYTHON).log"
     388$(INST)/$(FP_scons): @DEP_python@
    300389
    301 $(INST)/$(PEXPECT): $(INST)/$(PYTHON)
    302         +$(PIPE) "$(SAGE_SPKG) $(PEXPECT) 2>&1" "tee -a $(SAGE_LOGS)/$(PEXPECT).log"
     390$(INST)/$(FP_rubiks):
    303391
    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"
     392$(INST)/$(FP_sqlite): @DEP_readline@
    318393
    319394# To build SageTeX, you just need Python, but to test (SAGE_CHECK=yes)
    320395# 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"
     396$(INST)/$(FP_sagetex): @DEP_python@ $(SAGERUNTIME) @DEP_maxima@ @DEP_scipy@ \
     397                       @DEP_matplotlib@ @DEP_pil@ @DEP_tachyon@
    332398
    333 $(INST)/$(PYCRYPTO): $(INST)/$(PYTHON)
    334         +$(PIPE) "$(SAGE_SPKG) $(PYCRYPTO) 2>&1" "tee -a $(SAGE_LOGS)/$(PYCRYPTO).log"
     399$(INST)/$(FP_setuptools): @DEP_python@
    335400
    336 $(INST)/$(NETWORKX): $(INST)/$(PYTHON)
    337         +$(PIPE) "$(SAGE_SPKG) $(NETWORKX) 2>&1" "tee -a $(SAGE_LOGS)/$(NETWORKX).log"
     401$(INST)/$(FP_singular): @DEP_mpir@ @DEP_ntl@ @DEP_readline@ @DEP_mpfr@
    338402
    339 $(INST)/$(MPMATH): $(INST)/$(PYTHON)
    340         +$(PIPE) "$(SAGE_SPKG) $(MPMATH) 2>&1" "tee -a $(SAGE_LOGS)/$(MPMATH).log"
     403$(INST)/$(FP_pycrypto): @DEP_python@
    341404
    342 $(INST)/$(ZLIB):
    343         +$(PIPE) "$(SAGE_SPKG) $(ZLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(ZLIB).log"
     405$(INST)/$(FP_networkx): @DEP_python@
    344406
    345 $(INST)/$(JMOL): $(INST)/$(SAGENB)
    346         +$(PIPE) "$(SAGE_SPKG) $(JMOL) 2>&1" "tee -a $(SAGE_LOGS)/$(JMOL).log"
     407$(INST)/$(FP_mpmath): @DEP_python@
    347408
    348 $(INST)/$(FREETYPE):
    349         +$(PIPE) "$(SAGE_SPKG) $(FREETYPE) 2>&1" "tee -a $(SAGE_LOGS)/$(FREETYPE).log"
     409$(INST)/$(FP_jmol): @DEP_sagenb@
    350410
    351 $(INST)/$(LIBPNG): $(INST)/$(ZLIB)
    352         +$(PIPE) "$(SAGE_SPKG) $(LIBPNG) 2>&1" "tee -a $(SAGE_LOGS)/$(LIBPNG).log"
     411$(INST)/$(FP_libpng): @DEP_zlib@
    353412
    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"
     413$(INST)/$(FP_matplotlib): @DEP_python@ @DEP_numpy@ @DEP_freetype@ @DEP_libpng@ \
     414                     @DEP_gdmodule@
    358415
    359 $(INST)/$(CDDLIB): $(INST)/$(MPIR)
    360         +$(PIPE) "$(SAGE_SPKG) $(CDDLIB) 2>&1" "tee -a $(SAGE_LOGS)/$(CDDLIB).log"
     416$(INST)/$(FP_cddlib): @DEP_mpir@
    361417
    362 $(INST)/$(GFAN): $(INST)/$(MPIR) $(INST)/$(CDDLIB)
    363         +$(PIPE) "$(SAGE_SPKG) $(GFAN) 2>&1" "tee -a $(SAGE_LOGS)/$(GFAN).log"
     418$(INST)/$(FP_gfan): @DEP_mpir@ @DEP_cddlib@
    364419
    365 $(INST)/$(TACHYON): $(INST)/$(LIBPNG)
    366         +$(PIPE) "$(SAGE_SPKG) $(TACHYON) 2>&1" "tee -a $(SAGE_LOGS)/$(TACHYON).log"
     420$(INST)/$(FP_tachyon): @DEP_libpng@
    367421
    368 $(INST)/$(ECM): $(INST)/$(MPIR)
    369         +$(PIPE) "$(SAGE_SPKG) $(ECM) 2>&1" "tee -a $(SAGE_LOGS)/$(ECM).log"
     422$(INST)/$(FP_ecm): @DEP_mpir@
    370423
    371 $(INST)/$(RATPOINTS): $(INST)/$(MPIR)
    372         +$(PIPE) "$(SAGE_SPKG) $(RATPOINTS) 2>&1" "tee -a $(SAGE_LOGS)/$(RATPOINTS).log"
     424$(INST)/$(FP_ratpoints): @DEP_mpir@
    373425
    374 $(INST)/$(ECL): $(INST)/$(MPIR) $(INST)/$(READLINE) $(INST)/$(BOEHM_GC)
    375         +$(PIPE) "$(SAGE_SPKG) $(ECL) 2>&1" "tee -a $(SAGE_LOGS)/$(ECL).log"
     426$(INST)/$(FP_ecl): @DEP_mpir@ @DEP_readline@ @DEP_boehm_gc@
    376427
    377 $(INST)/$(MAXIMA): $(INST)/$(ECL)
    378         +$(PIPE) "$(SAGE_SPKG) $(MAXIMA) 2>&1" "tee -a $(SAGE_LOGS)/$(MAXIMA).log"
     428$(INST)/$(FP_maxima): @DEP_ecl@
    379429
    380 $(INST)/$(R): $(INST)/$(ATLAS) $(INST)/$(ICONV) $(INST)/$(READLINE)
    381         +$(PIPE) "$(SAGE_SPKG) $(R) 2>&1" "tee -a $(SAGE_LOGS)/$(R).log"
     430$(INST)/$(FP_r): @DEP_atlas@ @DEP_iconv@ @DEP_readline@
    382431
    383 $(INST)/$(RPY): $(INST)/$(PYTHON) $(INST)/$(R)
    384         +$(PIPE) "$(SAGE_SPKG) $(RPY) 2>&1" "tee -a $(SAGE_LOGS)/$(RPY).log"
     432$(INST)/$(FP_rpy2): @DEP_python@ @DEP_r@
    385433
    386 $(INST)/$(SYMPY): $(INST)/$(PYTHON)
    387         +$(PIPE) "$(SAGE_SPKG) $(SYMPY) 2>&1" "tee -a $(SAGE_LOGS)/$(SYMPY).log"
     434$(INST)/$(FP_sympy): @DEP_python@
    388435
    389 $(INST)/$(CYTHON): $(INST)/$(PYTHON)
    390         +$(PIPE) "$(SAGE_SPKG) $(CYTHON) 2>&1" "tee -a $(SAGE_LOGS)/$(CYTHON).log"
     436$(INST)/$(FP_cython): @DEP_python@
    391437
    392 $(INST)/$(FLINTQS): $(INST)/$(MPIR)
    393         +$(PIPE) "$(SAGE_SPKG) $(FLINTQS) 2>&1" "tee -a $(SAGE_LOGS)/$(FLINTQS).log"
     438$(INST)/$(FP_flintqs): @DEP_mpir@
    394439
    395 $(INST)/$(FLINT): $(INST)/$(MPIR) $(INST)/$(MPFR) $(INST)/$(NTL)
    396         +$(PIPE) "$(SAGE_SPKG) $(FLINT) 2>&1" "tee -a $(SAGE_LOGS)/$(FLINT).log"
     440$(INST)/$(FP_flint): @DEP_mpir@ @DEP_mpfr@ @DEP_ntl@
    397441
    398 $(INST)/$(M4RI): $(INST)/$(LIBPNG)
    399         +$(PIPE) "$(SAGE_SPKG) $(M4RI) 2>&1" "tee -a $(SAGE_LOGS)/$(M4RI).log"
     442$(INST)/$(FP_libm4ri): @DEP_libpng@
    400443
    401 $(INST)/$(M4RIE): $(INST)/$(M4RI) $(INST)/$(GIVARO) $(INST)/$(NTL)
    402         +$(PIPE) "$(SAGE_SPKG) $(M4RIE) 2>&1" "tee -a $(SAGE_LOGS)/$(M4RIE).log"
     444$(INST)/$(FP_libm4rie): @DEP_libm4ri@ @DEP_givaro@ @DEP_ntl@
    403445
    404446# zn_poly really does depend on Python, despite this is far from obvious.
    405447# 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"
     448$(INST)/$(FP_zn_poly): @DEP_mpir@ @DEP_python@
    408449
    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"
     450$(INST)/$(FP_sagenb): @DEP_python@ @DEP_setuptools@ @DEP_pexpect@ \
     451                      @DEP_jinja2@ @DEP_sphinx@ @DEP_docutils@
    412452
    413 $(INST)/$(SQLALCHEMY): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS)
    414         +$(PIPE) "$(SAGE_SPKG) $(SQLALCHEMY) 2>&1" "tee -a $(SAGE_LOGS)/$(SQLALCHEMY).log"
     453$(INST)/$(FP_sqlalchemy): @DEP_python@ @DEP_setuptools@
    415454
    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"
     455$(INST)/$(FP_sphinx): @DEP_python@ @DEP_setuptools@ @DEP_docutils@ \
     456                      @DEP_jinja2@ @DEP_pygments@
    419457
    420 $(INST)/$(JINJA2): $(INST)/$(PYTHON) $(INST)/$(SETUPTOOLS) $(INST)/$(DOCUTILS) \
     458$(INST)/$(FP_jinja2): @DEP_python@ @DEP_setuptools@ @DEP_docutils@
    421459
    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"
     460$(INST)/$(FP_pygments): @DEP_python@ @DEP_setuptools@
    426461
    427462# List all *build-time* dependencies of the Sage library.  These are,
    428463# on the one hand, programs needed for the build/install process of the
    429464# Sage library (e.g. JINJA2), and on the
    430465# other hand all dependencies for Cython files (e.g. PARI, NTL, MPIR).
    431 sage: \
    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 
    472 scripts: $(SCRIPT_TARGETS)
     466src/sage-configure-stamp: $(CSAGE)
     467
     468src/c_lib-configure-stamp: \
     469    @DEP_atlas@ \
     470    @DEP_cephes@ \
     471    @DEP_cliquer@ \
     472    @DEP_cython@ \
     473    @DEP_ecl@ \
     474    @DEP_eclib@ \
     475    @DEP_ecm@ \
     476    @DEP_flint@ \
     477    @DEP_libfplll@ \
     478    @DEP_gd@ \
     479    @DEP_givaro@ \
     480    @DEP_glpk@ \
     481    @DEP_gsl@ \
     482    @DEP_iml@ \
     483    @DEP_jinja2@ \
     484    @DEP_lcalc@ \
     485    @DEP_libgap@ \
     486    @DEP_libpng@ \
     487    @DEP_linbox@ \
     488    @DEP_libm4ri@ \
     489    @DEP_libm4rie@ \
     490    @DEP_mpc@ \
     491    @DEP_mpfi@ \
     492    @DEP_mpfr@ \
     493    @DEP_mpir@ \
     494    @DEP_ntl@ \
     495    @DEP_numpy@ \
     496    @DEP_pari@ \
     497    @DEP_polybori@ \
     498    @DEP_ppl@ \
     499    @DEP_pynac@ \
     500    @DEP_python@ \
     501    @DEP_ratpoints@ \
     502    @DEP_readline@ \
     503    @DEP_singular@ \
     504    @DEP_symmetrica@ \
     505    @DEP_znpoly@
    473506
    474507extcode: $(EXTCODE_TARGETS)
    475508
    476 csage: $(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"
     509# lib_c
     510$(CSAGE): @DEP_scons@ @DEP_mpir@ @DEP_ntl@ @DEP_pari@ @DEP_polybori@ @DEP_pynac@ \
     511          @DEP_python@
    484512
    485 $(INST)/ccache: $(BASE) $(INST)/$(ZLIB)
     513$(INST)/ccache: $(BASE) @DEP_zlib)
    486514        +$(PIPE) "$(SAGE_SPKG) ccache 2>&1" "tee -a $(SAGE_LOGS)/ccache.log"
    487515        touch $(INST)/ccache
    488516
    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"
     517$(INST)/$(FP_gcc): @DEP_mpir@ @DEP_mpfr@ @DEP_mpc@ @DEP_zlib@
    498518
    499 $(INST)/$(BLAS):
    500         +$(PIPE) "$(SAGE_SPKG) $(BLAS) 2>&1" "tee -a $(SAGE_LOGS)/$(BLAS).log"
     519$(INST)/$(FP_pil): @DEP_python@
    501520
    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"
     521$(INST)/$(FP_numpy): @DEP_python@ @DEP_lapack@ @DEP_blas@ @DEP_atlas@
    505522
    506 $(INST)/$(SCIPY): $(INST)/$(LAPACK) $(INST)/$(BLAS) $(INST)/$(NUMPY)
    507         +$(PIPE) "$(SAGE_SPKG) $(SCIPY) 2>&1" "tee -a $(SAGE_LOGS)/$(SCIPY).log"
     523$(INST)/$(FP_scipy): @DEP_lapack@ @DEP_blas@ @DEP_numpy@
    508524
    509525# 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"
     526@SAGE_CHECK_TRUE@$(INST)/$(FP_cvxopt): @DEP_matplotlib@
    515527
    516 $(INST)/$(CEPHES):
    517         +$(PIPE) "$(SAGE_SPKG) $(CEPHES) 2>&1" "tee -a $(SAGE_LOGS)/$(CEPHES).log"
     528$(INST)/$(FP_cvxopt): \
     529    @DEP_lapack@ @DEP_blas@ @DEP_numpy@ \
     530    @DEP_atlas@ @DEP_cephes@ @DEP_gsl@ \
     531    @DEP_glpk@
     532
     533$(INST)/$(FP_cephes):
    518534
    519535###############################################################################
    520536
    521537# setuptools forgets to update easy-install.pth during parallel
    522538# builds, so we build the relevant packages serially.
    523539
    524 $(INST)/$(PYGMENTS): $(INST)/$(SQLALCHEMY)
    525 $(INST)/$(JINJA2): $(INST)/$(PYGMENTS)
    526 $(INST)/$(SPHINX): $(INST)/$(JINJA2)
    527 $(INST)/$(SAGENB): $(INST)/$(SPHINX)
     540$(INST)/$(FP_pygments): @DEP_sqlalchemy@
     541$(INST)/$(FP_jinja2): @DEP_pygments@
     542$(INST)/$(FP_sphinx): @DEP_jinja2@
     543$(INST)/$(FP_sagenb): @DEP_sphinx@
     544
     545# direct phony targets: (FIXME: not phony yet)
     546.SECONDEXPANSION:
     547$(INSTALL_FP_NAMES:%=%-install): %-install: $(INST)/$$(FP_$$*)
     548
     549$(INSTALL_FP_NAMES:%=%-uninstall): %-uninstall:
     550        @echo not implemented
     551
     552# convenience rules
     553#incomplete/under construction (necessary?)
     554$(INSTALL_FP_NAMES:%=%-configure): %-configure: build/pkgs/%/src
     555        path=build/pkgs/$*;\
     556        export SAGE_LOCAL="$(abs_builddir)/local" CC="@CC@" CFLAGS="@CFLAGS@" \
     557               MAKE=$(MAKE) UNAME="@UNAME@" PATH=$(abs_builddir)/local/bin:$$PATH \
     558               LD_LIBRARY_PATH="$(abs_builddir)/local/lib:$$LD_LIBRARY_PATH" \
     559               srcdir="$(abs_top_srcdir)/$$path"; \
     560               PYTHONHOME="$(abs_builddir)/local"; \
     561        $(MAKE) -f$(abs_top_srcdir)/build/pkgs/$*/spkg-install -Cbuild/pkgs/$* configure
     562
     563# just remove it...
     564$(INSTALL_FP_NAMES:%=%-clean): %-clean:
     565        rm -rf build/pkgs/$*/src
     566        rm -rf build/pkgs/$*/*-stamp
     567
  • new file dist/bin/sage-dist-install.in

    diff --git a/dist/bin/sage-dist-install.in b/dist/bin/sage-dist-install.in
    new file mode 100644
    index 0000000..0ba9692
    - +  
     1#!/bin/sh
     2# this file is part of Sage
     3# (c) 2013 Felix Salfelder
     4# license: gplv3+
     5#
     6# this is intended for installation within spkg-install
     7#
     8# same functionality as install-sh, but also
     9# -F FILELIST append target filenames into filelist
     10# -D DESTDIR  prepend destdir before copy
     11# -v          verbose output
     12#
     13# EXAMPLES
     14#
     15## manual install, just use this instead of another install or cp
     16# sage-dist-install ...
     17#
     18## sane upstream makefiles
     19# make install INSTALL="/path/to/install -F$(prefix)/var/lib/sage/installed"
     20#
     21## broken makefile, doesn't honor DESTDIR, calls $(INSTALL)
     22# make install INSTALL="/.../install -F... -D$(DESTDIR)"
     23#
     24## completely broken makefile, just calls install,
     25## lets inject parameters through environment
     26# (export PATH=... DESTDIR_BYPASS=... FILELIST_BYPASS=...; make install)
     27#
     28## distutils (don't know yet)
     29# ...
     30
     31args=
     32verbose=$INSTALL_DEBUG
     33# query env, as it may be not possible to fix install call
     34destdir=$DESTDIR_BYPASS
     35filelist=$FILELIST_BYPASS
     36
     37while test $# -ne 0; do
     38  case $1 in
     39    -D)
     40      shift; destdir=$1; shift
     41      ;;
     42    -F)
     43      shift; filelist=$1; shift
     44      ;;
     45    -v)
     46      shift; verbose=yes;
     47      ;;
     48    -c|-C|-g|-s|-T|--help|--version)
     49      args="$args $1"
     50      shift
     51      ;;
     52    -d)
     53      shift
     54      args="$args -d $destdir$1"
     55      shift
     56      ;;
     57    -m|-o)
     58      args="$args $1"
     59      shift
     60      args="$args $1"
     61      shift
     62      ;;
     63    -t)
     64      args="$args $1"
     65      shift
     66      dst_arg=$1
     67      args="$args $1"
     68      shift
     69      ;;
     70    --) break;;
     71    -*)
     72      echo "$0: invalid option: $1" >&2
     73      exit 1
     74      ;;
     75    *) break;;
     76esac
     77done
     78
     79if test x$verbose = xyes; then
     80  echo "finding done start $args / $@"
     81fi
     82
     83extra_destarg=
     84
     85if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
     86  if test x$verbose = xyes; then
     87    echo "finding dst_arg"
     88  fi
     89  # When -d is used, all remaining arguments are directories to create.
     90  # When -t is used, the destination is already specified.
     91  # Otherwise, the last argument is the destination.  Remove it from $@.
     92  for arg
     93  do
     94    if test -n "$dst_arg"; then
     95      # $@ is not empty: it contains at least $arg.
     96      set "$@" "$dst_arg"
     97    fi
     98    shift # arg
     99    dst_arg=$arg
     100    # Protect names problematic for `test' and other utilities.
     101  done
     102  extra_destarg=$destdir$dst_arg
     103fi
     104
     105case $dst_arg in
     106  -* | [=\(\)!]) dst_arg=./$dst_arg;;
     107esac
     108
     109
     110if test -n "$filelist"; then
     111  set -C
     112  until 2> /dev/null > .$filelist.lock; do :; done
     113  trap 'rm -f .$filelist.lock; exit $?' INT TERM EXIT
     114  set +C
     115endif
     116
     117# $@ holds the list of files
     118for src in $@; do
     119  if test x$verbose = xyes; then
     120    echo "..." $src
     121  fi
     122
     123  dst=$dst_arg/`basename "$src"`
     124  args="$args $1"
     125  if test -n "$filelist"; then
     126    if test x$verbose = xyes; then
     127      echo "recording $dst_arg/$dst to $filelist"
     128    fi
     129    echo $dst_arg/$dst >> $filelist
     130  fi
     131  shift
     132done
     133
     134cmd="@INSTALL@ $args $@ $extra_destarg"
     135if test x$verbose = xyes; then
     136  echo calling $cmd
     137fi
     138$cmd
     139exit $?
     140
     141# vim:sw=2:et:
  • new file dist/bin/sage-dist-make.in

    diff --git a/dist/bin/sage-dist-make.in b/dist/bin/sage-dist-make.in
    new file mode 100644
    index 0000000..7fda700
    - +  
     1#!/bin/sh
     2
     3@GMAKE@ -I@abs_top_builddir@/dist -f $@
  • new file dist/etc/env.sh.in

    diff --git a/dist/etc/env.sh.in b/dist/etc/env.sh.in
    new file mode 100644
    index 0000000..d33cce5
    - +  
     1# this is the environment used for package-tasks
     2
     3SAGE_ROOT="@abs_top_builddir@"
     4SAGE_LOCAL="$SAGE_ROOT/local"
     5SAGE_SHARE="$SAGE_LOCAL/share"
     6SAGE_SRC="$SAGE_ROOT/src"
     7
     8PATH="$SAGE_LOCAL/bin:$PATH"
     9PATH="$SAGE_ROOT/dist/bin:$PATH"
     10PATH="@abs_builddir@/dist/bin:$PATH"
     11
     12LD_LIBRARY_PATH="$SAGE_LOCAL/lib:$LD_LIBRARY_PATH"
     13
     14# sage_fortran
     15PATH="$SAGE_ROOT/build/bin:$PATH"
     16
     17export SAGE_ROOT \
     18       SAGE_LOCAL \
     19       SAGE_SHARE \
     20       SAGE_SRC \
     21       PATH \
     22       LD_LIBRARY_PATH
     23
     24# FIXME: cannot know yet?!
     25if [ -z "$FC" ]; then
     26    if [ -n "$SAGE_FORTRAN" ]; then
     27        # Deprecated, see #13349.
     28        FC="$SAGE_FORTRAN"
     29    elif command -v gfortran >/dev/null 2>/dev/null; then
     30        FC=gfortran
     31    elif command -v g95 >/dev/null 2>/dev/null; then
     32        FC=g95
     33    elif command -v g77 >/dev/null 2>/dev/null; then
     34        FC=g77
     35    fi
     36fi
     37export FC
     38
     39###### FIXME: decruft ######
     40
     41# Setup env varariables if ccache is installed
     42if [ -d "$SAGE_LOCAL/libexec/ccache" ]; then
     43    PATH="$SAGE_LOCAL/libexec/ccache:$PATH"
     44fi
     45if [ -z "$CCACHE_BASEDIR" ]; then
     46    export CCACHE_BASEDIR="$SAGE_ROOT"
     47fi
     48
     49if [ "$LD" = "" ]; then
     50    LD="ld"  && export LD
     51fi
     52if [ "$AR" = "" ]; then
     53    AR="ar"  && export AR
     54fi
     55if [ "$AS" = "" ]; then
     56    AS="as"  && export AS
     57fi
     58
     59if [ "$LDFLAGS" = "" ]; then
     60    LDFLAGS=""          && export LDFLAGS
     61fi
     62
     63if [ "$CXXFLAGS" = "" ]; then
     64    export CXXFLAGS="$CFLAGS"
     65fi
     66
     67if [ "$CP" = "" ]; then
     68    CP="cp"  && export CP
     69fi
     70
     71if [ "$MV" = "" ]; then
     72    MV="mv"  && export MV
     73fi
     74
     75if [ "$RANLIB" = "" ]; then
     76    RANLIB="ranlib"  && export RANLIB
     77fi
     78
     79if [ "$LN" = "" ]; then
     80    LN="ln"  && export LN
     81fi
     82
     83if [ "$MKDIR" = "" ]; then
     84    MKDIR="mkdir"  && export MKDIR
     85fi
     86
     87if [ "$CHMOD" = "" ]; then
     88    CHMOD="chmod"  && export CHMOD
     89fi
     90
     91if [ "$TOUCH" = "" ]; then
     92    TOUCH="touch"  && export TOUCH
     93fi
  • new file m4/ac_foreign.m4

    diff --git a/m4/ac_foreign.m4 b/m4/ac_foreign.m4
    new file mode 100644
    index 0000000..2d9747e
    - +  
     1dnl a macro to register foreigns.
     2dnl dnl  AC_FOREIGN_PACKAGE([name])
     3dnl
     4AC_DEFUN([AC_FOREIGN_PACKAGE],
     5 [AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1], [Build $1]),
     6 [case "${enableval}" in
     7  yes) $1=true ;;
     8  no)  $1=false ;;
     9  *) AC_MSG_ERROR([bad value ${enableval} for --enable-$1]) ;;
     10 esac],[$1=$FOREIGN_DEFAULT])
     11 our_package='$(INST)/$(FP_$1)'
     12 if test $$1 = auto; then
     13  # automatic == classic mode
     14  if test x$CHK_$1 = xpositive; then
     15   # we are quite sure that the system package is okay, don't depend on ours.
     16   FOREIGN_AVAILABLE+=" $1"
     17   DEP_$1=
     18   $1=no
     19  else
     20   DEP_$1=$our_package
     21   $1=yes
     22  fi
     23 elif test $$1 = true; then
     24  FOREIGN_ENABLED+=" $1"
     25  if test x$CHK_$1 = xpositive; then
     26   AC_MSG_NOTICE(["forcefully overriding available system package: $1"])
     27  fi
     28  DEP_$1=$our_package
     29 else # --disable-<packagename>
     30  FOREIGN_DISABLED+=" $1"
     31  if test x$CHK_$1 = xnegative; then
     32   AC_MSG_NOTICE([system package for $1 is known to not work. you have been warned!])
     33   sleep 3
     34  fi
     35 fi
     36 AC_SUBST(DEP_$1)
     37 m4_pushdef([uppercase],translit([[$1]],[a-z],[A-Z]))
     38
     39 # this is not currently used. might be helpful...
     40 AM_CONDITIONAL([SAGE_OWN_]uppercase, [test x$$1 = xtrue])
     41 m4_popdef([uppercase])
     42 ])
  • sage.in

    diff --git a/sage.in b/sage.in
    index 46c69ba..81911c3 100755
    a b  
    1717# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    1818
    1919
    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 
    2620
    2721# Resolve all symbolic links in a filename.  This more or less behaves
    2822# like "readlink -f" except that it does not convert the filename to an
    fi 
    124118export SAGE_ROOT
    125119
    126120# 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
     121if [ -x "$SAGE_ROOT/local/bin/sage" ]; then
    130122    "$SAGE_ROOT/local/bin/sage" "$@"
     123elif [ -x "$SAGE_ROOT/src/bin/sage" ]; then
     124         # run a not-yet installed sage
     125    # particularly, env.sh is not in place, use a substitute.
     126    export SAGE_ETC="$SAGE_ROOT/dist/etc"
     127    "$SAGE_ROOT/src/bin/sage" "$@"
    131128else
    132129    echo >&2 "$0: no Sage installation found in \$SAGE_ROOT=$SAGE_ROOT"
    133130    exit 1