diff options
| -rw-r--r-- | acinclude.m4 | 12 | ||||
| -rw-r--r-- | configure.in | 1 | 
2 files changed, 12 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 diff --git a/configure.in b/configure.in index b086dbdf..2e6c5510 100644 --- a/configure.in +++ b/configure.in @@ -11,6 +11,7 @@ AC_INIT_BLUEZ  AC_LANG_C  AC_PROG_CC +AC_PROG_CC_PIE  AC_PROG_INSTALL  m4_define([_LT_AC_TAGCONFIG], []) | 
