summaryrefslogtreecommitdiffstats
path: root/m4/efl_compiler_flag.m4
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2016-02-05 10:36:22 (GMT)
committerOlliver Schinagl <oliver@schinagl.nl>2016-03-10 09:37:39 (GMT)
commit660f1a8cc94f7176f49d5021e7b979030c5ac42e (patch)
tree9de61b286e8bb59dd9f74280082c3dcac14b8585 /m4/efl_compiler_flag.m4
parent398af5331bacd2e2aa4914e9926bf32d28cf8c14 (diff)
downloadengagement-660f1a8cc94f7176f49d5021e7b979030c5ac42e.zip
engagement-660f1a8cc94f7176f49d5021e7b979030c5ac42e.tar.gz
engagement-660f1a8cc94f7176f49d5021e7b979030c5ac42e.tar.bz2
Add empty eflprj generated skeleton project
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'm4/efl_compiler_flag.m4')
-rw-r--r--m4/efl_compiler_flag.m457
1 files changed, 57 insertions, 0 deletions
diff --git a/m4/efl_compiler_flag.m4 b/m4/efl_compiler_flag.m4
new file mode 100644
index 0000000..5c46f1f
--- /dev/null
+++ b/m4/efl_compiler_flag.m4
@@ -0,0 +1,57 @@
+dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
+dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro that checks if a compiler flag is supported by the compiler.
+
+dnl Usage: EFL_COMPILER_FLAG(flag)
+dnl flag is added to CFLAGS if supported.
+
+AC_DEFUN([EFL_COMPILER_FLAG],
+[
+
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${CFLAGS} $1"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $1])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+if test "x${have_flag}" = "xno" ; then
+ CFLAGS="${CFLAGS_save}"
+fi
+AC_LANG_POP([C])
+
+])
+
+dnl Macro that checks if a linker flag is supported by the compiler.
+
+dnl Usage: EFL_LINKER_FLAG(flag)
+dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
+
+AC_DEFUN([EFL_LINKER_FLAG],
+[
+
+LDFLAGS_save="${LDFLAGS}"
+LDFLAGS="${LDFLAGS} $1"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $1])
+
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+if test "x${have_flag}" = "xno" ; then
+ LDFLAGS="${LDFLAGS_save}"
+fi
+AC_LANG_POP([C])
+
+])