gnucash/configure.in
Dave Peticolas ed0bc95f5d Rob Browning's patch to add automake.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2395 57a11ea4-9604-0410-9ed3-97b8803252fd
2000-06-02 09:00:31 +00:00

486 lines
15 KiB
Plaintext

## -*-m4-*-
dnl Process this file with autoconf to produce a configure script.
# FILE:
# configure.in
#
# FUNCTION:
# implements checks vfor a variety of system-specific functions
#
# Contents:
# Headers - Autoconf header stuff
# Variables - Hardcoded variables
# Programs - Check for programs binaries
# Functions - Check for functions
# With - Check for --with/without options
# Enable - Check for --enable/disable options
# Libraries - Check for libraries
# Footer - Autoconf footer stuff
### --------------------------------------------------------------------------
### Headers
### check for various programs, and stuff (do this first because later
### commands depend on them):
AC_INIT(src/guile/gnucash.h)
AM_INIT_AUTOMAKE(gnucash,1.3.8)
AM_CONFIG_HEADER(config.h)
dnl Set of available languages.
ALL_LINGUAS="fr de en_GB sv ja"
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_PROG_CC
AC_ISC_POSIX
AC_C_BIGENDIAN
AC_PROG_MAKE_SET
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h)
AC_CHECK_FUNCS(stpcpy memcpy)
### --------------------------------------------------------------------------
### Variables
### Set up all the initial variable values...
# USE_QUICKFILL:
AC_DEFINE(USE_QUICKFILL,1)
# Should we uses color (red/black) balances?
AC_ARG_ENABLE(color,
[ --disable-color don't use color (red/black) balances],
AC_DEFINE(USE_NO_COLOR,1),
AC_DEFINE(USE_NO_COLOR,0) )
AC_ARG_ENABLE(opt-style-install,
[ --enable-opt-style-install install everything in subdirs of --prefix],
[case "${enableval}" in
yes) gnc_opt_style_install=true ;;
no) gnc_opt_style_install=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-opt-style-install) ;;
esac],
[gnc_opt_style_install=false])
if test x${gnc_opt_style_install} = xtrue
then
GNC_CONFIGDIR='${sysconfdir}'
GNC_LIBDIR='${libdir}'
GNC_SHAREDIR='${datadir}'
GNC_SCM_INSTALL_DIR='${datadir}/scm'
GNC_DOC_INSTALL_DIR='${datadir}/doc'
else
GNC_CONFIGDIR='${sysconfdir}/gnucash'
GNC_LIBDIR='${pkglibdir}'
GNC_SHAREDIR='${pkgdatadir}'
GNC_SCM_INSTALL_DIR='${pkgdatadir}/scm'
GNC_DOC_INSTALL_DIR='${pkgdatadir}/doc'
fi
AC_SUBST(GNC_CONFIGDIR)
AC_SUBST(GNC_LIBDIR)
AC_SUBST(GNC_SHAREDIR)
AC_SUBST(GNC_SCM_INSTALL_DIR)
AC_SUBST(GNC_DOC_INSTALL_DIR)
# We should always see these errors...
CFLAGS="${CFLAGS} -Wall"
AC_ARG_ENABLE( debug,
[ --enable-debug compile with debugging flags set],
CFLAGS="${CFLAGS} -g"
LDFLAGS="${LDFLAGS} -g"
AC_DEFINE(DEBUG_MEMORY,1) AC_DEFINE(USE_DEBUG,1),
AC_DEFINE(DEBUG_MEMORY,0) AC_DEFINE(USE_DEBUG,0) )
AC_ARG_ENABLE( profile,
[ --enable-profile compile with profiling set],
CFLAGS="${CFLAGS} -pg"
LDFLAGS="${LDFLAGS} -pg")
AC_ARG_ENABLE( warnings,
[ --enable-warnings compile with lots of warnings generated],
CFLAGS="${CFLAGS} -g -Wall -ansi -pedantic -Wwrite-strings -Wid-clash-31 -Wpointer-arith -Wcast-qual -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wshadow -Woverloaded-virtual -Winline -felide-constructors -fnonnull-objects"
LDFLAGS="${LDFLAGS} -g -Wall"
AC_DEFINE(DEBUG_MEMORY,1) AC_DEFINE(USE_DEBUG,1) )
### --------------------------------------------------------------------------
### i18n
AC_ARG_WITH( locale-dir,
[ --with-locale-dir=PATH specify where to look for locale-specific information],
LOCALE_DIR="$with_locale_dir",
LOCALE_DIR="\${localedatadir}/locale")
AC_SUBST(LOCALE_DIR)
# (rlb) As far as I can tell from the gettext info pages, this stuff...
# We need the variable below defined for the gettext checks to work
#ac_cv_header_locale_h=yes
#AC_CAN_USE_GNU_GETTEXT
# (rlb) should be replaced with this...
AM_GNU_GETTEXT
### --------------------------------------------------------------------------
### Check for perl
# Check for perl, force version 5
# AC_CHECK_PROGS(PERL,perl5 perl) # Sets @PERL@
AC_PATH_PROG(PERL, perl)
AC_ARG_WITH(perl,
[ --with-perl=FILE which perl executable to use ],
PERL="${with_perl}")
# Make sure Perl was found
if test x"$PERL" = x; then
AC_MSG_ERROR([Cannot find Perl. Try using the --with-perl flag.])
fi
# Make sure it's version 5 or later
if "$PERL" -e 'exit 1 if $] < 5.0'; then
:
else
AC_MSG_ERROR([Found ${PERL} reports version ]
[`${PERL} -e 'print $]'`, need version 5.*])
fi
AC_SUBST(PERL)
# Now check for perl headers
# This appears to be what Perl's ExtUtils::MakeMaker module does, so
# I'm reasonably sure it's correct.
# PERLINCL="/usr/lib/perl5/i386-linux/5.00404"
#
PERLINCL=`$PERL -MConfig -e 'print $Config{"archlibexp"}'`
AC_ARG_WITH( perl-includes,
[ --with-perl-includes=DIR specify where to look for perl includes],
PERLINCL="$with_perl_includes" )
if test ! -d ${PERLINCL}/CORE; then
AC_MSG_ERROR([Missing directory ${PERLINCL}/CORE in the perl include directory])
fi
AC_SUBST(PERLINCL)
### -------------------------------------------------------------------
# Check for 'swig'
AC_PATH_PROG(SWIG,swig,no) # Sets @SWIG@
AC_ARG_WITH(swig,
[ --with-swig=FILE which swig executable to use ],
SWIG="${with_swig}")
if test x"$SWIG" = xno; then
AC_MSG_ERROR([Cannot find Swig. Try using the --with-swig flag.])
fi
### -------------------------------------------------------------------
# Let the user specify glib paths:
GLIB_CONFIG_BIN="glib-config"
AC_ARG_WITH( glib-config,
[ --with-glib-config=executable which glib-config to use to find glib ],
GLIB_CONFIG_BIN="$with_glib_config")
# If the user hasn't specified the binary, then try to find it.
if test x"${GLIB_CONFIG_BIN}" = x
then
AC_PATH_PROG(GLIB_CONFIG_BIN, glib-config, GLIB_CONFIG_NOT_FOUND)
fi
if test "${GLIB_CONFIG_BIN}"x != GLIB_CONFIG_NOT_FOUNDx
then
GLIB_CFLAGS=`${GLIB_CONFIG_BIN} --cflags`
GLIB_LIBS=`${GLIB_CONFIG_BIN} --libs`
fi
AC_SUBST(GLIB_CONFIG_BIN)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
# Let the user specify gnome paths:
GNOME_CONFIG_BIN="gnome-config"
AC_ARG_WITH( gnome-config,
[ --with-gnome-config=executable which gnome-config to use to find gnome ],
GNOME_CONFIG_BIN="$with_gnome_config")
# If the user hasn't specified the binary, then try to find it.
if test x"${GNOME_CONFIG_BIN}" = x
then
AC_PATH_PROG(GNOME_CONFIG_BIN, gnome-config, GNOME_CONFIG_NOT_FOUND)
fi
AC_SUBST(GNOME_CONFIG_BIN)
### --------------------------------------------------------------------------
### Libraries
LIBS="$LIBS -lm"
# We're going to set up our own X configure variables. These are only
# used in side configure. At the end, we use them to set X_LIBS.
# This allows us to be careful about libarary ordering, in case that's
# important.
AC_PATH_XTRA
if test x"$no_x" = xyes; then
AC_ERROR([Can not find X11 development headers or libraries.])
fi
# This is how to use the variables set by AC_PATH_XTRA:
# cc @X_CFLAGS@ -c -o foo.o foo.c
# cc @X_LIBS@ (-lfoo...) @X_PRE_LIBS@ -lX11 @X_EXTRA_LIBS@
# (Perhaps X_LIBS should have been called X_LDFLAGS.)
# XXX - Not all programs need all of these, surely.
X_LIBS="$X_LIBS -lXext -lXmu -lXt -lX11"
### --------------------------------------------------------------------------
### Gnome libs -- these are needed for the gnome builds
# Let the user specify gnome paths:
# -I...libgnomesupport is to fix bug in gnome-1.3 release
#
# I believe all the gnome configuration can and should be superceded by
# --with-gnome-config.
AC_ARG_WITH( gnome,
[ --with-gnome=PATH specify where to look for gnome includes and libs],
X_LIBS="${X_LIBS} -L$with_gnome/lib" X_CFLAGS="$X_CFLAGS -I$with_gnome/include -I$with_gnome/lib/gnome-libs/include" )
AC_ARG_WITH( gnome-includes,
[ --with-gnome-includes=DIR specify where to look for gnome includes],
X_CFLAGS="${X_CFLAGS} -I$with_gnome_includes -I$with_gnome_includes/libgnomesupport" )
AC_ARG_WITH( gnome-libraries,
[ --with-gnome-libraries=DIR specify where to look for gnome libs],
X_LIBS="${X_LIBS} -L$with_gnome_libraries" )
# Let the user specify imlib paths:
AC_ARG_WITH( imlib,
[ --with-imlib=PATH specify where to look for imlib includes and libs],
X_LIBS="${X_LIBS} -L$with_imlib/lib" X_CFLAGS="$X_CFLAGS -I$with_imlib/include" )
# the XmHTML widget needs libz, libjpeg, libpng and libm
# it also uses #ifdef's not #if's so DONT #def to zero.
AC_CHECK_LIB(z, deflateEnd,
AC_DEFINE(HAVE_ZLIB,1) LIBS="-lz $LIBS")
AC_CHECK_LIB(jpeg, jpeg_read_scanlines,
AC_DEFINE(HAVE_JPEG,1) LIBS="-ljpeg $LIBS")
AC_CHECK_LIB(png, png_read_image,
AC_DEFINE(HAVE_PNG,1) LIBS="-lpng $LIBS")
# This should be done in the OTHER_LIBRARIES argument to AC_CHECK_LIB
# if it's actually needed and Makefile.in's should be using
# X_PRE_LIBS, X_LIBS, and X_EXTRA_LIBS, rather than relying on LIBS.
# LIBS="-lXmu -lXt -lXext $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS"
AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
AC_DEFINE(HAVE_XPM,1) X_LIBS="-lXpm $X_LIBS",
AC_DEFINE(HAVE_XPM,0)
AC_MSG_ERROR([Cannot find required Xpm library]),
$X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS)
### -------------------------------------------------------------------------
## gtk-xmhtml
# if gtk-xmhtml header or library not found, gnome builds are disabled
# make gnome will run make gnome.disabled which echoes a warning message
## XXX - need to do this because gtk-xmhtml requires glibconfig.h
## and I don't want CPPFLAGS permanently altered.
## If there's a better way to tackle this please let me know!
OLDCPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS `$GNOME_CONFIG_BIN --cflags gnome`"
# gnome targets if all goes well
# XXX - should we shift these to the rest of the gnome configuration
# section?
GNOME_TARGET="gnome.real"
GNOME_STATIC_TARGET="gnome.static.real"
#AC_CHECK_HEADER might work, but I'm not sure it uses CPPFLAGS
# this guarantees it - it works. Promise!!
AC_MSG_CHECKING([gtk-xmhtml/gtk-xmhtml.h])
AC_TRY_CPP([#include <gtk-xmhtml/gtk-xmhtml.h>], AC_MSG_RESULT(yes) ,
AC_MSG_ERROR([Cannot find gtk-xmhtml.h]))
#undo damage to CPPFLAGS
CPPFLAGS="$OLDCPPFLAGS"
### --------------------------------------------------------------------------
EXTRALIBS=`$GNOME_CONFIG_BIN --libs gtkxmhtml`
#check for gtkxmhtml, export library link to variable GTK_XMHTML
AC_CHECK_LIB(gtkxmhtml, gtk_xmhtml_new,
GTK_XMHTML="gtkxmhtml",
AC_MSG_ERROR([Cannot find libgtkxmhtml.]),
$EXTRALIBS)
AC_SUBST(GTK_XMHTML)
### --------------------------------------------------------------------------
EXTRALIBS=`$GNOME_CONFIG_BIN --libs xml`
#check for libxml
AC_CHECK_LIB(xml, xmlDefaultSAXHandlerInit,
,
AC_MSG_ERROR([Cannot find libxml.]),
$EXTRALIBS)
### --------------------------------------------------------------------------
EXTRALIBS=`$GNOME_CONFIG_BIN --libs print`
# check for gnome-print and enable it via HAVE_LIBGNOMEPRINT
# if found
AC_CHECK_LIB(gnomeprint, gnome_print_context_new,
GNOMEBUILDLIBS="${GNOMEBUILDLIBS} print"
AC_DEFINE(HAVE_LIBGNOMEPRINT),
,
$EXTRALIBS)
AC_SUBST(GNOME_TARGET)
AC_SUBST(GNOME_STATIC_TARGET)
### --------------------------------------------------------------------------
## For now, we just presume you're using the GNOME version. The other
## UI's haven't been carried over during the automake transition. At
## some point, if it's deemed worthwhile, they can be resurrected...
GNOME=1
AC_DEFINE(GNOME)
GNOMEBUILDLIBS="gnomeui gnome gtkxmhtml xml ${GNOMEBUILDLIBS}"
if test "${GNOME_CONFIG_BIN}"x != GNOME_CONFIG_NOT_FOUNDx
then
GNOME_CFLAGS=`${GNOME_CONFIG_BIN} --cflags ${GNOMEBUILDLIBS}`
GNOME_LIBS=`${GNOME_CONFIG_BIN} --libs ${GNOMEBUILDLIBS}`
fi
AC_SUBST(GNOME_CFLAGS)
AC_SUBST(GNOME_LIBS)
### --------------------------------------------------------------------------
### G-wrap (libraries and executable)
G_WRAP_COMPILE_ARGS=""
G_WRAP_LINK_ARGS=""
# Find the configure script
AC_PATH_PROG(G_WRAP_CONFIG,g-wrap-config)
if test -x "${G_WRAP_CONFIG}";
then
# Find out what the g-wrap compile and link flags are.
G_WRAP_COMPILE_ARGS=`${G_WRAP_CONFIG} --c-compile-args guile`
G_WRAP_LINK_ARGS=`${G_WRAP_CONFIG} --c-static-link-args guile`
fi
# Find the tool
AC_PATH_PROG(G_WRAP, g-wrap)
if test x"${G_WRAP_COMPILE_ARGS}" = x || \
test x"${G_WRAP_LINK_ARGS}" = x || \
! test -x "${G_WRAP}";
then
AC_MSG_ERROR([
g-wrap does not appear to be installed. It must be installed and
its binary directory must be in your PATH. If you need to install
g-wrap, you can find it at ftp://ftp.gnucash.org/pub/g-wrap.])
fi
AC_SUBST(G_WRAP)
AC_SUBST(G_WRAP_CONFIG)
AC_SUBST(G_WRAP_COMPILE_ARGS)
AC_SUBST(G_WRAP_LINK_ARGS)
### --------------------------------------------------------------------------
### Guile (libraries and executable)
GUILE_COMPILE_ARGS=""
GUILE_LINK_ARGS=""
AC_PATH_PROG(GUILE_CONFIG,guile-config)
if test -x "${GUILE_CONFIG}";
then
# Find out what the guile compile and link flags are.
GUILE_COMPILE_ARGS=`${GUILE_CONFIG} compile`
GUILE_LINK_ARGS=`${GUILE_CONFIG} link`
fi
# Find the binary
AC_PATH_PROG(GUILE, guile)
if test x"${GUILE_COMPILE_ARGS}" = x || \
test x"${GUILE_LINK_ARGS}" = x || \
! test -x "${GUILE}";
then
AC_MSG_ERROR([
Guile does not appear to be installed. It must be installed and
its binary directory must be in your PATH.])
fi
AC_SUBST(GUILE)
AC_SUBST(GUILE_CONFIG)
AC_SUBST(GUILE_COMPILE_ARGS)
AC_SUBST(GUILE_LINK_ARGS)
AC_OUTPUT(
dnl # Makefiles
Makefile
doc/Makefile
doc/examples/Makefile
doc/html/Makefile
doc/html/C/Makefile
doc/html/C/image/Makefile
doc/html/fr/Makefile
doc/html/fr/image/Makefile
intl/Makefile
po/Makefile.in
raw/Makefile
raw/ofx/Makefile
raw/ofx/dtd/Makefile
raw/ofx/explore/Makefile
raw/ofx/parser/Makefile
rpm/Makefile
src/Makefile
src/engine/Makefile
src/gnome/Makefile
src/guile/Makefile
src/optional/Makefile
src/optional/swig/Makefile
src/pixmaps/Makefile
src/quotes/Makefile
src/register/Makefile
src/register/gnome/Makefile
src/scm/Makefile
src/scm/gnumeric/Makefile
src/scm/printing/Makefile
src/scm/qif-import/Makefile
src/scm/report/Makefile
src/scm/srfi/Makefile
dnl # src/swig/Makefile
dnl # src/swig/perl5/Makefile
dnl # non-makefiles
dnl # Please read doc/build-system before adding *anything* here
,
dnl # commands go here, but we don't have any right now
)