]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Feature 1527: ability to compile as a position independent executable
authorAlexander Gozman <a.gozman@securitycode.ru>
Mon, 28 Sep 2015 21:08:55 +0000 (00:08 +0300)
committerVictor Julien <victor@inliniac.net>
Thu, 8 Oct 2015 08:34:31 +0000 (10:34 +0200)
Adds corresponding configure option which enables proper CPPFLAGS
and LDFLAGS.

configure.ac

index ab2df12bc6422907d3ebe034f5b90ce42d9f3e22..97ce3ab1742ff9251b1ef369bce489bd27272a8f 100644 (file)
         enable_geoip="yes"
     fi
 
+  # Position Independent Executable
+    AC_ARG_ENABLE(pie,
+                AS_HELP_STRING([--enable-pie],[Enable compiling as a position independent executable]),
+                [ enable_pie="yes"],
+                [ enable_pie="no"])
+    if test "$enable_pie" = "yes"; then
+        CPPFLAGS="${CPPFLAGS} -fPIC"
+        LDFLAGS="${LDFLAGS} -pie"
+    fi
+
 # get cache line size
     AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no")
     if test "$HAVE_GETCONF_CMD" != "no"; then
@@ -1832,6 +1842,7 @@ Generic build parameters:
   GCC Protect enabled:                     ${enable_gccprotect}
   GCC march native enabled:                ${enable_gccmarch_native}
   GCC Profile enabled:                     ${enable_gccprofile}
+  Position Independent Executable enabled: ${enable_pie}
   CFLAGS                                   ${CFLAGS}
   PCAP_CFLAGS                              ${PCAP_CFLAGS}
   SECCFLAGS                                ${SECCFLAGS}"