dnl Process this file with autoconf to produce a configure script. AC_INIT(configure.in) AM_INIT_AUTOMAKE(g2c, 0.4) AM_CONFIG_HEADER(config.h) dnl Pick up the Gnome macros. AM_ACLOCAL_INCLUDE(macros) GNOME_INIT AC_ISC_POSIX AC_PROG_CC AM_PROG_CC_STDC AC_HEADER_STDC GNOME_COMPILE_WARNINGS GNOME_X_CHECKS XML_CHECK GNOME_ORBIT_CHECK BONOBO_CHECK dnl *************************************************************************** dnl GTK+ - Checks the version and sets GTK_CFLAGS & GTK_LIBS. dnl *************************************************************************** AM_PATH_GTK(1.2.0,, AC_MSG_ERROR(Cannot find GTK: Is gtk-config in path?)) dnl Add the languages which your application supports here. ALL_LINGUAS="" AM_GNU_GETTEXT dnl Set PACKAGE_LOCALE_DIR in config.h. if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale") else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") fi dnl *************************************************************************** dnl G2C_DATA_DIR - Sets the location of the data directory, where we install dnl source files added to projects (such as all the Gnome m4 macros). dnl This will substitute G2C_DATA_DIR in config.h (from acconfig.h). dnl *************************************************************************** if test "x${datadir}" = 'x${prefix}/share'; then if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(G2C_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}") else AC_DEFINE_UNQUOTED(G2C_DATA_DIR, "${prefix}/share/${PACKAGE}") fi else AC_DEFINE_UNQUOTED(G2C_DATA_DIR, "${datadir}/${PACKAGE}") fi dnl Subst PACKAGE_PIXMAPS_DIR. PACKAGE_PIXMAPS_DIR="`gnome-config --datadir`/pixmaps/${PACKAGE}" AC_SUBST(PACKAGE_PIXMAPS_DIR) dnl *************************************************************************** dnl CFLAGS - Use -Wall if we have gcc, and use -ansi -pedantic if ansi enabled. dnl *************************************************************************** AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]],,enable_ansi=no) 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 *************************************************************************** dnl Gnome Support (use --disable-gnome to disable). dnl (Use "#ifdef USE_GNOME" in Glade for Gnome-specific code.) dnl *************************************************************************** gnome_modules= AC_ARG_ENABLE(gnome, [ --disable-gnome disable use of gnome], gnome=$enableval, gnome=yes) if test "x$gnome" = "xyes"; then AC_PATH_PROG(gnome_config, gnome-config) if test "x$gnome_config" = "x"; then gnome=no fi fi if test "$gnome" = yes; then AC_DEFINE(USE_GNOME) gnome_modules="$gnome_modules gnomeui" else CPPFLAGS="$CPPFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" fi dnl *************************************************************************** dnl Check for Bonobo dnl *************************************************************************** try_bonobo=false have_bonobo=false bonobo_msg=no using_oaf=no AC_ARG_WITH(bonobo, [ --with-bonobo include Bonobo support (under development)], if test x$withval = xyes; then try_bonobo=true fi) if $try_bonobo; then AC_MSG_CHECKING(for Bonobo >= 0.27) if $gnome_config --libs bonobox > /dev/null 2>&1; then vers=`gnome-config --modversion bonobox | sed -e "s/bonobo-//" | \ awk 'BEGIN { FS = "."; } { printf "%d", $1 * 1000 + $2;}'` if test "$vers" -ge 27; then bonobo_ok=true else bonobo_ok=false fi else bonobo_ok=false fi if $bonobo_ok; then AC_MSG_RESULT(found) AC_DEFINE(ENABLE_BONOBO) gnome_modules="$gnome_modules bonobox" have_bonobo=true bonobo_msg=yes dnl Check if Bonobo is OAFized AC_MSG_CHECKING(if Bonobo uses OAF) if ( gnome-config --libs bonobox | grep oaf ) > /dev/null 2>&1 ; then using_oaf="yes" AC_DEFINE(USING_OAF) fi AC_MSG_RESULT("$using_oaf") AM_CONDITIONAL(USING_OAF, test "x$using_oaf" = "xyes") else AC_MSG_RESULT(not found) fi fi AM_CONDITIONAL(BONOBO, $have_bonobo) dnl *************************************************************************** dnl Add all the cflags & libs needed for the Gnome modules. dnl *************************************************************************** if test "x$gnome_modules" != "x"; then GNOME_CFLAGS=`$gnome_config --cflags $gnome_modules 2>/dev/null` GNOME_LDFLAGS=`$gnome_config --libs $gnome_modules 2>/dev/null` CPPFLAGS="$CPPFLAGS $GNOME_CFLAGS" LIBS="$LIBS $GNOME_LDFLAGS" fi dnl *************************************************************************** dnl Gnome-DB Support (use --disable-gnome-db to disable). dnl *************************************************************************** AC_ARG_ENABLE(gnome-db, [ --disable-gnome-db disable use of gnome-db], gnome_db=$enableval, gnome_db=yes) if test "x$gnome" != "xyes"; then gnome_db=no fi if test "x$gnome_db" = "xyes"; then AC_PATH_PROG(gnomedb_config, gnomedb-config) if test "x$gnomedb_config" = "x"; then gnome_db=no fi fi if test "x$gnome_db" = "xyes"; then AC_DEFINE(USE_GNOME_DB) GLADE_GNOME_DB_DIR="gnome-db" GLADE_GNOME_DB_LIB="gnome-db/libgnomedbwidgets.a" AC_SUBST(GLADE_GNOME_DB_DIR) AC_SUBST(GLADE_GNOME_DB_LIB) GDA_CFLAGS=`$gnomedb_config --cflags 2>/dev/null` GDA_LIBS=`$gnomedb_config --libs 2>/dev/null` CPPFLAGS="$GDA_CFLAGS $CPPFLAGS" LIBS="$GDA_LIBS $LIBS" fi dnl *************************************************************************** dnl Debugging - defines GLADE_DEBUG if --enable-debug option is used. dnl *************************************************************************** AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging info [default=no]], AC_DEFINE(SOURCE_DEBUG),) AC_OUTPUT([ Makefile macros/Makefile src/Makefile intl/Makefile po/Makefile.in ]) echo " Configuration: Compiler: ${CC} Gnome Support: ${gnome} Bonobo Support: ${bonobo_msg} Oaf Support: ${using_oaf} Gnome DB Support: ${gnome_db} "