[build] Fix some build oddness related to cross-compilation.

The Autoconf macro doesn't properly set the required variables properly
when the binaries aren't being cross-compiled. This results in the local
binaries like bin2c and ptime disregarding the compiler flags passed in
to configure scripts.
pull/1179/head
Suresh Sundriyal 11 months ago
parent 0361ed5700
commit 7a68f4d833

@ -306,9 +306,9 @@ AS_IF([test $? -eq 0],
AM_CONDITIONAL(USE_INCLUDED_YAJL, test $HAVE_LOCAL_YAJL -eq 0)
AM_CONDITIONAL(HAVE_LIBCURL, test x"$LIBCURL" != x"")
AM_CONDITIONAL([DISABLE_DOCUMENTATION], [ test x"$cross_compiling" != x"no" ])
AM_CONDITIONAL([CROSS_COMPILING], [ test x"$cross_compiling" != x"no" ])
USER_CXXFLAGS="${CXXFLAGS}"
AS_VAR_SET(USER_CXXFLAGS, ["$CXXFLAGS"])
AC_SUBST(USER_CXXFLAGS)
AC_CONFIG_HEADERS([src/config.h])

@ -498,8 +498,13 @@ lnav_test_SOURCES = \
test_override.c \
$(PLUGIN_SRCS)
if CROSS_COMPILING
ptimec$(BUILD_EXEEXT): ptimec.c
$(AM_V_CC) $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -g3 -o $@ $?
else
ptimec$(BUILD_EXEEXT): ptimec.c
$(AM_V_CC) $(CC) $(CPPFLAGS) $(LDFLAGS) -g3 -o $@ $?
endif
if HAVE_RE2C
RE2C_FILES = data_scanner_re.cc log_level_re.cc
@ -536,7 +541,7 @@ uncrusty:
(cd $(srcdir) && uncrustify -c ../lnav.cfg --replace $(SOURCES) \
$(HEADERS))
if !DISABLE_DOCUMENTATION
if !CROSS_COMPILING
all-local: $(LNAV_BUILT_FILES) lnav
if test -w $(srcdir)/internals; then \
env DUMP_INTERNALS_DIR=$(srcdir)/internals DUMP_CRASH=1 ./lnav Makefile; \

@ -1,8 +1,13 @@
all-local: bin2c$(BUILD_EXEEXT)
if CROSS_COMPILING
bin2c$(BUILD_EXEEXT): bin2c.c
$(AM_V_CC) $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -g3 -o $@ $? -lz
else
bin2c: bin2c.c
$(AM_V_CC) $(CC) $(CPPFLAGS) $(LDFLAGS) -g3 -o $@ $? -lz
endif
EXTRA_DIST = \
bin2c.c

Loading…
Cancel
Save