summaryrefslogtreecommitdiff
path: root/common/m4/as-scrub-include.m4
diff options
context:
space:
mode:
authorJeongmo Yang <jm80.yang@samsung.com>2012-09-07 21:59:49 +0900
committerJeongmo Yang <jm80.yang@samsung.com>2012-09-07 22:00:07 +0900
commit8665a5303d5fa3daaba53cff8f0758e0fc859636 (patch)
tree1f047a01969b70f244d6c0b4381a34e5b7b64355 /common/m4/as-scrub-include.m4
parent4e9e23ca3164c203a46c205da5af49e354dbbdd2 (diff)
downloadgst-plugins-s5pc2xx-8665a5303d5fa3daaba53cff8f0758e0fc859636.tar.gz
gst-plugins-s5pc2xx-8665a5303d5fa3daaba53cff8f0758e0fc859636.tar.bz2
gst-plugins-s5pc2xx-8665a5303d5fa3daaba53cff8f0758e0fc859636.zip
Change-Id: I0736f126be88ae94efb6698b91de356c16357e52
Diffstat (limited to 'common/m4/as-scrub-include.m4')
-rwxr-xr-xcommon/m4/as-scrub-include.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/common/m4/as-scrub-include.m4 b/common/m4/as-scrub-include.m4
new file mode 100755
index 0000000..96dfb8f
--- /dev/null
+++ b/common/m4/as-scrub-include.m4
@@ -0,0 +1,36 @@
+dnl as-scrub-include.m4 0.0.4
+
+dnl autostars m4 macro for scrubbing CFLAGS of system include dirs
+dnl because gcc 3.x complains about including system including dirs
+
+dnl Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl $Id: as-scrub-include.m4,v 1.5 2004/06/12 08:19:09 thomasvs Exp $
+
+dnl This macro uses output of cpp -v and expects it to contain text that
+dnl looks a little bit like this:
+dnl #include <...> search starts here:
+dnl /usr/local/include
+dnl /usr/lib/gcc-lib/i386-redhat-linux/3.2/include
+dnl /usr/include
+dnl End of search list.
+
+dnl AS_SCRUB_INCLUDE(VAR)
+dnl example
+dnl AS_SCRUB_INCLUDE(CFLAGS)
+dnl will remove all system include dirs from the given CFLAGS
+
+AC_DEFUN([AS_SCRUB_INCLUDE],
+[
+ GIVEN_CFLAGS=$[$1]
+ INCLUDE_DIRS=`echo | cpp -v 2>&1`
+
+ dnl remove everything from this output between the "starts here" and "End of"
+ dnl line
+ INCLUDE_DIRS=`echo $INCLUDE_DIRS | sed -e 's/.*<...> search starts here://' | sed -e 's/End of search list.*//'`
+ for dir in $INCLUDE_DIRS; do
+ dnl use "" as the sed script so $dir gets expanded
+ GIVEN_CFLAGS=`echo $GIVEN_CFLAGS | sed -e "s#-I$dir ##"`
+ done
+ [$1]=$GIVEN_CFLAGS
+])