summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Fontaine <fontaine.fabrice@gmail.com>2019-04-02 09:44:41 +0200
committerJan Kara <jack@suse.cz>2019-04-02 09:58:06 +0200
commite0690dcd450768e30859397a896f8e6d90ef40e4 (patch)
tree65f73ae2968e0bf299ff5342d878301d66051d42
parent0efb2331f1c39c9665fb6e92e83c7d080b877de1 (diff)
downloadlinuxquota-e0690dcd450768e30859397a896f8e6d90ef40e4.tar.gz
configure.ac: add --disable-pie option
PIE is not necessarily supported on all architectures, so add an option to allow the user to disable the PIE. This fixes the build on the m68k architecture: - http://autobuild.buildroot.org/results/25985bbc160e3d62b23c4c613b2a81f3711621e3 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac12
2 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 638198d..332bd67 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
ACLOCAL_AMFLAGS = -I m4
-AM_LDFLAGS = -pie
+AM_LDFLAGS = @PIE_LDFLAGS@
AM_CFLAGS = -fPIC @WARN_CFLAGS@
doc_DATA = \
diff --git a/configure.ac b/configure.ac
index 095ff86..b783568 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,6 +55,18 @@ AS_IF([test "x${prefix}" = "xNONE"], [
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/share/locale", [Locale-specific data directory])
])
+# ================
+# Check for ldflags
+# ================
+AC_ARG_ENABLE([pie],
+ [AS_HELP_STRING([--disable-pie], [Disable Position Independent Executable])],
+ [enable_pie="$enableval"],
+ [enable_pie=yes]
+)
+AS_IF([test x"$enable_pie" != "xno"], [
+ PIE_LDFLAGS="-pie"
+])
+AC_SUBST([PIE_LDFLAGS])
# ================
# Check for cflags