summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-10-28 01:20:48 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:23 -0500
commitcdbf52235aa596f3dd04de6f35631eeb1219ea45 (patch)
tree800baa74bfede61525664ae053829b8065d0246a
parent92e39b26fa901193ca392b332401debe026ef5c1 (diff)
downloadperk-cdbf52235aa596f3dd04de6f35631eeb1219ea45.tar.bz2
perk-cdbf52235aa596f3dd04de6f35631eeb1219ea45.tar.xz
build system: add cparser support.
-rwxr-xr-xconfigure7
-rw-r--r--sysinfo/toolchain/cparser.mk34
2 files changed, 41 insertions, 0 deletions
diff --git a/configure b/configure
index 4d99b9b..59a7640 100755
--- a/configure
+++ b/configure
@@ -183,6 +183,9 @@ native_defaults()
[ -z "$mb_native_cc" ] && mb_native_cc='clang'
$mb_native_cc -dM -E - < /dev/null > /dev/null 2>/dev/null || mb_native_cc=
+ [ -z "$mb_native_cc" ] && mb_native_cc='cparser'
+ $mb_native_cc -dM -E - < /dev/null > /dev/null 2>/dev/null || mb_native_cc=
+
if [ x"$mb_native_cc" = x ]; then
error_msg "config error: could not find a working native compiler."
exit 2
@@ -197,6 +200,10 @@ native_defaults()
fi
if [ x"$mb_toolchain" = x ]; then
+ $mb_native_cc -dM -E - < /dev/null | grep '__CPARSER__' > /dev/null && mb_toolchain='cparser'
+ fi
+
+ if [ x"$mb_toolchain" = x ]; then
error_msg "config error: could not identify the native compiler."
exit 2
fi
diff --git a/sysinfo/toolchain/cparser.mk b/sysinfo/toolchain/cparser.mk
new file mode 100644
index 0000000..c55dbe0
--- /dev/null
+++ b/sysinfo/toolchain/cparser.mk
@@ -0,0 +1,34 @@
+ifeq ($(CROSS_COMPILE)x,x)
+ CROSS_HOST =
+ CROSS_HOST_SPEC =
+else
+ CROSS_HOST = $(HOST)
+ CROSS_HOST_SPEC = --target=$(HOST)
+endif
+
+
+CC = $(NATIVE_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp
+CPP = $(NATIVE_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp -E
+CXX = $(NATIVE_CC) $(CROSS_HOST_SPEC) -Wno-experimental -integrated-cpp -std=c++
+
+
+AS = $(CROSS_COMPILE)as
+AR = $(CROSS_COMPILE)ar
+LD = $(CROSS_COMPILE)ld
+NM = $(CROSS_COMPILE)nm
+OBJDUMP = $(CROSS_COMPILE)objdump
+RANLIB = $(CROSS_COMPILE)ranlib
+SIZE = $(CROSS_COMPILE)size
+STRIP = $(CROSS_COMPILE)strip
+STRINGS = $(CROSS_COMPILE)strings
+
+
+ADDR2LINE = $(CROSS_COMPILE)addr2line
+COV = $(CROSS_COMPILE)gcov
+CXXFILT = $(CROSS_COMPILE)c++filt
+ELFEDIT = $(CROSS_COMPILE)elfedit
+OBJCOPY = $(CROSS_COMPILE)objcopy
+READELF = $(CROSS_COMPILE)readelf
+
+
+CFLAGS_PIC = -fPIC