vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 35e1a4a8eeb26c0a221c6948c35f6b5e8d9abf59 parent ef8f0f4534823e97113451c4ccb29d401f8da352 Author: Christian Hesse <mail@eworm.de> Date: Sun, 24 Apr 2016 21:49:13 +0200 build: run configure before building dependencies We need some basic configuration before building dependencies. For example useful CFLAGS have to be in place to prevent linker errors. The configure script is run again later with some extra parameters. Diffstat:
| M | GNUmakefile | | | 2 | ++ |
| M | configure | | | 55 | +++++++++++++++++++++++++++++++++++++------------------ |
2 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/GNUmakefile b/GNUmakefile @@ -169,6 +169,7 @@ dependencies-local: $(MAKE) dependency/build/local local: clean + ./configure --environment-only $(MAKE) dependencies-local ./configure CFLAGS="-I$(DEPS_INC)" LDFLAGS="-L$(DEPS_LIB)" LD_LIBRARY_PATH="$(DEPS_LIB)" $(MAKE) @@ -176,6 +177,7 @@ local: clean standalone: clean [ ! -e dependency/build/local ] || $(MAKE) dependencies-clean + ./configure --environment-only $(MAKE) dependency/build/libmusl-install PATH=$(DEPS_BIN):$$PATH PKG_CONFIG_PATH= PKG_CONFIG_LIBDIR= $(MAKE) \ CC=musl-gcc dependency/build/standalone diff --git a/configure b/configure @@ -12,6 +12,7 @@ Defaults for the options are specified in brackets. Configuration: --srcdir=DIR source directory [detected] + --environment-only check environment only, no system libraries Installation directories: --prefix=PREFIX main installation prefix [/usr/local] @@ -125,6 +126,7 @@ case "$arg" in --bindir=*) BINDIR=${arg#*=} ;; --sharedir=*) SHAREDIR=${arg#*=} ;; --mandir=*) MANDIR=${arg#*=} ;; +--environment-only) environmentonly=yes ;; --enable-lua|--enable-lua=yes) lua=yes ;; --disable-lua|--enable-lua=no) lua=no ;; --enable-selinux|--enable-selinux=yes) selinux=yes ;; @@ -225,6 +227,39 @@ tryldflag LDFLAGS_AUTO -Wl,-z,now tryldflag LDFLAGS_AUTO -Wl,-z,relro #tryldflag LDFLAGS_AUTO -pie +printf "creating config.mk... " + +cmdline=$(quote "$0") +for i ; do cmdline="$cmdline $(quote "$i")" ; done + +exec 3>&1 1>config.mk + +cat << EOF +# This version of config.mk was generated by: +# $cmdline +# Any changes made here will be lost if configure is re-run +SRCDIR = $SRCDIR +PREFIX = $PREFIX +EXEC_PREFIX = $EXEC_PREFIX +BINDIR = $BINDIR +MANPREFIX = $MANDIR +SHAREPREFIX = $SHAREDIR +CC = $CC +CFLAGS = $CFLAGS +LDFLAGS = $LDFLAGS +CFLAGS_STD = $CFLAGS_STD +LDFLAGS_STD = $LDFLAGS_STD +CFLAGS_AUTO = $CFLAGS_AUTO +LDFLAGS_AUTO = $LDFLAGS_AUTO +EOF +exec 1>&3 3>&- + +printf "done\n" + +if test "$environmentonly" = "yes"; then + exit 0 +fi + have_pkgconfig=no printf "checking for pkg-config... " cmdexists pkg-config && have_pkgconfig=yes @@ -430,30 +465,14 @@ EOF fi fi -printf "creating config.mk... " +printf "completing config.mk... " cmdline=$(quote "$0") for i ; do cmdline="$cmdline $(quote "$i")" ; done -exec 3>&1 1>config.mk +exec 3>&1 1>>config.mk cat << EOF -# This version of config.mk was generated by: -# $cmdline -# Any changes made here will be lost if configure is re-run -SRCDIR = $SRCDIR -PREFIX = $PREFIX -EXEC_PREFIX = $EXEC_PREFIX -BINDIR = $BINDIR -MANPREFIX = $MANDIR -SHAREPREFIX = $SHAREDIR -CC = $CC -CFLAGS = $CFLAGS -LDFLAGS = $LDFLAGS -CFLAGS_STD = $CFLAGS_STD -LDFLAGS_STD = $LDFLAGS_STD -CFLAGS_AUTO = $CFLAGS_AUTO -LDFLAGS_AUTO = $LDFLAGS_AUTO CFLAGS_CURSES = $CFLAGS_CURSES LDFLAGS_CURSES = $LDFLAGS_CURSES CFLAGS_TERMKEY = $CFLAGS_TERMKEY