source: trunk/third/GConf2/configure.in @ 18568

Revision 18568, 9.6 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18567, which included commits to RCS files with non-trunk default branches.
Line 
1AC_DEFUN([AC_FYI], [echo "FYI: " $1])
2
3AC_INIT(gconf/gconf.h)
4
5AM_CONFIG_HEADER(config.h)
6
7AM_INIT_AUTOMAKE(GConf, 2.2.0)
8
9AM_MAINTAINER_MODE
10
11AC_PROG_CC
12AC_PROG_CXX
13AC_ISC_POSIX
14AM_PROG_CC_STDC
15AC_HEADER_STDC
16AC_ARG_PROGRAM
17AM_PROG_LIBTOOL
18
19changequote(,)dnl
20if 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
37fi
38changequote([,])dnl
39
40dnl used to rename everything and support simultaneous installs.
41dnl not incremented for bugfix or unstable releases.
42MAJOR_VERSION=2
43AC_SUBST(MAJOR_VERSION)
44
45GETTEXT_PACKAGE=GConf$MAJOR_VERSION
46AC_SUBST(GETTEXT_PACKAGE)
47AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
48
49dnl libtool versioning for libgconf
50
51dnl increment if the interface has additions, changes, removals.
52GCONF_CURRENT=5
53
54dnl increment any time the source changes; set to
55dnl  0 if you increment CURRENT
56GCONF_REVISION=0
57
58dnl increment if any interfaces have been added; set to 0
59dnl  if any interfaces have been removed. removal has
60dnl  precedence over adding, so set to 0 if both happened.
61GCONF_AGE=1
62
63AC_SUBST(GCONF_CURRENT)
64AC_SUBST(GCONF_REVISION)
65AC_SUBST(GCONF_AGE)
66
67# find the actual value for $prefix that we'll end up with
68REAL_PREFIX=
69if test "x$prefix" = "xNONE"; then
70  REAL_PREFIX=$ac_default_prefix
71else
72  REAL_PREFIX=$prefix
73fi
74
75# Have to go $sysconfdir->$prefix/etc->/usr/local/etc   
76# if you actually know how to code shell then fix this :-)
77SYSCONFDIR_TMP="$sysconfdir"
78old_prefix=$prefix
79prefix=$REAL_PREFIX
80EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
81prefix=$old_prefix
82AC_SUBST(EXPANDED_SYSCONFDIR)
83
84dnl Save flags to aclocal
85ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
86
87dnl Specify the configuration source, default to xml::$(sysconfdir)/gconf/gconf.xml.defaults
88
89GCONF_CONFIG_SOURCE=
90AC_ARG_ENABLE(gconf-source,
91            [  --enable-gconf-source=sourceaddress      Where to install schema files.],GCONF_CONFIG_SOURCE=$enable_gconf_source,)
92
93if 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")
97else
98        AC_FYI("Using config source $GCONF_CONFIG_SOURCE for schema installation")
99fi
100
101AC_SUBST(GCONF_CONFIG_SOURCE)
102AC_SUBST(INSTALL_GCONF_CONFIG_SOURCE)
103
104dnl Default to debug spew in unstable branch
105AC_ARG_ENABLE(debug,
106            [  --enable-debug=[no/yes/minimum]      Compile with debug checks.],,enable_debug=minimum)
107
108if test "x$enable_debug" = "xyes"; then
109        CFLAGS="$CFLAGS -DGCONF_ENABLE_DEBUG=1"
110        AC_FYI("Will build with debugging spew and checks")
111else
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
118fi
119
120AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
121
122if test "x$with_html_dir" = "x" ; then
123  HTML_DIR='${datadir}/gtk-doc/html'
124else
125  HTML_DIR=$with_html_dir
126fi
127
128AC_SUBST(HTML_DIR)
129
130
131AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
132
133gtk_doc_min_version=0.6
134if $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
154fi
155
156AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
157AC_SUBST(HAVE_GTK_DOC)
158
159AC_CHECK_PROG(DB2HTML, db2html, true, false)
160AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
161
162dnl Let people disable the gtk-doc stuff.
163AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
164
165if 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
171fi
172
173dnl NOTE: We need to use a separate automake conditional for this
174dnl       to make this work with the tarballs.
175AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
176
177
178
179PKGCONFIG_MODULES='gmodule-2.0 >= 2.0.1 gobject-2.0 >= 2.0.1 ORBit-2.0 >= 2.4.0 linc >= 0.5.0'
180PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0"
181PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-2.0 >= 2.0.0"
182PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-2.0 libxml-2.0"
183
184PKG_CHECK_MODULES(DEPENDENT, $PKGCONFIG_MODULES)
185PKG_CHECK_MODULES(DEPENDENT_WITH_XML, $PKGCONFIG_MODULES_WITH_XML)
186PKG_CHECK_MODULES(DEPENDENT_WITH_GTK, $PKGCONFIG_MODULES_WITH_GTK, HAVE_GTK=yes, HAVE_GTK=no)
187PKG_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
190AM_CONDITIONAL(GTK, test x$HAVE_GTK != xno)
191
192AC_SUBST(DEPENDENT_LIBS)
193AC_SUBST(DEPENDENT_CFLAGS)
194AC_SUBST(DEPENDENT_WITH_XML_LIBS)
195AC_SUBST(DEPENDENT_WITH_XML_CFLAGS)
196AC_SUBST(DEPENDENT_WITH_GTK_LIBS)
197AC_SUBST(DEPENDENT_WITH_GTK_CFLAGS)
198AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_LIBS)
199AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_CFLAGS)
200
201
202AC_ARG_ENABLE(bdbbackend, Enable BDB backend,,enable_bdbbackend=no)
203AC_ARG_WITH(db3-includes, [  --with-db3-includes=PREFIX     Location of DB3 includes.],
204            with_db3_includes="$withval", with_db3_includes="/usr/include")
205AC_ARG_WITH(db3-libs, [  --with-db3-libs=PREFIX     Location of DB3 libs.],
206            with_db3_libs="$withval", with_db3_libs="/usr/lib")
207
208BDB_LIBS=
209BDB_CFLAGS=
210
211if 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
265fi
266
267if 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.)])
270fi
271
272AM_CONDITIONAL(BDB, test -n "$BDB_LIBS")
273
274AC_SUBST(BDB_LIBS)
275AC_SUBST(BDB_CFLAGS)
276
277ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
278AC_SUBST(ORBIT_IDL)
279
280AC_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.]]))])
284AC_SUBST(POPT_LIBS)
285
286AC_CHECK_HEADER(pthread.h, have_pthreads=yes)
287AM_CONDITIONAL(PTHREADS, test -n "$have_pthreads")
288
289AC_CHECK_FUNCS(usleep)
290
291AC_CHECK_FUNCS(flockfile)
292
293ALL_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
295AM_GLIB_GNU_GETTEXT
296
297# AM_GNU_GETTEXT above substs $DATADIRNAME
298# this is the directory where the *.{mo,gmo} files are installed
299gconflocaledir='${prefix}/${DATADIRNAME}/locale'
300AC_SUBST(gconflocaledir)
301
302AC_CHECK_FUNCS(bind_textdomain_codeset)
303
304AC_SUBST(CFLAGS)
305AC_SUBST(CPPFLAGS)
306AC_SUBST(LDFLAGS)
307
308## Just for debugging purposes
309absolute_top_srcdir=`pwd`
310AC_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
315AC_PROG_AWK
316AC_CHECK_PROGS(PERL, perl5 perl)
317
318# We would like indent, but don't require it.
319AC_CHECK_PROG(INDENT, indent, indent)
320
321_found_perl=0
322if test -n "$PERL" && $PERL -v | grep 'version 5.' > /dev/null ; then
323  _found_perl=1
324else
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
330fi
331
332REBUILD=\#
333if test $_found_perl -eq 1; then
334  if test -n "$AWK" ; then
335    REBUILD=
336  fi
337fi
338AC_SUBST(REBUILD)
339
340AC_OUTPUT([
341Makefile
342gconf.spec
343gconf.m4
344gconf/Makefile
345gconf/default.path
346backends/Makefile
347po/Makefile.in
348doc/Makefile
349doc/gconf/Makefile
350examples/Makefile
351tests/Makefile
352gconf-2.0.pc
353])
354
355
Note: See TracBrowser for help on using the repository browser.