]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libcody/configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / libcody / configure.ac
index 960191ecb72c4d34111535be85e6760922ec88bb..14e8dd4a2260700146d41ea0589bbd85a037f77a 100644 (file)
@@ -63,9 +63,31 @@ fi
 # Enable --enable-host-shared.
 AC_ARG_ENABLE(host-shared,
 [AS_HELP_STRING([--enable-host-shared],
-               [build host code as shared libraries])],
-[PICFLAG=-fPIC], [PICFLAG=])
+               [build host code as shared libraries])])
+AC_SUBST(enable_host_shared)
+
+# Enable --enable-host-pie.
+AC_ARG_ENABLE(host-pie,
+[AS_HELP_STRING([--enable-host-pie],
+               [build host code as PIE])])
+AC_SUBST(enable_host_pie)
+
+if test x$enable_host_shared = xyes; then
+  PICFLAG=-fPIC
+elif test x$enable_host_pie = xyes; then
+  PICFLAG=-fPIE
+else
+  PICFLAG=
+fi
+
+if test x$enable_host_pie = xyes; then
+  LD_PICFLAG=-pie
+else
+  LD_PICFLAG=
+fi
+
 AC_SUBST(PICFLAG)
+AC_SUBST(LD_PICFLAG)
 
 NMS_ENABLE_EXCEPTIONS