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])
25 # Don't add a default "-g -O2" if CFLAGS wasn't specified. For debugging it is
26 # often more convenient to have "-g -O0". You can still override it by
27 # explicitly setting it on the command line.
35 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
46 # pkg-config dependencies
47 # This unconditionally checks for all dependencies even if they are disabled. We
48 # later look whether all required depedencies are met and finish the
49 # configuration. We group similar packages into one logical group here to avoid
50 # having variables for each single library.
51 # This, however, makes ./configure output very unintuitive error messages if a
52 # package is not found so we must make sure we print more verbose messages
56 PKG_CHECK_MODULES([XKBCOMMON], [xkbcommon],
57 [have_xkbcommon=yes], [have_xkbcommon=no])
58 AC_SUBST(XKBCOMMON_CFLAGS)
59 if test "x$have_xkbcommon" = "xyes" ; then
60 AC_DEFINE([BUILD_HAVE_XKBCOMMON], [1], [Have xkbcommon library])
62 AM_CONDITIONAL([BUILD_HAVE_XKBCOMMON], [test "x$have_xkbcommon" = "xyes"])
64 PKG_CHECK_MODULES([CHECK], [check],
65 [have_check=yes], [have_check=no])
66 AC_SUBST(CHECK_CFLAGS)
68 AM_CONDITIONAL([BUILD_HAVE_CHECK], [test "x$have_check" = "xyes"])
72 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
73 # saves the results in local variables.
77 AC_MSG_CHECKING([whether to build with debugging on])
78 AC_ARG_ENABLE([debug],
79 [AS_HELP_STRING([--enable-debug],
80 [whether to build with debugging on])])
81 if test "x$enable_debug" = "x" ; then
82 enable_debug="yes (default)"
84 AC_MSG_RESULT([$enable_debug])
85 if test "x${enable_debug% *}" = "xyes" ; then
87 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
90 AC_DEFINE([NDEBUG], [1], [No Debug])
92 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
93 [test "x$enable_debug" = "xyes"])
96 AC_MSG_CHECKING([whether to enable code optimizations])
97 AC_ARG_ENABLE([optimizations],
98 [AS_HELP_STRING([--disable-optimizations],
99 [whether to disable code optimizations])])
100 if test "x$enable_optimizations" = "x" ; then
101 enable_optimizations="yes (default)"
103 AC_MSG_RESULT([$enable_optimizations])
104 if test "x${enable_optimizations% *}" = "xyes" ; then
105 enable_optimizations="yes"
107 enable_optimizations="no"
109 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
110 [test "x$enable_optimizations" = "xyes"])
114 # After everything is configured, we create all makefiles.
117 AC_CONFIG_FILES([Makefile
122 # Configuration output
123 # Show configuration to the user so they can check whether everything was
124 # configured as expected.
127 AC_MSG_NOTICE([Build configuration:
130 exec-prefix: $exec_prefix
132 includedir: $includedir
134 Miscellaneous Options:
136 optimizations: $enable_optimizations
137 building tests: $have_check
139 Run "${MAKE-make}" to start compilation process])