[i18n] Add Portuguese translation.
[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
b5dcb86b
AG
33# Generate po/LINGUAS for available PO files
34rm -f $srcdir/po/LINGUAS
35for po_file in `ls $srcdir/po/*.po | sort`;
36do
37 lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"`
38 echo $lang >> $srcdir/po/LINGUAS
39done
40
35e537d9 41# Handle --enable-debug option
4185d89e
AG
42AC_ARG_ENABLE(debug,
43 [AC_HELP_STRING([--enable-debug],
44 [enable debug support @<:@default=no@:>@])],
45 [enable_debug="${enableval}"],
46 [enable_debug=no]
47)
48if test "$enable_debug" = "yes"; then
49 # turn on debug and disable optimization
50 CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g"
51 case "$CC" in
52 gcc*)
53 CPPFLAGS="$CPPFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration"
54 ;;
55 *)
56 ;;
57 esac
58 dnl Be more strict on portability
59 #CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=700"
60else
61 # turn off glib debug checks
62 CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
63fi
64
35e537d9
AG
65dnl Test for required libraries
66pkg_modules="libfm >= 1.2.0 x11"
67PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
68AC_SUBST(PACKAGE_CFLAGS)
69AC_SUBST(PACKAGE_LIBS)
70
0cdc072f
AG
71dnl GTK+ stuff
72AC_ARG_WITH(gtk,
73 [AC_HELP_STRING([--with-gtk=VER],
74 [build 'gtk' GUI, choose GTK+ version for build])
75AC_HELP_STRING([--without-gtk],
76 [disable 'gtk' GUI build @<:@default@:>@])],
77 [ac_with_gtk="${withval}"],
78 [ac_with_gtk=no]
79)
80
81if test x"$ac_with_gtk" != xno; then
82 case "$ac_with_gtk" in
83 3|3.*)
84 pkg_modules="gtk+-3.0"
85 ;;
86 *)
87 pkg_modules="gtk+-2.0 >= 2.18.0"
88 ;;
89 esac
90 PKG_CHECK_MODULES(GTK, [$pkg_modules], [with_gtk=yes], [with_gtk=no])
91fi
92AM_CONDITIONAL(WITH_GTK, [test x$with_gtk = xyes])
93AC_SUBST(GTK_CFLAGS)
94AC_SUBST(GTK_LIBS)
95
601296b4
AG
96dnl Test for libunistring for correct UTF-8 printf
97AC_CHECK_LIB(unistring, ulc_fprintf)
98
7e60a2a7
AG
99dnl Supress extra linking
100AC_MSG_CHECKING([whether $LD accepts --as-needed])
101case `$LD --as-needed -v 2>&1 </dev/null` in
102*GNU* | *'with BFD'*)
103 LDFLAGS="$LDFLAGS -Wl,--as-needed"
104 AC_MSG_RESULT([yes])
105 ;;
106*)
107 AC_MSG_RESULT([no])
108 ;;
109esac
110
4185d89e
AG
111dnl Fix invalid sysconfdir when --prefix=/usr
112if test `eval "echo $sysconfdir"` = /usr/etc
113then
114 sysconfdir=/etc
115fi
116
117dnl Finish all
118AC_CONFIG_FILES([
119 Makefile
c6e7c29a 120 lxhotkey.pc
4185d89e
AG
121 src/Makefile
122 plugins/Makefile
123 po/Makefile.in
f44d3df1 124 man/lxhotkey.1
4185d89e
AG
125])
126AC_OUTPUT