Projekt

Allgemein

Profil

Herunterladen (17,4 KB) Statistiken
| Zweig: | Markierung: | Revision:
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.60)
AC_INIT
AC_CANONICAL_TARGET([])
AC_CONFIG_SRCDIR([aqfinance-config.in.in])
AC_CONFIG_HEADER([config.h])


###-------------------------------------------------------------------------
#
# versions
#
AF_VERSION_MAJOR=0
AF_VERSION_MINOR=9
AF_VERSION_PATCHLEVEL=25
AF_VERSION_BUILD=0
dnl "stable", "rcX", "betaX", "cvs"
AF_VERSION_TAG="beta"

AF_VERSION_FULL_STRING="$AF_VERSION_MAJOR.$AF_VERSION_MINOR.$AF_VERSION_PATCHLEVEL.$AF_VERSION_BUILD${AF_VERSION_TAG}"
AF_VERSION_STRING="$AF_VERSION_MAJOR.$AF_VERSION_MINOR.$AF_VERSION_PATCHLEVEL"


###-------------------------------------------------------------------------
#
# SO version
#
AF_SO_CURRENT=0
AF_SO_REVISION=0
AF_SO_AGE=0
AF_SO_EFFECTIVE="`echo \$(($AF_SO_CURRENT-$AF_SO_AGE))`"



###-------------------------------------------------------------------------
#
# datetime
#
DATETIME="`date +\"%Y%m%d%H%M%S\"`"
AC_SUBST(DATETIME)


###-------------------------------------------------------------------------
#
# Create release string
#
case "$AF_VERSION_TAG" in
cvs | git | svn)
AF_VERSION_RELEASE_STRING="$AF_VERSION_FULL_STRING"
;;
stable)
AF_VERSION_RELEASE_STRING="$AF_VERSION_MAJOR.$AF_VERSION_MINOR.$AF_VERSION_PATCHLEVEL"
;;
*)
AF_VERSION_RELEASE_STRING="$AF_VERSION_MAJOR.$AF_VERSION_MINOR.$AF_VERSION_PATCHLEVEL"
# add TAG
AF_VERSION_RELEASE_STRING="$AF_VERSION_RELEASE_STRING${AF_VERSION_TAG}"
;;
esac

AC_SUBST(AF_VERSION_MAJOR)
AC_SUBST(AF_VERSION_MINOR)
AC_SUBST(AF_VERSION_PATCHLEVEL)
AC_SUBST(AF_VERSION_BUILD)
AC_SUBST(AF_VERSION_TAG)
AC_SUBST(AF_VERSION_FULL_STRING)
AC_SUBST(AF_VERSION_STRING)
AC_SUBST(AF_VERSION_RELEASE_STRING)

AC_DEFINE_UNQUOTED(AF_VERSION_MAJOR,$AF_VERSION_MAJOR,
[major version])
AC_DEFINE_UNQUOTED(AF_VERSION_MINOR,$AF_VERSION_MINOR,
[minor version])
AC_DEFINE_UNQUOTED(AF_VERSION_PATCHLEVEL,$AF_VERSION_PATCHLEVEL,
[patchlevel])
AC_DEFINE_UNQUOTED(AF_VERSION_BUILD,$AF_VERSION_BUILD, [build])
AC_DEFINE_UNQUOTED(AF_VERSION_STRING,"$AF_VERSION_STRING",
[version string])
AC_DEFINE_UNQUOTED(AF_VERSION_FULL_STRING,"$AF_VERSION_FULL_STRING",
[full version string])
AC_DEFINE_UNQUOTED(AF_VERSION_TAG,$AF_VERSION_TAG, [tag])

AC_SUBST(AF_SO_CURRENT)
AC_SUBST(AF_SO_REVISION)
AC_SUBST(AF_SO_AGE)
AC_SUBST(AF_SO_EFFECTIVE)
AC_DEFINE_UNQUOTED(AF_SO_EFFECTIVE_STR, "$AF_SO_EFFECTIVE",
[effective SO version])

AM_INIT_AUTOMAKE(aqfinance, $AF_VERSION_RELEASE_STRING)


