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"])
66 # This parses all arguments that are given via "--enable-XY" or "--with-XY" and
67 # saves the results in local variables.
71 AC_MSG_CHECKING([whether to build with debugging on])
72 AC_ARG_ENABLE([debug],
73 [AS_HELP_STRING([--enable-debug],
74 [whether to build with debugging on])])
75 if test "x$enable_debug" = "x" ; then
76 enable_debug="yes (default)"
78 AC_MSG_RESULT([$enable_debug])
79 if test "x${enable_debug% *}" = "xyes" ; then
81 AC_DEFINE([BUILD_ENABLE_DEBUG], [1], [Enable debug mode])
84 AC_DEFINE([NDEBUG], [1], [No Debug])
86 AM_CONDITIONAL([BUILD_ENABLE_DEBUG],
87 [test "x$enable_debug" = "xyes"])
90 AC_MSG_CHECKING([whether to enable code optimizations])
91 AC_ARG_ENABLE([optimizations],
92 [AS_HELP_STRING([--disable-optimizations],
93 [whether to disable code optimizations])])
94 if test "x$enable_optimizations" = "x" ; then
95 enable_optimizations="yes (default)"
97 AC_MSG_RESULT([$enable_optimizations])
98 if test "x${enable_optimizations% *}" = "xyes" ; then
99 enable_optimizations="yes"
101 enable_optimizations="no"
103 AM_CONDITIONAL([BUILD_ENABLE_OPTIMIZATIONS],
104 [test "x$enable_optimizations" = "xyes"])
108 # After everything is configured, we create all makefiles.
111 AC_CONFIG_FILES([Makefile
116 # Configuration output
117 # Show configuration to the user so they can check whether everything was
118 # configured as expected.
121 AC_MSG_NOTICE([Build configuration:
124 exec-prefix: $exec_prefix
126 includedir: $includedir
128 Miscellaneous Options:
130 optimizations: $enable_optimizations
132 Run "${MAKE-make}" to start compilation process])