summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2013-02-05 16:00:30 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2013-02-05 16:36:53 +0100
commitb95e3bb72259bda5443e747532e6a9a381a9a9b2 (patch)
treef968ff8e7fcf705d5e2f2b62fe778d5b40a62b52
parentafb0082df327abe5c48838bdcec26e41923da1db (diff)
downloadptxdist-b95e3bb72259bda5443e747532e6a9a381a9a9b2.tar.gz
ptxdist-b95e3bb72259bda5443e747532e6a9a381a9a9b2.tar.xz
scripts/wrapper: add host-wrapper, but do not enable yet
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
-rwxr-xr-xscripts/wrapper/host-cpp-wrapper14
-rwxr-xr-xscripts/wrapper/host-g++-wrapper12
-rwxr-xr-xscripts/wrapper/host-gcc-wrapper12
-rw-r--r--scripts/wrapper/libwrapper.sh27
4 files changed, 62 insertions, 3 deletions
diff --git a/scripts/wrapper/host-cpp-wrapper b/scripts/wrapper/host-cpp-wrapper
new file mode 100755
index 000000000..b3a1afe4a
--- /dev/null
+++ b/scripts/wrapper/host-cpp-wrapper
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+. "$(dirname "$(readlink -f "$0")")/libwrapper.sh" || exit
+
+HOST=true
+
+cc_check_args "${@}"
+
+LINKING=false
+unset PTXDIST_CCACHE
+
+cpp_add_host_extra
+
+wrapper_exec "$@"
diff --git a/scripts/wrapper/host-g++-wrapper b/scripts/wrapper/host-g++-wrapper
new file mode 100755
index 000000000..68966133a
--- /dev/null
+++ b/scripts/wrapper/host-g++-wrapper
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+. "$(dirname "$(readlink -f "$0")")/libwrapper.sh" || exit
+
+HOST=true
+
+cc_check_args "${@}"
+
+cc_add_host_ld_args
+cxx_add_host_extra
+
+wrapper_exec "$@"
diff --git a/scripts/wrapper/host-gcc-wrapper b/scripts/wrapper/host-gcc-wrapper
new file mode 100755
index 000000000..07c00c473
--- /dev/null
+++ b/scripts/wrapper/host-gcc-wrapper
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+. "$(dirname "$(readlink -f "$0")")/libwrapper.sh" || exit
+
+HOST=true
+
+cc_check_args "${@}"
+
+cc_add_host_ld_args
+cc_add_host_extra
+
+wrapper_exec "$@"
diff --git a/scripts/wrapper/libwrapper.sh b/scripts/wrapper/libwrapper.sh
index 6b2e204ba..055e9a88d 100644
--- a/scripts/wrapper/libwrapper.sh
+++ b/scripts/wrapper/libwrapper.sh
@@ -3,6 +3,7 @@
COMPILING=false
FORTIFY=true
FPIE=true
+HOST=false
LINKING=true
OPTIMIZE=false
PIE=true
@@ -50,9 +51,11 @@ cc_check_args() {
OPTIMIZE=true
;;
-I/usr/include | -L/usr/lib | -L/lib)
- echo "wrapper: Bad search path in:" >&2
- echo "${0##*/} $*" >&2
- exit 1
+ if ! ${HOST}; then
+ echo "wrapper: Bad search path in:" >&2
+ echo "${0##*/} $*" >&2
+ exit 1
+ fi
;;
-)
COMPILING=true
@@ -121,6 +124,12 @@ cc_add_target_ld_args() {
fi
}
+cc_add_host_ld_args() {
+ if ${LINKING}; then
+ add_late_arg ${PTXDIST_HOST_LDFLAGS}
+ fi
+}
+
cc_add_fortify() {
# fortify only works when optimizing is enabled. The warning
# generated when combining -D_FORTIFY_SOURCE with -O0 can confuse
@@ -160,3 +169,15 @@ cxx_add_target_extra() {
cpp_add_target_extra
add_opt_arg TARGET_EXTRA_CXXFLAGS ${PTXCONF_TARGET_EXTRA_CXXFLAGS}
}
+
+cpp_add_host_extra() {
+ add_arg ${PTXDIST_HOST_CPPFLAGS}
+}
+
+cc_add_host_extra() {
+ cpp_add_host_extra
+}
+
+cxx_add_host_extra() {
+ cpp_add_host_extra
+}