annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
1 AC_INIT([minori], [0.1.0-alpha.1])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
2
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
3 AC_CANONICAL_HOST
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
4
258
862d0d8619f6 *: HUUUGE changes
Paper <paper@paper.us.eu.org>
parents: 250
diff changeset
5 AC_CONFIG_SUBDIRS([dep/pugixml dep/animone dep/anitomy])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
6 AC_CONFIG_SRCDIR([src/main.cc])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
7 AC_CONFIG_AUX_DIR([build-aux])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
8 AC_CONFIG_MACRO_DIRS([m4])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
9
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
10 AM_INIT_AUTOMAKE([-Wall -Wportability foreign subdir-objects])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
11
264
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
12 dnl need C compiler for utf8proc
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
13 AC_PROG_CC
9a04802848c0 *: improve multiple things
Paper <paper@paper.us.eu.org>
parents: 258
diff changeset
14
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
15 dnl Do we have a C++17 compiler
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16 AC_PROG_CXX
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
17 AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
290
9347e2eaf6e5 autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents: 289
diff changeset
18 AC_LANG([C++])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
20 dnl Init libtool
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
21 AM_PROG_AR
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 LT_INIT
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23
282
19eb6c4dca78 autotools: ax_have_qt sucks, use pkgconf instead
Paper <paper@paper.us.eu.org>
parents: 273
diff changeset
24
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
25 dnl Qt?
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
26
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
27
289
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
28 PKG_CHECK_MODULES([QT], [Qt5Core >= 5.7.0 Qt5Widgets Qt5Gui], [
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
29 QT_PATH="$(eval $PKG_CONFIG --variable=exec_prefix Qt5Core)"
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
30 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)"
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
31
289
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
32 AC_PATH_PROGS(QT_MOC, [moc-qt5 moc], moc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
33 AC_PATH_PROGS(QT_RCC, [rcc-qt5 rcc], rcc, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
34 AC_PATH_PROGS(QT_UIC, [uic-qt5 uic], uic, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
35 AC_PATH_PROGS(QT_LRELEASE, [lrelease-qt5 lrelease], lrelease, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
36 AC_PATH_PROGS(QT_LUPDATE, [lupdate-qt5 lupdate], lupdate, ["${QT_HOST_PATH}" "${QT_PATH}/bin"])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
38 dnl On some platforms (see: Debian), Qt is built with
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
39 dnl `-reduce-relocations`, which requires applications
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
40 dnl to be built with position-independent code.
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
41 dnl
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
42 dnl Unfortunately there's no way to check for this
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
43 dnl without using qmake (bleugh), so we use this check
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
44 dnl to see if qglobal.h can be included without PIC.
289
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
45
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
46 AC_MSG_CHECKING([for Qt requiring -fPIC])
290
9347e2eaf6e5 autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents: 289
diff changeset
47
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
48 saved_CXXFLAGS="$CXXFLAGS"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
49 CXXFLAGS="$CXXFLAGS $QT_CFLAGS"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
50 AC_COMPILE_IFELSE(
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
51 [AC_LANG_PROGRAM([#include <qglobal.h>], [])],
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
52 [
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
53 AC_MSG_RESULT([no])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
54 CXXFLAGS="$saved_CXXFLAGS"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
55 ],
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
56 [
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
57 AC_MSG_RESULT([yes])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
58 CXXFLAGS="$saved_CXXFLAGS -fPIC -DPIC"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
59 ]
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
60 )
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
61 ], [
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
62 PKG_CHECK_MODULES([QT], [Qt6Core Qt6Widgets Qt6Gui], [
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
63 QT_BIN_DIRECTORY="$(eval $PKG_CONFIG --variable=bindir Qt6Core)"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
64 QT_LIBEXEC_DIRECTORY="$(eval $PKG_CONFIG --variable=libexecdir Qt6Core)"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
65
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
66 AC_PATH_PROGS(QT_MOC, [moc], moc, ["${QT_LIBEXEC_DIRECTORY}"])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
67 AC_PATH_PROGS(QT_RCC, [rcc], rcc, ["${QT_LIBEXEC_DIRECTORY}"])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
68 AC_PATH_PROGS(QT_UIC, [uic], uic, ["${QT_LIBEXEC_DIRECTORY}"])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
69 AC_PATH_PROGS(QT_LRELEASE, [lrelease], lrelease, ["${QT_BIN_DIRECTORY}"])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
70 AC_PATH_PROGS(QT_LUPDATE, [lupdate], lupdate, ["${QT_BIN_DIRECTORY}"])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
71
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
72 dnl in my testing Qt 6 seems to require PIC unconditionally...
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
73 CXXFLAGS="$CXXFLAGS -fPIC"
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
74 ], [
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
75 AC_MSG_ERROR([${QT_PKG_ERRORS}.])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
76 ])
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
77 ])
289
3dbf01233fec autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents: 288
diff changeset
78
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
79 dnl need this for moc
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
80 AC_PROG_MKDIR_P
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
81 AC_SUBST([MKDIR_P])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
82
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
83 dnl libcurl?
291
9a88e1725fd2 *: refactor lots of stuff
Paper <paper@paper.us.eu.org>
parents: 290
diff changeset
84 LIBCURL_CHECK_CONFIG([yes], [7.87.0], [have_libcurl=yes], [have_libcurl=no])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
85
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
86 AS_IF([test "x$have_libcurl" = "xno"], [AC_MSG_ERROR([*** libcurl not found.])])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
87
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
88 build_windows=no
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
89 build_osx=no
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
90 build_linux=no
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
91 build_glib=no
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
92
250
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
93 AS_CASE(["$host_os"],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
94 [cygwin*|mingw*], [build_windows=yes],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
95 [darwin*], [build_osx=yes],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
96 [linux*], [build_linux=yes],
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
97 [])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
98
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
99 if test "x$build_windows" = "xyes"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
100 AC_DEFINE([WIN32])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
101
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
102 dnl Check for windres
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
103 AC_CHECK_TOOL([WINDRES], [windres])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
104 AC_SUBST([WINDRES])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
105 elif test "x$build_osx" = "xyes"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
106 AC_DEFINE([MACOSX])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
107 else
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
108 AS_IF([test "x$build_linux" = "xyes"], [AC_DEFINE([linux])])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
109
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
110 PKG_CHECK_MODULES([GLIB], [gio-2.0 glib-2.0], [build_glib=yes], [build_glib=no])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
111 if test "x$build_glib" = "xyes"; then
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
112 AC_DEFINE([GLIB])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
113
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
114 AC_SUBST([GLIB_CFLAGS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
115 AC_SUBST([GLIB_LIBS])
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
116 fi
c130f47f6f48 *: many many changes
Paper <paper@paper.us.eu.org>
parents: 249
diff changeset
117 fi
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
118
267
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
119 AC_DEFINE([UTF8PROC_STATIC])
09c5bd74fe93 win32: make builds work again
Paper <paper@paper.us.eu.org>
parents: 264
diff changeset
120
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
121 AM_CONDITIONAL([BUILD_WIN], [test "x$build_windows" = "xyes"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
122 AM_CONDITIONAL([BUILD_OSX], [test "x$build_osx" = "xyes"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
123 AM_CONDITIONAL([BUILD_GLIB], [test "x$build_glib" = "xyes"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
124 AM_CONDITIONAL([BUILD_WINDRES], [test "x$WINDRES" != "x"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
125
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
126 AC_CONFIG_FILES([Makefile])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
127 AC_OUTPUT