summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorCedric Bail <cedric.bail@samsung.com>2013-11-04 20:14:47 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-04 20:54:21 +0900
commit0d0a746f0c0d210d5be1f741f7e5b3a8148c7755 (patch)
tree8442b56e10fa5d9cfd565a2f94af8b90714e3dc7 /m4
parentd9049a11de53edd946cd482d892718226e3c8e58 (diff)
downloadelementary-0d0a746f0c0d210d5be1f741f7e5b3a8148c7755.tar.gz
elementary: automatically detect if compiler can build quicklaunch binary.
Diffstat (limited to 'm4')
-rw-r--r--m4/elm_quicklaunch.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/m4/elm_quicklaunch.m4 b/m4/elm_quicklaunch.m4
new file mode 100644
index 000000000..19fb4bed1
--- /dev/null
+++ b/m4/elm_quicklaunch.m4
@@ -0,0 +1,24 @@
+dnl Copyright (C) 2013 Cedric Bail <cedric dot bail at samsung dot com>
+dnl That code is public domain and can be freely used or copied
+
+dnl Macro that check if -pie -rdynamic can be given to ld
+
+dnl Usage: ELM_QUICKLAUNCH
+dnl add -pie -rdynamic to LDFLAGS and -fpie to CFLAGS
+
+AC_DEFUN([ELM_QUICKLAUNCH],
+[
+AC_MSG_CHECKING([If the compiler as what it takes to do quicklaunch (-pie -rdynamic)])
+old_LDFLAGS="$LDFLAGS"
+old_CFLAGS="$CFLAGS"
+
+LDFLAGS="$LDFLAGS -pie -rdynamic"
+CFLAGS="$CFLAGS -fpie"
+
+AC_LINK_IFELSE([int main(){}],
+ [AC_MSG_RESULT([yes])],
+ [LDFLAGS="$old_LDFLAGS"
+ CFLAGS="$old_CFLAGS"
+ AC_MSG_RESULT([no])
+ ])
+])