From f6457b3d5408d5afe9a4de96d7623f1aa9ec39c4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 6 Mar 2006 15:34:29 +0000 Subject: r13867: Wrap the cflags.sh hack in the build system. You can now simply set subsystem-specific compiler flags in the .mk files. (This used to be commit d512b147e8dda39016faf74a50a9d85bfc23a2eb) --- source4/script/cflags.pl | 26 ++++++++++++++++++++++++++ source4/script/cflags.sh | 28 ---------------------------- 2 files changed, 26 insertions(+), 28 deletions(-) create mode 100755 source4/script/cflags.pl delete mode 100755 source4/script/cflags.sh (limited to 'source4/script') diff --git a/source4/script/cflags.pl b/source4/script/cflags.pl new file mode 100755 index 0000000000..6dfaa83c0b --- /dev/null +++ b/source4/script/cflags.pl @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +# 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 +# jelmer@samba.org, March 2006 +use strict; +use warnings; + +my $target = shift; + +sub check_flags($) +{ + my ($name)=@_; + open (IN, "extra_cflags.txt"); + while ( =~ /^([^:]+): (.*)$/) { + next unless ($1 eq $target); + print "$2 "; + } + close(IN); + print "\n"; +} + +check_flags($target); + +exit 0; diff --git a/source4/script/cflags.sh b/source4/script/cflags.sh deleted file mode 100755 index dc7bd794c6..0000000000 --- a/source4/script/cflags.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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" ] || [ "./$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; -- cgit