# process this file with autoconf to produce a configure script ## ## information on the package ## AC_INIT(Subcommander,1.2.2,[dev@subcommander.tigris.org]) AC_SUBST(PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) AC_CONFIG_SRCDIR(sublib/version.in.h) AC_CONFIG_AUX_DIR(ac-helpers) AM_INIT_AUTOMAKE(subdir-objects) AH_TOP([ #ifndef SC_CONFIG_H #define SC_CONFIG_H ]) AH_BOTTOM([ /* gettext */ #define _n(x) x #ifdef ENABLE_NLS #include // libintl.h defines sprintf to libintl_sprintf. Unfortunately // QCString has an sprintf method. Since sprintf is a define // now the linker requires a QCString::libintl_sprintf symbol. // To fix this we undef sprintf again. #undef sprintf #define _(x) dgettext(PACKAGE_NAME, x) #define _q(x) QString::fromUtf8(dgettext(PACKAGE_NAME, x)) #define _s(x) sc::String(dgettext(PACKAGE_NAME, x)) #else #define _(x) (x) #define _q(x) QString::fromUtf8(x) #define _s(x) sc::String(x) #endif #endif // SC_CONFIG_H ]) ## ## checks for programs ## AM_PROG_CC_C_O AC_PROG_CXX AC_PROG_RANLIB AC_PROG_MAKE_SET ## ## get host system, we need to know if we are running MacOSX or another Unix ## system ## AC_CANONICAL_HOST ## ## checks for libraries ## ## # check for apr # APR_FIND_APR([],[],[1], [0 1]) if test x$apr_found = xno; then AC_MSG_ERROR([apr not found]) fi APR_CPPFLAGS="`$apr_config --cflags --cppflags`" APR_INCLUDES="`$apr_config --includes`" APR_LIBS="`$apr_config --link-ld --libs`" if test $? -ne 0; then AC_MSG_ERROR([apr-config --includes failed]) fi AC_SUBST(APR_CPPFLAGS) AC_SUBST(APR_INCLUDES) AC_SUBST(APR_LIBS) # # end check for apr ## ## # check for apr-util # APR_FIND_APU([],[],[1], [0 1]) if test x$apu_found = xno; then AC_MSG_ERROR([apr-util not found]) fi APU_INCLUDES="`$apu_config --includes`" APU_LIBS="`$apu_config --ldflags --link-ld --libs`" if test $? -ne 0; then AC_MSG_ERROR([apu-config --includes failed]) fi AC_SUBST(APU_INCLUDES) AC_SUBST(APU_LIBS) # # end check for apr-util ## ## # check for boost # AC_MSG_CHECKING([for boost]) AC_ARG_WITH( [boost], AC_HELP_STRING([--with-boost=DIR],[path to boost installation]), [ boost_path=$withval with_boost="yes" ],[ with_boost="no" ] ) if test x$with_boost = xyes; then BOOST_INCLUDES="-I$boost_path/include" else BOOST_INCLUDES="" fi case $host in powerpc-apple-darwin*) BOOST_INCLUDES="$BOOST_INCLUDES -Wno-long-double" ;; esac CPPFLAGS="$BOOST_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[ #include ]], [[ boost::shared_ptr ptr; ]] ), [ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([try setting --with-boost]) ] ) AC_SUBST(BOOST_INCLUDES) # # end check for boost ## ## # check for subversion # # todo check for minimum required version # AC_MSG_CHECKING([for subversion]) AC_ARG_WITH( [subversion], AC_HELP_STRING([--with-subversion=DIR],[path to subversion 1.2.x (or better) installation]), [ svn_path=$withval with_svn="yes" ],[ with_svn="no" ] ) if test x$with_svn = xyes; then SVN_INCLUDES="-I$svn_path/include/subversion-1" SVN_LIBS="-L$svn_path/lib" SVN_PATH="$svn_path" else # no path given, try to find it.. svn_test_header="include/subversion-1/svn_client.h" svn_test_paths=" /usr /usr/local /opt/subversion " for svn_test_path in $svn_test_paths; do if test -f "$svn_test_path/$svn_test_header"; then svn_auto_path=$svn_test_path fi done # found something? if test x$svn_auto_path = x; then SVN_INCLUDES="" SVN_LIBS="" SVN_PATH="" else SVN_INCLUDES="-I$svn_auto_path/include/subversion-1" SVN_LIBS="-L$svn_auto_path/lib" SVN_PATH="$svn_auto_path" fi fi # required since svn 1.4 case $host in powerpc-apple-darwin*) SVN_LIBS="$SVN_LIBS -framework security" ;; esac CPPFLAGS="$APR_INCLUDES $SVN_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[#include ]], [[const svn_version_t* v = svn_client_version();]] ), [ AC_MSG_RESULT([yes]) AC_MSG_RESULT([ headers $SVN_INCLUDES]) AC_MSG_RESULT([ libraries $SVN_LIBS]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([try setting --with-subversion]) ] ) AC_SUBST(SVN_INCLUDES) AC_SUBST(SVN_LIBS) AC_SUBST(SVN_PATH) # # end check for subversion ## ## # check for neon # AC_MSG_CHECKING([for neon]) AC_ARG_WITH( [neon], AC_HELP_STRING([--with-neon=DIR],[path to neon installation]), [ neon_path=$withval with_neon="yes" ],[ with_neon="no" ] ) if test x$with_neon = xyes; then NEON_INCLUDES="-I$neon_path/include" NEON_LIBS="`$neon_path/bin/neon-config --libs`" else NEON_INCLUDES="" NEON_LIBS="" fi CPPFLAGS="$NEON_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[#include ]], [[ne_sock_exit()]] ), [ AC_MSG_RESULT([yes]) AC_MSG_RESULT([ headers $NEON_INCLUDES]) AC_MSG_RESULT([ libraries $NEON_LIBS]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([try setting --with-neon]) ] ) AC_SUBST(NEON_INCLUDES) AC_SUBST(NEON_LIBS) # # end check for neon ## ## # check for openssl # AC_MSG_CHECKING([for openssl]) AC_ARG_WITH( [openssl], AC_HELP_STRING([--with-openssl=DIR],[path to openssl installation]), [ ssl_path=$withval with_ssl="yes" ],[ with_ssl="no" ] ) if test x$with_ssl = xyes; then SSL_INCLUDES="-I$ssl_path/include" SSL_LIBS="-L$ssl_path/lib" else SSL_INCLUDES="" SSL_LIBS="" fi CPPFLAGS="$SSL_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[ #include #include #include ]], [[ EVP_cleanup(); ERR_free_strings(); unsigned long openssl = OPENSSL_VERSION_NUMBER; ]] ), [ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_ERROR([try setting --with-openssl]) ] ) AC_SUBST(SSL_INCLUDES) AC_SUBST(SSL_LIBS) # # end check for openssl ## ## # check for berkeley db # we only care for the include path to extract the berkeley db version # for the about dialog... # AC_MSG_CHECKING([for berkeley db (include)]) AC_ARG_WITH( [berkeley-db], AC_HELP_STRING([--with-berkeley-db=DIR],[include path of berkeley db]), [ bdb_path=$withval with_bdb="yes" ],[ with_bdb="no" ] ) if test x$with_bdb = xyes; then BDB_INCLUDES="-I$bdb_path" BDB_LIBS="" else BDB_INCLUDES="" BDB_LIBS="" fi CPPFLAGS="$BDB_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[ #include ]], [[ unsigned long num = DB_VERSION_MAJOR; ]] ), [ AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_DB_H],[1],[berkeley db]) ],[ AC_MSG_RESULT([no]) # AC_MSG_ERROR([try setting --with-berkeley-db]) ] ) AC_SUBST(BDB_INCLUDES) AC_SUBST(BDB_LIBS) # # end check for berkeley db ## ## # check for MacOSX # case $host in powerpc-apple-darwin*) AC_DEFINE(_MACOSX,1,[MacOSX]) ;; esac # # end check for MacOSX ## ## # check for X11, qt may need it # AC_PATH_X AC_PATH_XTRA # # end check for X11 ## ## # check for qt # AC_MSG_CHECKING([if --enable-static-qt option is specified]) AC_ARG_ENABLE( [static-qt], AC_HELP_STRING([--enable-static-qt],[link with static qt library]), [ static_qt="$enable_static_qt" AC_MSG_RESULT([$static_qt]) ],[ static_qt="no" AC_MSG_RESULT([no]) ] ) AC_MSG_CHECKING([for Qt]) AC_ARG_WITH( [qt], AC_HELP_STRING([--with-qt=DIR],[path to qt3 installation ($QTDIR)]), [ qt_path=$withval with_qt="yes" ],[ with_qt="no" ] ) if test x$with_qt = xno; then # no path given, try to find it.. qt_test_bin="bin/moc" qt_test_paths=" /usr /usr/share/qt3 $QTDIR " for qt_test_path in $qt_test_paths; do if test -f "$qt_test_path/$qt_test_bin"; then qt_auto_path=$qt_test_path fi done # found something? if test x$qt_auto_path != x; then QT_LIBS="-L$qt_auto_path/lib" QT_BIN="$qt_auto_path/bin" qt_path="$qt_auto_path" else # no.. AC_MSG_RESULT([no]) AC_MSG_ERROR([try setting --with-qt or $QTDIR]) fi fi if test x$qt_path != x; then QT_BIN="$qt_path/bin" # extract version numbers of qt QT_VERSION=`$QT_BIN/moc -v 2>&1 | sed "s/.*(Qt \(.*\))/\1/"` QT_MAJOR=`echo $QT_VERSION | sed "s/\(.*\)[[.]].*[[.]].*/\1/"` QT_MINOR=`echo $QT_VERSION | sed "s/.*[[.]]\(.*\)[[.]].*/\1/"` # check version, the version must be.. #echo "($QT_VERSION)($QT_MAJOR)($QT_MINOR)" # >= 3.2 if test $QT_MAJOR -eq 3 -a $QT_MINOR -ge 2; then goodqt=yes # extract library name, copied from autoconf archive (based on bnv_have_qt.m4) qt_lib="`ls $qt_path/lib/libqt* | sed -n 1p | sed s@$qt_path/lib/lib@@ | [sed s@[.].*@@]`" # decide qt linkage, static or not if test x$static_qt = xyes; then QT_LIBS="$qt_path/lib/lib$qt_lib.a" else QT_LIBS="-L$qt_path/lib -l$qt_lib" fi # find qt3 header qt_test_inc_paths=" $qt_path/include $qt_path/include/qt3 " for qt_test_inc_path in $qt_test_inc_paths; do if test -e "$qt_test_inc_path/qglobal.h"; then qt_inc_path=$qt_test_inc_path fi done QT_INCLUDES="-I$qt_inc_path" # = 4.0.0 elif test $QT_MAJOR -eq 4; then # goodqt=yes goodqt=no # QT_INCLUDES="-DQT3_SUPPORT -I$qt_path/include -I$qt_path/include/Qt" # QT_LIBS="$QT_LIBS -lQtCore -lQtGui -lQtNetwork -lQt3Support" else goodqt=no fi if test x$goodqt != xyes; then AC_MSG_RESULT([yes, but it is a wrong version]) # AC_MSG_ERROR([found qt version $QT_VERSION but I need 3.2+ or 4+]) AC_MSG_ERROR([found qt version $QT_VERSION but I need 3.2 <= version < 4.0.0]) fi fi # test if the platform needs X11 or MacOSX stuff for Qt case $host in powerpc-apple-darwin*) # no X11 required, Qt is native on MacOSX so we need MacOSX libraries QT_LIBS="-framework Carbon $QT_LIBS" ;; *) # any other Unix platform will need X11, so add the required includes and libs for X11 #debug output #echo "($x_includes) ($x_libraries) ($X_CFLAGS) ($X_PRE_LIBS) ($X_LIBS) ($X_EXTRA_LIBS)" if test x$x_includes != x; then QT_INCLUDES="$QT_INCLUDES -I$x_includes" fi if test x$x_libraries != x; then QT_LIBS="$QT_LIBS -L$x_libraries $X_PRE_LIBS -lX11 -lXext -lXmu -lXt -lXi $X_EXTRA_LIBS" fi ;; esac # do a simple compile test CPPFLAGS="$QT_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[#include ]], [[QWidget* w = new QWidget();]] ), [ AC_MSG_RESULT([yes]) AC_MSG_RESULT([ version $QT_VERSION]) AC_MSG_RESULT([ headers $QT_INCLUDES]) AC_MSG_RESULT([ libraries $QT_LIBS]) AC_MSG_RESULT([ binaries $QT_BIN]) ],[ AC_MSG_RESULT([yes, but it does not work!]) AC_MSG_ERROR([try setting --with-qt or $QTDIR]) ] ) AC_SUBST(QT_INCLUDES) AC_SUBST(QT_LIBS) AC_SUBST(QT_BIN) # QT_MOC # QT_CXXFLAGS # QT_LIBS # # end check for Qt ## ## # nls # AC_ARG_ENABLE( [nls], AC_HELP_STRING([--enable-nls],[enable i18n (gettext)]), [ AC_DEFINE(ENABLE_NLS,1,[enable i18n (gettext)]) enable_nls=yes ],[ enable_nls=$enableval ] ) AM_CONDITIONAL(ENABLE_NLS, test x$enable_nls = xyes) AC_ARG_ENABLE( [bundle-svn-nls], AC_HELP_STRING([--enable-bundle-svn-nls],[bundle svn nls files on MacOSX]), [ AC_DEFINE(MACOSX_BUNDLED_SVN_NLS,1,[bundled svn nls files on MacOSX]) enable_bundle_svn_nls=yes ],[ enable_bundle_svn_nls=$enableval ] ) AM_CONDITIONAL(BUNDLE_SVN_NLS, test x$enable_bundle_svn_nls = xyes) if test x$enable_nls = xyes; then AC_SEARCH_LIBS([bindtextdomain], [intl]) fi # # nls ## ## # check for stlport # AC_MSG_CHECKING([for stlport]) AC_ARG_WITH( [stlport], AC_HELP_STRING([--with-stlport=DIR],[path to stlport installation]), [ stlport_path=$withval with_stlport="yes" ],[ with_stlport="no" ] ) if test x$with_stlport = xyes; then STLPORT_INCLUDES="-I$stlport_path/include/stlport" STLPORT_LIBS="-L$stlport_path/lib -lstlport_gcc" else STLPORT_INCLUDES="" STLPORT_LIBS="" fi CPPFLAGS="$STLPORT_INCLUDES" AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[ #include ]], [[ #ifndef _STLPORT_VERSION #error no stlport! #endif // _STLPORT_VERSION ]] ), [ AC_MSG_RESULT([yes]) has_stlport="yes" ],[ AC_MSG_RESULT([no]) has_stlport="no" ] ) AC_SUBST(STLPORT_INCLUDES) AC_SUBST(STLPORT_LIBS) # # end check for stlport ## ## # check if the compiler needs stlport # # if we don't have stlport we need at least gcc 3.x # just warn for an unknown compiler # if test x$has_stlport = xno; then AC_MSG_CHECKING([wether we have a working stl]) AC_LANG(C++) AC_COMPILE_IFELSE( AC_LANG_PROGRAM( [[ ]], [[ #if defined __GNUC__ && __GNUC__ < 3 # error needs stlport! #endif // __GNUC__ ]] ), [ AC_MSG_RESULT([yes]) ],[ AC_MSG_RESULT([no]) AC_MSG_RESULT([ this g++ (__GNUC__ < 3) will need stlport to build!]) AC_MSG_ERROR([try setting --with-stlport]) ] ) fi # # end compiler needs stlport ## ## ## checks for header files ## #AC_CHECK_HEADERS([malloc.h]) ## checks for types ## none ## checks for structures ## none ## checks for compiler characteristics ## none ## ## checks for library functions ## #AC_CHECK_FUNCS([atexit]) ## checks for system services ## none ## ## create Makefiles ## #AC_CONFIG_FILES([FILE...]) AC_OUTPUT([ Makefile po/Makefile svn/Makefile util/Makefile sublib/Makefile submerge/Makefile subcommander/Makefile ])