2 # libtsm - build configuration script
3 # Copyright (c) 2012-2013 David Herrmann <dh.herrmann@gmail.com>
10 [https://github.com/dvdhrm/libtsm/issues],
12 [http://dvdhrm.github.io/libtsm])
13 AC_CONFIG_SRCDIR([src/tsm_vte.c])
14 AC_CONFIG_AUX_DIR([build-aux])
15 AC_CONFIG_MACRO_DIR([m4])
16 AC_CONFIG_HEADER(config.h)
17 AC_USE_SYSTEM_EXTENSIONS
21 AM_INIT_AUTOMAKE([foreign 1.11 subdir-objects dist-xz no-dist-gzip tar-pax -Wall -Werror -Wno-portability])
22 AM_SILENT_RULES([yes])
24 AC_SUBST(PACKAGE_DESCRIPTION, ["terminal-emulator state machine"])
27 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
28 # often more convenient to have "-g -O0". You can still override it by
29 # explicitly setting it on the command line.
37 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
48 # We need xkbcommon for keysym definitions. If it's not found, we use our own
49 # private copy of xkbcommon-keysyms.h.
52 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
53 [have_xkbcommon=yes], [have_xkbcommon=no])
54 AC_SUBST(XKBCOMMON_CFLAGS)
55 if test "x$have_xkbcommon" = "xyes" ; then
56 AC_DEFINE([BUILD_HAVE_XKBCOMMON], [1], [Have xkbcommon library])
58 AM_CONDITIONAL([BUILD_HAVE_XKBCOMMON], [test "x$have_xkbcommon" = "xyes"])
61 # Test for "check" which we use for our test-suite. If not found, we disable
65 PKG_CHECK_MODULES([CHECK], [check],
66 [have_check=yes], [have_check=no])
67 AC_SUBST(CHECK_CFLAGS)
69 AM_CONDITIONAL([BUILD_HAVE_CHECK], [test "x$have_check" = "xyes"])
73 # If --enable-debug is given, we enable several non-standard debug options. We
74 # enable a lot of debug options by default, so this option is really only for
75 # extended developer debug modes.
78 AC_MSG_CHECKING([whether to build with debugging on])
79 AC_ARG_ENABLE([debug],
80 [AS_HELP_STRING([--enable-debug],
81 [whether to build with debugging on])])
82 if test "x$enable_debug" = "x" ; then
83 enable_debug="yes (default)"
85 AC_MSG_RESULT([$enable_debug])
87 if test "x${enable_debug% *}" = "xyes" ; then
89 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
92 AC_DEFINE([NDEBUG], [1], [No Debug])
94 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
95 [test "x$enable_debug" = "xyes"])
98 # Enable gcc compiler optimizations. We enable them by default but allow
99 # disabling them for better backtraces during debugging.
102 AC_MSG_CHECKING([whether to enable code optimizations])
103 AC_ARG_ENABLE([optimizations],
104 [AS_HELP_STRING([--disable-optimizations],
105 [whether to disable code optimizations])])
106 if test "x$enable_optimizations" = "x" ; then
107 enable_optimizations="yes (default)"
109 AC_MSG_RESULT([$enable_optimizations])
111 if test "x${enable_optimizations% *}" = "xyes" ; then
112 enable_optimizations="yes"
114 enable_optimizations="no"
116 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
117 [test "x$enable_optimizations" = "xyes"])
121 # After everything is configured, we create all makefiles.
124 AC_CONFIG_FILES([Makefile
129 # Configuration output
130 # Show configuration to the user so they can check whether everything was
131 # configured as expected.
134 AC_MSG_NOTICE([Build configuration:
137 exec-prefix: $exec_prefix
139 includedir: $includedir
141 Miscellaneous Options:
143 optimizations: $enable_optimizations
144 building tests: $have_check
146 Run "${MAKE-make}" to start compilation process])