]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libcpp/configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / libcpp / configure.ac
index 89ac99b04bdb21f851174acb98d3b75d5e838350..b29b4d6acf1fff95517ac2e242a96577f1070dcc 100644 (file)
@@ -211,8 +211,23 @@ esac
 # 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
+
 AC_SUBST(PICFLAG)
 
 # Enable Intel CET on Intel CET enabled host if jit is enabled.