###-------------------------------------------------------------------------
#
# prefix handling
#
AC_PREFIX_DEFAULT(/usr)
if test "x$prefix" = "xNONE"; then
prefix=$ac_default_prefix
ac_configure_args="$ac_configure_args --prefix $prefix"
fi
AC_SUBST(prefix)


###-------------------------------------------------------------------------
#
# Checks for programs.
#
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_CHECK_PROG(USE_DOT,dot,YES,NO)
AC_CHECK_PROG(SED,sed,sed)


###-------------------------------------------------------------------------
#
# Checks for libraries.
#


###-------------------------------------------------------------------------
#
# Checks for header files.
#

AC_HEADER_STDC
AC_CHECK_HEADERS([locale.h])


###-------------------------------------------------------------------------
#
# Checks for typedefs, structures, and compiler characteristics.
#

AC_C_CONST


###-------------------------------------------------------------------------
#
# Checks for library functions.
#
AC_CHECK_FUNCS([setlocale localeconv])



###-------------------------------------------------------------------------
#
# OS dependent settings
#
AQ_CHECK_OS

af_internal_libs="\$(top_builddir)/src/lib/libaqfinance.la"
af_libs="-L\$(libdir) -laqfinance"
af_includes="-I`eval echo $prefix/include`"
af_pkgdatadir="`eval echo $prefix/share`/aqfinance"
af_plugindir="\$(libdir)/aqfinance/plugins/${AF_SO_EFFECTIVE}"

case "$OS_TYPE" in
posix)
af_sys_is_windows=0
;;
windows)
af_sys_is_windows=1
ACX_WINDOWS_PATHS
;;
esac
AM_CONDITIONAL(IS_WINDOWS, [test "$OS_TYPE" = "windows"])



###-------------------------------------------------------------------------
#
# Check for Gwen
#

AC_GWENHYWFAR(3,99,0,0)
if test "$have_gwenhywfar" != "yes"; then
AC_MSG_ERROR([
*** Gwenhywfar not found. Please install the package (including corresponding
*** devel packages)])
fi
all_includes="$all_includes $gwenhywfar_includes"



###-------------------------------------------------------------------------
#
# Check for AqBanking
#
AC_AQBANKING(4,99,0,0)

if test "$have_aqbanking" != "yes"; then
AC_MSG_ERROR([
*** AqBanking not found. Online banking not available.])
else
all_includes="$all_includes $aqbanking_includes"
AC_DEFINE(HAVE_AQBANKING, 1, [if AqBanking is available])
fi



###-------------------------------------------------------------------------
# Check for fox toolkit
#

AQ_CHECK_FOX
AM_CONDITIONAL(WITH_FOX, [test "$have_fox" = "yes"])



###-------------------------------------------------------------------------
# Check for Gwen-GUI implementation for FOX16
#

PKG_CHECK_MODULES([GWENGUI_FOX16], [gwengui-fox16])



###-------------------------------------------------------------------------
# Add all the previous includes to all_includes, but in the
# correct order.
#
all_includes="$all_includes $qbanking_includes"
all_includes="$all_includes $aqbanking_includes $gwenhywfar_includes"


###-------------------------------------------------------------------------
#
# Check for GMP
#

