AC_INIT(Recoll, 1.6) AC_CONFIG_HEADERS([common/autoconfig.h]) AC_PREREQ(2.53) AC_CONFIG_SRCDIR(index/recollindex.cpp) sys=`uname` if test -f mk/$sys ; then (cd mk; rm -f sysconf; ln -s $sys sysconf) else cat < #include ],[ iconv(0,(const char **)0,(size_t *)0,(char **)0,(size_t *)0); ], rcl_iconv_inbuf_const="1", rcl_iconv_inbuf_const="0") if test X$rcl_iconv_inbuf_const = X1 ; then AC_DEFINE(RCL_ICONV_INBUF_CONST, 1, [iconv parameter 2 is const char**]) fi AC_MSG_CHECKING(for type of string parameter to putenv) AC_TRY_COMPILE([ #include ],[ putenv((const char *)0); ], rcl_putenv_string_const="1", rcl_putenv_string_const="0") if test X$rcl_putenv_string_const = X1 ; then AC_DEFINE(PUTENV_ARG_CONST, 1, [putenv parameter is const]) fi #### Look for Xapian AC_PATH_PROG(XAPIAN_CONFIG, xapian-config, no) if test "$XAPIAN_CONFIG" = "no" ; then AC_MSG_ERROR([Cannot find xapian-config command in $PATH. Is xapian-core installed ?]) exit 1 fi LIBXAPIAN=`$XAPIAN_CONFIG --libs` # Workaround for problem in xapian-config in some versions: wrongly lists # libstdc++.la in the lib list for i in $LIBXAPIAN ; do case $i in *stdc++*|-lm|-lgcc_s|-lc);; *) tmpxaplib="$tmpxaplib $i";; esac done LIBXAPIAN=$tmpxaplib # Also recent xapian libs need lz even when they think they don't... LIBXAPIAN="$LIBXAPIAN -lz" XAPIANCXXFLAGS=`$XAPIAN_CONFIG --cxxflags` #echo XAPIAN_CONFIG: $XAPIAN_CONFIG #echo LIBXAPIAN: $LIBXAPIAN #echo XAPIANCXXFLAGS: $XAPIANCXXFLAGS #### QT # The way qt and its tools (qmake especially) are installed is very # different between systems (and maybe qt versions) # # In general we need QTDIR to be set, because it is used inside the # qmake-generated makefiles. But there are exceptions: ie on debian3.1 (at # least on the sourceforge compile farm), QTDIR is not needed because qmake # generates hard paths (and is installed in /usr/bin). We don't want to # force the user to set QTDIR if it is not needed. # # The logic is then to first look for qmake, possibly using QTDIR if it is # set. # # If QTDIR is not set, we then generate a bogus qt project and check if # QTDIR is needed in the Makefile, in which case we complain. # # QMAKESPEC: on most Linux system, there is a 'default' link inside the # mkspecs directory, so that QMAKESPEC is not needed. # If QMAKESPEC is not set and needed, the qmake test at the previous test # will have failed, and we tell the user to check his environment. # if test X$QTDIR != X ; then PATH=$QTDIR/bin:$PATH export PATH fi # MacosX stuff: we don't support this (the native search tool is more than # good enough), but we make things work just enough so that the program can # be compiled and roughly installed (not as a .app, but to /usr/local), # basically to enable using a Macbook for development if test X$sys = XDarwin ; then # The defaults tends to be macx-xcode, which we cant use QMAKESPEC=macx-g++ export QMAKESPEC #QMAKESPEC_SPEC="-spec max-g++" #AC_SUBST(QMAKESPEC_SPEC) fi AC_PATH_PROG([QMAKE], [qmake], NOTFOUND) if test X$QMAKE = XNOTFOUND ; then AC_MSG_ERROR([Cannot find the qmake program. Maybe you need to install qt development files and tools and/or set the QTDIR environment variable?]) fi if test X$sys = XDarwin ; then QMAKE="${QMAKE} -spec macx-g++" fi # Discriminate qt3/4. Qt3 qmake prints its version on stderr but we don't # depend on this. We try to detect the qt 4 version string instead. qmakevers="`qmake --version 2>&1`" #echo "qmake version: $qmakevers" v4=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*4.*'` if test X$v4 = X0 ; then AC_MSG_NOTICE([using qt version 3 user interface]) QTGUI=qtgui else AC_MSG_NOTICE([using qt version 4 user interface]) QTGUI=qt4gui AC_PATH_PROG([UIC3], [uic3], NOTFOUND) if test X$UIC3 = XNOTFOUND ; then AC_MSG_ERROR([Cannot find the uic3 program. Maybe you need to add the qt3 compatibility libraries and tools to your qt4 installation ?]) fi fi cd $QTGUI # We just want a .pro file: no problem with unsubstituted variables at # this point. test -f uifrom3 && make -f uifrom3 test -f recoll.pro && chmod +w recoll.pro cp recoll.pro.in recoll.pro #echo QMAKE ${QMAKE} ${QMAKE} recoll.pro if test $? != 0 ; then AC_MSG_ERROR([Cannot use qmake to generate a Makefile. Maybe you need to check the QTDIR and QMAKESPEC environment variables?]) fi # is QTDIR set and do we actually need it ? if test X$QTDIR = X ; then QTDIRNEEDED=`grep INCPATH Makefile | grep = | grep QTDIR` if test "X$QTDIRNEEDED" != "X" ; then AC_MSG_ERROR([You need to set the QTDIR variable to point to the QT installation. If there is no default mkspecs, you should also set QMAKESPEC]) fi fi cd .. ##################### End QT detection ### X11: this is needed for the session monitoring code (in recollindex -m) AC_PATH_XTRA #echo X_CFLAGS "'$X_CFLAGS'" X_PRE_LIBS "'$X_PRE_LIBS'" X_LIBS "'$X_LIBS'" X_EXTRA_LIBS "'$X_EXTRA_LIBS'" # We have to expand prefix in here, couldn't find a way to do it inside # the qt gui .pro file or Makefile. This just means that you can't change # prefix at build time. It works at install time because we dont' use the # qtgui Makefile m_prefix=$prefix test "X$m_prefix" = "XNONE" && m_prefix=/usr/local m_datadir=${m_prefix}/share QTRECOLL_DATADIR=${m_datadir}/recoll AC_SUBST(X_CFLAGS) AC_SUBST(X_PRE_LIBS) AC_SUBST(X_LIBS) AC_SUBST(X_EXTRA_LIBS) AC_SUBST(INCICONV) AC_SUBST(LIBICONV) AC_SUBST(LIBXAPIAN) AC_SUBST(LIBFAM) AC_SUBST(QMAKE) AC_SUBST(QTGUI) AC_SUBST(QTRECOLL_DATADIR) AC_SUBST(XAPIANCXXFLAGS) AC_CONFIG_FILES(mk/localdefs) AC_CONFIG_FILES(recollinstall) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(sampleconf/recoll.conf) AC_CONFIG_FILES($QTGUI/recoll.pro) for d in bincimapmime index lib query do rm -f $d/alldeps.stamp cp -f /dev/null $d/alldeps done (cd lib;test -f Makefile && chmod +w Makefile;sh mkMake) AC_OUTPUT chmod a+x recollinstall