Commit | Line | Data |
---|---|---|
0cd84ed6 HJYP |
1 | # -*- Autoconf -*- |
2 | # Process this file with autoconf to produce a configure script. | |
af8a1e47 | 3 | AC_PREREQ([2.64]) |
1f65c948 | 4 | AC_INIT([lxappearance],[0.5.5],[http://lxde.org/]) |
53c66dba | 5 | AM_INIT_AUTOMAKE([1.11 -Wall -Werror foreign subdir-objects no-dist-gzip dist-xz]) |
0cd84ed6 | 6 | |
6a425f6b JL |
7 | # intltool |
8 | IT_PROG_INTLTOOL([0.40.0]) | |
9 | ||
10 | #Initialize libtool | |
11 | LT_PREREQ([2.2.6]) | |
12 | LT_INIT() | |
0cd84ed6 | 13 | |
8f1bbe3f JL |
14 | # Support silent build rules. Disable by either passing --disable-silent-rules |
15 | # to configure or passing V=1 to make | |
16 | AM_SILENT_RULES([yes]) | |
17 | ||
29e7d940 | 18 | AC_CONFIG_HEADERS([config.h]) |
6a425f6b | 19 | AC_CONFIG_MACRO_DIR([m4]) |
29e7d940 | 20 | |
6a425f6b | 21 | # C compiler |
0cd84ed6 | 22 | AC_PROG_CC |
6a425f6b JL |
23 | AC_PROG_INSTALL |
24 | AM_PROG_CC_C_O | |
25 | AC_PROG_CC_STDC | |
0cd84ed6 HJYP |
26 | |
27 | # Checks for libraries. | |
28 | ||
29 | # Checks for header files. | |
0cd84ed6 HJYP |
30 | |
31 | # Checks for typedefs, structures, and compiler characteristics. | |
32 | ||
33 | # Checks for library functions. | |
34 | ||
0cd84ed6 | 35 | |
62d4031f | 36 | AC_ARG_ENABLE(man, |
44b9b0f2 | 37 | AS_HELP_STRING([--enable-man],[regenerate roff man pages from Docbook @<:@default=yes@:>@]), |
c7b7bbfe DB |
38 | [case "${enableval}" in |
39 | yes) enable_man=yes ;; | |
40 | no) enable_man=no ;; | |
41 | *) AC_MSG_ERROR([bad value "${enableval}" for --enable-man, use "yes" (default) or "no".]) ;; | |
42 | esac],[]) | |
62d4031f | 43 | |
e2eadb8a | 44 | AC_ARG_ENABLE(more_warnings, |
44b9b0f2 | 45 | [AS_HELP_STRING([--enable-more-warnings], |
e2eadb8a JL |
46 | [Add more warnings @<:@default=no@:>@])], |
47 | [enable_more_warnings="${enableval}"], | |
48 | [enable_more_warnings=no] | |
49 | ) | |
50 | ||
8108db6a | 51 | AC_ARG_ENABLE(gtk3, |
44b9b0f2 | 52 | AS_HELP_STRING([--enable-gtk3],[enable to use gtk-3.0 instead of gtk-2.0]), |
8108db6a JL |
53 | [case "${enableval}" in |
54 | yes) enable_gtk3=yes ;; | |
55 | no) enable_gtk3=no ;; | |
56 | *) AC_MSG_ERROR([bad value "${enableval}" for --enable-gtk3, use "yes" (default) or "no".]) ;; | |
57 | esac],[]) | |
58 | ||
9f90caed HJYP |
59 | PKG_CHECK_MODULES(XLIB, "x11") |
60 | AC_SUBST(XLIB_CFLAGS) | |
61 | AC_SUBST(XLIB_LIBS) | |
0cd84ed6 | 62 | |
8108db6a JL |
63 | if test "x$enable_gtk3" = "xyes" ; then |
64 | CFLAGS="$CFLAGS -DENABLE_GTK3" | |
65 | gtk_modules="gtk+-3.0 >= 3.0.0" | |
66 | else | |
67 | gtk_modules="gtk+-2.0 >= 2.12.0 gthread-2.0" | |
68 | fi | |
69 | ||
756f0a66 | 70 | PKG_CHECK_MODULES(GTK, [$gtk_modules]) |
0cd84ed6 HJYP |
71 | AC_SUBST(GTK_CFLAGS) |
72 | AC_SUBST(GTK_LIBS) | |
73 | ||
c847cfdc JL |
74 | AC_ARG_ENABLE(dbus, |
75 | [AS_HELP_STRING([--enable-dbus], | |
76 | [Use Dbus support (usefull for lxsession > 0.4.9) @<:@default=no@:>@])], | |
77 | [enable_dbus="${enableval}"], | |
78 | [enable_dbus=no] | |
79 | ) | |
80 | ||
81 | ||
82 | if test x"$enable_dbus" = x"yes"; then | |
83 | PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.95 dbus-glib-1 >= 0.70]) | |
84 | CFLAGS="$CFLAGS -DENABLE_DBUS" | |
85 | fi | |
a9567f8c JL |
86 | AC_SUBST(DBUS_CFLAGS) |
87 | AC_SUBST(DBUS_LIBS) | |
88 | ||
c847cfdc JL |
89 | |
90 | ||
756f0a66 HJYP |
91 | gmodule_modules="gmodule-export-2.0" |
92 | PKG_CHECK_MODULES(GMODULE, [$gmodule_modules]) | |
93 | AC_SUBST(GMODULE_CFLAGS) | |
94 | AC_SUBST(GMODULE_LIBS) | |
95 | ||
0cd84ed6 HJYP |
96 | # gio_modules="gthread-2.0 gio-unix-2.0 glib-2.0 >= 2.18.0" |
97 | # PKG_CHECK_MODULES(GIO, [$gio_modules]) | |
98 | # AC_SUBST(GIO_CFLAGS) | |
99 | # AC_SUBST(GIO_LIBS) | |
100 | ||
101 | # menu_modules="libmenu-cache >= 0.3.2" | |
102 | # PKG_CHECK_MODULES(MENU_CACHE, [$menu_modules]) | |
103 | # AC_SUBST(MENU_CACHE_CFLAGS) | |
104 | # AC_SUBST(MENU_CACHE_LIBS) | |
105 | ||
e2eadb8a | 106 | if test x"$enable_more_warnings" = x"yes"; then |
8f1bbe3f JL |
107 | ADDITIONAL_FLAGS="-Wall -Werror=all -Werror=format -Werror=implicit-function-declaration -Werror=implicit-int -Werror=missing-braces -Werror=parentheses -Werror=return-type -Werror=strict-aliasing -Werror=switch -Wuninitialized -Werror=unused-label -Werror=unused-value -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Werror=missing-declarations -Wredundant-decls -Wmissing-noreturn -Wpointer-arith -Wcast-align -Wwrite-strings -Werror=inline -Werror=format-nonliteral -Wformat-nonliteral -Werror=format-security -Wformat-security -Winit-self -Werror=missing-include-dirs -Werror=undef -Werror=aggregate-return -Wmissing-format-attribute -Werror=nested-externs -fno-strict-aliasing -fmessage-length=0 -Wp,-D_FORTIFY_SOURCE=2 -DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES" |
108 | fi | |
109 | AC_SUBST(ADDITIONAL_FLAGS) | |
110 | ||
62d4031f | 111 | AC_ARG_ENABLE(man, |
44b9b0f2 | 112 | [AS_HELP_STRING([--enable-man], |
62d4031f JL |
113 | [regenerate roff man pages from Docbook @<:@default=no@:>@])], |
114 | [enable_man="${enableval}"], | |
115 | [enable_man=no] | |
0cd84ed6 | 116 | ) |
62d4031f | 117 | |
0cd84ed6 HJYP |
118 | if test "$enable_debug" = "yes"; then |
119 | # turn on debug and disable optimization | |
120 | CPPFLAGS="$CPPFLAGS -DG_ENABLE_DEBUG -O0 -g" | |
121 | else | |
122 | # turn off glib debug checks | |
123 | CPPFLAGS="$CPPFLAGS -DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS" | |
124 | fi | |
125 | ||
126 | # Generate po/LINGUAS on the fly rather than relying on translators | |
127 | # to maintain it manually. This also overcome the problem that Transifex | |
128 | # cannot add a language to po/LINGUAS if a new po file is submitted. | |
129 | rm -f $srcdir/po/LINGUAS | |
130 | for po_file in `ls $srcdir/po/*.po | sort`; | |
131 | do | |
132 | lang=`echo "$po_file" | sed "s|.*/po/\(.*\)\.po|\1|g"` | |
133 | echo $lang >> $srcdir/po/LINGUAS | |
134 | done | |
135 | ||
108e166e | 136 | GETTEXT_PACKAGE=lxappearance |
0cd84ed6 HJYP |
137 | AC_SUBST(GETTEXT_PACKAGE) |
138 | AM_GLIB_GNU_GETTEXT | |
139 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.]) | |
140 | ||
62d4031f JL |
141 | if test x"$enable_man" = x"yes"; then |
142 | AC_PATH_PROG([XSLTPROC], [xsltproc]) | |
143 | if test -z "$XSLTPROC"; then | |
144 | enable_man=no | |
145 | fi | |
146 | ||
147 | dnl check for DocBook DTD and stylesheets in the local catalog. | |
148 | JH_CHECK_XML_CATALOG([-//OASIS//DTD DocBook XML V4.1.2//EN], | |
149 | [DocBook XML DTD V4.1.2], [], enable_man=no) | |
150 | JH_CHECK_XML_CATALOG([http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl], | |
151 | [DocBook XSL Stylesheets >= 1.70.1], [], enable_man=no) | |
152 | fi | |
153 | ||
bb69b4af | 154 | AM_CONDITIONAL(ENABLE_MAN, test "x$enable_man" != "xno") |
62d4031f | 155 | |
0cd84ed6 HJYP |
156 | AC_CONFIG_FILES([ |
157 | Makefile | |
0cd84ed6 HJYP |
158 | data/Makefile |
159 | data/ui/Makefile | |
39bff85f | 160 | data/ui/about.ui |
756f0a66 | 161 | data/lxappearance.pc |
62d4031f | 162 | man/Makefile |
0cd84ed6 | 163 | po/Makefile.in |
6a425f6b | 164 | src/Makefile |
0cd84ed6 HJYP |
165 | ]) |
166 | ||
167 | AC_OUTPUT | |
168 | ||
6a425f6b JL |
169 | echo |
170 | echo lxappearance....................... : Version $VERSION | |
171 | echo | |
172 | echo Enable debug....................: "$enable_debug" | |
173 | echo Enable Dbus support.............: "$enable_dbus" | |
174 | echo Prefix..........................: $prefix | |
175 | echo | |
176 | echo The binary will be installed in $prefix/bin | |
177 | echo | |
178 | echo http://lxde.org/ | |
179 | echo | |
180 | echo "Ready to make lxappearance. Type 'make' to continue." | |
181 | echo | |
182 |