# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.60) AC_INIT AC_CANONICAL_TARGET([]) AC_CONFIG_SRCDIR([src/lib/aqdiagram/aqdg_api.h]) AC_CONFIG_HEADER([config.h]) ###------------------------------------------------------------------------- # # versions # AQDG_VERSION_MAJOR=0 AQDG_VERSION_MINOR=0 AQDG_VERSION_PATCHLEVEL=1 AQDG_VERSION_BUILD=0 dnl "stable", "rcX", "betaX", "cvs" AQDG_VERSION_TAG="git" AQDG_VERSION_FULL_STRING="$AQDG_VERSION_MAJOR.$AQDG_VERSION_MINOR.$AQDG_VERSION_PATCHLEVEL.$AQDG_VERSION_BUILD${AQDG_VERSION_TAG}" AQDG_VERSION_STRING="$AQDG_VERSION_MAJOR.$AQDG_VERSION_MINOR.$AQDG_VERSION_PATCHLEVEL" ###------------------------------------------------------------------------- # # SO version # AQDG_SO_CURRENT=0 AQDG_SO_AGE=0 AQDG_SO_REVISION=1 AQDG_SO_EFFECTIVE="`echo \$(($AQDG_SO_CURRENT-$AQDG_SO_AGE))`" ###------------------------------------------------------------------------- # # datetime # DATETIME="`date +\"%Y%m%d%H%M%S\"`" AC_SUBST(DATETIME) ###------------------------------------------------------------------------- # # Create release string # case "$AQDG_VERSION_TAG" in cvs | git | svn) AQDG_VERSION_RELEASE_STRING="$AQDG_VERSION_FULL_STRING" ;; stable) AQDG_VERSION_RELEASE_STRING="$AQDG_VERSION_MAJOR.$AQDG_VERSION_MINOR.$AQDG_VERSION_PATCHLEVEL" ;; *) AQDG_VERSION_RELEASE_STRING="$AQDG_VERSION_MAJOR.$AQDG_VERSION_MINOR.$AQDG_VERSION_PATCHLEVEL" # add TAG AQDG_VERSION_RELEASE_STRING="$AQDG_VERSION_RELEASE_STRING${AQDG_VERSION_TAG}" ;; esac AC_SUBST(AQDG_VERSION_MAJOR) AC_SUBST(AQDG_VERSION_MINOR) AC_SUBST(AQDG_VERSION_PATCHLEVEL) AC_SUBST(AQDG_VERSION_BUILD) AC_SUBST(AQDG_VERSION_TAG) AC_SUBST(AQDG_VERSION_FULL_STRING) AC_SUBST(AQDG_VERSION_STRING) AC_SUBST(AQDG_VERSION_RELEASE_STRING) AC_DEFINE_UNQUOTED(AQDG_VERSION_MAJOR,$AQDG_VERSION_MAJOR, [major version]) AC_DEFINE_UNQUOTED(AQDG_VERSION_MINOR,$AQDG_VERSION_MINOR, [minor version]) AC_DEFINE_UNQUOTED(AQDG_VERSION_PATCHLEVEL,$AQDG_VERSION_PATCHLEVEL, [patchlevel]) AC_DEFINE_UNQUOTED(AQDG_VERSION_BUILD,$AQDG_VERSION_BUILD, [build]) AC_DEFINE_UNQUOTED(AQDG_VERSION_STRING,"$AQDG_VERSION_STRING", [version string]) AC_DEFINE_UNQUOTED(AQDG_VERSION_FULL_STRING,"$AQDG_VERSION_FULL_STRING", [full version string]) AC_DEFINE_UNQUOTED(AQDG_VERSION_TAG,$AQDG_VERSION_TAG, [tag]) AC_SUBST(AQDG_SO_CURRENT) AC_SUBST(AQDG_SO_REVISION) AC_SUBST(AQDG_SO_AGE) AC_SUBST(AQDG_SO_EFFECTIVE) AC_DEFINE_UNQUOTED(AQDG_SO_EFFECTIVE_STR, "$AQDG_SO_EFFECTIVE", [effective SO version]) AM_INIT_AUTOMAKE(aqdiagram, $AQDG_VERSION_RELEASE_STRING) ###------------------------------------------------------------------------- # # prefix handling # AC_PREFIX_DEFAULT(/usr/local) 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) PKG_PROG_PKG_CONFIG ###------------------------------------------------------------------------- # # 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 aqdg_internal_libs="\$(top_builddir)/src/lib/libaqdiagram.la" aqdg_libs="-L\$(libdir) -laqdiagram" aqdg_includes="-I`eval echo $prefix/include`" aqdg_pkgdatadir="`eval echo $prefix/share`/aqdiagram" case "$OS_TYPE" in posix) aqdg_sys_is_windows=0 ;; windows) aqdg_sys_is_windows=1 AC_DEFINE(AQDG_SYS_IS_WINDOWS, 1, [whether the system is WIN32]) ACX_WINDOWS_PATHS ;; esac AM_CONDITIONAL(IS_WINDOWS, [test "$OS_TYPE" = "windows"]) AM_CONDITIONAL(IS_OSX, [test "$OSYSTEM" = "osx"]) AM_CONDITIONAL(IS_LINUX, [test "$OSYSTEM" = "linux"]) ###------------------------------------------------------------------------- # # Check for Gwen # AC_GWENHYWFAR(5,2,0,0) ###------------------------------------------------------------------------- # # check typemaker2 # AC_MSG_CHECKING(typemaker2 binary) AC_ARG_WITH(typemaker2-exe, [ --with-typemaker2-exe=EXE path and name of the executable typemaker2], [typemaker2_exe="$withval"], [typemaker2_exe="\$(gwenhywfar_bindir)/typemaker2"] ) AC_MSG_RESULT($typemaker2_exe) AC_SUBST(typemaker2_exe) ###------------------------------------------------------------------------- # Check for Cairo # AC_MSG_CHECKING(whether cairo support is wanted) AC_ARG_ENABLE(cairo, [ --enable-cairo enable cairo support (default=yes)], enable_cairo="$enableval", enable_cairo="yes") AC_MSG_RESULT($enable_cairo) if test "$enable_cairo" != "no"; then PKG_CHECK_MODULES([CAIRO], [cairo], [HAVE_CAIRO="yes"], [HAVE_CAIRO="no"]) if test "$HAVE_CAIRO" = "yes"; then AC_DEFINE(HAVE_CAIRO, 1, [if Cairo is available]) fi else HAVE_CAIRO="no" fi ###------------------------------------------------------------------------- # # 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 cfg search dir # AC_MSG_CHECKING(cfg search dir) AC_ARG_WITH(cfg-searchdir, [ --with-cfg-searchdir=DIR where to search for cfg files], [aqdiagram_cfg_searchdir="$withval"], [aqdiagram_cfg_searchdir=""]) if test -z "$aqdiagram_cfg_searchdir"; then if test "$OSYSTEM" = "windows"; then aqdiagram_cfg_searchdir="etc" else if test "$enable_local_install" != "no"; then aqdiagram_cfg_searchdir="etc" else aqdiagram_cfg_searchdir="\$(sysconfdir)" fi fi fi AC_SUBST(aqdiagram_cfg_searchdir) AC_MSG_RESULT($aqdiagram_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], [aqdiagram_locale_searchdir="$withval"], [aqdiagram_locale_searchdir=""]) if test -z "${aqdiagram_locale_searchdir}"; then if test "$OSYSTEM" = "windows"; then aqdiagram_locale_searchdir="share/locale" else if test "$enable_local_install" != "no"; then aqdiagram_locale_searchdir="share/locale" else aqdiagram_locale_searchdir="\$(localedir)" fi fi fi AC_SUBST(aqdiagram_locale_searchdir) AC_MSG_RESULT($aqdiagram_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], [aqdiagram_data_searchdir="$withval"], [aqdiagram_data_searchdir=""]) if test -z "${aqdiagram_data_searchdir}"; then if test "$OSYSTEM" = "windows"; then aqdiagram_data_searchdir="share/aqdiagram" else if test "$enable_local_install" != "no"; then aqdiagram_data_searchdir="share/aqdiagram" else aqdiagram_data_searchdir="\$(datadir)/aqdiagram" fi fi fi AC_SUBST(aqdiagram_data_searchdir) AC_MSG_RESULT($aqdiagram_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"]) ###------------------------------------------------------------------------- # # 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) ###------------------------------------------------------------------------- # # docpath # AC_MSG_CHECKING(docpath) AC_ARG_WITH(docpath, [ --with-docpath=DIR where to store the apidoc], [docpath="$withval"], [docpath="${HOME}/apidoc"]) AC_SUBST(docpath) AC_MSG_RESULT($docpath) ###------------------------------------------------------------------------- # # check for doc type # AC_MSG_CHECKING(if full docu should be created) AC_ARG_ENABLE(full-doc, [ --enable-full-doc enable creating full apidoc (default=no)], [ case "${enableval}" in yes) enable_fulldoc="yes";; no) enable_fulldoc="no";; *) AC_MSG_ERROR(bad value ${enableval} for --enable-full-doc);; esac ], enable_fulldoc="no") if test "$enable_fulldoc" = "yes"; then DOXYGEN_INPUT="listdoc.h src" DOXYGEN_DEFINE="" DOXYGEN_FILE_PATTERNS="*.h *.hpp *.c *.cpp" DOXYGEN_EXCLUDE_PATTERNS="" else DOXYGEN_DEFINE="DOXYGEN_HIDE" DOXYGEN_INPUT="listdoc.h aqdiagram" DOXYGEN_FILE_PATTERNS="*.h *.hpp" DOXYGEN_EXCLUDE_PATTERNS="*_p.h" fi AC_SUBST(DOXYGEN_INPUT) AC_SUBST(DOXYGEN_DEFINE) AC_SUBST(DOXYGEN_FILE_PATTERNS) AC_SUBST(DOXYGEN_EXCLUDE_PATTERNS) AC_MSG_RESULT($enable_fulldoc) ###------------------------------------------------------------------------- # # search for tag files # AC_MSG_CHECKING(doxygen tag files) DOXYGEN_TAGFILES="" DOXYGEN_TAGFILEPATHS="" if test -d "${docpath}"; then tagfiles="`cd ${docpath} && ls *.tag`" if test -n "${tagfiles}"; then # remove own package from list tagfiles="`echo ${tagfiles} | ${SED} -e s/${PACKAGE}.tag//`" # add every remaining tag file for ff in ${tagfiles}; do DOXYGEN_TAGFILES="${DOXYGEN_TAGFILES} ${docpath}/${ff}=${docpath}/`basename -s .tag ${ff}`" done fi fi if test -z "${DOXYGEN_TAGFILES}"; then AC_MSG_RESULT(none) else AC_MSG_RESULT(found) fi AC_SUBST(DOXYGEN_TAGFILES) ###------------------------------------------------------------------------- # # check whether test code should be enabled # AC_MSG_CHECKING(whether to enable test code) AC_ARG_ENABLE(testcode, [ --enable-testcode allow compiling of test code (default=no)], enable_testcode="$enableval", enable_testcode="no") AC_MSG_RESULT($enable_testcode) if test "$enable_testcode" != "no"; then AC_DEFINE(AQDIAGRAM_ENABLE_TESTCODE, 1, [whether to enable test code]) fi ###------------------------------------------------------------------------- # # 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(aqdg_includes) AC_SUBST(aqdg_includes) AC_SUBST(aqdg_internal_libs) AC_SUBST(aqdg_libs) AC_SUBST(aqdg_pkgdatadir) AC_SUBST(aqdg_plugindir) AC_SUBST(aqdg_sys_is_windows) ###------------------------------------------------------------------------- # # Output files # AC_CONFIG_FILES([Makefile m4/Makefile src/Makefile src/lib/Makefile src/lib/aqdiagram/Makefile src/lib/aqdiagram/draw/Makefile src/lib/aqdiagram/graph/Makefile ]) AC_OUTPUT ###------------------------------------------------------------------------- # # Summary # echo echo echo "Summary" echo "----------------------------------------------------" echo "AqDiagram : $AQDG_VERSION_FULL_STRING" echo "Local Installation Mode : $enable_local_install" echo "Cfg Search Folder : $aqdiagram_cfg_searchdir" echo "Data Search Folder : $aqdiagram_data_searchdir" echo "Locale Search Folder : $aqdiagram_locale_searchdir" echo "Symbol Visibility : $visibility_supported" echo echo "----------------------------------------------------" echo "You can now run \"make\" (or gmake on FreeBSD) to compile."