Mercurial > minori
comparison dep/animia/configure.ac @ 236:4d461ef7d424
HUGE UPDATE: convert build system to autotools
why? because cmake sucks :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Fri, 19 Jan 2024 00:24:02 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
235:593108b3d555 | 236:4d461ef7d424 |
---|---|
1 AC_INIT([animia], [0.1.0-alpha.1]) | |
2 | |
3 AC_CANONICAL_HOST | |
4 | |
5 AC_CONFIG_SRCDIR([src/animia.cc]) | |
6 AC_CONFIG_AUX_DIR([build-aux]) | |
7 AC_CONFIG_MACRO_DIRS([m4]) | |
8 | |
9 AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) | |
10 | |
11 # Do we have a C++17 compiler | |
12 AC_PROG_CXX | |
13 | |
14 AM_PROG_AR | |
15 LT_INIT | |
16 | |
17 build_win32=no | |
18 build_osx=no | |
19 build_linux=no | |
20 build_libutil=no | |
21 build_kvm=no | |
22 | |
23 build_x11=no | |
24 build_wayland=no | |
25 | |
26 case "${host_os}" in | |
27 cygwin*|mingw*) | |
28 # Windows | |
29 build_windows=yes | |
30 AC_CHECK_TOOL([WINDRES], [windres]) | |
31 AC_SUBST(WINDRES) | |
32 AC_DEFINE([WIN32]) | |
33 ;; | |
34 darwin*) | |
35 # Mac OS X | |
36 build_osx=yes | |
37 AC_DEFINE([MACOSX]) | |
38 ;; | |
39 linux*) | |
40 build_linux=yes | |
41 AC_DEFINE([LINUX]) | |
42 ;; | |
43 *) | |
44 # FreeBSD | |
45 AC_CHECK_LIB([util], [kinfo_getfile], [build_libutil=yes], [build_libutil=no]) | |
46 if test "x$build_libutil" = "xyes"; then | |
47 AC_DEFINE([LIBUTIL]) | |
48 else | |
49 # OpenBSD | |
50 AC_CHECK_LIB([kvm], [kvm_getfiles], [build_kvm=yes], [build_kvm=no]) | |
51 if test "x$build_kvm" = "xyes"; then | |
52 AC_DEFINE([LIBKVM]) | |
53 fi | |
54 fi | |
55 ;; | |
56 esac | |
57 | |
58 if ! test "x$build_osx" = "xyes" && ! test "x$build_windows" = "xyes"; then | |
59 PKG_CHECK_MODULES(XCB, [xcb xcb-res], [build_x11=yes], [build_x11=no]) | |
60 if test "x$build_x11" = "xyes"; then | |
61 AC_DEFINE([X11]) | |
62 fi | |
63 PKG_CHECK_MODULES(WAYLAND, [wayland-client], [build_wayland=yes], [build_wayland=no]) | |
64 if test "x$build_wayland" = "xyes"; then | |
65 AC_DEFINE([WAYLAND]) | |
66 fi | |
67 fi | |
68 | |
69 AM_CONDITIONAL([BUILD_WIN], [test "x$build_windows" = "xyes"]) | |
70 AM_CONDITIONAL([BUILD_OSX], [test "x$build_osx" = "xyes"]) | |
71 AM_CONDITIONAL([BUILD_LINUX], [test "x$build_linux" = "xyes"]) | |
72 AM_CONDITIONAL([BUILD_LIBUTIL], [test "x$build_libutil" = "xyes"]) | |
73 AM_CONDITIONAL([BUILD_LIBKVM], [test "x$build_kvm" = "xyes"]) | |
74 | |
75 AM_CONDITIONAL([BUILD_XCB], [test "x$build_x11" = "xyes"]) | |
76 AM_CONDITIONAL([BUILD_WAYLAND], [test "x$build_wayland" = "xyes"]) | |
77 | |
78 AC_CONFIG_FILES([Makefile]) | |
79 AC_OUTPUT |