changeset 290:9347e2eaf6e5

autoconf: add checking message for Qt PIC stuff
author Paper <paper@paper.us.eu.org>
date Wed, 08 May 2024 17:32:28 -0400
parents 3dbf01233fec
children 9a88e1725fd2
files configure.ac
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Wed May 08 17:27:13 2024 -0400
+++ b/configure.ac	Wed May 08 17:32:28 2024 -0400
@@ -11,11 +11,11 @@
 
 dnl need C compiler for utf8proc
 AC_PROG_CC
-AC_LANG([C++])
 
 dnl Do we have a C++17 compiler
 AC_PROG_CXX
 AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
+AC_LANG([C++])
 
 dnl Init libtool
 AM_PROG_AR
@@ -44,12 +44,20 @@
 dnl without using qmake (bleugh), so we use this check
 dnl to see if qglobal.h can be included without PIC.
 
+AC_MSG_CHECKING([for Qt requiring -fPIC])
+
 saved_CXXFLAGS="$CXXFLAGS"
 CXXFLAGS="$CXXFLAGS $QT_CFLAGS"
 AC_COMPILE_IFELSE(
 	[AC_LANG_PROGRAM([#include <qglobal.h>], [])],
-	[CXXFLAGS="$saved_CXXFLAGS"],
-	[CXXFLAGS="$saved_CXXFLAGS -fPIC"]
+	[
+		AC_MSG_RESULT([no])
+		CXXFLAGS="$saved_CXXFLAGS"
+	],
+	[
+		AC_MSG_RESULT([yes])
+		CXXFLAGS="$saved_CXXFLAGS -fPIC -DPIC"
+	]
 )
 
 dnl need this for moc