AC_DEFUN([AC_FYI], [echo "FYI: " $1]) AC_INIT(gconf/gconf.h) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(GConf-dbus, 2.16.0) AM_MAINTAINER_MODE AC_CANONICAL_HOST case "$host" in *-*-mingw*) os_win32=yes ;; *) os_win32=no ;; esac AM_CONDITIONAL(OS_WIN32, [test "$os_win32" = "yes"]) if test "$os_win32" = "yes"; then if test x$enable_static = xyes -o x$enable_static = x; then AC_MSG_WARN([Disabling static library build, must build as DLL on Windows.]) enable_static=no fi if test x$enable_shared = xno; then AC_MSG_WARN([Enabling shared library build, must build as DLL on Windows.]) fi enable_shared=yes fi AC_PROG_CC AC_PROG_CXX AC_ISC_POSIX AM_PROG_CC_STDC AC_HEADER_STDC #AC_ARG_PROGRAM AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) changequote(,)dnl if test "x$GCC" = "xyes"; then case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac if test "x$enable_ansi" = "xyes"; then case " $CFLAGS " in *[\ \ ]-ansi[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ansi" ;; esac case " $CFLAGS " in *[\ \ ]-pedantic[\ \ ]*) ;; *) CFLAGS="$CFLAGS -pedantic" ;; esac fi fi changequote([,])dnl dnl used to rename everything and support simultaneous installs. dnl not incremented for bugfix or unstable releases. MAJOR_VERSION=2 AC_SUBST(MAJOR_VERSION) GETTEXT_PACKAGE=GConf$MAJOR_VERSION AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package]) dnl libtool versioning for libgconf dnl increment if the interface has additions, changes, removals. GCONF_CURRENT=5 dnl increment any time the source changes; set to dnl 0 if you increment CURRENT GCONF_REVISION=0 dnl increment if any interfaces have been added; set to 0 dnl if any interfaces have been removed. removal has dnl precedence over adding, so set to 0 if both happened. GCONF_AGE=1 AC_SUBST(GCONF_CURRENT) AC_SUBST(GCONF_REVISION) AC_SUBST(GCONF_AGE) # find the actual value for $prefix that we'll end up with REAL_PREFIX= if test "x$prefix" = "xNONE"; then REAL_PREFIX=$ac_default_prefix else REAL_PREFIX=$prefix fi AC_ARG_WITH(sysconfsubdir, AC_HELP_STRING([--with-sysconfsubdir], [directory name used under sysconfdir, default=gconf]), sysconfsubdir=${withval}, sysconfsubdir=gconf) AC_SUBST(sysconfsubdir) if test x"${sysconfsubdir}" != x; then sysgconfdir='${sysconfdir}/${sysconfsubdir}' else sysgconfdir='${sysconfdir}' fi AC_SUBST(sysgconfdir) dnl Save flags to aclocal ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" dnl Default to debug spew in unstable branch AC_ARG_ENABLE(debug, [ --enable-debug=[no/yes/minimum] Compile with debug checks.],,enable_debug=minimum) if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -DGCONF_ENABLE_DEBUG=1" AC_FYI("Will build with debugging spew and checks") else if test "x$enable_debug" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CHECKS=1 -DG_DISABLE_ASSERT=1" AC_FYI("Will build without *any* debugging code") else AC_FYI("Will build with debug checks but no debug spew") fi fi GTK_DOC_CHECK([1.0]) AC_ARG_ENABLE(gtk, [ --enable-gtk Enable GTK+ support (for gconf-sanity-check) [default=auto]], enable_gtk="$enableval", enable_gtk=auto) AC_ARG_ENABLE(system-bus, [ --enable-system-bus Use the system bus instead of session bus], enable_system_bus="$enableval", enable_system_bus=no) AM_CONDITIONAL(USE_SYSTEM_BUS, test x$enable_system_bus = xyes) if test x$enable_system_bus = xyes; then AC_DEFINE(USE_SYSTEM_BUS, 1, Use the system bus) fi AC_ARG_WITH(dbus_service_dir, [ --with-dbus-service-dir=PATH choose directory for dbus service files, [default=PREFIX/share/dbus-1/services]], with_dbus_service_dir="$withval", with_dbus_service_dir=$datadir/dbus-1/services) DBUS_SERVICE_DIR=$with_dbus_service_dir AC_SUBST(DBUS_SERVICE_DIR) PKGCONFIG_MODULES='glib-2.0 > 2.8.0 gmodule-2.0 >= 2.7.0 gobject-2.0 >= 2.7.0 dbus-glib-1 >= 0.60' PKGCONFIG_MODULES_WITH_XML="$PKGCONFIG_MODULES libxml-2.0" PKGCONFIG_MODULES_WITH_GTK=" $PKGCONFIG_MODULES gtk+-2.0 >= 2.0.0" PKGCONFIG_MODULES_WITH_XML_AND_GTK=" $PKGCONFIG_MODULES gtk+-2.0 libxml-2.0" PKG_CHECK_MODULES(DEPENDENT, $PKGCONFIG_MODULES) PKG_CHECK_MODULES(DEPENDENT_WITH_XML, $PKGCONFIG_MODULES_WITH_XML) if test "x$enable_gtk" != "xno"; then PKG_CHECK_MODULES(DEPENDENT_WITH_GTK, $PKGCONFIG_MODULES_WITH_GTK, HAVE_GTK=yes, HAVE_GTK=no) PKG_CHECK_MODULES(DEPENDENT_WITH_XML_AND_GTK, $PKGCONFIG_MODULES_WITH_XML_AND_GTK, , DEPENDENT_WITH_XML_AND_GTK_CFLAGS=$DEPENDENT_WITH_XML_CFLAGS DEPENDENT_WITH_XML_AND_GTK_LIBS=$DEPENDENT_WITH_XML_LIBS) if test "x$enable_gtk" = "xyes" && test "x$HAVE_GTK" = "xno"; then AC_MSG_ERROR([[ *** Could not find GTK+ 2.0 or greater. *** Go to http://www.gtk.org/ to get it.]]) fi else HAVE_GTK=no DEPENDENT_WITH_XML_AND_GTK_CFLAGS=$DEPENDENT_WITH_XML_CFLAGS DEPENDENT_WITH_XML_AND_GTK_LIBS=$DEPENDENT_WITH_XML_LIBS fi AM_CONDITIONAL(GTK, test x$HAVE_GTK != xno) AC_SUBST(DEPENDENT_LIBS) AC_SUBST(DEPENDENT_CFLAGS) AC_SUBST(DEPENDENT_WITH_XML_LIBS) AC_SUBST(DEPENDENT_WITH_XML_CFLAGS) AC_SUBST(DEPENDENT_WITH_GTK_LIBS) AC_SUBST(DEPENDENT_WITH_GTK_CFLAGS) AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_LIBS) AC_SUBST(DEPENDENT_WITH_XML_AND_GTK_CFLAGS) #ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`" #AC_SUBST(ORBIT_IDL) AC_CHECK_HEADER(popt.h, , AC_MSG_ERROR([[ *** Couldn't find popt. Please download and install from *** ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/ and try again.]])) AC_CHECK_HEADER(pthread.h, have_pthreads=yes) AM_CONDITIONAL(PTHREADS, test -n "$have_pthreads") AC_CHECK_HEADERS(syslog.h sys/wait.h) AC_CHECK_FUNCS(getuid sigaction fsync fchmod) LDAP_LIBS= AC_CHECK_HEADER(ldap.h, [ AC_CHECK_LIB(ldap, ldap_init, [LDAP_LIBS="-lldap"]) ]) AC_SUBST(LDAP_LIBS) AM_CONDITIONAL(LDAP_SUPPORT, test -n "$LDAP_LIBS") dnl ************************************************** dnl LDAP support. dnl ************************************************** if test "$os_win32" != yes; then SAVE_CFLAGS="$CFLAGS" SAVE_LIBS="$LIBS" LDAP_CFLAGS="-DLDAP_DEPRECATED" CFLAGS="$CFLAGS $LDAP_CFLAGS" LIBS="$LIBS $LDAP_LIBS" AC_CHECK_FUNCS(ldap_ntlm_bind) CFLAGS="$SAVE_CFLAGS" LIBS="$SAVE_LIBS" else # Win32 LDAP_CFLAGS="-DLDAP_DEPRECATED" LDAP_LIBS="-lwldap32" AC_SUBST(LDAP_CFLAGS) AC_SUBST(LDAP_LIBS) AC_DEFINE(HAVE_LDAP,1,[Define if you have LDAP support]) msg_ldap="yes" fi # Win32 IT_PROG_INTLTOOL([0.33]) AM_GLIB_GNU_GETTEXT # AM_GNU_GETTEXT above substs $DATADIRNAME # this is the directory where the *.{mo,gmo} files are installed gconflocaledir='${prefix}/${DATADIRNAME}/locale' AC_SUBST(gconflocaledir) AC_CHECK_FUNCS(bind_textdomain_codeset) AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) ## Just for debugging purposes absolute_top_srcdir=`pwd` AC_SUBST(absolute_top_srcdir) # define a MAINT-like variable REBUILD which is set if Perl # and awk are found, so autogenerated sources can be rebuilt AC_PROG_AWK AC_CHECK_PROGS(PERL, perl5 perl) # We would like indent, but don't require it. AC_CHECK_PROG(INDENT, indent, indent) _found_perl=0 if test -n "$PERL" && $PERL -v | grep 'version 5.' > /dev/null ; then _found_perl=1 else # The version string for perl changed for 'version 5' to 'v5' in # perl 5.6 or therabouts if test -n "$PERL" && $PERL -v | grep 'v5.' > /dev/null ; then _found_perl=1 fi fi REBUILD=\# if test $_found_perl -eq 1; then if test -n "$AWK" ; then REBUILD= fi fi AC_SUBST(REBUILD) AC_OUTPUT([ Makefile gconf-2.m4 gconf-zip gconf/Makefile backends/Makefile po/Makefile.in doc/Makefile doc/gconf/Makefile examples/Makefile tests/Makefile dbus-tests/Makefile gconf-2.0.pc ])