diff options
author | Damien Miller <djm@mindrot.org> | 2019-11-29 12:32:23 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-11-29 12:32:23 +1100 |
commit | b218055e59a7c1a1816f7a55ca18e3f3c05d63a4 (patch) | |
tree | 10bc1600b9dca94071750cba7cc637158450cba7 /configure.ac | |
parent | 0dedb703adcd98d0dbc4479f5f312a2bd3df2850 (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.ac | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 1749b2903..c57b2401f 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1725,6 +1725,18 @@ if test "x$use_pie" != "xno"; then | |||
1725 | fi | 1725 | fi |
1726 | fi | 1726 | fi |
1727 | 1727 | ||
1728 | AC_MSG_CHECKING([whether -fPIC is accepted]) | ||
1729 | SAVED_CFLAGS="$CFLAGS" | ||
1730 | CFLAGS="$CFLAGS -fPIC" | ||
1731 | AC_COMPILE_IFELSE( | ||
1732 | [AC_LANG_PROGRAM( [[ #include <stdlib.h> ]], [[ exit(0); ]] )], | ||
1733 | [AC_MSG_RESULT([yes]) | ||
1734 | PICFLAG="-fPIC"; ], | ||
1735 | [AC_MSG_RESULT([no]) | ||
1736 | PICFLAG=""; ]) | ||
1737 | CFLAGS="$SAVED_CFLAGS" | ||
1738 | AC_SUBST([PICFLAG]) | ||
1739 | |||
1728 | dnl Checks for library functions. Please keep in alphabetical order | 1740 | dnl Checks for library functions. Please keep in alphabetical order |
1729 | AC_CHECK_FUNCS([ \ | 1741 | AC_CHECK_FUNCS([ \ |
1730 | Blowfish_initstate \ | 1742 | Blowfish_initstate \ |
@@ -5301,6 +5313,10 @@ AC_SUBST([DEPEND], [$(cat $srcdir/.depend)]) | |||
5301 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" | 5313 | CFLAGS="${CFLAGS} ${CFLAGS_AFTER}" |
5302 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" | 5314 | LDFLAGS="${LDFLAGS} ${LDFLAGS_AFTER}" |
5303 | 5315 | ||
5316 | # Make a copy of CFLAGS without -fpie | ||
5317 | CFLAGS_NOPIE=`echo "$CFLAGS" | sed 's/ -fPIE//'` | ||
5318 | AC_SUBST([CFLAGS_NOPIE]) | ||
5319 | |||
5304 | AC_EXEEXT | 5320 | AC_EXEEXT |
5305 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ | 5321 | AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ |
5306 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ | 5322 | openbsd-compat/Makefile openbsd-compat/regress/Makefile \ |