summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-12-23 04:27:44 -0500
committermidipix <writeonce@midipix.org>2018-12-24 10:51:57 -0500
commit6b54affb86868ea60b49dba64fbda7e3ba084b4f (patch)
treee7c970db1919e5084f515fb3a365060ab5826129
parent1e4d9f70242986c5cf12922a5f702c937c006e79 (diff)
downloadbfirm-6b54affb86868ea60b49dba64fbda7e3ba084b4f.tar.bz2
bfirm-6b54affb86868ea60b49dba64fbda7e3ba084b4f.tar.xz
build system: target & native cchost logic: initial clean-up.
-rw-r--r--Makefile.in13
-rwxr-xr-xconfigure12
-rwxr-xr-xsysinfo/host/host.sh48
3 files changed, 13 insertions, 60 deletions
diff --git a/Makefile.in b/Makefile.in
index 888e570..e91fe9e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -258,15 +258,9 @@ dirs.tag:
mkdir -p lib
touch dirs.tag
-cchost:
- $(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(CC)" --cflags="$(CFLAGS)"
-
host.tag: Makefile
- $(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(CC)" --cflags="$(CFLAGS)"
- touch host.tag
-
-cchost-native:
- $(PROJECT_DIR)/sysinfo/host/host.sh --compiler="$(NATIVE_CC)"
+ $(CC) $(CFLAGS) -dumpmachine > host.tmp
+ mv host.tmp host.tag
version.tag: $(GIT_REFERENCE_INDEX)
$(PROJECT_DIR)/sysinfo/version.sh \
@@ -284,6 +278,7 @@ clean: clean-implib
rm -f tree.tag
rm -f dirs.tag
rm -f host.tag
+ rm -f host.tmp
rm -f version.tag
rm -f app.tag
rm -f $(SHARED_OBJS)
@@ -465,7 +460,7 @@ clean: clean-implib
@echo $(CFLAGS)
-.PHONY: cchost cchost-native package-app \
+.PHONY: package-app \
all install shared static app \
shared-objs shared-lib \
shared-soname shared-solink \
diff --git a/configure b/configure
index 0c0ac00..96ab8a7 100755
--- a/configure
+++ b/configure
@@ -382,8 +382,7 @@ native_defaults()
fi
if [ -z "$mb_native_cc_host" ]; then
- mb_native_cc_host=$($mb_project_dir/sysinfo/host/host.sh \
- --compiler=$mb_native_cc --cflags="$mb_native_cc_cflags")
+ mb_native_cc_host=$($mb_native_cc $mb_native_cc_cflags -dumpmachine)
fi
if [ -z "$mb_compiler" ]; then
@@ -595,7 +594,14 @@ config_copy()
if [ -z "$mb_cchost" ]; then
if [ "$mb_host" = 'native' ]; then
- mb_cchost=$(make -s -f $mb_pwd/Makefile.tmp cchost)
+ if [ -n "$mb_user_cc" ]; then
+ mbt_cc="$mb_user_cc"
+ else
+ mbt_cc="$mb_native_cc"
+ fi
+
+ mbt_cflags=$(make -f $mb_pwd/Makefile.tmp .display-cflags)
+ mb_cchost=$($mbt_cc $mbt_cflags -dumpmachine)
else
mb_cchost=$mb_host
fi
diff --git a/sysinfo/host/host.sh b/sysinfo/host/host.sh
deleted file mode 100755
index 686edca..0000000
--- a/sysinfo/host/host.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-error_msg()
-{
- echo $@ >&2
-}
-
-host_test()
-{
- mb_hdrdir=$(pwd)/build
- mkdir -p $mb_hdrdir || exit 2
-
- if [ -z "$mb_compiler" ]; then
- echo "config error: compiler not set."
- exit 2
- fi
-
- $mb_compiler $mb_cflags -dumpmachine && return 0
-
- error_msg "config error: invalid compiler."
- exit 2
-}
-
-# one: args
-for arg ; do
- case "$arg" in
- --help) usage
- ;;
- --compiler=*)
- mb_compiler=${arg#*=}
- ;;
- --cflags=*)
- mb_cflags=${arg#*=}
- ;;
- *)
- error_msg ${arg#}: "unsupported config argument."
- exit 2
- ;;
- esac
-done
-
-
-# two: test
-host_test
-
-
-# all done
-exit 0