GTK+ plugin: fix test for a number in '#' or '%' value template.
[lxde/lxhotkey.git] / configure.ac
CommitLineData
4185d89e 1AC_PREREQ(2.53)
c6e7c29a 2AC_INIT(lxhotkey, 0.1.0, http://lxde.org/)
4185d89e
AG
3AM_INIT_AUTOMAKE([-Wall foreign subdir-objects no-dist-gzip dist-xz])
4AC_CONFIG_HEADER([config.h])
5AC_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
9AM_SILENT_RULES([yes])
10
11# Force to dynamic
12AC_DISABLE_STATIC
13
14# Checks for programs.
15AC_PROG_CC
16AC_PROG_INSTALL
17AC_PROG_LN_S
18IT_PROG_INTLTOOL([0.40.0], [no-xml])
19AM_PROG_CC_C_O
20m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
21
22# Initialize libtool
23LT_PREREQ([2.2])
24LT_INIT
25
26# International support
c6e7c29a 27GETTEXT_PACKAGE=lxhotkey
4185d89e
AG
28AC_SUBST(GETTEXT_PACKAGE)
29AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
30
31AM_GLIB_GNU_GETTEXT
32
35e537d9 33# Handle --enable-debug option
4185d89e
AG
34AC_ARG_ENABLE(debug,
35 [AC_HELP_STRING([--enable-debug],
36 [enable debug support @<:@default=no@:>@])],
37 [enable_debug="${enableval}"],
38 [enable_debug=no]
39)
40if 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"
52else
53 # turn off glib debug checks
54 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
55fi
56
35e537d9
AG
57dnl Test for required libraries
58pkg_modules="libfm >= 1.2.0 x11"
59PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
60AC_SUBST(PACKAGE_CFLAGS)
61AC_SUBST(PACKAGE_LIBS)
62
0cdc072f
AG
63dnl GTK+ stuff
64AC_ARG_WITH(gtk,
65 [AC_HELP_STRING([--with-gtk=VER],
66 [build 'gtk' GUI, choose GTK+ version for build])
67AC_HELP_STRING([--without-gtk],
68 [disable 'gtk' GUI build @<:@default@:>@])],
69 [ac_with_gtk="${withval}"],
70 [ac_with_gtk=no]
71)
72
73if test x"$ac_with_gtk" != xno; then
74 case "$ac_with_gtk" in
75 3|3.*)
76 pkg_modules="gtk+-3.0"
77 ;;
78 *)
79 pkg_modules="gtk+-2.0 >= 2.18.0"
80 ;;
81 esac
82 PKG_CHECK_MODULES(GTK, [$pkg_modules], [with_gtk=yes], [with_gtk=no])
83fi
84AM_CONDITIONAL(WITH_GTK, [test x$with_gtk = xyes])
85AC_SUBST(GTK_CFLAGS)
86AC_SUBST(GTK_LIBS)
87
601296b4
AG
88dnl Test for libunistring for correct UTF-8 printf
89AC_CHECK_LIB(unistring, ulc_fprintf)
90
7e60a2a7
AG
91dnl Supress extra linking
92AC_MSG_CHECKING([whether $LD accepts --as-needed])
93case `$LD --as-needed -v 2>&1 </dev/null` in
94*GNU* | *'with BFD'*)
95 LDFLAGS="$LDFLAGS -Wl,--as-needed"
96 AC_MSG_RESULT([yes])
97 ;;
98*)
99 AC_MSG_RESULT([no])
100 ;;
101esac
102
4185d89e
AG
103dnl Fix invalid sysconfdir when --prefix=/usr
104if test `eval "echo $sysconfdir"` = /usr/etc
105then
106 sysconfdir=/etc
107fi
108
109dnl Finish all
110AC_CONFIG_FILES([
111 Makefile
c6e7c29a 112 lxhotkey.pc
4185d89e
AG
113 src/Makefile
114 plugins/Makefile
115 po/Makefile.in
f44d3df1 116 man/lxhotkey.1
4185d89e
AG
117])
118AC_OUTPUT