From 03e4dbbec1d264ddebc8b2a423d74d7cd903d4d3 Mon Sep 17 00:00:00 2001 From: cathugger Date: Fri, 6 Oct 2017 14:09:08 +0000 Subject: [PATCH] more compatibility tweaks --- Makefile.in | 2 +- configure.ac | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index e230b1e..28845d7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ CC= @CC@ CSTD= @CSTD@ -Wall -CFLAGS= $(CSTD) @CFLAGS@ -DED25519_@ED25519IMPL@ @MYDEFS@ +CFLAGS= $(CSTD) @CFLAGS@ @CPPFLAGS@ -DED25519_@ED25519IMPL@ @MYDEFS@ ASFLAGS= LDFLAGS= @NOPIE@ @LDFLAGS@ MV= mv diff --git a/configure.ac b/configure.ac index 04786be..827b70d 100644 --- a/configure.ac +++ b/configure.ac @@ -37,16 +37,30 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], CFLAGS="$oldcflags" nopie="" + oldcflags="$CFLAGS" -CFLAGS="-no-pie" -AC_MSG_CHECKING([whether CC supports -no-pie]) +CFLAGS="-nopie" +AC_MSG_CHECKING([whether CC supports -nopie]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [AC_MSG_RESULT([yes])] - [nopie="-no-pie"], + [nopie="-nopie"], [AC_MSG_RESULT([no])] ) CFLAGS="$oldcflags" +if test "x$nopie" = "x" +then + oldcflags="$CFLAGS" + CFLAGS="-no-pie" + AC_MSG_CHECKING([whether CC supports -no-pie]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AC_MSG_RESULT([yes])] + [nopie="-no-pie"], + [AC_MSG_RESULT([no])] + ) + CFLAGS="$oldcflags" +fi + MYDEFS="" ed25519impl=""