]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Better detection of unsupported compiler options.
authorDarren Tucker <dtucker@dtucker.net>
Fri, 8 Jun 2018 03:55:59 +0000 (13:55 +1000)
committerDarren Tucker <dtucker@dtucker.net>
Fri, 8 Jun 2018 03:55:59 +0000 (13:55 +1000)
Should prevent "unsupported -Wl,-z,retpoline" warnings during linking.
ok djm@

aclocal.m4

index ac6b6684a51b00991d51c16d0ebafcbf2d23da91..25ecc49a22037d58cab43891ea9a9bc7cdcee074 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
 }
        ]])],
                [
-if `grep -i "unrecognized option" conftest.err >/dev/null`
+if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null
 then
                AC_MSG_RESULT([no])
                CFLAGS="$saved_CFLAGS"
@@ -63,7 +63,7 @@ int main(int argc, char **argv) {
 }
        ]])],
                [
-if `grep -i "unrecognized option" conftest.err >/dev/null`
+if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null
 then
                AC_MSG_RESULT([no])
                CFLAGS="$saved_CFLAGS"
@@ -100,8 +100,15 @@ int main(int argc, char **argv) {
        exit(0);
 }
                ]])],
-               [ AC_MSG_RESULT([yes])
-                 LDFLAGS="$saved_LDFLAGS $_define_flag"],
+               [
+if $ac_cv_path_EGREP -i "unrecognized option|warning.*ignored" conftest.err >/dev/null
+then
+                 AC_MSG_RESULT([no])
+                 LDFLAGS="$saved_LDFLAGS"
+else
+                 AC_MSG_RESULT([yes])
+                 LDFLAGS="$saved_LDFLAGS $_define_flag"
+fi             ],
                [ AC_MSG_RESULT([no])
                  LDFLAGS="$saved_LDFLAGS" ]
        )