gmp_libs=""
AC_CHECK_LIB(gmp, __gmpz_init, [have_gmp="yes"], [have_gmp="no"])
AC_CHECK_HEADERS(gmp.h, [], [have_gmp="no"])
if test "$have_gmp" != "yes"; then
AC_MSG_ERROR([GMP is required, see http://swox.com/gmp])
else
gmp_libs="-lgmp"
fi
AC_SUBST(gmp_libs)



###-------------------------------------------------------------------------
#
# check for aqupdater
#
AC_MSG_CHECKING(aqupdater is wanted)
AC_ARG_WITH(aqupdater, [ --with-aqupdater=DIR use aqupdater from DIR],
[aqfinance_aqupdater_dir="$withval"],
[aqfinance_aqupdater_dir=""])

if test -n "${aqfinance_aqupdater_dir}"; then
aqupdater_libs="-L${aqfinance_aqupdater_dir}/lib -laqupdate"
aqupdater_headers="-I${aqfinance_aqupdater_dir}/include/aqupdate"
AC_DEFINE(WITH_AQUPDATER, 1, [whether aqupdater is wanted])
AC_MSG_RESULT(yes, $aqfinance_aqupdater_dir)
else
AC_MSG_RESULT(no)
fi

AC_SUBST(aqupdater_libs)
AC_SUBST(aqupdater_headers)


###-------------------------------------------------------------------------
#
# check whether local installation mode is enabled
#

AC_MSG_CHECKING(whether local installation mode is wanted)
AC_ARG_ENABLE(local-install,
[ --enable-local-install allow local installation mode (default=no)],
enable_local_install="$enableval",
enable_local_install="no")
AC_MSG_RESULT($enable_local_install)

if test "$enable_local_install" != "no"; then
AC_DEFINE(ENABLE_LOCAL_INSTALL, 1, [whether local install is wanted])
fi



###-------------------------------------------------------------------------
#
# check plugin search path
#
AC_MSG_CHECKING(plugin search dir)
AC_ARG_WITH(plugin-searchdir, [ --with-plugin-searchdir=DIR where to search for plugins],
[aqfinance_plugin_searchdir="$withval"],
[aqfinance_plugin_searchdir=""])

if test -z "${aqfinance_plugin_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
aqfinance_plugin_searchdir="lib/aqfinance/plugins/${AF_SO_EFFECTIVE}"
elif test "$OSYSTEM" = "osx"; then
if test "$enable_local_install" != "no"; then
aqfinance_plugin_searchdir="Frameworks/AqBanking/lib/aqfinance/plugins/${AF_SO_EFFECTIVE}"
else
aqfinance_plugin_searchdir="$af_plugindir"
fi
else
if test "$enable_local_install" != "no"; then
aqfinance_plugin_searchdir="lib/aqfinance/plugins/${AF_SO_EFFECTIVE}"
else
aqfinance_plugin_searchdir="$af_plugindir"
fi
fi
fi

AC_SUBST(aqfinance_plugin_searchdir)
AC_MSG_RESULT($aqfinance_plugin_searchdir)



###-------------------------------------------------------------------------
#
# check cfg search dir
#
AC_MSG_CHECKING(cfg search dir)
AC_ARG_WITH(cfg-searchdir, [ --with-cfg-searchdir=DIR where to search for cfg files],
[aqfinance_cfg_searchdir="$withval"],
[aqfinance_cfg_searchdir=""])

if test -z "$aqfinance_cfg_searchdir"; then
if test "$OSYSTEM" = "windows"; then
aqfinance_cfg_searchdir="etc"
elif test "$OSYSTEM" = "osx"; then
if test "$enable_local_install" != "no"; then
aqfinance_cfg_searchdir="Frameworks/AqBanking/etc"
else
aqfinance_cfg_searchdir="\$(sysconfdir)"
fi
else
if test "$enable_local_install" != "no"; then
aqfinance_cfg_searchdir="etc"
else
aqfinance_cfg_searchdir="\$(sysconfdir)"
fi
fi
fi


AC_SUBST(aqfinance_cfg_searchdir)
AC_MSG_RESULT($aqfinance_cfg_searchdir)



###-------------------------------------------------------------------------
#
# check locale search dir
#
AC_MSG_CHECKING(locale search dir)
AC_ARG_WITH(locale-searchdir, [ --with-locale-searchdir=DIR where to search for locale files],
[aqfinance_locale_searchdir="$withval"],
[aqfinance_locale_searchdir=""])

if test -z "${aqfinance_locale_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
aqfinance_locale_searchdir="share/locale"
elif test "$OSYSTEM" = "osx"; then
if test "$enable_local_install" != "no"; then
aqfinance_locale_searchdir="Frameworks/AqBanking/share/locale"
else
aqfinance_locale_searchdir="\$(localedir)"
fi
else
if test "$enable_local_install" != "no"; then
aqfinance_locale_searchdir="share/locale"
else
aqfinance_locale_searchdir="\$(localedir)"
fi
fi
fi

AC_SUBST(aqfinance_locale_searchdir)
AC_MSG_RESULT($aqfinance_locale_searchdir)



###-------------------------------------------------------------------------
#
# check data search dir
#
AC_MSG_CHECKING(data search dir)
AC_ARG_WITH(data-searchdir, [ --with-data-searchdir=DIR where to search for data files],
[aqfinance_data_searchdir="$withval"],
[aqfinance_data_searchdir=""])

if test -z "${aqfinance_data_searchdir}"; then
if test "$OSYSTEM" = "windows"; then
aqfinance_data_searchdir="share/aqfinance"
elif test "$OSYSTEM" = "osx"; then
if test "$enable_local_install" != "no"; then
aqfinance_data_searchdir="Frameworks/AqBanking/share/aqfinance"
else
aqfinance_data_searchdir="\$(datadir)/aqfinance"
fi
else
if test "$enable_local_install" != "no"; then
aqfinance_data_searchdir="share/aqfinance"
else
aqfinance_data_searchdir="\$(datadir)/aqfinance"
fi
fi
fi

AC_SUBST(aqfinance_data_searchdir)
AC_MSG_RESULT($aqfinance_data_searchdir)



###-------------------------------------------------------------------------
#
# check for I18N
#

HAVE_I18N="yes"
AC_CHECK_PROG(XGETTEXT,xgettext,xgettext, missing)
AC_PATH_PROG([MSGFMT], [msgfmt], [missing])
if test "$XGETTEXT" = "missing" -o "$MSGFMT" = "missing" ; then
HAVE_I18N="no"
AC_MSG_WARN([xgettext is missing. Locale support is disabled.])
else
# Watch out: The AC_CHECK_HEADERS macro will force the inclusion
# of several other important macros immediately. However, at
# this point those other macros would only occur inside the
# conditional branch, so everything will break down if xgettext
# is missing. Therefore this conditionaled check needs to come
# only after the standard (non-conditional) macros.
AC_CHECK_HEADERS([locale.h libintl.h], [], [HAVE_I18N="no"])
AC_SEARCH_LIBS(gettext, intl, [], [HAVE_I18N="no"])
fi


AC_SUBST(HAVE_I18N)
if test "$HAVE_I18N" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_I18N, 1, [whether I18N is available])
fi
AM_CONDITIONAL(USE_I18N, [test "$HAVE_I18N" = "yes"])



###-------------------------------------------------------------------------
#
# check versions header file
#
AC_MSG_CHECKING(versions header file)
AC_ARG_ENABLE(versions-header,
[ --enable-versions-header enable use of versions header (default=no)],
enable_versions_header="$enableval",
enable_versions_header="no")
AC_MSG_RESULT($enable_versions_header)

if test "$enable_versions_header" != "no"; then
AC_DEFINE(ENABLE_VERSIONS_HEADER, 1, [whether versions header is wanted])
fi



###-------------------------------------------------------------------------
#
# GCC version (check for usability)
#

AC_MSG_CHECKING(if symbol visibility is supported)
case `basename $CC` in
gcc*)
gccversion=`$CC --version | { read x1 x2 x3; echo $x3; }`
case $gccversion in
0.* | 1.* | 2.* | 3.*)
visibility_supported="no (needs gcc >=4.0, you have $gccversion)"
;;
*)
visibility_supported="yes"
AC_DEFINE(GCC_WITH_VISIBILITY_ATTRIBUTE, 1, [visibility])
visibility_cflags="-fvisibility=hidden"
;;
esac
;;
*)
visibility_supported="no (needs gcc >=4.0, you use $CC)"
;;
esac

