From fd4fcc7a6cc0f242a6c1b08248fde214652015b5 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Fri, 19 Jul 2019 16:02:41 +0000 Subject: Simplify cross-build support some more --- Makefile | 7 +++---- configure | 8 +++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 497db20..9c69d30 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,6 @@ CPPFLAGS_ALL := $(CPPFLAGS_AUTO) $(CPPFLAGS) CFLAGS_ALL := $(CFLAGS_AUTO) $(CFLAGS) LDFLAGS_ALL := $(LDFLAGS_AUTO) $(LDFLAGS) LDLIBS_ALL := $(LDLIBS_AUTO) $(LDLIBS) -REALCC = $(CROSS_COMPILE)$(CC) AR := $(CROSS_COMPILE)ar RANLIB := $(CROSS_COMPILE)ranlib STRIP := $(CROSS_COMPILE)strip @@ -119,17 +118,17 @@ $(DESTDIR)$(includedir)/$(package)/%.h: src/include/$(package)/%.h exec $(INSTALL) -D -m 644 $< $@ %.o: %.c - exec $(REALCC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) -c -o $@ $< + exec $(CC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) -c -o $@ $< %.lo: %.c - exec $(REALCC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) $(CFLAGS_SHARED) -c -o $@ $< + exec $(CC) $(CPPFLAGS_ALL) $(CFLAGS_ALL) $(CFLAGS_SHARED) -c -o $@ $< libskarnet.a.xyzzy: $(ALL_SOBJS) exec $(AR) rc $@ $^ exec $(RANLIB) $@ libskarnet.so.xyzzy: $(ALL_DOBJS) - exec $(REALCC) -o $@ $(CFLAGS_ALL) $(CFLAGS_SHARED) $(LDFLAGS_ALL) $(LDFLAGS_SHARED) -Wl,-soname,libskarnet.so.$(version_M) $^ $(SOCKET_LIB) $(SPAWN_LIB) $(SYSCLOCK_LIB) $(TAINNOW_LIB) $(TIMER_LIB) $(UTIL_LIB) + exec $(CC) -o $@ $(CFLAGS_ALL) $(CFLAGS_SHARED) $(LDFLAGS_ALL) $(LDFLAGS_SHARED) -Wl,-soname,libskarnet.so.$(version_M) $^ $(SOCKET_LIB) $(SPAWN_LIB) $(SYSCLOCK_LIB) $(TAINNOW_LIB) $(TIMER_LIB) $(UTIL_LIB) .PHONY: it all clean distclean tgz strip install install-data install-sysdeps install-dynlib install-lib install-include diff --git a/configure b/configure index d4bcbb4..2248242 100755 --- a/configure +++ b/configure @@ -363,10 +363,9 @@ trycc ${CC} if test -n "$cross" && test -n "$CC_AUTO" ; then b=`basename "$CC"` if test "${b}" = "${b##$cross}" ; then - echo "Warning: compiler $CC is declared as a cross-compiler for target $target but does not start with prefix $cross" 1>&2 + echo "$0: warning: compiler $CC is declared as a cross-compiler for target $target but does not start with prefix $cross" 1>&2 fi fi -trycc ${cross}${CC} trycc ${cross}gcc trycc ${cross}clang trycc ${cross}cc @@ -434,6 +433,9 @@ if test -n "$sysdeps" ; then timer_lib=$(cat $sysdeps/timer.lib) util_lib=$(cat $sysdeps/util.lib) else + if test -n "$cross" ; then + echo "$0: warning: possible cross-build attempt with a native compiler" 1>&2 + fi sysdeps=sysdeps.cfg mkdir -p $sysdeps echo "$target" > $sysdeps/target @@ -594,7 +596,7 @@ SYSCLOCK_LIB := ${sysclock_lib} TAINNOW_LIB := ${tainnow_lib} TIMER_LIB := ${timer_lib} UTIL_LIB := ${util_lib} -CC := ${CC_AUTO##${cross}} +CC := ${CC_AUTO} CPPFLAGS_AUTO := $CPPFLAGS_AUTO CPPFLAGS := $CPPFLAGS $CPPFLAGS_POST CFLAGS_AUTO := $CFLAGS_AUTO -- cgit v1.2.3