dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.52) AC_REVISION($Revision: 1.39 $) AC_INIT(DirComp, 1.3.03, [g17m0@lycos.com], DirComp) RELEASE=${PACKAGE_VERSION%.*} VERSION=AC_PACKAGE_VERSION AC_DEFINE_UNQUOTED(PRG_RELEASE, "$RELEASE", [Define to the release of the program]) MYSUBDIRS="Common" dnl AC_CANONICAL_SYSTEM AM_INIT_AUTOMAKE(dist-bzip2) AM_CONFIG_HEADER(dircomp-cfg.h) AC_LANG_CPLUSPLUS AC_C_BIGENDIAN ALL_LINGUAS="de en es" dnl Checks for programs. AC_PROG_CXX AM_GNU_GETTEXT dnl Use yes/no as values, as this is also shown by configure AC_CHECK_PROG([HAVE_DIFF], [diff], [1], [0]) AC_CHECK_PROG([HAVE_XXDIFF], [xxdiff], [1], [0]) AC_CHECK_PROG([HAVE_KOMPARE], [kompare], [1], [0]) AC_DEFINE_UNQUOTED([HAVE_DIFF], $HAVE_DIFF, [Set to 1 if diff exists, 0 if not]) AC_DEFINE_UNQUOTED([HAVE_XXDIFF], $HAVE_XXDIFF, [Set to 1 if xxdiff exists, 0 if not]) AC_DEFINE_UNQUOTED([HAVE_KOMPARE], $HAVE_KOMPARE, [Set to 1 if kompare exists, 0 if not]) dnl Checks for libraries. AC_CHECK_LIB(stdc++, main) AC_CHECK_LIB(m, main) AC_CHECK_LIB(dl, main) AC_CHECK_LIB(pthread, main) PKG_CHECK_MODULES(YMP, YGP >= 0.8.00, [], [AC_MSG_ERROR(Need libYGP to make); exit]) PKG_CHECK_MODULES(XMP, XGP >= 0.8.00 gtkmm-2.4 >= 2.4.0, [MYSUBDIRS="$MYSUBDIRS X-windows"], [AC_WARN(libXGP or gtkmm is not installed; subdir X-windows will not be made)]) GTHREAD_CFLAGS="" GTHREAD_LIBS="" if test $ac_cv_lib_pthread_main = no; then AC_MSG_WARN(libpthread is not installed! Disabling threads) else PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.2.0, [GTHREAD_CFLAGS="$GTHREAD_CFLAGS -DENABLE_THREADS"], [AC_WARN("gthreads are not installed! Disabling threads")]) fi AC_SUBST(GTHREAD_CFLAGS) AC_SUBST(GTHREAD_LIBS) AC_SUBST(YMP_CFLAGS) AC_SUBST(YMP_LIBS) AC_SUBST(XMP_CFLAGS) AC_SUBST(XMP_LIBS) dnl Checks for header files. AC_HEADER_DIRENT if test "$enable_corba" == "yes"; then PKG_CHECK_MODULES(CGP, CGP >= 0.6.40, [MYSUBDIRS="CORBA $MYSUBDIRS" CORBAOBJECTS="\$(top_srcdir)/CORBA/CCompDir.o \$(top_srcdir)/CORBA/CICompDir.o" AC_DEFINE(HAVE_CGP)], [AC_WARN(libCGP or MICO is not installed; subdir CORBA will not be made)]) fi AC_SUBST(CORBAOBJECTS) AC_SUBST(MYSUBDIRS) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. dnl Enable special features AC_ARG_ENABLE(server, AC_HELP_STRING([--enable-server], [Enables daemon/server mode])], if test "$enableval" != "no"; then CXXFLAGS="$CXXFLAGS -DENABLE_SERVER"; fi) AC_ARG_ENABLE(corba, AC_HELP_STRING([--enable-corba], [Enables DirComp to start as CORBA server])], if test "$enableval" != "no"; then CXXFLAGS="$CXXFLAGS -DENABLE_CORBA"; fi) AC_ARG_ENABLE(debug, AC_HELP_STRING([[[[[--enable-debug[=LEVEL]]]]]], [Enables additional traces]), if test "$enableval" != "no"; then test "$enableval" == "yes" && enableval=0 CXXFLAGS="-g -O2 -DTRACELEVEL=$enableval"; else CXXFLAGS="-O2 -UTRACELEVEL"; fi) AC_ARG_ENABLE(checks, AC_HELP_STRING([[[[[--enable-checks[=LEVEL]]]]]], [Enables additional (internal) checks]), if test "$enableval" != "no"; then test "$enableval" == "yes" && enableval=0 CXXFLAGS="$CXXFLAGS -DCHECK=$enableval"; else CXXFLAGS="$CXXFLAGS -DNDEBUG -UCHECK"; fi) AC_OUTPUT([Makefile Common/Makefile X-windows/Makefile CORBA/Makefile \ intl/Makefile po/Makefile.in doc/Makefile]) dnl Settings for autoheader AH_TOP([#ifndef DIRCOMP_CFG_H #define DIRCOMP_CFG_H]) AH_BOTTOM([#if defined (HAVE_GETTEXT) && defined (ENABLE_NLS) # include # ifdef CONVERT_TO_UTF8 # define _(String) Glib::locale_to_utf8 (gettext (String)) # else # define _(String) gettext (String) # endif # define N_(String) gettext_noop (String) # define gettext_noop(String) (String) #else # define _(String) (String) # define N_(String) (String) # define ngettext(Str1, Str2, flag) (((flag) == 1) ? (Str1) : (Str2)) # define binddomain(Domain) # define bindtextdomain(Package, Directory) #endif #endif]) AH_TEMPLATE([HAVE_CGP], [Set to 1 if libCGP exists])