diff options
author | Ori Bernstein <ori@eigenstate.org> | 2015-04-13 10:46:02 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2015-04-13 10:46:02 -0700 |
commit | 06e6ee07fff5e331807d2692830e7f327fa855d9 (patch) | |
tree | 69bf26ac18cc85ac3f512e7f847bb83d22ff1aa7 | |
parent | 48d3fa27d026c5e32842adbef29d1e5ff9276fe9 (diff) | |
download | mc-06e6ee07fff5e331807d2692830e7f327fa855d9.tar.gz |
fix configure scripts, add var cache support for regen.
-rwxr-xr-x | configure | 23 | ||||
-rw-r--r-- | mbld/bldfile | 4 | ||||
-rw-r--r-- | mk/c.mk | 2 |
3 files changed, 26 insertions, 3 deletions
@@ -8,12 +8,16 @@ for i in `seq 30`; do done echo "Automake emulated successfully" -INST_ROOT='/usr/local' prefix="/usr/local" for arg in $*; do shift 1 case $arg in + "--redo" | "-r") + if [ -f ./configvar_cache ]; then + . ./configvar_cache + fi + ;; "--prefix" | "-p") prefix=shift $* ;; @@ -41,20 +45,34 @@ echo '#define Ldcmd {"ld", "-o", NULL}' >> config.h echo '#define Defaultasm Gnugas' >> config.h echo '#define Objsuffix ".o"' >> config.h echo 'export SYSCLASS=posixy' >> config.mk + +# mbld mbld/config.myr +echo "pkg config = " > mbld/config.myr +echo "const Instroot = \"$prefix\"" >> mbld/config.myr +echo "const Objsuffix = \".o\"" >> mbld/config.myr +echo "const Linkcmd = [\"ld\", \"-o\"]" >> mbld/config.myr +echo "const Arcmd = [\"ar\", \"-rcs\"]" >> mbld/config.myr +echo "const Ascmd = [\"as\", \"-g\"]" >> mbld/config.myr +echo "const Directlib = false" >> mbld/config.myr +echo "const Runtime = \"_myrrt.o\"" >> mbld/config.myr +echo "const Manpath = \"share/man/man\"" >> mbld/config.myr case $OS in *Linux*) echo '#define Symprefix ""' >> config.h echo '#define Defaultasm Gnugas' >> config.h echo 'export SYS=linux' >> config.mk + echo 'const Sys = "Linux"' >> mbld/config.myr ;; *Darwin*) echo '#define Symprefix "_"' >> config.h echo 'export SYS=osx' >> config.mk + echo 'const Sys = "OSX"' >> mbld/config.myr ;; *FreeBSD*) echo '#define Symprefix ""' >> config.h echo '#define Defaultasm Gnugas' >> config.h echo 'export SYS=freebsd' >> config.mk + echo 'const Sys = "FreeBSD"' >> mbld/config.myr ;; *) echo '' @@ -70,6 +88,7 @@ esac case $MACH in *x86_64*) echo 'export ARCH=x64' >> config.mk + echo 'const Arch = "x64"' >> mbld/config.myr ;; *) echo '' @@ -78,7 +97,9 @@ case $MACH in echo 'Cannot build' echo '********************************' esac +echo ';;' >> mbld/config.myr +echo "prefix=$prefix" > configvar_cache cat << EOF Building with: prefix=$prefix diff --git a/mbld/bldfile b/mbld/bldfile index 1577322..1986947 100644 --- a/mbld/bldfile +++ b/mbld/bldfile @@ -24,7 +24,9 @@ bin mbld = lib ../libregex:regex ;; -gen config.myr {durable} = ./configure ;; +gen config.myr {durable} = + sh -c "cd .. && ./configure --redo" +;; man = mbld.1;; @@ -117,6 +117,6 @@ uninstall: subdirs-uninstall mkdir -p $(_DEPSDIR) config.mk: configure - ./configure + ./configure --redo -include $(_DEPS) |