Initial commit.
[lxde/lxhotkey.git] / configure.ac
1 AC_PREREQ(2.53)
2 AC_INIT(lxkeys, 0.1.0, http://lxde.org/)
3 AM_INIT_AUTOMAKE([-Wall foreign subdir-objects no-dist-gzip dist-xz])
4 AC_CONFIG_HEADER([config.h])
5 AC_CONFIG_MACRO_DIR([m4])
6
7 # Support silent build rules. Disable by either passing --disable-silent-rules
8 # to configure or passing V=1 to make
9 AM_SILENT_RULES([yes])
10
11 # Force to dynamic
12 AC_DISABLE_STATIC
13
14 # Checks for programs.
15 AC_PROG_CC
16 AC_PROG_INSTALL
17 AC_PROG_LN_S
18 IT_PROG_INTLTOOL([0.40.0], [no-xml])
19 AM_PROG_CC_C_O
20 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
21
22 # Initialize libtool
23 LT_PREREQ([2.2])
24 LT_INIT
25
26 # International support
27 GETTEXT_PACKAGE=lxkeys
28 AC_SUBST(GETTEXT_PACKAGE)
29 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
30
31 AM_GLIB_GNU_GETTEXT
32
33 # --enable-debug option
34 AC_ARG_ENABLE(debug,
35     [AC_HELP_STRING([--enable-debug],
36         [enable debug support @<:@default=no@:>@])],
37     [enable_debug="${enableval}"],
38     [enable_debug=no]
39 )
40 if test "$enable_debug" = "yes"; then
41     # turn on debug and disable optimization
42     CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
43     case "$CC" in
44     gcc*)
45         CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration"
46         ;;
47     *)
48         ;;
49     esac
50     dnl Be more strict on portability
51     #CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
52 else
53     # turn off glib debug checks
54     CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
55 fi
56
57 dnl Fix invalid sysconfdir when --prefix=/usr
58 if test `eval "echo $sysconfdir"` = /usr/etc
59 then
60     sysconfdir=/etc
61 fi
62
63 dnl Finish all
64 AC_CONFIG_FILES([
65     Makefile
66     src/Makefile
67     plugins/Makefile
68     po/Makefile.in
69 ])
70 AC_OUTPUT