1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405 |
- AC_INIT([REDUCE], [from SourceForge], [acn1@cam.ac.uk])
- # **************************************************************************
- # * Copyright (C) 2017-22, Codemist. A C Norman *
- # * *
- # * Redistribution and use in source and binary forms, with or without *
- # * modification, are permitted provided that the following conditions are *
- # * met: *
- # * *
- # * * Redistributions of source code must retain the relevant *
- # * copyright notice, this list of conditions and the following *
- # * disclaimer. *
- # * * Redistributions in binary form must reproduce the above *
- # * copyright notice, this list of conditions and the following *
- # * disclaimer in the documentation and/or other materials provided *
- # * with the distribution. *
- # * *
- # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
- # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT *
- # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS *
- # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE *
- # * COPYRIGHT OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, *
- # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, *
- # * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS *
- # * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
- # * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR *
- # * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF *
- # * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
- # * DAMAGE. *
- # **************************************************************************
- # The next line is a dreadful thing and is in case I am launched
- # from a bash prompt, in which case the SHELL variable will be set
- # to /bin/bash (or perhaps the user's login shell?). Anyway that hurts
- # config.guess on Solaris.... so I will force matters so that I use
- # plan vanilla /bin/sh henceforth. So BEWARE and do not use bash extensions.
- if test -x /bin/sh
- then
- SHELL=/bin/sh
- export SHELL
- fi
- AC_COPYRIGHT([The REDUCE project])
- # $Id$
- # If necessary you can fetch source versions of autoconf and automake and
- # install private versions for use here. Following discussions with other
- # developers I am now going to require autoconf, automake and libtool
- # availability, although an enthusiastic person could probably get things
- # working without them.
- AC_PREREQ(2.61)
- AC_CONFIG_MACRO_DIRS([m4])
- AC_CONFIG_AUX_DIR([.])
- AC_CANONICAL_HOST()
- abssrcdir=`"$srcdir/scripts/here.sh"`
- if which cygpath 2> /dev/null
- then
- a=`cygpath -am "$abssrcdir"`
- b="${a%%/*}/"
- d="${a#${b}}"
- c=`cygpath $b`
- abssrcdir="$c$d"
- fi
- AC_MSG_NOTICE([Absolute path to source directory = $abssrcdir])
- #
- # There is a horror here. If one fetches everything from subversion
- # then timstamps can be ill-ordered, and it can seem necessary to
- # re-create the autoconf-related files. The standard way that autoconf and
- # automake allow for this is not very generous if the version of autoconf
- # on the local machine does not match the one used in the files from the
- # central site.
- #
- # I am now going to try to respond to that by forcing a re-generation of
- # all the autoconf files each time anybody runs configure. That adds to the
- # cost for everybody and means that everybody NEEDS autoconf, automake and
- # libtool installed, but may be more robust. I will check the versions of
- # autoconf and automake that are present and stop if they are too old.
- # If that case hits you you may need to fetch new versions (in source form)
- # and build and install them somewhere on your PATH. This is in fact not
- # too difficult, it is along the lines of
- # <fetch source archive from the Free Software Foundation archives>
- # # (please use a local mirror)
- # tar xvfz <source-archive.tgz>
- # cd <where it unpacked to>
- # ./configure --prefix=/usr/local/bin
- # make
- # sudo make install
- # and if you do not have authority to write files to /usr/local/bin then
- # set up a directory of your own, put it early in your PATH and use that as
- # the "--prefix".
- # Note that AS_HELP_STRING has been available since version 2.61 and
- # use of AC_HELP_STRING leads to loud moans from version 2.71
- AC_ARG_WITH(autogen,
- AS_HELP_STRING([--with-autogen], [Regenerate autoconf file at start]),
- [],
- [with_autogen="yes"])
- if test "$with_autogen" = "yes"
- then
- if ! which autoconf > /dev/null 2> /dev/null
- then
- printf "You must have autoconf (at least version 2.61) installed to\n"
- printf "build this package. Install it and try again please.\n"
- exit 1
- fi
- if ! which automake > /dev/null 2> /dev/null
- then
- printf "You must have automake (at least version 1.13) installed to\n"
- printf "build this package. Install it and try again please.\n"
- exit 1
- fi
- if ! which libtool > /dev/null 2> /dev/null
- then
- printf "You must have libtool installed to build this package. Install\n"
- printf "it and try again please.\n"
- printf "Note on some Linux systems it is in a package called libtool-bin\n"
- exit 1
- fi
- # The next fragment should extract version numbers for autoconf and automake
- # I extract version info from the two utilities. The first line of
- # the output from "autoxx --version" is "autoxx ... nn.nn.nn" with
- # a two or three component version number at the end.
- acver=`autoconf --version 2> /dev/null | head -1`
- amver=`automake --version 2> /dev/null | head -1`
- # Get rid of everything as far as the final blank in the data. What is
- # left is just the version number, whihc may be two or three components,
- # such as 14.2.1 or 15.0
- acver=`echo $acver | sed -e 's/.* //'`
- amver=`echo $amver | sed -e 's/.* //'`
- # The major version number is got by stripping of everything from the "." on.
- acmaj=`echo $acver | sed -e 's/\..*//'`
- ammaj=`echo $amver | sed -e 's/\..*//'`
- # The minor version number is left if one deleted the major number.
- acver=`echo $acver | sed -e "s/$acmaj\.//"`
- amver=`echo $amver | sed -e "s/$ammaj\.//"`
- # What was left could have a patch level - get rid of it.
- acmin=`echo $acver | sed -e 's/\..*//'`
- ammin=`echo $amver | sed -e 's/\..*//'`
- AC_MSG_NOTICE([detected autoconf: $acmaj.$acmin automake: $ammaj.$ammin])
- if test $acmaj -lt 2 || test $acmaj -eq 2 && test $acmin -lt 61
- then
- printf "You have autoconf $acmaj.$acmin but at least 2.61 is needed\n"
- printf "to build this package. Install it and try again please.\n"
- exit 1
- fi
- if test $ammaj -lt 1 || test $ammaj -eq 1 && test $ammin -lt 13
- then
- printf "You have automake $ammaj.$ammin but at least 1.13 is needed\n"
- printf "to build this package. Install it and try again please.\n"
- exit 1
- fi
- here=`pwd`
- cd $abssrcdir
- printf "Regenerate autoconf-related files\n"
- find . -name config.cache | xargs rm -f
- printf "\n\n+++ About to recreate all autoconf generated files +++\n\n"
- if ! eval $SHELL -c \"./autogen.sh $ac_configure_args\"
- then
- printf "The autogen.sh script seems to have failed. I can not continue\n"
- exit 1
- fi
- cd $here
- # It is unexpectedly important the the "--without-autogen" be provided as
- # the first argument in the re-try. This is because otherwise some malformed
- # input later on (eg "--") could cause it not to be recognised, leading
- # to an infinite cycle of attempted re-generation!
- printf "Restart: $abssrcdir/configure --without-autogen $ac_configure_args\n"
- # Because this uses "exec" it chains into the restarted processing and does
- # not proceed further in this shell.
- exec $SHELL -c "$abssrcdir/configure --without-autogen $ac_configure_args"
- fi
- # Next and before I do anything much else I will see if any GUI toolkit that
- # I am using needs to be unpacked from source. Well before I do that I need
- # to sort out whether I am using CSL or PSL and in the former case whether
- # I am using the FOX or wxWidgets toolkit.
- AC_ARG_WITH(csl,
- AS_HELP_STRING([--with-csl], [Use the CSL Lisp system]),
- [],
- [with_csl="no"])
- AC_ARG_WITH(psl,
- AS_HELP_STRING([--with-psl], [Use the PSL Lisp system]),
- [],
- [with_psl="no"])
- AC_ARG_WITH(both,
- AS_HELP_STRING([--with-both], [Use both the CSL and PSL Lisp systems]),
- [],
- [with_both="no"])
- if test "$with_both" != "no"
- then
- with_csl="yes"
- with_psl="yes"
- fi
- # Ensure that at least one Lisp system is selected
- if test "$with_psl" = "no" && test "$with_csl" = "no"
- then
- AC_MSG_ERROR(
- [you must specify either --with-csl or --with-psl to select a Lisp])
- fi
- AC_ARG_WITH(gui,
- AS_HELP_STRING([--with-gui],
- [use --without-gui to get a text-only system (CSL only)]),
- [],
- [with_gui="yes"])
- # As part of what MAY be a transition I am supporting two possible GUI
- # toolkits, viz FOX and wxWidgets. See www.fox-toolkit.org and
- # www.wxwidgets.org. If you do not say anything explicit then you will
- # get the code built with my default choice and the build will occur in
- # un-decorated directory-names. If you explicitly go either "--with-fox"
- # or "--with-wx" then you get that GUI toolkit used and the directory will
- # be decorated so that this does not interfere with the default. I set the
- # default here...
- # If you go "--without-fox" or "--without-wx" then that will disable use
- # of that toolkit. If the other was selected this will in effect get ignored.
- # If the one you say "--without" about is the one that would have been the
- # default then you get a system without a GUI at all.
- # I reserve the right (one day) to change the default toolkit I use to build
- # a GUI, but at the stage I put this in there is a workable one using FOX
- # and essentially nothing beyond some configuration steps using wxWidgets!
- default_gui="fox"
- #default_gui="wx"
- AC_ARG_WITH(wx,
- AS_HELP_STRING([--with-wx],
- [enable or disable use of wxWidgets (CSL only)]),
- [],
- [with_wx="default"])
- AC_ARG_WITH(fox,
- AS_HELP_STRING([--with-fox],
- [enable or disable use of FOX (CSL only)]),
- [],
- [with_fox="default"])
- if test "$with_psl" != "no" && test "$with_csl" = "no"
- then
- with_fox=no
- with_wx=no
- with_gui=no
- fi
- if test "$with_csl" != "no"
- then
- # This is where I unpack a new copy of wxWidgets if I need to.
- # If the user has said nothing then both with_fox and with_wx will be
- # "default", and default_gui will be either"fox" or "wx".
- # The things the user can reasonably say will be
- # <nothing> build using default GUI in directory x-y-z
- # (eg in cslbuild/i386-pc-windows)
- # --without-gui build non-GUI version in x-y-x-nogui
- # --with-fox build FOX version in x-y-z
- # --with-wx build wxWidgets version in x-y-z-wx
- # --without-fox if FOX is the default behave as --without -gui
- # --without-wx if wxWidgets is the default behave as --without-gui
- # If the user says --without-wx when FOX was to be the default GUI then in
- # effect this redundant statement is ignored.
- # It is not proper to say more than one from --with-fox, --with-wx,
- # and --without-gui, but each can be used in separate calls to the
- # configure script to build parallel versions.
- #
- # There is no point or merit in --with-fox=XXXX for some XXX
- # other than "yes" OR "no", and "--with-fox=no" is interpreted as being the
- # same as "--without-fox" (etc). I use "--with-fox=default" as the situation
- # if the user does not specify "--with-fox" at all.
- if test "$with_gui" = "no" && (test "$with_fox" != "default" || test "$with_wx" != "default")
- then
- AC_MSG_ERROR([If you say --without-gui you must not say --with-fox or --with-wx as well
- (or even --without-fox or --without-wx)])
- fi
- if test "$with_fox" != "default" && test "$with_wx" != "default"
- then
- AC_MSG_ERROR([You must not say --with-fox (or --without-fox) and --with-wx
- (or --without-wx) at the same time])
- fi
- if test "$with_gui" = "no"
- then
- with_fox="no"
- with_wx="no"
- else
- case $default_gui/$with_fox/$with_wx in
- fox/default/default)
- # simple default case
- with_fox="yes"
- with_wx="no";
- ;;
- fox/yes/*)
- # explicit --with-fox. I allow this even though in this situation it
- # is redundant because when wxWidgets becomes the default it will be
- # needed if you want a fox build.
- with_fox="yes"
- with_wx="no";
- ;;
- fox/no/*)
- # explicit --without-fox. If fox is that default this
- # leads to the without-gui situation.
- with_fox="no"
- with_wx="no";
- ;;
- fox/*/yes)
- # explicit --with-wx overrides the default
- with_fox="no"
- with_wx="yes";
- ;;
- fox/*/no)
- # explicit --without-wx. If fox is the default this will not have any
- # effect and since maybe somebody thought it would disable the whole
- # GUI I will make it an error.
- AC_MSG_ERROR([--with-fox is the default configuration so --without-wx is not needed])
- ;;
- wx/default/default)
- # simple default case (if wx is preferred)
- with_fox="no"
- with_wx="yes";
- ;;
- wx/*/yes)
- # explicit --with-wx is permitted even when not needed
- with_fox="no"
- with_wx="yes";
- ;;
- wx/yes/*)
- # explicit --with-fox that overrides default
- with_fox="yes"
- with_wx="no";
- ;;
- wx/no/*)
- # explicit --without-fox
- AC_MSG_ERROR([--with-wx is the default configuration so --without-fox is not needed])
- ;;
- *)
- AC_MSG_ERROR([--with-fox=$with_fox and --with-wx=$with_wx inconsistent here])
- ;;
- esac
- fi
- AC_MSG_NOTICE([with_fox=$with_fox, with_wx=$with_wx])
- # Now at most one of with_wx and with_fox will be "yes". They could both
- # be "no".
- if test "$with_wx" != "no"
- then
- d=`pwd`
- cd $abssrcdir/csl/support-packages
- # The next line should collect the names of all versions of wxWidgets that
- # I have .tar.bz2 files for, and they should end up in alphabetic order.
- a=`echo wxWidgets-*-*-*.tar.bz2`
- # Here I keep the last item in the list, which should be the latest version
- # present.
- a=${a##* }
- # Remove the ".tar.bz2" suffix
- b=${a%.tar.bz2}
- cd ..
- # Now I need to check if the version of wxWidgets I have already got
- # in an unpacked state matches the most recent one available. Well I look at
- # date-stamps - has the unpacked copy of wxWidgets got a newer date-stamp than
- # the archived one?
- if test $abssrcdir/csl/support-packages/wxWidgets_revision -nt \
- wxWidgets/wxWidgets_revision
- then
- printf "will unpack a fresh copy of wxWidgets\n"
- mkdir wxWidgets-new
- cp $abssrcdir/csl/support-packages/wxWidgets_revision wxWidgets-new
- mv wxWidgets-new wxWidgets
- # At present my wxWidgets archive is packed as for a directory named
- # just "wxWidgets", but I will allow for any future change where the
- # directory mentioned in the tar archive has a version number included.
- tar xfj support-packages/$a -C wxWidgets --strip-components=1
- # At one stage I had trouble with the unpacked archive not being all
- # readable, so here I forcibly reset permssions
- chmod -R +rw wxWidgets
- # The official distribution needs its autogen.sh script run to create
- # a configure file.
- cd wxWidgets
- ./autogen.sh
- cd ..
- printf "wxWidgets unpacked from archive $a\n"
- fi
- cd $d
- fi
- fi
- # I will only attempt to build a Mac univeral binary if things are
- # configured with "--enable-universal", and even then such a build will
- # only be possible if enough build libraries have been installed in
- # universal mode. At the time of updating this comment (January 2022)
- # this seems possible on either an Intel or arm-based Mac running Big Sur.
- # It needs universal versions of many of the libraries etc that get
- # set up using macports, and scripts/make-universal.sh is available to
- # try to establish a suitable encironment. Note that make-universal.sh will
- # NOT manage to make every "port" universal, but for me it manages enough.
- # and over time the rest may catch up, for what that is worth.
- AC_ARG_ENABLE(universal,
- AS_HELP_STRING([--enable-universal],
- [Try to build universal binary on Mac Big Sur (CSL only)]),
- [],
- [enable_universal="no"])
- ORIG="$CC$CXX"
- OLD_CFLAGS="$CFLAGS"
- OLD_CXXFLAGS="$CXXFLAGS"
- OLD_CPPFLAGS="$CPPFLAGS"
- AC_PROG_CC
- AC_PROG_CXX
- CFLAGS="$OLD_CFLAGS"
- CXXFLAGS="$OLD_CXXFLAGS"
- CPPFLAGS="$OLD_CPPFLAGS"
- uname_m=`uname -m`
- uname_s=`uname -s`
- case "$uname_s" in
- Darwin)
- # "uname -o" is not available on the Macintosh!
- uname_o="macOS"
- if test "$CC" = ""; then CC=clang; fi
- if test "$CXX" = ""; then CXX=clang++; fi
- if test "$enable_universal" != "no"
- then
- # I must not add these to CPPFLAGS because the pre-processor does not like
- # the idea of dual targets!
- OLDCFLAGS="$CFLAGS"
- OLDCXXFLAGS="$CXXFLAGS"
- OLDLDFLAGS="$LDFLAGS"
- CFLAGS="$CFLAGS -arch x86_64 -arch arm64"
- CXXFLAGS="$CXXFLAGS -arch x86_64 -arch arm64"
- LDFLAGS="$LDFLAGS -arch x86_64 -arch arm64"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],
- [[return 0]])],
- [AC_MSG_NOTICE(Will build in universal mode)],
- [CFLAGS="$OLDCFLAGS"
- CXXFLAGS="$OLDCXXFLAGS"
- LDFLAGS="$OLDLDFLAGS"
- AC_MSG_NOTICE(Universal build not possible on this host)])
- fi
- ;;
- *)
- uname_o=`uname -o 2>/dev/null`
- ;;
- esac
- AC_ARG_WITH(build,
- AS_HELP_STRING([--with-build], [Used internally to control build directory]),
- [],
- [with_build="unknown"])
- AC_ARG_WITH(pslbuild,
- AS_HELP_STRING([--with-pslbuild], [Used internally to control build directory]),
- [],
- [with_pslbuild="unknown"])
- AC_ARG_WITH(cygbuild,
- AS_HELP_STRING([--with-cygbuild], [Used internally to control build directory]),
- [],
- [with_cygbuild="unknown"])
- AC_ARG_WITH(cygbuild64,
- AS_HELP_STRING([--with-cygbuild64], [Used internally to control build directory]),
- [],
- [with_cygbuild64="unknown"])
- AC_ARG_WITH(force,
- AS_HELP_STRING([--with-force], [Forces refresh of windows varients]),
- [],
- [with_force="no"])
- # I could provide a --with-libedit=... option but the plan here is that
- # the version used will only change during transitions made by the developers
- # and so I limit myself to a fixed setting here. No ordinary person should
- # ever need to alter this.
- # This is set here so that if I need to experiment with or chance to a
- # different version that will be reasonably tidy.
- LIBEDIT_VERSION=20140620-3.1
- #LIBEDIT_VERSION=20210216-3.1
- ############################################################################
- #
- # Modern versions of the autoconf tools seems to moan dreadfully if you pass
- # down a flag that they do not know about, and so I transcribe into here
- # all the flags that the CSL configuration may ever want. The down-side of
- # this is that "configure --help" shows them all.
- AC_ARG_WITH(lto,
- AS_HELP_STRING([--with-lto],
- [Experiment with extreme optimisation in gcc (CSL only)]),
- [],
- [with_lto="no"])
- AC_ARG_WITH(cygwin,
- AS_HELP_STRING([--with-cygwin],
- [Force use of raw cygwin (CSL only)]),
- [],
- [with_cygwin="no"])
- AC_ARG_WITH(xft,
- AS_HELP_STRING([--with-xft],
- [Can be used to disable use of XFT. Default is yes (CSL only)]),
- [],
- [with_xft="yes"])
- AC_ARG_WITH(xim,
- AS_HELP_STRING([--with-xim],
- [Can be used to control use of XIM. Default is yes (now) (CSL only)]),
- [],
- [with_xim="yes"])
- AC_ARG_ENABLE(debug,
- AS_HELP_STRING([--enable-debug],
- [compile for debugging (CSL only)]),
- [],
- [enable_debug="no"])
- AC_ARG_ENABLE(profile,
- AS_HELP_STRING([--enable-profile],
- [compile for profiling (CSL only)]),
- [],
- [enable_profile="no"])
- AC_ARG_ENABLE(conservative,
- AS_HELP_STRING([--enable-conservative],
- [garbage collect option: testing and development use (CSL only)]),
- [],
- [enable_conservative="no"])
- AC_ARG_ENABLE(test,
- AS_HELP_STRING([--enable-test],
- [testing-mode version (CSL only)]),
- [],
- [enable_test="no"])
- if test "$enable_test" = "yes"
- then
- AC_DEFINE([TEST], [1], [For use by developers])
- fi
- AC_ARG_ENABLE(experiment,
- AS_HELP_STRING([--enable-experiment],
- [testing-mode version (CSL only)]),
- [],
- [enable_experiment="no"])
- if test "$enable_experiment" = "yes"
- then
- AC_DEFINE([EXPERIMENT], [1], [For use by developers])
- fi
- AC_ARG_WITH(arithlib,
- AS_HELP_STRING([--with-arithlib],
- [development of arithlib.hpp support (CSL only)]),
- [],
- [with_arithlib="no"])
- AC_ARG_ENABLE(static,
- AS_HELP_STRING([--enable-static],
- [link it all statically (CSL only)]),
- [],
- [enable_static="no"])
- AC_ARG_WITH(throw,
- AS_HELP_STRING([--without-throw],
- [Avoid C++ catch & throw. Experimental. (CSL only)]),
- [],
- [with_throw="yes"])
- AC_ARG_WITH(threads,
- AS_HELP_STRING([--without-theads],
- [Experimental Lisp thread support. (CSL only)]),
- [],
- [with_throw="no"])
- CSLBASE=cslbase
- GENERATED_C=generated-c
- AC_ARG_ENABLE(static,
- AS_HELP_STRING([--enable-static],
- [link it all statically (CSL only)]),
- [],
- [enable_static="no"])
- ###########################################################################
- # Now I want to know if the current directory is the same as $srcdir. At
- # one stage I checked that by looking to see if $srcdir was ".". That was OK
- # for direct calls of the form "./configure" where the "." as in "./" was
- # detected. But the reconfig step messes that up and anyway it is a delicate
- # cheat. So here is a different delicate cheat!
- rm -f ./testfile.tst "$abssrcdir/testfile.tst"
- touch "$abssrcdir/testfile.tst"
- if test -f ./testfile.tst
- then
- rm -f ./testfile.tst
- inplace="yes"
- else
- inplace="no"
- fi
- printf "in-place build attempt = $inplace\n"
- # I have a fairly elaborate scheme to select a directory to use. At present
- # for PSL there are no relevant extra configure parameters, so I will not
- # pass anthing down even if something has been specified! Thus PSL will get
- # built in a simple directory named after the operating system while for
- # CSL you may be able to create multiple versions (eg debugging and
- # non-debugging) on the same machine, and the binaries will get created in
- # separate sub-directories.
- # One HORRID issue is that as regards anything that is to do with selecting
- # directories to build in etc I want to look at $host as produced by
- # just one version of config.guess. This is because in the past I have
- # come across cases where different versions or releases of config.guess
- # report the same machine with slightly different names. That could cause
- # messy confusion! So when I want that information I find it once here and
- # as necessary pass it down to lower parts of the tree.
- AC_MSG_NOTICE([host=$host args=$ac_configure_args])
- if test "$with_psl" != "no"
- then
- case $host in
- *windows | *cygwin)
- build="x86_64-pc-windows"
- ;;
- *)
- # For cases other than Windows the PSL case is simpler.
- build=`$SHELL $abssrcdir/scripts/findhost.sh $host`
- ;;
- esac
- else
- # For PSL find an initial name for the directory to build in. In the Windows
- # case this will be messed with further.
- build=`eval "$SHELL $abssrcdir/scripts/findhost.sh $host $ac_configure_args"`
- fi
- AC_MSG_NOTICE([Will build in the $build subdirectory])
- # There are many configure options that are valid or relevant at the
- # top level but are not needed for sub-configure calls
- filtered=`$abssrcdir/scripts/filter.sh "$ac_configure_args"`
- nohost=`$abssrcdir/scripts/nohost.sh "$ac_configure_args"`
- AC_MSG_NOTICE([args=<$ac_configure_args>])
- AC_MSG_NOTICE([filtered=<$filtered>])
- AC_MSG_NOTICE([nohost=<$nohost>])
- # Hah - the next is a jolly jape. It arranged that when I build on one of my
- # own real machines I default to a new and experimental layout for the build
- # of windows versions, but everybody else (unless their host has a name
- # matching mine!) should be undisturbed.
- # I have disabled this just for a while... I am making other changes and I do
- # not want this confusion to mess me up. The XXX is there to cause this
- # match not to be taken.
- case `uname -n` in
- *panamintXXX* | *gauguinXXX*)
- default_windows_layout="new"
- ;;
- *)
- default_windows_layout="old"
- ;;
- esac
- AC_ARG_WITH(windows_layout,
- AS_HELP_STRING([--with-windows_layout], [old or new windows layout]),
- [],
- [with_windows_layout="$default_windows_layout"])
- AC_MSG_NOTICE([default=$default_windows_layout this-layout=$with_windows_layout])
- if test "$with_windows_layout" != "new"
- then
- with_windows_layout="old"
- fi
- setpasscc ()
- {
- passcc=""
- if test "$CPP" != ""; then passcc="$passcc CPP=\"$CPP\""; fi
- if test "$CC" != ""; then passcc="$passcc CC=\"$CC\""; fi
- if test "$CXXCPP" != ""; then passcc="$passcc CXXCPP=\"$CXXCPP\""; fi
- if test "$CXX" != ""; then passcc="$passcc CXX=\"$CXX\""; fi
- if test "$LD" != ""; then passcc="$passcc LD=\"$LD\""; fi
- AC_MSG_NOTICE([passcc = $passcc])
- }
- csl_inplace_cygwin_build ()
- {
- # The argument here should be x88_64-pc-cygwin
- target=$1
- forcer=$2
- AC_MSG_NOTICE([in csl_inplace_cygwin_build wwl=$with_windows_layout])
- # Find the proper name for the target directory, allowing for --enable-debug
- # and any other options that may be relevant.
- if test "$with_windows_layout" = "new"
- then
- cygver="cyg64"
- build=`eval "$SHELL $abssrcdir/scripts/findhost.sh intel-pc-windows $ac_configure_args --with-cygwin"`
- AC_MSG_NOTICE([target=$target => build=$build/$cygver])
- mkdir -p "$abssrcdir/cslbuild/$build/$cygver"
- cp "$abssrcdir/csl/$CSLBASE/Makefile.windows" "$abssrcdir/cslbuild/$build/Makefile"
- cp "$abssrcdir/csl/$CSLBASE/stub2020.c" "$abssrcdir/cslbuild/$build/stub2020.c"
- cp "$abssrcdir/csl/$CSLBASE/make-cygwin-symlink.c" "$abssrcdir/cslbuild/$build/make-cygwin-symlink.c"
- cp "$abssrcdir/csl/$CSLBASE/redpsl.sh" "$abssrcdir/cslbuild/$build/redpsl"
- cd "$abssrcdir/cslbuild/$build/$cygver"
- else
- build=`eval "$SHELL $abssrcdir/scripts/findhost.sh $target $ac_configure_args --with-cygwin"`
- AC_MSG_NOTICE([target=$target => build=$build])
- mkdir -p "$abssrcdir/cslbuild/$build"
- cd "$abssrcdir/cslbuild/$build"
- fi
- AC_MSG_NOTICE([host=$host buildmc=$buildmc pass_host=$pass_host])
- pass_build="--with-build=\"$build\" --with-pslbuild=\"$pslbuild\""
- doconfig="$SHELL $abssrcdir/configure --config-cache $ac_configure_args \
- STRIP=\"$STRIP\" RANLIB=\"$RANLIB\" \
- $forcer CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBS=\"$LIBS\" \
- $pass_build --with-cygwin"
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About restart configure steps in proper target directory +++\n\n"
- eval "$doconfig"
- AC_MSG_NOTICE([configuration for cygwin on $target complete])
- cd "$abssrcdir"
- }
- csl_inplace_nativewin_build ()
- {
- buildmc=$1
- host=$2
- AC_MSG_NOTICE([CSL inplace for native Windows])
- if test "$with_windows_layout" = "new"
- then
- winver="win64"
- build=`eval "$SHELL $abssrcdir/scripts/findhost.sh intel-pc-windows $ac_configure_args"`
- AC_MSG_NOTICE([About to configure using $host in $build/$winver])
- mkdir -p "$abssrcdir/cslbuild/$build/$winver"
- cp "$abssrcdir/csl/$CSLBASE/Makefile.windows" "$abssrcdir/cslbuild/$build/Makefile"
- cd "$abssrcdir/cslbuild/$build/$winver"
- else
- build=`eval "$SHELL $abssrcdir/scripts/findhost.sh $target $ac_configure_args"`
- AC_MSG_NOTICE([About to configure using $host in $build])
- mkdir -p "$abssrcdir/cslbuild/$build"
- cd "$abssrcdir/cslbuild/$build"
- fi
- if test "$with_windows_layout" = "new"
- then
- cygextra=
- else
- # The Windows version would like to know where to find cygwin variants
- # at run-time.
- cygextra=
- ed64="s/.*windows/x86_64-pc-cygwin/; s/.*cygwin/x86_64-pc-cygwin/"
- dd64=`echo $build | sed -e "$ed64"`
- cygextra="$cygextra --with-cygbuild64=$abssrcdir/cslbuild/$dd64"
- AC_MSG_NOTICE([cygextra = $cygextra])
- fi
- pass_build="--with-build=\"$build\" --with-pslbuild=\"$pslbuild\""
- doconfig="$SHELL $abssrcdir/configure --config-cache $ac_configure_args \
- CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBS=\"$LIBS\" \
- $cygextra $pass_build --host=$host"
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About restart configure steps in proper target directory +++\n\n"
- eval "$doconfig"
- AC_MSG_NOTICE([configuration for $target complete])
- cd "$abssrcdir"
- }
- csl_inplace_windows_build ()
- {
- # If I am on Windows I will configure for variants:
- # x86_64-pc-cygwin
- # x86_64-w64-mingw
- AC_MSG_NOTICE([Inplace Windows build...])
- # I am going to suppose that all the compilers I could possibly want
- # are installed. That means I do not need to put in code here to test that!
- AC_MSG_NOTICE([Configure cygwin64 version])
- csl_inplace_cygwin_build "x86_64-pc-cygwin"
- AC_MSG_NOTICE([Configure windows64 version])
- csl_inplace_nativewin_build "x86_64-pc-windows" "x86_64-w64-mingw32"
- }
- csl_inplace_build ()
- {
- mkdir -p "$abssrcdir/cslbuild"
- # When I configure I will install a default "profile.dat" if there is
- # not one in place already, but the user can always regenerate a newer
- # local version of the profile.
- # Well in csl/generated-c I keep what I expect to be the "previous released
- # profile" as profile.dat.old, and if the user has their own profile.dat
- # matching that I will install the newer replacement for them.
- if test ! -d "$abssrcdir/cslbuild/$GENERATED_C" ||
- test ! -f "$abssrcdir/cslbuild/$GENERATED_C/profile.dat" ||
- diff "$abssrcdir/cslbuild/$GENERATED_C/profile.dat" \
- "$abssrcdir/csl/$GENERATED_C/profile.dat.old" >/dev/null
- then
- mkdir -p "$abssrcdir/cslbuild/$GENERATED_C"
- cp -r "$abssrcdir/csl/$GENERATED_C" "$abssrcdir/cslbuild"
- fi
- # Now I am configuring for CSL and am doing so from the top directory.
- AC_MSG_NOTICE([CSL in-place build for $build])
- case $build in
- *cygwin* | *windows* | *mingw*)
- csl_inplace_windows_build
- ;;
- *)
- # All other platforms come here...
- mkdir -p "$abssrcdir/cslbuild/$build"
- cd "$abssrcdir/cslbuild/$build"
- pass_build="--with-build=\"$build\" --with-pslbuild=\"$pslbuild\""
- doconfig="$SHELL $abssrcdir/configure --config-cache $ac_configure_args \
- CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBS=\"$LIBS\" \
- $pass_build"
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About restart configure steps +++\n\n"
- eval "$doconfig"
- cd "$abssrcdir"
- ;;
- esac
- }
- psl_inplace_build ()
- {
- AC_MSG_NOTICE([+++ Will build in $abssrcdir/pslbuild/$build])
- mkdir -p "$abssrcdir/pslbuild/$build"
- cd "$abssrcdir/pslbuild/$build"
- # This passes down any configure arguments to the PSL-specific configuration
- # but at present I do not expect any to be relevant.
- pass_build="--with-build=\"$build\""
- printf "\n\n+++ About to configure for PSL +++\n\n"
- eval "$SHELL $abssrcdir/psl/configure --config-cache $ac_configure_args \
- $pass_build CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" "
- AC_MSG_NOTICE([About to configure crlibm])
- builddir=`pwd`
- mkdir -p crlibm
- cd crlibm
- setpasscc
- doconfig="$SHELL $abssrcdir/libraries/crlibm/configure --config-cache $filtered \
- $pass_host \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- $passcc \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure crlibm +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- case "$host" in
- *windows)
- ;;
- *)
- AC_MSG_NOTICE([About to configure libedit])
- mkdir -p libedit
- cd libedit
- doconfig="$SHELL $abssrcdir/libraries/libedit-$LIBEDIT_VERSION/configure --config-cache \
- $nohost \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- --enable-widec=yes \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure libedit +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- ;;
- esac
- ln -f -s $abssrcdir/libraries/wineditline .
- AC_MSG_NOTICE([About to configure redfront])
- mkdir -p redfront
- cd redfront
- setpasscc
- doconfig="$SHELL $abssrcdir/generic/newfront/configure --config-cache $nohost \
- $passcc \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure redfront +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- }
- # There are many configure options that are valid or relevant at the
- # top level but are not needed for sub-configure calls
- filtered=`$abssrcdir/scripts/filter.sh "$ac_configure_args"`
- nohost=`$abssrcdir/scripts/nohost.sh "$ac_configure_args"`
- case $inplace in
- yes)
- # Here somebody has run the "configure" script within the top-level
- # source directory. I really want the build to take place in a
- # host-specific subdirectory so I will divert things!
- # When testing if --with-csl etc got passed I should check that the option
- # NO was NOT given rather than that the option yes was.
- if test "$with_csl" != "no"
- then
- csl_inplace_build
- fi
- if test "$with_psl" != "no"
- then
- psl_inplace_build
- fi
- printf "All sub-tasks should have completed\n"
- exit 0
- ;;
- *)
- AC_MSG_NOTICE([+++ standard build case, abssrcdir = $abssrcdir = "$abssrcdir"])
- ;;
- esac
- # This is where the main bit of this script starts.
- AC_CONFIG_SRCDIR(scripts/make.sh)
- AM_INIT_AUTOMAKE([1.13 -Wno-portability foreign no-dist-gzip dist-bzip2])
- LT_INIT
- AC_CONFIG_FILES([Makefile])
- ###############################################################################
- builddir=`pwd`
- AC_ARG_WITH(ccache,
- AS_HELP_STRING([--with-ccache],
- [--without-ccache can be used to disable use of ccache]),
- [], [])
- AC_CHECK_PROG([CCACHE], [ccache], [ccache], [])
- AC_MSG_NOTICE([CC=/$CC/ CXX=/$CXX/ CCACHE=/$CCACHE/])
- # The use of ccache here deserves an explanation. The first and maybe obvious
- # thing is that if either ccache seems not to to be installed or if the person
- # who invoked the configure script had overridden CC or CXX so specify any
- # custom compilers that I will not do anything.
- # Then the "obvious" thing do do would be to go 'CC="ccache $CC"' so that
- # subsequent compilation ended up cached. Well before I can do that I need
- # to get CC set - and remember that if --host is set then it may end up
- # being a cross-compiler. So 'CC="ccache gcc"' is certainly not good enough.
- # However the autoconf macros that set CC (and CXX) also set CFLAGS etc
- # in ways I do not want, so I take steps to preserve and restore those.
- # Now an issue that caused me much pain. If CC ends up as text with embedded
- # whitespace then passing it down to lower-level configure scripts is
- # delicate. And at least one library that I use performs a test of the form
- # if test $CC = xxx; then
- # (where perhaps more properly it would have gone 'test "$CC" = "xxx"') and
- # if CC expands to more than one word that gives a syntax error. So to work
- # around both those problems I dynamically create short scripts to compile
- # via ccache. These are placed in the top level build directory, which should
- # be platform specific. This extra layer of shell scripting will have an
- # adverse cost, but I hope that will be balanced by the effects of ccache.
- # Please note that here (and in other places) that whitespace in the path
- # to where Reduce gets built is not supported. If some keen person would
- # like to review all the build scripts and get quoting of strings fully
- # correct that might be nice!
- # Hah - a further issue. On some platforms gcc and g++ (and some others) will
- # be links to ccache and so the facility is already used automatically. In
- # that case it is not a help to wrap in an extra call to ccache!
- if test "$with_ccache" != "no" &&
- test "$ORIG" = "" &&
- test "$CCACHE" != ""
- then
- RAWCC="`which $CC 2> /dev/null`"
- RAWXX="`which $CXX 2> /dev/null`"
- case "$CC$CXX `ls -l $RAWCC 2>/dev/null` `ls -l $RAWCXX 2>/dev/null`" in
- *ccache*)
- ;;
- *)
- d=`pwd`
- printf "#! /bin/sh\nccache $CC \"\$@\"\n" > $d/cachecc.sh
- printf "#! /bin/sh\nccache $CXX \"\$@\"\n" > $d/cachecxx.sh
- chmod +x $d/cachecc.sh $d/cachecxx.sh
- CC="$d/cachecc.sh"
- CXX="$d/cachecxx.sh"
- ;;
- esac
- fi
- if test "$with_csl" != "no"
- then
- # Here I have a bunch of sub-directories that I need to configure
- AC_MSG_NOTICE([About to configure CSL core])
- mkdir -p csl
- cd csl
- case $host in
- *darwin* | *Darwin*)
- if test -d $HOME/ports/include
- then
- CPPFLAGS="$CPPFLAGS -I$HOME/ports/include"
- fi
- if test -d $HOME/ports/include/freetype2
- then
- CPPFLAGS="$CPPFLAGS -I$HOME/ports/include/freetype2"
- fi
- if test -d $HOME/ports/lib
- then
- LDFLAGS="$LDFLAGS -L$HOME/ports/lib"
- fi
- if test -d /opt/local/include
- then
- CPPFLAGS="$CPPFLAGS -I/opt/local/include"
- fi
- if test -d /opt/local/lib
- then
- LDFLAGS="$LDFLAGS -L/opt/local/lib"
- fi
- # CPPFLAGS="$CPPFLAGS -mmacosx-version-min=10.13"
- # CFLAGS="$CFLAGS -mmacosx-version-min=10.13"
- # CXXFLAGS="$CXXFLAGS -mmacosx-version-min=10.13"
- # LDFLAGS="$LDFLAGS -mmacosx-version-min=10.13"
- ;;
- esac
- # If I am compiling for native Cygwin I will not pass down "--host"
- # if I am building for the natural target.
- AC_MSG_NOTICE([host=$host build=$build])
- pass_host="--host=$host"
- if test "$with_cygwin" != "no"
- then
- pass_host=""
- if test "$host" != "x86_64-unknown-cygwin" &&
- test "$host" != "x86_64-pc-cygwin"
- then
- pass_host="--host=$host"
- fi
- fi
- AC_MSG_NOTICE([with_cygwin=$with_cygwin pass_host=$pass_host])
- if test "$with_wx" != "no"
- then
- # A short essay to explain why I pass down "--host=$host" here. There are
- # two points. The first is that I cope with 64-bit windows by use of
- # cross-compilation using the x86_64-win32-mingw32 toolchain, and I need
- # to pass down the information that I am doing that.
- # The second reason is that different releases of "config.guess" can report
- # machine identities differently. I have particularly observes this on
- # openSuSE Linux where some versions brand the host triple with "-suse-" in
- # the middle. I do not mind much just what triple is used, but I do mind
- # very much it it is not consistent all the way through my build. So I
- # let this top-level configure script make the choice and by explicitly
- # propagating if to sub-packages I end up safer.
- # However if I am building for raw cygwin I find that I have pain if I
- # specify --host specifically, so in that case I will not!
- pass_build="--with-build=\"$build\""
- setpasscc
- doconfig="$SHELL $abssrcdir/csl/$CSLBASE/configure -C \
- $ac_configure_args \
- $passcc \
- CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBS=\"$LIBS\" \
- $pass_host --with-wx=\"$with_wx\" $pass_build --without-fox"
- elif test "$with_fox" != "no"
- then
- pass_build="--with-build=\"$build\""
- setpasscc
- doconfig="$SHELL $abssrcdir/csl/$CSLBASE/configure -C \
- $ac_configure_args \
- $passcc \
- CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBS=\"$LIBS\" \
- $pass_host --with-fox=\"$builddir\" $pass_build --without-wx"
- else
- # This final version will be without any GUI.
- pass_build="--with-build=\"$build\""
- setpasscc
- doconfig="$SHELL $abssrcdir/csl/$CSLBASE/configure \
- -C \
- $ac_configure_args \
- $passcc \
- CPPFLAGS=\"$CPPFLAGS\" CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" LIBS=\"$LIBS\" \
- $pass_host $pass_build --without-fox --without-wx"
- fi
- AC_MSG_NOTICE([$doconfig])
- printf "\n\n+++ About to configure CSL +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- extras=
- wx=
- case $host in
- *cygwin*)
- if test "$with_cygwin" != "yes"
- then
- AC_MSG_NOTICE([gcc will be used in mingw mode.])
- else
- AC_MSG_NOTICE([Using raw cygwin])
- CPPFLAGS="$CPPFLAGS -I/usr/include/freetype2 -I/usr/include/ncurses "
- extras="--with-xft --with-xim"
- fi
- ;;
- *Darwin* | *darwin*)
- # clang on MacOSX does not provide -mfpmath
- # CFLAGS="$CFLAGS -msse2 -mfpmath=sse"
- # CXXFLAGS="$CXXFLAGS -msse2 -mfpmath=sse"
- MACARCH="--enable-macosx_arch=x86_64"
- extras="--with-xft --with-xim"
- wx="--with-cocoa \
- $MACARCH "
- # --with-macosx-version-min=10.13
- ;;
- *)
- # On most non-windowed platforms Xft is a very good idea! And I am now
- # relying on it. Ditto XIM
- CFLAGS="$CFLAGS "
- CXXFLAGS="$CXXFLAGS "
- extras="--with-xft --with-xim"
- ;;
- esac
- if test "$with_wx" != "no"
- then
- mkdir wxWidgets
- cd wxWidgets
- AC_MSG_NOTICE([About to configure wxWidgets])
- # I need --enable-unicode on Windows at least so that I can use the
- # BaKoMa fonts which remap at least one TeX glyph to outside the range
- # of simple 8-bit characters. This will bring some follow-on pain no doubt
- # but addressing that pain is probably good in the long term.
- setpasscc
- doconfig="$SHELL $abssrcdir/csl/wxWidgets/configure -C $wx \
- $pass_host \
- CPPFLAGS=\"$CPPFLAGS -D_GNU_SOURCE=1\" \
- CFLAGS=\"$CFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- $passcc \
- --disable-shared \
- --enable-unicode \
- --disable-compat28 \
- --enable-monolithic \
- --disable-sys-libs \
- --without-libjpeg \
- --without-libtiff \
- --disable-svg \
- --without-sdl \
- --without-expat \
- --without-libiconv \
- --without-regex \
- --disable-webview \
- --disable-richtext \
- --disable-gif \
- --disable-pcx \
- --enable-graphics_ctx \
- --disable-tga \
- --disable-pnm \
- --enable-dynlib \
- --enable-dynamicloader \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- if test "$enable_debug" != "no"
- then
- doconfig="$doconfig --enable-debug"
- else
- doconfig="$doconfig --disable-debug"
- fi
- if test "$with_cygwin" != "no"
- then
- doconfig="$doconfig --with-gtk"
- fi
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure wxWidgets +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- elif test "$with_fox" != "no"
- then
- AC_MSG_NOTICE([About to configure FOX])
- mkdir -p fox/src
- # The Makefile that comes with FOX seems to require these GIF files
- # in the build directory.
- cp "$abssrcdir/csl/fox/src/"*.gif fox/src
- cd fox
- setpasscc
- doconfig="$SHELL $abssrcdir/csl/fox/configure -C $ac_configure_args \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- $passcc \
- $pass_host \
- --enable-release \
- --with-opengl=no \
- --disable-jpeg \
- --disable-zlib \
- --disable-bz2lib \
- --disable-png \
- --disable-tiff \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\" \
- $extras"
- printf "\n\n+++ About to configure FOX +++\n\n"
- AC_MSG_NOTICE([doconfig = $doconfig])
- eval "$doconfig"
- cd "$builddir"
- fi
- fi
- AC_MSG_NOTICE([GUI toolkit config spawned])
- if test "$with_crlibm" = "no"
- then
- AC_MSG_NOTICE([crlibm will not be used here])
- else
- AC_MSG_NOTICE([About to configure crlibm])
- mkdir -p crlibm
- cd crlibm
- setpasscc
- doconfig="$SHELL $abssrcdir/libraries/crlibm/configure -C $filtered \
- $pass_host \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- $passcc \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure crlibm +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- fi
- AC_MSG_NOTICE([About to configure libffi])
- mkdir -p libffi
- if test "$enable_universal" = "yes"
- then
- # This is a messy script that arranges to build a universal version of
- # the library on MacOS.
- cp $abssrcdir/libraries/libffi-for-mac/Makefile libffi
- else
- cd libffi
- setpasscc
- doconfig="$SHELL $abssrcdir/libraries/libffi/configure -C $filtered \
- $pass_host \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- $passcc \
- --disable-multi-os-directory \
- --disable-docs \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure libffi +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- fi
- AC_MSG_NOTICE([About to configure libsoftfloat])
- mkdir -p softfloat
- cd softfloat
- setpasscc
- # NOTE that there is now a SoftFloat-3e and I should migrate to use of it!
- doconfig="$SHELL $abssrcdir/libraries/SoftFloat-3a/source/configure -C \
- $filtered \
- $pass_host \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- $passcc \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure softfloat +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- AC_MSG_NOTICE([About to configure libedit])
- mkdir -p libedit
- cd libedit
- setpasscc
- doconfig="$SHELL $abssrcdir/libraries/libedit-$LIBEDIT_VERSION/configure -C \
- $nohost \
- $passcc \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- --enable-widec=yes \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure libedit +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- ln -f -s $abssrcdir/libraries/wineditline .
- AC_MSG_NOTICE([About to configure redfront])
- mkdir -p redfront
- cd redfront
- setpasscc
- doconfig="$SHELL $abssrcdir/generic/newfront/configure -C $nohost \
- $passcc \
- CPPFLAGS=\"$CPPFLAGS\" \
- CFLAGS=\"$CFLAGS\" \
- CXXFLAGS=\"$CXXFLAGS\" \
- LDFLAGS=\"$LDFLAGS\" \
- --prefix=\"$builddir\" \
- --libdir=\"$builddir/lib\" \
- --includedir=\"$builddir/include\""
- AC_MSG_NOTICE([doconfig = $doconfig])
- printf "\n\n+++ About to configure redfront +++\n\n"
- eval "$doconfig"
- cd "$builddir"
- AC_MSG_NOTICE([All sub-packages have had their configure script launched])
- ###############################################################################
- AM_CONDITIONAL(csl, test "$with_csl" != "no")
- AM_CONDITIONAL(psl, test "$with_psl" != "no")
- AM_CONDITIONAL(cslpsl, test "$with_csl" != "no" && test "$with_psl" != "no")
- AM_CONDITIONAL(fox, test "$with_fox" != "no")
- AM_CONDITIONAL(wx, test "$with_wx" != "no")
- AM_CONDITIONAL(crlibm, test "$with_crlibm" != "no")
- AC_MSG_NOTICE([final output from top level configuration])
- AC_OUTPUT
- printf "All sub-tasks should have completed\n"
- # end of configure.ac
|