commit 71066d24c1aed0542635f29f5c1e82e092edd4a9 from: Omar Polo via: omar-polo date: Fri Nov 26 18:18:04 2021 UTC provide HOSTCC and HOSTCFLAGS variables to simplify cross-compilation pagebundler is a helper that needs to be built with the *host* compiler because it's used to generate some sources. In normal situations, HOSTCC and HOSTCFLAGS are just ${CC} and ${CFLAGS}, but folks that cross-compile can specify there the host compiler and flags to successfully build telescope. The idea is largely based on what gforth does: it re-uses ${CFLAGS} for the host compiler though, while I'm adding an extra variable for that. commit - de04b1788232dab669d2026c101a686199a97c7c commit + 71066d24c1aed0542635f29f5c1e82e092edd4a9 blob - ca129b383abc105a42724fdc1cfd3cc6950a9a1f blob + 061cfe1c6cbf013d853e929d5c55e2c5626ebd37 --- Makefile.am +++ Makefile.am @@ -52,6 +52,9 @@ telescope_SOURCES += phos/phos.h \ noinst_PROGRAMS = pagebundler pagebundler_SOURCES = pagebundler.c +pagebundler$(EXEEXT): pagebundler.c + $(HOSTCC) $(HOSTCFLAGS) -o $@ pagebundler.c + BUILT_SOURCES = cmd.gen.c compile_flags.txt emoji-matcher.c pages.c CLEANFILES = cmd.gen.c compile_flags.txt emoji-matcher.c pages.c \ blob - 997ba466e163999248a18dccb19d864f60c25e63 blob + 55f0eb68cedf4e00483e80af7f0f17ee8748f0fe --- configure.ac +++ configure.ac @@ -8,6 +8,12 @@ AC_PROG_YACC PKG_PROG_PKG_CONFIG +AC_ARG_VAR(HOSTCC, [The C compiler on the host.]) +AC_ARG_VAR(HOSTCFLAGS, [CFLAGS for the host compiler]) + +test -z "${HOSTCC}" && HOSTCC='$(CC)' +test -z "${HOSTCFLAGS}" && HOSTCFLAGS='$(CFLAGS)' + AC_ARG_WITH([libimsg], AS_HELP_STRING([--with-libimsg], [Build with imsg-compat library (default: disabled)]))