annotate configure.ac @ 240:6ffe42286978

m4: use different method for CXXFLAGS
author Paper <paper@paper.us.eu.org>
date Fri, 19 Jan 2024 13:47:56 -0500
parents cae61340cc86
children 06d6c351925c
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
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
5 AC_CONFIG_SUBDIRS([dep/pugixml dep/animia 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
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
12 # Do we have a C++17 compiler
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
13 : ${CXXFLAGS=""}
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
14 AC_PROG_CXX
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
15 AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
16
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
17 # Init libtool
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
18 AM_PROG_AR
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
19 LT_INIT
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
20
239
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
21 have_qt=no
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
22 # Qt?
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
23 AX_HAVE_QT
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
24
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
25 if test "x$have_qt" = "xno"; then
240
6ffe42286978 m4: use different method for CXXFLAGS
Paper <paper@paper.us.eu.org>
parents: 239
diff changeset
26 PKG_CHECK_MODULES([QT], [Qt6Widgets >= 6.0.0], [have_qt=yes], [true])
239
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
27 # prioritize qt 5
240
6ffe42286978 m4: use different method for CXXFLAGS
Paper <paper@paper.us.eu.org>
parents: 239
diff changeset
28 PKG_CHECK_MODULES([QT], [Qt5Widgets >= 5.15.0], [have_qt=yes], [true])
239
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
29
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
30 if test "x$have_qt" = "xno"; then
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
31 AC_MSG_ERROR([*** Qt not found.])
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
32 fi
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
33
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
34 QT_CXXFLAGS=$QT_CFLAGS
cae61340cc86 configure: check pkg-config for qt
Paper <paper@paper.us.eu.org>
parents: 237
diff changeset
35 AC_SUBST([QT_CXXFLAGS])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
36 fi
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
37
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
38 # need this for moc
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
39 AC_PROG_MKDIR_P
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
40
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
41 # libcurl?
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
42 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
43
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
44 if test "x$have_libcurl" = "xno"; then
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
45 AC_MSG_ERROR([*** libcurl not found.])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
46 fi
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
47
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
48 build_windows=no
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
49 build_osx=no
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
50 build_glib=no
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
51
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
52 case "${host_os}" in
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
53 cygwin*|mingw*)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
54 # Windows
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
55 build_windows=yes
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
56 AC_CHECK_TOOL([WINDRES], [windres])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
57 AC_SUBST(WINDRES)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
58 AC_DEFINE(WIN32)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
59 ;;
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
60 darwin*)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
61 # Mac OS X
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
62 build_osx=yes
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
63 AC_DEFINE(MACOSX)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
64 ;;
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
65 *)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
66 if test "x$host_os" = "xlinux"; then
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
67 AC_DEFINE(LINUX)
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
68 fi
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
69 # Everything else
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
70 AC_SUBST([GIO_CFLAGS])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
71 AC_SUBST([GIO_LIBS])
237
a7d0d543b334 *: make OS X builds succeed
Paper <paper@paper.us.eu.org>
parents: 236
diff changeset
72 PKG_CHECK_MODULES([GIO], [gio-2.0], [build_glib=yes], [])
236
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
73 ;;
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
74 esac
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
75
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
76 AM_CONDITIONAL([BUILD_WIN], [test "x$build_windows" = "xyes"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
77 AM_CONDITIONAL([BUILD_OSX], [test "x$build_osx" = "xyes"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
78 AM_CONDITIONAL([BUILD_GLIB], [test "x$build_glib" = "xyes"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
79 AM_CONDITIONAL([BUILD_WINDRES], [test "x$WINDRES" != "x"])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
80
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
81 AC_CONFIG_FILES([Makefile])
4d461ef7d424 HUGE UPDATE: convert build system to autotools
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
82 AC_OUTPUT