summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/cflags.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/source4/script/cflags.sh b/source4/script/cflags.sh
new file mode 100755
index 0000000000..b2ee8b3761
--- /dev/null
+++ b/source4/script/cflags.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# This is a hack to allow per target cflags. It isn't very elegant, but it
+# is the most portable idea we have come up with yet
+# tridge@samba.org, July 2005
+
+TARGET=$1
+
+check_flags()
+{
+ NAME=$1
+ (
+ while read tag flags; do
+ if [ "$tag" = "$NAME" ]; then
+ echo "$flags"
+ exit 0;
+ fi
+ done
+ ) < extra_cflags.txt
+}
+
+
+NAME=$TARGET
+while [ "$NAME" != "." ]; do
+ check_flags "$NAME"
+ NAME=`dirname $NAME`
+done
+exit 0;