From cc44c4e0de2fe238bf37779c5c7fd559cd38adfd Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 4 Mar 2023 05:05:13 +0200 Subject: [PATCH 34/34] qt6.m4: Set "-fPIC" by default Switch compile tests around so that "-fPIC" gets set if possible, not only when required for the build to success. On some environments build was succeeding without "-fPIC", but produced binaries did not work. See osdn #47334 Signed-off-by: Marko Lindqvist --- m4/qt6.m4 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/m4/qt6.m4 b/m4/qt6.m4 index 72ac79d361..69ee66dd29 100644 --- a/m4/qt6.m4 +++ b/m4/qt6.m4 @@ -87,18 +87,19 @@ AC_DEFUN([FC_QT6_COMPILETEST], CPPFLAGS_SAVE="$CPPFLAGS" CPPFLAGS="${CPPFLAGS}${CPPFADD}" + CXXFLAGS_SAVE="${CXXFLAGS}" + CXXFLAGS="${CXXFLAGS} -fPIC" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int a; QApplication app(a, 0);]])], [qt6_headers=yes - FC_QT6_CPPFLAGS="${FC_QT6_CPPFLAGS}${CPPFADD}"], - [CXXFLAGS_SAVE="${CXXFLAGS}" - CXXFLAGS="${CXXFLAGS} -fPIC" + FC_QT6_CPPFLAGS="${FC_QT6_CPPFLAGS}${CPPFADD}" + FC_QT6_CXXFLAGS="${FC_QT6_CXXFLAGS} -fPIC" + CXXFLAGS="${CXXFLAGS_SAVE}"], + [CXXFLAGS="${CXXFLAGS_SAVE}" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[int a; QApplication app(a, 0);]])], [qt6_headers=yes - FC_QT6_CPPFLAGS="${FC_QT6_CPPFLAGS}${CPPFADD}" - FC_QT6_CXXFLAGS="${FC_QT6_CXXFLAGS} -fPIC"]) - CXXFLAGS="${CXXFLAGS_SAVE}"]) + FC_QT6_CPPFLAGS="${FC_QT6_CPPFLAGS}${CPPFADD}"])]) CPPFLAGS="$CPPFLAGS_SAVE" ]) -- 2.39.2