diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-06-16 00:49:28 +0000 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-06-16 00:49:28 +0000 |
commit | 70ee40161f6faa1faa8670ca2fd7b517c4de0598 (patch) | |
tree | bae5358184e95d7436b480c9a6dbf15a3299bd05 /acinclude.m4 | |
parent | a39a1b4c3e075e80d05caad61646a352693f5455 (diff) |
Enable usage of PIE by default
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index e12fd01a..6242e390 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -45,13 +45,18 @@ AC_DEFUN([AC_INIT_BLUEZ], [ ]) AC_DEFUN([AC_ARG_BLUEZ], [ - fortify_enable=yes debug_enable=no + fortify_enable=yes + pie_enable=yes AC_ARG_ENABLE(fortify, AC_HELP_STRING([--disable-fortify], [disable compile time buffer checks]), [ fortify_enable=${enableval} ]) + AC_ARG_ENABLE(pie, AC_HELP_STRING([--disable-pie], [enable position independent executables flag]), [ + pie_enable=${enableval} + ]) + AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable compiling with debugging information]), [ debug_enable=${enableval} ]) @@ -60,6 +65,11 @@ AC_DEFUN([AC_ARG_BLUEZ], [ CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" fi + if (test "${pie_enable}" = "yes" && test "${ac_cv_prog_cc_pie}" = "yes"); then + CFLAGS="$CFLAGS -fPIC" + LDFLAGS="$LDFLAGS -pie" + fi + if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then CFLAGS="$CFLAGS -g -O0" fi |