Mercurial > minori
diff configure.ac @ 291:9a88e1725fd2
*: refactor lots of stuff
I forgot to put this into different commits, oops!
anyway, it doesn't really matter *that* much since this is an
unfinished hobby project anyway. once it starts getting stable
commit history will be more important, but for now it's not
that big of a deal
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Sun, 12 May 2024 16:31:07 -0400 |
parents | 9347e2eaf6e5 |
children | 703fb7d7c917 |
line wrap: on
line diff
--- a/configure.ac Wed May 08 17:32:28 2024 -0400 +++ b/configure.ac Sun May 12 16:31:07 2024 -0400 @@ -23,49 +23,65 @@ dnl Qt? + + PKG_CHECK_MODULES([QT], [Qt5Core >= 5.7.0 Qt5Widgets Qt5Gui], [ QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)" QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)" - QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)" + AC_PATH_PROGS(QT_MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) AC_PATH_PROGS(QT_RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) AC_PATH_PROGS(QT_UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) AC_PATH_PROGS(QT_LRELEASE, [lrelease-qt5 lrelease], lrelease, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) AC_PATH_PROGS(QT_LUPDATE, [lupdate-qt5 lupdate], lupdate, ["${QT_HOST_PATH}" "${QT_PATH}/bin"]) -], [ - AC_MSG_ERROR([${QT_PKG_ERRORS}.]) -]) -dnl On some platforms (see: Debian), Qt is built with -dnl `-reduce-relocations`, which requires applications -dnl to be built with position-independent code. -dnl -dnl Unfortunately there's no way to check for this -dnl without using qmake (bleugh), so we use this check -dnl to see if qglobal.h can be included without PIC. + dnl On some platforms (see: Debian), Qt is built with + dnl `-reduce-relocations`, which requires applications + dnl to be built with position-independent code. + dnl + dnl Unfortunately there's no way to check for this + 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]) + AC_MSG_CHECKING([for Qt requiring -fPIC]) -saved_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$CXXFLAGS $QT_CFLAGS" -AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([#include <qglobal.h>], [])], - [ - AC_MSG_RESULT([no]) - CXXFLAGS="$saved_CXXFLAGS" - ], - [ - AC_MSG_RESULT([yes]) - CXXFLAGS="$saved_CXXFLAGS -fPIC -DPIC" - ] -) + saved_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $QT_CFLAGS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include <qglobal.h>], [])], + [ + AC_MSG_RESULT([no]) + CXXFLAGS="$saved_CXXFLAGS" + ], + [ + AC_MSG_RESULT([yes]) + CXXFLAGS="$saved_CXXFLAGS -fPIC -DPIC" + ] + ) +], [ + PKG_CHECK_MODULES([QT], [Qt6Core Qt6Widgets Qt6Gui], [ + QT_BIN_DIRECTORY="$(eval $PKG_CONFIG --variable=bindir Qt6Core)" + QT_LIBEXEC_DIRECTORY="$(eval $PKG_CONFIG --variable=libexecdir Qt6Core)" + + AC_PATH_PROGS(QT_MOC, [moc], moc, ["${QT_LIBEXEC_DIRECTORY}"]) + AC_PATH_PROGS(QT_RCC, [rcc], rcc, ["${QT_LIBEXEC_DIRECTORY}"]) + AC_PATH_PROGS(QT_UIC, [uic], uic, ["${QT_LIBEXEC_DIRECTORY}"]) + AC_PATH_PROGS(QT_LRELEASE, [lrelease], lrelease, ["${QT_BIN_DIRECTORY}"]) + AC_PATH_PROGS(QT_LUPDATE, [lupdate], lupdate, ["${QT_BIN_DIRECTORY}"]) + + dnl in my testing Qt 6 seems to require PIC unconditionally... + CXXFLAGS="$CXXFLAGS -fPIC" + ], [ + AC_MSG_ERROR([${QT_PKG_ERRORS}.]) + ]) +]) dnl need this for moc AC_PROG_MKDIR_P AC_SUBST([MKDIR_P]) dnl libcurl? -LIBCURL_CHECK_CONFIG([yes], [7.7.2], [have_libcurl=yes], [have_libcurl=no]) +LIBCURL_CHECK_CONFIG([yes], [7.87.0], [have_libcurl=yes], [have_libcurl=no]) AS_IF([test "x$have_libcurl" = "xno"], [AC_MSG_ERROR([*** libcurl not found.])])