Mercurial > minori
annotate configure.ac @ 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 |
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 | 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 | 12 dnl need C compiler for utf8proc |
13 AC_PROG_CC | |
14 | |
250 | 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 | 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 | 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 | 25 dnl Qt? |
289
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
26 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
|
27 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
|
28 QT_HOST_PATH="$(eval $PKG_CONFIG --variable=host_bins Qt5Core)" |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
29 QT_VERSION="$(eval $PKG_CONFIG --modversion Qt5Gui)" |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
30 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
|
31 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
|
32 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
|
33 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
|
34 AC_PATH_PROGS(QT_LUPDATE, [lupdate-qt5 lupdate], lupdate, ["${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 ], [ |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
36 AC_MSG_ERROR([${QT_PKG_ERRORS}.]) |
282
19eb6c4dca78
autotools: ax_have_qt sucks, use pkgconf instead
Paper <paper@paper.us.eu.org>
parents:
273
diff
changeset
|
37 ]) |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
38 |
289
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
39 dnl On some platforms (see: Debian), Qt is built with |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
40 dnl `-reduce-relocations`, which requires applications |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
41 dnl to be built with position-independent code. |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
42 dnl |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
43 dnl Unfortunately there's no way to check for this |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
44 dnl without using qmake (bleugh), so we use this check |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
45 dnl to see if qglobal.h can be included without PIC. |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
46 |
290
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
47 AC_MSG_CHECKING([for Qt requiring -fPIC]) |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
48 |
289
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
49 saved_CXXFLAGS="$CXXFLAGS" |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
50 CXXFLAGS="$CXXFLAGS $QT_CFLAGS" |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
51 AC_COMPILE_IFELSE( |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
52 [AC_LANG_PROGRAM([#include <qglobal.h>], [])], |
290
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
53 [ |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
54 AC_MSG_RESULT([no]) |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
55 CXXFLAGS="$saved_CXXFLAGS" |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
56 ], |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
57 [ |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
58 AC_MSG_RESULT([yes]) |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
59 CXXFLAGS="$saved_CXXFLAGS -fPIC -DPIC" |
9347e2eaf6e5
autoconf: add checking message for Qt PIC stuff
Paper <paper@paper.us.eu.org>
parents:
289
diff
changeset
|
60 ] |
289
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
61 ) |
3dbf01233fec
autoconf: add a check for some weird Qt PIC requirements
Paper <paper@paper.us.eu.org>
parents:
288
diff
changeset
|
62 |
250 | 63 dnl need this for moc |
64 AC_PROG_MKDIR_P | |
65 AC_SUBST([MKDIR_P]) | |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
66 |
250 | 67 dnl libcurl? |
237 | 68 LIBCURL_CHECK_CONFIG([yes], [7.7.2], [have_libcurl=yes], [have_libcurl=no]) |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
69 |
250 | 70 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
|
71 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
72 build_windows=no |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
73 build_osx=no |
250 | 74 build_linux=no |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
75 build_glib=no |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
76 |
250 | 77 AS_CASE(["$host_os"], |
78 [cygwin*|mingw*], [build_windows=yes], | |
79 [darwin*], [build_osx=yes], | |
80 [linux*], [build_linux=yes], | |
81 []) | |
82 | |
83 if test "x$build_windows" = "xyes"; then | |
84 AC_DEFINE([WIN32]) | |
85 | |
86 dnl Check for windres | |
87 AC_CHECK_TOOL([WINDRES], [windres]) | |
88 AC_SUBST([WINDRES]) | |
89 elif test "x$build_osx" = "xyes"; then | |
90 AC_DEFINE([MACOSX]) | |
91 else | |
92 AS_IF([test "x$build_linux" = "xyes"], [AC_DEFINE([linux])]) | |
93 | |
94 PKG_CHECK_MODULES([GLIB], [gio-2.0 glib-2.0], [build_glib=yes], [build_glib=no]) | |
95 if test "x$build_glib" = "xyes"; then | |
96 AC_DEFINE([GLIB]) | |
97 | |
98 AC_SUBST([GLIB_CFLAGS]) | |
99 AC_SUBST([GLIB_LIBS]) | |
100 fi | |
101 fi | |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
102 |
267
09c5bd74fe93
win32: make builds work again
Paper <paper@paper.us.eu.org>
parents:
264
diff
changeset
|
103 AC_DEFINE([UTF8PROC_STATIC]) |
09c5bd74fe93
win32: make builds work again
Paper <paper@paper.us.eu.org>
parents:
264
diff
changeset
|
104 |
236
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
105 AM_CONDITIONAL([BUILD_WIN], [test "x$build_windows" = "xyes"]) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
106 AM_CONDITIONAL([BUILD_OSX], [test "x$build_osx" = "xyes"]) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
107 AM_CONDITIONAL([BUILD_GLIB], [test "x$build_glib" = "xyes"]) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
108 AM_CONDITIONAL([BUILD_WINDRES], [test "x$WINDRES" != "x"]) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
109 |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
110 AC_CONFIG_FILES([Makefile]) |
4d461ef7d424
HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff
changeset
|
111 AC_OUTPUT |