# -fvisibility is at least not available on MinGW/gcc-3.4.4 (will
# give an "unrecognized cmdline option"). Also, unfortunately I
# don't know an easy way to ask the compiler here. Maybe
# http://autoconf-archive.cryp.to/ax_cflags_gcc_option.html
case "$OS_TYPE" in
windows)
visibility_supported="no (not yet on MinGW/Windows)"
visibility_cflags=""
;;
*)
;;
esac


AC_MSG_RESULT(${visibility_supported})
AC_SUBST(visibility_cflags)



###-------------------------------------------------------------------------
#
# check for release
#
AC_MSG_CHECKING(whether this is an official release)
AC_ARG_ENABLE(release,
[ --enable-release make this an official release (default=no)],
[ case "${enableval}" in
yes) enable_release="yes";;
no) enable_release="no";;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-release);;
esac
],
enable_release="no")

if test "$enable_release" = "yes"; then
STRIPALL="-s"
else
STRIPALL=""
fi
AC_SUBST(STRIPALL)
AC_MSG_RESULT($enable_release)



###-------------------------------------------------------------------------
#
# Debug arguments for compilation
#
ACX_COMPILE_WARN()



###-------------------------------------------------------------------------
#
# Substitute vars
#
AS_SCRUB_INCLUDE(all_includes)
AC_SUBST(all_includes)
AC_SUBST(all_libraries)
AS_SCRUB_INCLUDE(af_includes)
AC_SUBST(af_includes)
AC_SUBST(af_internal_libs)
AC_SUBST(af_libs)
AC_SUBST(af_pkgdatadir)
AC_SUBST(af_plugindir)
AC_SUBST(af_sys_is_windows)
AC_SUBST(XMLMERGE)
AC_DEFINE_UNQUOTED(AF_DATA, "${af_data}", [data dir])



