diff configure.ac @ 250:c130f47f6f48

*: many many changes e.g. the search page is actually implemented now!
author Paper <paper@paper.us.eu.org>
date Sun, 04 Feb 2024 21:17:17 -0500
parents 6b2441c776dd
children 862d0d8619f6
line wrap: on
line diff
--- a/configure.ac	Wed Jan 24 20:18:59 2024 -0500
+++ b/configure.ac	Sun Feb 04 21:17:17 2024 -0500
@@ -9,61 +9,59 @@
 
 AM_INIT_AUTOMAKE([-Wall -Wportability foreign subdir-objects])
 
-# Do we have a C++17 compiler
+dnl Do we have a C++17 compiler
 : ${CXXFLAGS=""}
 AC_PROG_CXX
 AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
 
-# Init libtool
+dnl Init libtool
 AM_PROG_AR
 LT_INIT
 
-# Qt?
-AX_HAVE_QT
+dnl Qt?
+AT_WITH_QT([widgets gui core], [], [], [have_qt=no], [have_qt=yes])
+
+AS_IF([test "x$have_qt" = "xno"], [AC_MSG_ERROR([*** Qt not found.])])
 
-if test "x$have_qt" = "xno"; then
-	AC_MSG_ERROR([*** Qt not found.])
-fi
+dnl need this for moc
+AC_PROG_MKDIR_P
+AC_SUBST([MKDIR_P])
 
-# need this for moc
-AC_PROG_MKDIR_P
-
-# libcurl?
+dnl libcurl?
 LIBCURL_CHECK_CONFIG([yes], [7.7.2], [have_libcurl=yes], [have_libcurl=no])
 
-if test "x$have_libcurl" = "xno"; then
-	AC_MSG_ERROR([*** libcurl not found.])
-fi
+AS_IF([test "x$have_libcurl" = "xno"], [AC_MSG_ERROR([*** libcurl not found.])])
 
 build_windows=no
 build_osx=no
+build_linux=no
 build_glib=no
 
-case "${host_os}" in
-	cygwin*|mingw*)
-		# Windows
-		build_windows=yes
-		AC_CHECK_TOOL([WINDRES], [windres])
-		AC_SUBST(WINDRES)
-		AC_PROG_SED # We need sed for version numbers in windres
-		AC_SUBST(SED)
-		AC_DEFINE(WIN32)
-		;;
-	darwin*)
-		# Mac OS X
-		build_osx=yes
-		AC_DEFINE(MACOSX)
-		;;
-	*)
-		if test "x$host_os" = "xlinux"; then
-			AC_DEFINE(LINUX)
-		fi
-		# Everything else
-		AC_SUBST([GIO_CFLAGS])
-		AC_SUBST([GIO_LIBS])
-		PKG_CHECK_MODULES([GIO], [gio-2.0], [build_glib=yes], [])
-		;;
-esac
+AS_CASE(["$host_os"],
+	[cygwin*|mingw*], [build_windows=yes],
+	[darwin*], [build_osx=yes],
+	[linux*], [build_linux=yes],
+	[])
+
+if test "x$build_windows" = "xyes"; then
+	AC_DEFINE([WIN32])
+
+	dnl Check for windres
+	AC_CHECK_TOOL([WINDRES], [windres])
+	AC_SUBST([WINDRES])
+elif test "x$build_osx" = "xyes"; then
+	AC_DEFINE([MACOSX])
+else
+	AS_IF([test "x$build_linux" = "xyes"], [AC_DEFINE([linux])])
+
+	PKG_CHECK_MODULES([GLIB], [gio-2.0 glib-2.0], [build_glib=yes], [build_glib=no])
+	if test "x$build_glib" = "xyes"; then
+		AC_DEFINE([GLIB])
+
+		AC_SUBST([GLIB_CFLAGS])
+		AC_SUBST([GLIB_LIBS])
+	fi
+fi
 
 AM_CONDITIONAL([BUILD_WIN], [test "x$build_windows" = "xyes"])
 AM_CONDITIONAL([BUILD_OSX], [test "x$build_osx" = "xyes"])