summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2019-11-29 12:32:23 +1100
committerDamien Miller <djm@mindrot.org>2019-11-29 12:32:23 +1100
commitb218055e59a7c1a1816f7a55ca18e3f3c05d63a4 (patch)
tree10bc1600b9dca94071750cba7cc637158450cba7 /configure.ac
parent0dedb703adcd98d0dbc4479f5f312a2bd3df2850 (diff)
(yet) another x-platform fix for sk-dummy.so
Check for -fPIC support from compiler Compile libopenbsd-compat -fPIC Don't mix -fPIE and -fPIC when compiling
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 1749b290..c57b2401 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1725,6 +1725,18 @@ if test "x$use_pie" != "xno"; then
fi
fi
+AC_MSG_CHECKING([whether -fPIC is accepted])
+SAVED_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fPIC"
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM( [[ #include <stdlib.h> ]], [[ exit(0); ]] )],
+ [AC_MSG_RESULT([yes])
+ PICFLAG="-fPIC"; ],
+ [AC_MSG_RESULT([no])
+ PICFLAG=""; ])
+CFLAGS="$SAVED_CFLAGS"
+AC_SUBST([PICFLAG])
+
dnl Checks for library functions. Please keep in alphabetical order
AC_CHECK_FUNCS([ \
Blowfish_initstate \
@@ -5301,6 +5313,10 @@ AC_SUBST([DEPEND], [$(cat $srcdir/.depend)])
CFLAGS="${CFLAGS} ${CFLAGS_AFTER}"
LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}"
+# Make a copy of CFLAGS without -fpie
+CFLAGS_NOPIE=`echo "$CFLAGS" | sed 's/ -fPIE//'`
+AC_SUBST([CFLAGS_NOPIE])
+
AC_EXEEXT
AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \
openbsd-compat/Makefile openbsd-compat/regress/Makefile \