###-------------------------------------------------------------------------
#
# Output files
#

AC_CONFIG_FILES([Makefile
aqfinance-config.in
doc/Makefile
data/Makefile
data/accounts/Makefile
data/accounts/c/Makefile
data/accounts/de_DE/Makefile
m4/Makefile
po/Makefile
src/Makefile
src/lib/Makefile
src/lib/version.h
src/lib/engine/Makefile
src/lib/engine/lib/Makefile
src/lib/engine/lib/db/Makefile
src/lib/engine/lib/book/Makefile
src/lib/engine/lib/modules/Makefile
src/lib/engine/lib/modules/xml/Makefile
src/lib/engine/plugins/Makefile
src/lib/engine/plugins/db/Makefile
src/lib/engine/plugins/db/dir/Makefile
src/lib/typemaker2/Makefile
src/lib/typemaker2/c/Makefile
src/fox/Makefile
src/fox/lib/Makefile
src/fox/lib/widgets/Makefile
src/fox/lib/external/Makefile
src/fox/lib/af/Makefile
src/fox/lib/af/dialogs/Makefile
src/fox/lib/af/dialogs/wizards/Makefile
src/fox/lib/af/dialogs/wizards/setup/Makefile
src/fox/lib/af/icons/Makefile
src/fox/lib/af/views/Makefile
src/fox/lib/af/widgets/Makefile
src/fox/lib/af/modules/Makefile
src/fox/lib/af/modules/accounts/Makefile
src/fox/lib/af/modules/bankaccounts/Makefile
src/fox/lib/af/modules/outbox/Makefile
src/fox/lib/af/modules/transfers/Makefile
src/fox/lib/af/modules/partners/Makefile
src/fox/lib/af/modules/business/Makefile
src/fox/apps/Makefile
src/fox/apps/aqfinance/Makefile
src/apps/Makefile
src/apps/aqfinance-cli/Makefile
])
AC_OUTPUT



###-------------------------------------------------------------------------
#
# Summary
#

echo
echo
echo "Summary"
echo "----------------------------------------------------"
echo "AqFinance version : $AF_VERSION_FULL_STRING"
echo "Local Installation Mode : $enable_local_install"
echo "Cfg Search Folder : $aqfinance_cfg_searchdir"
echo "Data Search Folder : $aqfinance_data_searchdir"
echo "Locale Search Folder : $aqfinance_locale_searchdir"
echo "Plugin Search Folder : $aqfinance_plugin_searchdir"
echo "Symbol Visibility : $visibility_supported"
echo "Use Versions Header : $enable_versions_header"
if test -n "${aqfinance_aqupdater_dir}"; then
echo "Support for updater : yes"
else
echo "Support for updater : no"
fi
echo

echo "----------------------------------------------------"
echo "You can now run \"make\" (or gmake on FreeBSD) to compile."

(14-14/14)