### $Id: configure.in,v 1.155 2002/01/18 22:46:39 jody Exp $ ### ### Configure script for Guppi ### ### # Look for guppi-data.c, to make sure we are in the right directory AC_INIT(src/libguppidata/guppi-data.c) AC_CANONICAL_SYSTEM AM_CONFIG_HEADER(config.h) AC_ARG_ENABLE(bonobo, [ --disable-bonobo Compile without bonobo support],,) if test "x$enable_bonobo" = "x"; then enable_bonobo=yes fi AC_ARG_ENABLE(gnumeric, [ --enable-gnumeric Support Gnumeric],,) if test "x$enable_gnumeric" = "x"; then enable_gnumeric=yes fi AC_ARG_ENABLE(sluggish-linking, [ --enable-sluggish-linking Needed for building share libs on some platforms],enable_sluggish_linking=yes,enable_sluggish_linking=no) if test "x$enable_sluggish_linking" = "x"; then enable_sluggish_linking=no fi dnl ==================================== dnl = Begin profiling support dnl ==================================== ENABLE_PROFILER= AC_ARG_ENABLE(profiler, [ --enable-profiler Enable profiler], ENABLE_PROFILER=1) profile_msg=no if test "x$ENABLE_PROFILER" = "x1" then CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES" LDFLAGS="${prefix}/lib/libprofiler.so -lpthread" profile_msg=yes fi AC_SUBST(ENABLE_PROFILER) AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1") echo " " echo " === Configure args ===" echo " Support Bonobo: $enable_bonobo" echo " Sluggish Linking: $enable_sluggish_linking" echo " " ### Define various version numbers and export them GUPPI_MAJOR_VERSION=0 GUPPI_MINOR_VERSION=40 GUPPI_MICRO_VERSION=3 GUPPI_VERSION=$GUPPI_MAJOR_VERSION.$GUPPI_MINOR_VERSION.$GUPPI_MICRO_VERSION # Increment if the interface has additions, changes, removals. GUPPI_CURRENT=16 # Increment any time the source changes; set to 0 if you increment CURRENT GUPPI_REVISION=0 # Increment if any interfaces have been added; set to 0 if any # interfaces have been removed. removal has precedence over adding, so # set to 0 if both happened. GUPPI_AGE=0 AC_SUBST(GUPPI_MAJOR_VERSION) AC_SUBST(GUPPI_MINOR_VERSION) AC_SUBST(GUPPI_MICRO_VERSION) AC_SUBST(GUPPI_VERSION) AC_SUBST(GUPPI_CURRENT) AC_SUBST(GUPPI_REVISION) AC_SUBST(GUPPI_AGE) AC_DEFINE_UNQUOTED(GUPPI_MAJOR_VERSION, $GUPPI_MAJOR_VERSION) AC_DEFINE_UNQUOTED(GUPPI_MINOR_VERSION, $GUPPI_MINOR_VERSION) AC_DEFINE_UNQUOTED(GUPPI_MICRO_VERSION, $GUPPI_MICRO_VERSION) AM_INIT_AUTOMAKE(Guppi, $GUPPI_VERSION) ### ### Set a bunch of misc autoconf/automake options ### AC_PROG_CC AC_ISC_POSIX AC_STDC_HEADERS AM_ACLOCAL_INCLUDE(macros) AM_PROG_XML_I18N_TOOLS AM_MAINTAINER_MODE # Disable the building of static libraries by default # This really speeds up compiles and shrinks the size of the build dir. AC_DISABLE_STATIC AM_PROG_LIBTOOL # Allow program names to be changed upon install AC_ARG_PROGRAM if test -f ./HACKING; then GUPPI_FROM_CVS=1 AC_SUBST(GUPPI_FROM_CVS) AC_DEFINE_UNQUOTED(GUPPI_FROM_CVS, $GUPPI_FROM_CVS) fi ### ### Check and configure for various libraries ### # Configure gettext ALL_LINGUAS="az da de el es fr is it nl no pl pt pt_BR ru sk sv tr uk zh_CN" AM_GNOME_GETTEXT gnomelocaledir='${prefix}/${DATADIRNAME}/locale' AC_SUBST(gnomelocaledir) # Configure Lex and Yacc AM_PROG_LEX AC_PROG_YACC ### Set up glib and gtk+ #AM_PATH_GLIB(1.2.8,,AC_MSG_ERROR("Glib 1.2.8 or newer not found or broken - see config.log for details.")) #AM_PATH_GTK(1.2.8,,AC_MSG_ERROR("Gtk+ 1.2.8 or newer not found or broken - see config.log for details.")) ### Set up Gnome GNOME_X_CHECKS # Perform some handy X11-related checks GNOME_INIT ### Turn on useful compiler warnings. This could cause problems if you ### aren't using gcc. GNOME_COMPILE_WARNINGS ### Check for Bonobo if test "$enable_bonobo" = "yes"; then bonobo_msg=no AC_MSG_CHECKING(for Bonobo >= 1.0.8) if gnome-config --libs bonobox_print > /dev/null 2>&1; then verstxt=`gnome-config --modversion bonobox_print` vers=`echo "$verstxt" | sed -e "s/^bonobo-//" | \ awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3; }'` if test "$vers" -ge 1000008; then bonobo_ok=true else bonobo_ok=false fi else # if gnome-config bonobo_ok=false fi if $bonobo_ok; then AC_MSG_RESULT($vers found) AC_MSG_CHECKING(if Bonobo uses OAF) if ( gnome-config --libs bonobo | grep oaf ) > /dev/null 2>&1 ; then enable_oaf="yes" else enable_oaf="no" fi AC_MSG_RESULT("$enable_oaf") if test "x$enable_oaf" = "xyes"; then AC_PATH_PROG(OAF_CONFIG,oaf-config,no) if test x$OAF_CONFIG = xno; then AC_MSG_ERROR("You enabled OAF support but oaf-config was not found") else dnl Success OAF_LIBS=`$OAF_CONFIG --libs` OAF_CFLAGS=`$OAF_CONFIG --cflags` AC_SUBST(USING_BONOBO) AM_CONDITIONAL(USING_BONOBO,$bonobo_ok) AC_DEFINE(USING_BONOBO) BONOBO_CFLAGS=`gnome-config --cflags bonobox_print` BONOBO_LIBS="-lbonobo-print `gnome-config --libs bonobox_print`" bonobo_msg=yes fi else # if test $enable_oaf OAF_LIBS= OAF_CFLAGS= fi AC_SUBST(OAF_LIBS) AC_SUBST(OAF_CFLAGS) AC_SUBST(BONOBO_LIBS) AC_SUBST(BONOBO_CFLAGS) else # if $bonobo_ok AC_MSG_RESULT(not found) fi dnl IDL flags for non-standard prefixes IDL_FLAGS="`gnome-config --cflags idl`" for path in `echo $GNOME_PATH | awk 'BEGIN { RS = ":"; } { print;}'`; do IDL_FLAGS="$IDL_FLAGS -I$path/share/idl" done AC_SUBST(IDL_FLAGS) else # if test $enable_bonobo # AC_MSG_RESULT([***]) AC_MSG_RESULT([*** Bonobo support explicitly blocked by --disable-bonobo option.]) # AC_MSG_RESULT([***]) bonobo_ok=false bonobo_msg=no fi ### Check for some extra gnome-related libraries GNOME_XML_CHECK gnome_xml_vers=`gnome-config --modversion xml | sed -e 's/\..*//' | sed -e 's/xml-//'` if test "x$gnome_xml_vers" = "x1"; then gnome_xml_vers="1.x" GNOME_XML_HEADER_VERSION_1=1 AC_DEFINE(GNOME_XML_HEADER_VERSION_1) elif test "x$gnome_xml_vers" = "x2"; then gnome_xml_vers="2.x" GNOME_XML_HEADER_VERSION_2=1 AC_DEFINE(GNOME_XML_HEADER_VERSION_2) else gnome_xml_vers="unknown" fi AM_PATH_LIBART(2.2.0) AM_PATH_LIBGLADE(,,"gnome") AM_PATH_GNOME_PRINT(0.28.0) ### Support for the old gnome-print API is now officially deprecated. ### AC_CHECK_LIB(gnomeprint, gnome_font_get_size, AC_MSG_RESULT("Using new GnomeFont API"), AC_DEFINE(USING_OLD_FONT_API), $GNOME_PRINT_LIBS) AM_PATH_GDK_PIXBUF(0.11.0) ############################################################################## dnl ************************************************** dnl * Check for Gnumeric dnl ************************************************** gnumeric_msg="not enabled" gnumeric_enabled=no GNUMERIC_IDLDIR="" GUPPI_GNUMERIC_LIBS="" GUPPI_GNUMERIC_CFLAGS="" GUPPI_GNUMERIC_GRAPH_VERSION=Graph_v2 if test x"$enable_gnumeric" = xyes; then AC_MSG_CHECKING(Gnumeric is installed) if gnome-config --moddatadir gnumeric > /dev/null 2>&1; then GNUMERIC_IDLDIR=`gnome-config --moddatadir gnumeric`/idl AC_MSG_RESULT(yes) AC_MSG_CHECKING(Gnumeric Graphing IDL file existence) GNUMERIC_GRAPH_IDL="$GNUMERIC_IDLDIR"/GNOME_Gnumeric_Graph.idl if test -r "$GNUMERIC_GRAPH_IDL" > /dev/null 2>&1; then AC_MSG_RESULT([found $GNUMERIC_GRAPH_IDL]) AC_MSG_CHECKING(Gnumeric Graphing IDL file version) if (grep "$GUPPI_GNUMERIC_GRAPH_VERSION" "$GNUMERIC_GRAPH_IDL" ) > /dev/null 2>&1 ; then AC_MSG_RESULT([version is good]) AC_MSG_CHECKING(for GnomeCanvasPixbuf >= 0.8.0) if gnome-config --libs gnomecanvaspixbuf > /dev/null 2>&1; then verstxt=`gnome-config --modversion gnomecanvaspixbuf` vers=`echo $verstxt | awk 'BEGIN { FS = "."; } { printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` if test "$vers" -ge 8000; then AC_MSG_RESULT([ok. found $verstxt]) AC_MSG_CHECKING(for Gnome App libraries (GAL) >= 0.8) if gnome-config --libs gal > /dev/null 2>&1; then verstxt=`gnome-config --modversion gal` vers=`echo $verstxt | sed -e "s/gal-//" -e 's/cvs$//' -e 's/pre$//' | \ awk -F. '{ printf "%d", $1*1000000 + $2*10000 + $3*100 + $4; }'` if test "$vers" -ge 80000; then AC_MSG_RESULT([ok. found $verstxt]) gnumeric_enabled=yes gnumeric_msg="yes in $GNUMERIC_GRAPH_IDL" GUPPI_GNUMERIC_LIBS=`gnome-config --libs gnomeui gnomecanvaspixbuf gal bonobox_print` GUPPI_GNUMERIC_CFLAGS=`gnome-config --cflags gnomeui gnomecanvaspixbuf gal bonobox_print` # Add orbit's cflags/libs GUPPI_GNUMERIC_LIBS="$GUPPI_GNUMERIC_LIBS $ORBIT_LIBS" GUPPI_GNUMERIC_CFLAGS="$GUPPI_GNUMERIC_CFLAGS $ORBIT_CFLAGS" # Add the cflags/libs we need for python GUPPI_GNUMERIC_LIBS="$GUPPI_GNUMERIC_LIBS $PY_LIB_LOC $PY_LIBS $PY_EXTRA_LIBS" GUPPI_GNUMERIC_CFLAGS="$GUPPI_GNUMERIC_CFLAGS $PY_CFLAGS" else gnumeric_msg="no. GNOME App Libs (GAL) >= 0.8 needed for gnumeric support" AC_MSG_RESULT([ unsupported version]) fi else gnumeric_msg="no. missing GNOME App Libs (GAL)" AC_MSG_RESULT([ not found]) fi else gnumeric_msg="no. GNOME Canvas Pixbuf >= 0.8.0 needed for gnumeric support" AC_MSG_RESULT([ unsupported version]) fi else gnumeric_msg="no. missing GNOME Canvas Pixbuf" AC_MSG_RESULT([ not found]) fi else gnumeric_msg="no. unsupported version in $GNUMERIC_GRAPH_IDL" AC_MSG_RESULT([ unsupported version]) fi else gnumeric_msg="no. idl not found, requires at least version 0.71" AC_MSG_RESULT([ not found]) fi else gnumeric_msg="no. gnumeric is not installed." AC_MSG_RESULT([, gnome-config --moddatadir gnumeric failed]) fi fi AC_SUBST(SUPPORT_GNUMERIC) AC_SUBST(GNUMERIC_GRAPH_IDL) AC_SUBST(GUPPI_GNUMERIC_GRAPH_VERSION) AC_SUBST(GUPPI_GNUMERIC_LIBS) AC_SUBST(GUPPI_GNUMERIC_CFLAGS) AM_CONDITIONAL(SUPPORT_GNUMERIC, test "x$gnumeric_enabled" != "xno") dnl ****************************** dnl shlib factory dnl ****************************** AC_ARG_ENABLE(shlib-factory, [ --enable-shlib-factory build editor factory as shared library [default=no]],shlib_factory="$enableval", shlib_factory="no") if test "x$shlib_factory" = "xyes"; then GUPPI_GNUMERIC_COMPONENT_TYPE="shlib" GUPPI_GNUMERIC_LOCATION="guppi-gnumeric.so" GUPPI_GNUMERIC_SHLIB=1 AC_DEFINE(GUPPI_GNUMERIC_SHLIB) else GUPPI_GNUMERIC_COMPONENT_TYPE="exe" GUPPI_GNUMERIC_LOCATION="guppi-gnumeric" fi AC_SUBST(GUPPI_GNUMERIC_COMPONENT_TYPE) AC_SUBST(GUPPI_GNUMERIC_LOCATION) AM_CONDITIONAL(GUPPI_GNUMERIC_SHLIB, test "x$shlib_factory" = "xyes") ############################################################################## dnl ========================== dnl = gtk-doc & docbook stuff dnl ========================== AC_ARG_WITH(html-dir, [ --with-html-dir=PATH path to installed docs ]) if test "x$with_html_dir" = "x" ; then HTML_DIR='${datadir}/gtk-doc/html' else HTML_DIR=$with_html_dir fi AC_SUBST(HTML_DIR) AC_CHECK_PROG(DB2HTML, db2html, true, false) AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML) AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false) AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC) AC_SUBST(HAVE_GTK_DOC) dnl Let people disable the gtk-doc stuff. AC_ARG_ENABLE(gtk-doc, [ --enable-gtk-doc Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto) if test x$enable_gtk_doc = xauto ; then if test x$GTKDOC = xtrue ; then enable_gtk_doc=yes else enable_gtk_doc=no fi fi dnl NOTE: We need to use a separate automake conditional for this dnl to make this work with the tarballs. AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes) ### Some useful directories for use in Makefiles PLUG_IN_DIR='$(libdir)/guppi/plug-ins/$(VERSION)' AC_SUBST(PLUG_IN_DIR) PIXMAPS_DIR='$(datadir)/pixmaps/guppi' AC_SUBST(PIXMAPS_DIR) SCRIPTS_DIR='$(datadir)/guppi/scripts' AC_SUBST(SCRIPTS_DIR) GLADE_DIR='$(datadir)/guppi/glade' AC_SUBST(GLADE_DIR) ############################################################################## ### ### Bundle all of our external library-specific Makefile variables into two. ### STANDARD_CFLAGS='$(GTK_CFLAGS) $(GNOME_INCLUDEDIR) $(LIBGLADE_CFLAGS) $(GNOME_PRINT_CFLAGS) $(GDK_PIXBUF_CFLAGS) $(ORBIT_CFLAGS) $(BONOBO_CFLAGS)' AC_SUBST(STANDARD_CFLAGS) STANDARD_LDFLAGS='$(GNOME_LIBDIR) $(GNOMEUI_LIBS) $(GNOMECANVASPIXBUF_LIBS) $(ZVT_LIBS) $(LIBGLADE_LIBS) $(GNOME_PRINT_LIBS) $(GNOME_XML_LIBS) $(BONOBO_LIBS)' AC_SUBST(STANDARD_CFLAGS) AC_SUBST(STANDARD_LDFLAGS) EXTRA_LDFLAGS="" if test "$enable_sluggish_linking" = "yes"; then EXTRA_LDFLAGS="$EXTRA_LDFLAGS $STANDARD_LDFLAGS" AC_MSG_RESULT("Sluggish linking mode enabled.") else AC_MSG_RESULT("Sluggish linking mode disabled.") fi AC_SUBST(EXTRA_LDFLAGS) ### ### Define variables for libguppiConf.sh ### LIBGUPPI_LIBDIR='-L${libdir}' LIBGUPPI_INCLUDEDIR='-I${includedir} -I${includedir}/gnome-1.0 -I${includedir}/gnome-1.0/libguppitank' LIBGUPPI_INCLUDEDIR="$LIBGUPPI_INCLUDEDIR $STANDARD_CFLAGS" LIBGUPPI_LIBS="-lguppitank -lguppi" LIBGUPPI_LIBS="$LIBGUPPI_LIBS $STANDARD_LDFLAGS" AC_SUBST(LIBGUPPI_LIBDIR) AC_SUBST(LIBGUPPI_INCLUDEDIR) AC_SUBST(LIBGUPPI_LIBS) ### ### Now generate the Makefiles ### AC_OUTPUT([ Makefile Guppi.spec macros/Makefile pixmaps/Makefile sample-data/Makefile intl/Makefile po/Makefile.in src/Makefile src/libguppiuseful/Makefile src/libguppispecfns/Makefile src/libguppidata/Makefile src/libguppidataimpl/Makefile src/libguppidataui/Makefile src/libguppistat/Makefile src/libguppiplot/Makefile libguppitank/Makefile guppi-gnumeric/Makefile guppi-gnumeric/GNOME_Guppi_Gnumeric.oaf.in guppi-gnumeric/guppi-gnumeric-version.h plug-ins/Makefile plug-ins/plot/Makefile plug-ins/plot/axis/Makefile plug-ins/plot/background/Makefile plug-ins/plot/barchart/Makefile plug-ins/plot/boxplot/Makefile plug-ins/plot/compass-box/Makefile plug-ins/plot/frame/Makefile plug-ins/plot/image/Makefile plug-ins/plot/legend/Makefile plug-ins/plot/linechart/Makefile plug-ins/plot/linegraph/Makefile plug-ins/plot/pie/Makefile plug-ins/plot/pricebars/Makefile plug-ins/plot/scatter/Makefile plug-ins/plot/text/Makefile plug-ins/plot/xybox/Makefile tests/Makefile tests/testlib/Makefile tests/useful/Makefile tests/data/Makefile tests/plot/Makefile doc/Makefile doc/C/Makefile ],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) echo " Configuration: Source code location: ${srcdir} Compiler: ${CC} GNOME XML Version: ${gnome_xml_vers} Bonobo Support: ${bonobo_msg} Gnumeric Support: ${gnumeric_msg} Built-in Profiling: ${profile_msg} Build API Docs: ${enable_gtk_doc} "