1 | AC_DEFUN([AC_FYI], [echo "FYI: " $1]) |
---|
2 | |
---|
3 | AC_INIT(gconf/gconf.h) |
---|
4 | |
---|
5 | AM_CONFIG_HEADER(config.h) |
---|
6 | |
---|
7 | AM_INIT_AUTOMAKE(GConf, 2.2.0) |
---|
8 | |
---|
9 | AM_MAINTAINER_MODE |
---|
10 | |
---|
11 | AC_PROG_CC |
---|
12 | AC_PROG_CXX |
---|
13 | AC_ISC_POSIX |
---|
14 | AM_PROG_CC_STDC |
---|
15 | AC_HEADER_STDC |
---|
16 | AC_ARG_PROGRAM |
---|
17 | AM_PROG_LIBTOOL |
---|
18 | |
---|
19 | changequote(,)dnl |
---|
20 | if test "x$GCC" = "xyes"; then |
---|
21 | case " $CFLAGS " in |
---|
22 | *[\ \ ]-Wall[\ \ ]*) ;; |
---|
23 | *) CFLAGS="$CFLAGS -Wall" ;; |
---|
24 | esac |
---|
25 | |
---|
26 | if test "x$enable_ansi" = "xyes"; then |
---|
27 | case " $CFLAGS " in |
---|
28 | *[\ \ ]-ansi[\ \ ]*) ;; |
---|
29 | *) CFLAGS="$CFLAGS -ansi" ;; |
---|
30 | esac |
---|
31 | |
---|
32 | case " $CFLAGS " in |
---|
33 | *[\ \ ]-pedantic[\ \ ]*) ;; |
---|
34 | *) CFLAGS="$CFLAGS -pedantic" ;; |
---|
35 | esac |
---|
36 | fi |
---|
37 | fi |
---|
38 | changequote([,])dnl |
---|
39 | |
---|
40 | dnl used to rename everything and support simultaneous installs. |
---|
41 | dnl not incremented for bugfix or unstable releases. |
---|
42 | MAJOR_VERSION=2 |
---|
43 | AC_SUBST(MAJOR_VERSION) |
---|
44 | |
---|
45 | GETTEXT_PACKAGE=GConf$MAJOR_VERSION |
---|
46 | AC_SUBST(GETTEXT_PACKAGE) |
---|
47 | AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package]) |
---|
48 | |
---|
49 | dnl libtool versioning for libgconf |
---|
50 | |
---|
51 | dnl increment if the interface has additions, changes, removals. |
---|
52 | GCONF_CURRENT=5 |
---|
53 | |
---|
54 | dnl increment any time the source changes; set to |
---|
55 | dnl 0 if you increment CURRENT |
---|
56 | GCONF_REVISION=0 |
---|
57 | |
---|
58 | dnl increment if any interfaces have been added; set to 0 |
---|
59 | dnl if any interfaces have been removed. removal has |
---|
60 | dnl precedence over adding, so set to 0 if both happened. |
---|
61 | GCONF_AGE=1 |
---|
62 | |
---|
63 | AC_SUBST(GCONF_CURRENT) |
---|
64 | AC_SUBST(GCONF_REVISION) |
---|
65 | AC_SUBST(GCONF_AGE) |
---|
66 | |
---|
67 | # find the actual value for $prefix that we'll end up with |
---|
68 | REAL_PREFIX= |
---|
69 | if test "x$prefix" = "xNONE"; then |
---|
70 | REAL_PREFIX=$ac_default_prefix |
---|
71 | else |
---|
72 | REAL_PREFIX=$prefix |
---|
73 | fi |
---|
74 | |
---|
75 | # Have to go $sysconfdir->$prefix/etc->/usr/local/etc |
---|
76 | # if you actually know how to code shell then fix this :-) |
---|
77 | SYSCONFDIR_TMP="$sysconfdir" |
---|
78 | old_prefix=$prefix |
---|
79 | prefix=$REAL_PREFIX |
---|
80 | EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP` |
---|
81 | prefix=$old_prefix |
---|
82 | AC_SUBST(EXPANDED_SYSCONFDIR) |
---|
83 | |
---|
84 | dnl Save flags to aclocal |
---|
85 | ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" |
---|
86 | |
---|
87 | dnl Specify the configuration source, default to xml::$(sysconfdir)/gconf/gconf.xml.defaults |
---|
88 | |
---|
89 | GCONF_CONFIG_SOURCE= |
---|
90 | AC_ARG_ENABLE(gconf-source, |
---|
91 | [ --enable-gconf-source=sourceaddress Where to install schema files.],GCONF_CONFIG_SOURCE=$enable_gconf_source,) |
---|
92 | |
---|
93 | if test "x$GCONF_CONFIG_SOURCE" = "x"; then |
---|
94 | GCONF_CONFIG_SOURCE="xml::\${sysconfdir}/gconf/gconf.xml.defaults" |
---|
95 | INSTALL_GCONF_CONFIG_SOURCE="xml::\$(DESTDIR)\${sysconfdir}/gconf/gconf.xml.defaults" |
---|
96 | AC_FYI("Using default config source $GCONF_CONFIG_SOURCE for schema installation") |
---|
97 | else |
---|
98 | AC_FYI("Using config source $GCONF_CONFIG_SOURCE for schema installation") |
---|
99 | fi |
---|
100 | |
---|
101 | AC_SUBST(GCONF_CONFIG_SOURCE) |
---|
102 | AC_SUBST(INSTALL_GCONF_CONFIG_SOURCE) |
---|
103 | |
---|
104 | dnl Default to debug spew in unstable branch |
---|
105 | AC_ARG_ENABLE(debug, |
---|
106 | [ --enable-debug=[no/yes/minimum] Compile with debug checks.],,enable_debug=minimum) |
---|
107 | |
---|
108 | if test "x$enable_debug" = "xyes"; then |
---|
109 | CFLAGS="$CFLAGS -DGCONF_ENABLE_DEBUG=1" |
---|
110 | AC_FYI("Will build with debugging spew and checks") |
---|
111 | else |
---|
112 | if test "x$enable_debug" = "xno"; then |
---|
113 | CFLAGS="$CFLAGS -DG_DISABLE_CHECKS=1 -DG_DISABLE_ASSERT=1" |
---|
114 | AC_FYI("Will build without *any* debugging code") |
---|
115 | else |
---|
116 | AC_FYI("Will build with debug checks but no debug spew") |
---|
117 | fi |
---|
118 | fi |
---|
119 | |
---|
120 | AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) |
---|
121 | |
---|
122 | if test "x$with_html_dir" = "x" ; then |
---|
123 | HTML_DIR='${datadir}/gtk-doc/html' |
---|
124 | else |
---|
125 | HTML_DIR=$with_html_dir |
---|
126 | fi |
---|
127 | |
---|
128 | AC_SUBST(HTML_DIR) |
---|
129 | |
---|
130 | |
---|
131 | AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) |
---|
132 | |
---|
133 | gtk_doc_min_version=0.6 |
---|
134 | if $GTKDOC ; then |
---|
135 | gtk_doc_version=`gtkdoc-mkdb --version` |
---|
136 | AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version]) |
---|
137 | |
---|
138 | IFS="${IFS= }"; gconf_save_IFS="$IFS"; IFS="." |
---|
139 | set $gtk_doc_version |
---|
140 | for min in $gtk_doc_min_version ; do |
---|
141 | cur=$1; shift |
---|
142 | if test -z $min ; then break; fi |
---|
143 | if test -z $cur ; then GTKDOC=false; break; fi |
---|
144 | if test $cur -gt $min ; then break ; fi |
---|
145 | if test $cur -lt $min ; then GTKDOC=false; break ; fi |
---|
146 | done |
---|
147 | IFS="$gconf_save_IFS" |
---|
148 | |
---|
149 | if $GTKDOC ; then |
---|
150 | AC_MSG_RESULT(yes) |
---|
151 | else |
---|
152 | AC_MSG_RESULT(no) |
---|
153 | fi |
---|
154 | fi |
---|
155 | |
---|
156 | AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC) |
---|
157 | AC_SUBST(HAVE_GTK_DOC) |
---|
158 | |
---|
159 | AC_CHECK_PROG(DB2HTML, db2html, true, false) |
---|
160 | AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) |
---|
161 | |
---|
162 | dnl Let people disable the gtk-doc stuff. |
---|
163 | AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) |
---|
164 | |
---|
165 | if test x$enable_gtk_doc = xauto ; then |
---|
166 | if test x$GTKDOC = xtrue ; then |
---|
167 | enable_gtk_doc=yes |
---|
168 | else |
---|
169 | enable_gtk_doc=no |
---|
170 | fi |
---|
171 | fi |
---|
172 | |
---|
173 | dnl NOTE: We need to use a separate automake conditional for this |
---|
174 | dnl to make this work with the tarballs. |
---|
175 | AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) |
---|
176 | |
---|
177 | |
---|
178 | |
---|
179 | PKGCONFIG_MODULES='gmodule-2.0 >= 2.0.1 gobject-2.0 >= 2.0.1 ORBit-2.0 >= 2.4.0 linc >= 0.5.0' |
---|
180 | PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0" |
---|
181 | PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-2.0 >= 2.0.0" |
---|
182 | PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-2.0 libxml-2.0" |
---|
183 | |
---|
184 | PKG_CHECK_MODULES(DEPENDENT, $PKGCONFIG_MODULES) |
---|
185 | PKG_CHECK_MODULES(DEPENDENT_WITH_XML, $PKGCONFIG_MODULES_WITH_XML) |
---|
186 | PKG_CHECK_MODULES(DEPENDENT_WITH_GTK, $PKGCONFIG_MODULES_WITH_GTK, HAVE_GTK=yes, HAVE_GTK=no) |
---|
187 | PKG_CHECK_MODULES(DEPENDENT_WITH_XML_AND_GTK, $PKGCONFIG_MODULES_WITH_XML_AND_GTK, , |
---|
188 | DEPENDENT_WITH_XML_AND_GTK_CFLAGS=$DEPENDENT_WITH_XML_CFLAGS DEPENDENT_WITH_XML_AND_GTK_LIBS=$DEPENDENT_WITH_XML_LIBS) |
---|
189 | |
---|
190 | AM_CONDITIONAL(GTK, test x$HAVE_GTK != xno) |
---|
191 | |
---|
192 | AC_SUBST(DEPENDENT_LIBS) |
---|
193 | AC_SUBST(DEPENDENT_CFLAGS) |
---|
194 | AC_SUBST(DEPENDENT_WITH_XML_LIBS) |
---|
195 | AC_SUBST(DEPENDENT_WITH_XML_CFLAGS) |
---|
196 | AC_SUBST(DEPENDENT_WITH_GTK_LIBS) |
---|
197 | AC_SUBST(DEPENDENT_WITH_GTK_CFLAGS) |
---|
198 | AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_LIBS) |
---|
199 | AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_CFLAGS) |
---|
200 | |
---|
201 | |
---|
202 | AC_ARG_ENABLE(bdbbackend, Enable BDB backend,,enable_bdbbackend=no) |
---|
203 | AC_ARG_WITH(db3-includes, [ --with-db3-includes=PREFIX Location of DB3 includes.], |
---|
204 | with_db3_includes="$withval", with_db3_includes="/usr/include") |
---|
205 | AC_ARG_WITH(db3-libs, [ --with-db3-libs=PREFIX Location of DB3 libs.], |
---|
206 | with_db3_libs="$withval", with_db3_libs="/usr/lib") |
---|
207 | |
---|
208 | BDB_LIBS= |
---|
209 | BDB_CFLAGS= |
---|
210 | |
---|
211 | if test "x$enable_bdbbackend" = "xyes"; then |
---|
212 | have_db3_includes="no" |
---|
213 | if test "x${with_db3_includes}" != "xno"; then |
---|
214 | CPPFLAGS_save="$CPPFLAGS" |
---|
215 | |
---|
216 | AC_MSG_CHECKING(for DB3 includes in $with_db3_includes) |
---|
217 | AC_MSG_RESULT("") |
---|
218 | |
---|
219 | CPPFLAGS="$CPPFLAGS -I$with_db3_includes" |
---|
220 | AC_CHECK_HEADERS(db3/db.h, [ db3_includes="yes" ]) |
---|
221 | CPPFLAGS="$CPPFLAGS_save" |
---|
222 | |
---|
223 | if test "x{$db3_includes}" != "xno" -a "x{$db3_includes}" != "x" ; then |
---|
224 | have_db3_includes="yes" |
---|
225 | BDB_CFLAGS="-I$with_db3_includes" |
---|
226 | fi |
---|
227 | else |
---|
228 | AC_MSG_CHECKING(for DB3 includes) |
---|
229 | AC_MSG_RESULT(no) |
---|
230 | fi |
---|
231 | |
---|
232 | have_db3_libs="no" |
---|
233 | if test "x${with_db3_libs}" != "xno" -a "x${have_db3_includes}" != "xno"; then |
---|
234 | CFLAGS_save="$CFLAGS" |
---|
235 | LIBS_save="$LDFLAGS" |
---|
236 | |
---|
237 | AC_CACHE_CHECK([for DB3 libraries], db3_libs, |
---|
238 | [ |
---|
239 | for db3libs in "-ldb-3.3" "-ldb-3.2" "-ldb-3.1" "-ldb-3"; do |
---|
240 | if test "x${with_db3_libs}" != "x"; then |
---|
241 | LIBS="$LIBS -L$with_db3_libs $db3libs" |
---|
242 | else |
---|
243 | LIBS="$LIBS $db3libs" |
---|
244 | fi |
---|
245 | |
---|
246 | AC_TRY_LINK_FUNC(db_env_create, db3_libs="yes", db3_libs="no") |
---|
247 | CFLAGS="$CFLAGS_save" |
---|
248 | LIBS="$LIBS_save" |
---|
249 | |
---|
250 | if test "$db3_libs" = "yes"; then |
---|
251 | break |
---|
252 | fi |
---|
253 | done |
---|
254 | ]) |
---|
255 | if test "x${db3_libs}" != "xno"; then |
---|
256 | have_db3_libs="yes" |
---|
257 | BDB_LIBS="-L$with_db3_libs $db3libs" |
---|
258 | else |
---|
259 | BDB_LIBS="" |
---|
260 | fi |
---|
261 | else |
---|
262 | AC_MSG_CHECKING(for DB3 libraries) |
---|
263 | AC_MSG_RESULT(no) |
---|
264 | fi |
---|
265 | fi |
---|
266 | |
---|
267 | if test "x$BDB_LIBS" = x; then |
---|
268 | AC_MSG_WARN(No db3 library found or bdb not enabled. Not building bdb backend.) |
---|
269 | AC_MSG_WARN([(Note, this is a good thing because the bdb backend doesn't work anyhow.)]) |
---|
270 | fi |
---|
271 | |
---|
272 | AM_CONDITIONAL(BDB, test -n "$BDB_LIBS") |
---|
273 | |
---|
274 | AC_SUBST(BDB_LIBS) |
---|
275 | AC_SUBST(BDB_CFLAGS) |
---|
276 | |
---|
277 | ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`" |
---|
278 | AC_SUBST(ORBIT_IDL) |
---|
279 | |
---|
280 | AC_CHECK_LIB(popt, poptGetArg, POPT_LIBS=-lpopt, |
---|
281 | [AC_CHECK_HEADER(popt.h, , AC_MSG_ERROR([[ |
---|
282 | *** Couldn't find popt. Please download and install from |
---|
283 | *** ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/ and try again.]]))]) |
---|
284 | AC_SUBST(POPT_LIBS) |
---|
285 | |
---|
286 | AC_CHECK_HEADER(pthread.h, have_pthreads=yes) |
---|
287 | AM_CONDITIONAL(PTHREADS, test -n "$have_pthreads") |
---|
288 | |
---|
289 | AC_CHECK_FUNCS(usleep) |
---|
290 | |
---|
291 | AC_CHECK_FUNCS(flockfile) |
---|
292 | |
---|
293 | ALL_LINGUAS="ar az be bg ca cs da de el es eu fi fr ga gl hu it ja ko lv ms nl nn no pl pt pt_BR ro ru sk sl sv tr uk vi zh_CN zh_TW" |
---|
294 | |
---|
295 | AM_GLIB_GNU_GETTEXT |
---|
296 | |
---|
297 | # AM_GNU_GETTEXT above substs $DATADIRNAME |
---|
298 | # this is the directory where the *.{mo,gmo} files are installed |
---|
299 | gconflocaledir='${prefix}/${DATADIRNAME}/locale' |
---|
300 | AC_SUBST(gconflocaledir) |
---|
301 | |
---|
302 | AC_CHECK_FUNCS(bind_textdomain_codeset) |
---|
303 | |
---|
304 | AC_SUBST(CFLAGS) |
---|
305 | AC_SUBST(CPPFLAGS) |
---|
306 | AC_SUBST(LDFLAGS) |
---|
307 | |
---|
308 | ## Just for debugging purposes |
---|
309 | absolute_top_srcdir=`pwd` |
---|
310 | AC_SUBST(absolute_top_srcdir) |
---|
311 | |
---|
312 | # define a MAINT-like variable REBUILD which is set if Perl |
---|
313 | # and awk are found, so autogenerated sources can be rebuilt |
---|
314 | |
---|
315 | AC_PROG_AWK |
---|
316 | AC_CHECK_PROGS(PERL, perl5 perl) |
---|
317 | |
---|
318 | # We would like indent, but don't require it. |
---|
319 | AC_CHECK_PROG(INDENT, indent, indent) |
---|
320 | |
---|
321 | _found_perl=0 |
---|
322 | if test -n "$PERL" && $PERL -v | grep 'version 5.' > /dev/null ; then |
---|
323 | _found_perl=1 |
---|
324 | else |
---|
325 | # The version string for perl changed for 'version 5' to 'v5' in |
---|
326 | # perl 5.6 or therabouts |
---|
327 | if test -n "$PERL" && $PERL -v | grep 'v5.' > /dev/null ; then |
---|
328 | _found_perl=1 |
---|
329 | fi |
---|
330 | fi |
---|
331 | |
---|
332 | REBUILD=\# |
---|
333 | if test $_found_perl -eq 1; then |
---|
334 | if test -n "$AWK" ; then |
---|
335 | REBUILD= |
---|
336 | fi |
---|
337 | fi |
---|
338 | AC_SUBST(REBUILD) |
---|
339 | |
---|
340 | AC_OUTPUT([ |
---|
341 | Makefile |
---|
342 | gconf.spec |
---|
343 | gconf.m4 |
---|
344 | gconf/Makefile |
---|
345 | gconf/default.path |
---|
346 | backends/Makefile |
---|
347 | po/Makefile.in |
---|
348 | doc/Makefile |
---|
349 | doc/gconf/Makefile |
---|
350 | examples/Makefile |
---|
351 | tests/Makefile |
---|
352 | gconf-2.0.pc |
---|
353 | ]) |
---|
354 | |
---|
355 | |
---|