logo

utils-std

Collection of commonly available Unix tools git clone https://anongit.hacktivis.me/git/utils-std.git/
commit: 3bf87210e4c41efda09e5059320e5f4eed9c214d
parent 6a521e290ac2a494036db967396af3b1a2613c39
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 23 Dec 2024 22:47:41 +0100

More readable Makefile with building a lib/utils.a

Diffstat:

M.builds/freebsd.yml6++++--
M.builds/netbsd.yml6++++--
MMakefile193++++++++++++++++++++++++-------------------------------------------------------
MREADME.md2+-
Mbootstrap-regen.sh9++++++++-
Mbootstrap.sh13+++++++++----
Mconfigure14++++++++++++++
7 files changed, 99 insertions(+), 144 deletions(-)

diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml @@ -5,6 +5,8 @@ image: freebsd/latest packages: - gcc - devel/cram + - devel/gmake +# gmake pulled to get POSIX.1-2024 $^ which pdpmake also supports sources: - https://anongit.hacktivis.me/git/utils-std.git tasks: @@ -12,11 +14,11 @@ tasks: - clang: | cd utils-std CC=clang ./configure - make clean check + gmake clean check - gcc: | cd utils-std CC=gcc ./configure - make clean check + gmake clean check triggers: - action: email condition: failure diff --git a/.builds/netbsd.yml b/.builds/netbsd.yml @@ -4,7 +4,9 @@ image: netbsd/latest packages: - clang + - gmake # FIXME: cram/prysk on NetBSD, where? +# gmake pulled to get POSIX.1-2024 $^ which pdpmake also supports sources: - https://anongit.hacktivis.me/git/utils-std.git tasks: @@ -12,11 +14,11 @@ tasks: - clang: | cd utils-std CC=clang CRAM=true ./configure - make clean check + gmake clean check - gcc: | cd utils-std CC=gcc CRAM=true ./configure - make clean check + gmake clean check triggers: - action: email condition: failure diff --git a/Makefile b/Makefile @@ -17,7 +17,7 @@ bootstrap.sh: Makefile bootstrap-regen.sh .c: $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDSTATIC) + $(CC) -std=c99 $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDSTATIC) .c.o: $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} @@ -62,7 +62,7 @@ lint: $(MAN1SO) .PHONY: clean clean: - $(RM) -fr $(EXE) ${EXE:=.c.gcov} ${EXE:=.gcda} ${EXE:=.gcno} cmd/expr.tab.c $(MAN1SO) $(TEST_CMDS) $(TEST_LIBS) + $(RM) -fr $(EXE) ${EXE:=.c.gcov} ${EXE:=.gcda} ${EXE:=.gcno} cmd/expr.tab.c $(MAN1SO) $(TEST_CMDS) $(TEST_LIBS) ${LIBUTILS_O} install: all mkdir -p ${DESTDIR}${BINDIR}/ @@ -81,148 +81,73 @@ format: $(C_SOURCES) lib/sys_signame.c: lib/sys_signame.sh lib/sys_signame.sh >|lib/sys_signame.c -cmd/date: cmd/date.c lib/iso_parse.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/date.c lib/iso_parse.c $(LDFLAGS) $(LDSTATIC) +LIBUTILS_O = ${LIBUTILS_C:.c=.o} +lib/utils.a: ${LIBUTILS_O} ${LIBUTILS_H} config.mk Makefile + ${AR} rc ${ARFLAGS} lib/utils.a ${LIBUTILS_O} build/cmd/date.1: cmd/date.1.in lib/iso_parse.mdoc Makefile $(M4) cmd/date.1.in > $@ -cmd/touch: cmd/touch.c lib/iso_parse.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/touch.c lib/iso_parse.c $(LDFLAGS) $(LDSTATIC) - build/cmd/touch.1: cmd/touch.1.in lib/iso_parse.mdoc Makefile $(M4) cmd/touch.1.in > $@ -cmd/sleep: cmd/sleep.c lib/strtodur.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/sleep.c lib/strtodur.c $(LDFLAGS) $(LDSTATIC) - -cmd/timeout: cmd/timeout.c lib/strtodur.c lib/sys_signame.h lib/sys_signame.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/timeout.c lib/strtodur.c lib/sys_signame.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_mode: test-lib/t_mode.c lib/mode.c Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_mode.c lib/mode.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_strtodur: test-lib/t_strtodur.c lib/strtodur.c Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_strtodur.c lib/strtodur.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_symbolize_mode: test-lib/t_symbolize_mode.c lib/symbolize_mode.c Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_symbolize_mode.c lib/symbolize_mode.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_truncation: test-lib/t_truncation.c lib/truncation.c Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_truncation.c lib/truncation.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_sha1: test-lib/t_sha1.c lib/sha1.c lib/sha1.h lib/bytes2hex.c lib/strconv.h Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_sha1.c lib/sha1.c lib/bytes2hex.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_sha256: test-lib/t_sha256.c lib/sha256.c lib/sha256.h lib/bytes2hex.c lib/strconv.h Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_sha256.c lib/sha256.c lib/bytes2hex.c $(LDFLAGS) $(LDSTATIC) - -test-lib/t_sha512: test-lib/t_sha512.c lib/sha512.c lib/sha512.h lib/bytes2hex.c lib/strconv.h Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-lib/t_sha512.c lib/sha512.c lib/bytes2hex.c $(LDFLAGS) $(LDSTATIC) - - -cmd/df: cmd/df.c lib/humanize.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/df.c lib/humanize.c $(LDFLAGS) $(LDSTATIC) - -cmd/chmod: cmd/chmod.c lib/mode.c lib/symbolize_mode.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/chmod.c lib/mode.c lib/symbolize_mode.c $(LDFLAGS) $(LDSTATIC) - -cmd/mkdir: cmd/mkdir.c lib/mode.c lib/mode.h lib/lib_mkdir.c lib/lib_mkdir.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/mkdir.c lib/mode.c lib/lib_mkdir.c $(LDFLAGS) $(LDSTATIC) - -cmd/mknod: cmd/mknod.c lib/mode.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/mknod.c lib/mode.c $(LDFLAGS) $(LDSTATIC) - -cmd/mkfifo: cmd/mkfifo.c lib/mode.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/mkfifo.c lib/mode.c $(LDFLAGS) $(LDSTATIC) - -cmd/seq: cmd/seq.c Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/seq.c -lm $(LDFLAGS) $(LDSTATIC) - -cmd/rm: cmd/rm.c lib/consent.c lib/consent.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/rm.c lib/consent.c $(LDFLAGS) $(LDSTATIC) - -cmd/truncate: cmd/truncate.c lib/truncation.c lib/truncation.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/truncate.c lib/truncation.c $(LDFLAGS) $(LDSTATIC) - -cmd/head: cmd/head.c lib/truncation.c lib/truncation.h lib/fs.c lib/fs.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/head.c lib/truncation.c lib/fs.c $(LDFLAGS) $(LDSTATIC) - -cmd/split: cmd/split.c lib/truncation.c lib/truncation.h lib/fs.c lib/fs.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/split.c lib/truncation.c lib/fs.c $(LDFLAGS) $(LDSTATIC) - -cmd/tr: cmd/tr.c lib/tr_str.c lib/tr_str.h lib/err.c lib/err.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/tr.c lib/tr_str.c lib/err.c $(LDFLAGS) $(LDSTATIC) - -cmd/chown: cmd/chown.c lib/fs.c lib/fs.h lib/user_group_parse.c lib/user_group_parse.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/chown.c lib/fs.c lib/user_group_parse.c $(LDFLAGS) $(LDSTATIC) - -cmd/realpath: cmd/realpath.c lib/fs.c lib/offline_realpath.c lib/fs.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/realpath.c lib/fs.c lib/offline_realpath.c $(LDFLAGS) $(LDSTATIC) - cmd/expr.tab.c: cmd/expr.y Makefile $(YACC) -b cmd/expr cmd/expr.y -cmd/expr: cmd/expr.tab.c lib/err.c lib/err.h Makefile - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -D_POSIX_C_SOURCE=200809L -o $@ cmd/expr.tab.c lib/err.c $(LDFLAGS) $(LDSTATIC) - -cmd/cat: cmd/cat.c lib/fs.c lib/fs.h Makefile config.mk - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/cat.c lib/fs.c $(LDFLAGS) $(LDSTATIC) +# Needs -D_POSIX_C_SOURCE=200809L due to OpenBSD yacc +cmd/expr: cmd/expr.tab.c lib/utils.a + $(RM) -f cmd/expr.tab.c.gcov cmd/expr.tab.o.gcda cmd/expr.tab.o.gcno + $(CC) -std=c99 $(CFLAGS) -D_POSIX_C_SOURCE=200809L -o cmd/expr cmd/expr.tab.c lib/utils.a $(LDFLAGS) $(LDSTATIC) -cmd/install: cmd/install.c lib/mode.c lib/user_group_parse.c lib/user_group_parse.h lib/fs.c lib/fs.h lib/lib_mkdir.c lib/lib_mkdir.h Makefile config.mk - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/install.c lib/mode.c lib/user_group_parse.c lib/fs.c lib/lib_mkdir.c $(LDFLAGS) $(LDSTATIC) - -cmd/mv: cmd/mv.c lib/consent.c lib/consent.h lib/fs.c lib/fs.h Makefile config.mk - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/mv.c lib/consent.c lib/fs.c $(LDFLAGS) $(LDSTATIC) - -cmd/sha1sum: cmd/sha1sum.c lib/sha1.c lib/sha1.h lib/bytes2hex.c lib/strconv.h Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/sha1sum.c lib/sha1.c lib/bytes2hex.c $(LDFLAGS) $(LDSTATIC) - -cmd/sha256sum: cmd/sha256sum.c lib/sha256.c lib/sha256.h lib/bytes2hex.c lib/strconv.h Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/sha256sum.c lib/sha256.c lib/bytes2hex.c $(LDFLAGS) $(LDSTATIC) - -cmd/sha512sum: cmd/sha512sum.c lib/sha512.c lib/sha512.h lib/bytes2hex.c lib/strconv.h Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ cmd/sha512sum.c lib/sha512.c lib/bytes2hex.c $(LDFLAGS) $(LDSTATIC) - -test-cmd/pathchk-getlimits: test-cmd/pathchk-getlimits.c Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-cmd/pathchk-getlimits.c $(LDFLAGS) $(LDSTATIC) - -test-cmd/getpriority: test-cmd/getpriority.c Makefile - $(CC) -std=c99 $(CFLAGS) -o $@ test-cmd/getpriority.c $(LDFLAGS) $(LDSTATIC) - -cmd/printf: cmd/printf.c lib/err.c lib/err.h Makefile config.mk - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o cmd/printf cmd/printf.c lib/err.c $(LDFLAGS) $(LDSTATIC) - -cmd/paste: cmd/paste.c lib/err.c lib/err.h Makefile config.mk - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o cmd/paste cmd/paste.c lib/err.c $(LDFLAGS) $(LDSTATIC) - -cmd/join: cmd/join.c lib/err.c lib/err.h Makefile config.mk +# Needs -lm +cmd/seq: cmd/seq.c Makefile $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o cmd/join cmd/join.c lib/err.c $(LDFLAGS) $(LDSTATIC) + $(CC) -std=c99 $(CFLAGS) -o $@ cmd/seq.c -lm $(LDFLAGS) $(LDSTATIC) -cmd/whoami: cmd/whoami.c lib/err.c lib/err.h Makefile config.mk - $(RM) -f ${<:=.gcov} ${@:=.gcda} ${@:=.gcno} - $(CC) -std=c99 $(CFLAGS) -o cmd/whoami cmd/whoami.c lib/err.c $(LDFLAGS) $(LDSTATIC) +# ./bootstrap.sh binaries should be kept simple +lib/fs.o: lib/fs.c lib/fs.h +lib/err.o: lib/err.c lib/err.h +lib/consent.o: lib/consent.c lib/consent.h +lib/tr_str.o: lib/tr_str.c lib/tr_str.h +cmd/cat: cmd/cat.c lib/fs.o +cmd/printf: cmd/printf.c lib/err.o +cmd/rm: cmd/rm.c lib/consent.o +cmd/tr: cmd/tr.c lib/tr_str.o lib/err.o + +cmd/chmod: cmd/chmod.c lib/utils.a +cmd/chown: cmd/chown.c lib/utils.a +cmd/date: cmd/date.c lib/utils.a +cmd/df: cmd/df.c lib/utils.a +cmd/head: cmd/head.c lib/utils.a +cmd/install: cmd/install.c lib/utils.a +cmd/join: cmd/join.c lib/utils.a +cmd/mkdir: cmd/mkdir.c lib/utils.a +cmd/mkfifo: cmd/mkfifo.c lib/utils.a +cmd/mknod: cmd/mknod.c lib/utils.a +cmd/mv: cmd/mv.c lib/utils.a +cmd/paste: cmd/paste.c lib/utils.a +cmd/realpath: cmd/realpath.c lib/utils.a +cmd/seq: cmd/seq.c lib/utils.a +cmd/sha1sum: cmd/sha1sum.c lib/utils.a +cmd/sha256sum: cmd/sha256sum.c lib/utils.a +cmd/sha512sum: cmd/sha512sum.c lib/utils.a +cmd/sleep: cmd/sleep.c lib/utils.a +cmd/split: cmd/split.c lib/utils.a +cmd/timeout: cmd/timeout.c lib/utils.a +cmd/touch: cmd/touch.c lib/utils.a +cmd/truncate: cmd/truncate.c lib/utils.a +cmd/whoami: cmd/whoami.c lib/utils.a + +lib/mode.o: lib/mode.c lib/mode.h +lib/sha1.o: lib/sha1.c lib/sha1.h +lib/sha256.o: lib/sha256.c lib/sha256.h +lib/sha512.o: lib/sha512.c lib/sha512.h +lib/bytes2hex.o: lib/bytes2hex.c lib/strconv.h + +test-lib/t_mode: test-lib/t_mode.c lib/mode.o +test-lib/t_strtodur: test-lib/t_strtodur.c lib/strtodur.o +test-lib/t_symbolize_mode: test-lib/t_symbolize_mode.c lib/symbolize_mode.o +test-lib/t_truncation: test-lib/t_truncation.c lib/truncation.o +test-lib/t_sha1: test-lib/t_sha1.c lib/sha1.c lib/bytes2hex.o +test-lib/t_sha256: test-lib/t_sha256.c lib/sha256.c lib/bytes2hex.o +test-lib/t_sha512: test-lib/t_sha512.c lib/sha512.c lib/bytes2hex.o diff --git a/README.md b/README.md @@ -14,7 +14,7 @@ Developed on Linux+musl, automatically tested on FreeBSD and NetBSD thanks to [S - C99 Compiler + POSIX.1-2017 C Library (POSIX.1-2024 recommended) - POSIX yacc(1) implementation - POSIX Shell -- POSIX.1-2017 Make +- POSIX.1-2024 Make - (optional, test) [prysk](https://www.prysk.net/) (or [cram](https://bitheap.org/cram/) but it got abandoned) - (optional, lint) mandoc: <https://mdocml.bsd.lv/> For linting the manual pages diff --git a/bootstrap-regen.sh b/bootstrap-regen.sh @@ -20,13 +20,20 @@ $MAKE clean # SPDX-License-Identifier: MPL-2.0 # Generated using ./bootstrap-regen.sh : ${CC:=cc} +: ${AR:=ar} : ${YACC:=yacc} : ${CFLAGS:=-Os -Wall} set -ex ' - $MAKE -n CC='$$CC' CFLAGS='$$CFLAGS' LDFLAGS='$$LDFLAGS' LDSTATIC='$$LDSTATIC' YACC='$$YACC' $targets | grep -vF -e .c.gcov -e 'make[1]:' + $MAKE -n \ + CC='$$CC' CFLAGS='$$CFLAGS' \ + AR='$$AR' ARFLAGS='$$ARFLAGS' \ + LDFLAGS='$$LDFLAGS' LDSTATIC='$$LDSTATIC' \ + YACC='$$YACC' \ + $targets \ + | grep -vF -e .c.gcov -e 'make[1]:' printf " ./cmd/printf '\\nDone, you should now be able to run PATH=cmd/:\$PATH ./configure && make clean && make\\n' diff --git a/bootstrap.sh b/bootstrap.sh @@ -3,17 +3,22 @@ # SPDX-License-Identifier: MPL-2.0 # Generated using ./bootstrap-regen.sh : ${CC:=cc} +: ${AR:=ar} : ${YACC:=yacc} : ${CFLAGS:=-Os -Wall} set -ex -$CC -std=c99 $CFLAGS -o cmd/cat cmd/cat.c lib/fs.c $LDFLAGS $LDSTATIC +$CC -std=c99 $CFLAGS -c -o lib/fs.o lib/fs.c +$CC -std=c99 $CFLAGS -o cmd/cat cmd/cat.c lib/fs.o $LDFLAGS $LDSTATIC $CC -std=c99 $CFLAGS -o cmd/echo cmd/echo.c $LDFLAGS $LDSTATIC -$CC -std=c99 $CFLAGS -o cmd/printf cmd/printf.c lib/err.c $LDFLAGS $LDSTATIC -$CC -std=c99 $CFLAGS -o cmd/rm cmd/rm.c lib/consent.c $LDFLAGS $LDSTATIC +$CC -std=c99 $CFLAGS -c -o lib/err.o lib/err.c +$CC -std=c99 $CFLAGS -o cmd/printf cmd/printf.c lib/err.o $LDFLAGS $LDSTATIC +$CC -std=c99 $CFLAGS -c -o lib/consent.o lib/consent.c +$CC -std=c99 $CFLAGS -o cmd/rm cmd/rm.c lib/consent.o $LDFLAGS $LDSTATIC $CC -std=c99 $CFLAGS -o cmd/test cmd/test.c $LDFLAGS $LDSTATIC -$CC -std=c99 $CFLAGS -o cmd/tr cmd/tr.c lib/tr_str.c lib/err.c $LDFLAGS $LDSTATIC +$CC -std=c99 $CFLAGS -c -o lib/tr_str.o lib/tr_str.c +$CC -std=c99 $CFLAGS -o cmd/tr cmd/tr.c lib/tr_str.o lib/err.o $LDFLAGS $LDSTATIC ./cmd/printf ' Done, you should now be able to run PATH=cmd/:$PATH ./configure && make clean && make diff --git a/configure b/configure @@ -18,6 +18,7 @@ Variables: CROSS_COMPILE=TRIPLE MSGFMT=BIN + AR=BIN CC=BIN YACC=BIN MAKE=BIN @@ -28,6 +29,7 @@ Variables: REUSE=BIN CFLAGS=OPTIONS + ARFLAGS=OPTIONS LDFLAGS=OPTIONS LDSTATIC=OPTIONS EXTRA_CFLAGS=OPTIONS @@ -69,6 +71,14 @@ gen_targets() { printf 'MAN1 = ${MAN1SO} ' printf '%s\n ' cmd/*.1 | grep -v -F ${target_filter} | tr -d '\n' echo + + printf 'LIBUTILS_C = ' + echo lib/*.c + echo + + printf 'LIBUTILS_H = ' + echo lib/*.h + echo } check_cmd() { @@ -120,6 +130,7 @@ PREFIX="${PREFIX:-/usr/local}" MSGFMT="${MSGFMT:-msgfmt}" CC="${CC:-${CROSS_COMPILE}cc}" +AR="${AR:-${CROSS_COMPILE}ar}" YACC="${YACC:-yacc}" MAKE="${MAKE:-make}" GCOV="${GCOV:-${CROSS_COMPILE}gcov}" @@ -169,6 +180,7 @@ CFLAGS="${CFLAGS} -DDEBUG -UNDEBUG" ## System checks # commands check_cmd CC "$CC" || exit 1 +check_cmd AR "$AR" || exit 1 check_cmd YACC "$YACC" || exit 1 check_cmd MAKE "$MAKE" || exit 1 check_cmd M4 "$M4" || exit 1 @@ -257,6 +269,7 @@ PERLDIR = ${PERLDIR} MANDIR = ${MANDIR} CC = ${CC} +AR = ${AR} YACC = ${YACC} MAKE = ${MAKE} M4 = ${M4} @@ -268,6 +281,7 @@ CRAM = ${CRAM} REUSE = ${REUSE} CFLAGS = ${CFLAGS} +ARFLAGS = ${ARFLAGS} LDFLAGS = ${LDFLAGS} LDSTATIC = ${LDSTATIC} EOF