]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - configure.ac
configure: Implement --enable-host-pie
[thirdparty/gcc.git] / configure.ac
index 1eb689d68b1ce59f3ce8fb8c240cd9a1ff3f1be0..7fa12222c25aedc1f4afec56f260e378048cbee1 100644 (file)
@@ -1870,6 +1870,22 @@ AC_ARG_ENABLE(host-shared,
  esac])
 AC_SUBST(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)
+
 # By default, C and C++ are the only stage 1 languages.
 stage1_languages=,c,