~ubuntu-branches/ubuntu/karmic/recoll/karmic

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Kartik Mistry
  • Date: 2007-05-03 12:15:02 UTC
  • Revision ID: james.westby@ubuntu.com-20070503121502-rmfihk303ic03g59
Tags: upstream-1.8.1
ImportĀ upstreamĀ versionĀ 1.8.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_INIT(Recoll, 1.6)
 
2
AC_CONFIG_HEADERS([common/autoconfig.h])
 
3
AC_PREREQ(2.53)
 
4
AC_CONFIG_SRCDIR(index/recollindex.cpp)
 
5
 
 
6
sys=`uname`
 
7
if test -f mk/$sys ; then
 
8
    (cd mk; test -f sysconf || ln -s $sys sysconf)
 
9
else
 
10
   cat <<EOF
 
11
    No system configuration file found in mk/ for '$sys'. Maybe you
 
12
    could try to write one, starting from one of the existing files, they
 
13
    are really simple.
 
14
EOF
 
15
   exit 1
 
16
fi
 
17
 
 
18
# Use aspell to provide spelling expansions ?
 
19
# The default is yes. If we do find an aspell installation, we use it. Else
 
20
# we do compile the aspell module using an internal copy of aspell.h
 
21
# Only --with-aspell=no will completely disable aspell support
 
22
AC_ARG_WITH(aspell, 
 
23
    AC_HELP_STRING([--without-aspell],
 
24
   [Disable use of aspell spelling package to provide term expansion to other spellings]),
 
25
        withAspell=$withval, withAspell=yes)
 
26
case $withAspell in
 
27
     no);;
 
28
     yes)
 
29
     AC_PATH_PROG(aspellProg, aspell)
 
30
     ;;
 
31
     *) # The argument should be the path to the aspell program
 
32
     aspellProg=$withAspell
 
33
     ;;
 
34
esac
 
35
echo withAspell = $withAspell
 
36
 
 
37
if test X$withAspell != Xno ; then
 
38
   AC_DEFINE(RCL_USE_ASPELL, 1, [Compile the aspell interface])
 
39
   if test X$aspellProg != X ; then
 
40
      aspellBase=`dirname $aspellProg`
 
41
      aspellBase=`dirname $aspellBase`
 
42
      AC_DEFINE_UNQUOTED(ASPELL_PROG, "$aspellProg",
 
43
        [Path to the aspell program])
 
44
      if test -f $aspellBase/include/aspell.h ; then    
 
45
          AC_DEFINE_UNQUOTED(ASPELL_INCLUDE, "$aspellBase/include/aspell.h",
 
46
            [Path to the aspell api include file])
 
47
      else
 
48
        AC_MSG_NOTICE([aspell support enabled but aspell package not found. Compiling with internal aspell interface file])
 
49
         AC_DEFINE(ASPELL_INCLUDE, ["aspell-local.h"])
 
50
      fi
 
51
   else
 
52
     # aspell support enabled but no aspell install yet
 
53
        AC_MSG_NOTICE([aspell support enabled but aspell package not found. Compiling with internal aspell interface file])
 
54
        AC_DEFINE(ASPELL_INCLUDE, ["aspell-local.h"])
 
55
   fi
 
56
fi
 
57
 
 
58
# Real time monitoring with FAM
 
59
AC_ARG_WITH(fam, 
 
60
    AC_HELP_STRING([--with-fam],
 
61
   [Use File Alteration Monitor for almost real time indexing of modified files. Give the fam/gamin library as argument (ie: /usr/lib/libfam.so) if configure does not find the right one.]),
 
62
        withFam=$withval, withFam=no)
 
63
case $withFam in
 
64
     no);;
 
65
     yes)
 
66
        for dir in /usr/local/lib /usr/lib;do 
 
67
         if test -f $dir/libfam.so ; then famLib=$dir/libfam.so;break;fi
 
68
        done
 
69
     ;;
 
70
     *) # The argument should be the path to the fam library
 
71
     famLib=$withFam
 
72
     ;;
 
73
esac
 
74
 
 
75
if test X$withFam != Xno ; then
 
76
   AC_DEFINE(RCL_MONITOR, 1, [Real time monitoring option])
 
77
   AC_DEFINE(RCL_USE_FAM, 1, [Compile the fam interface])
 
78
   if test X$famLib != X ; then
 
79
      famLibDir=`dirname $famLib`
 
80
      famBase=`dirname $famLibDir`
 
81
      famBLib=`basename $famLib .so | sed -e s/lib//`
 
82
      if test ! -f $famBase/include/fam.h ; then
 
83
         AC_MSG_ERROR([fam.h not found in $famBase/include. Specify --with-fam=no to disable fam support])
 
84
      fi
 
85
      LIBFAM="-L$famLibDir -l$famBLib"
 
86
      AC_MSG_NOTICE([fam library directive: $LIBFAM])
 
87
      AC_DEFINE_UNQUOTED(FAM_INCLUDE, "$famBase/include/fam.h",
 
88
        [Path to the fam api include file])
 
89
   else
 
90
        AC_MSG_ERROR([fam library not found])
 
91
   fi
 
92
fi
 
93
 
 
94
if test -f /usr/include/sys/inotify.h -a X$withFam = Xno ; then
 
95
   inot_default=yes
 
96
else
 
97
   inot_default=no
 
98
fi
 
99
 
 
100
# Real time monitoring with inotify
 
101
AC_ARG_WITH(inotify, 
 
102
    AC_HELP_STRING([--with-inotify],
 
103
   [Use inotify for almost real time indexing of modified files.]),
 
104
        withInotify=$withval, withInotify=$inot_default)
 
105
 
 
106
if test X$withInotify != Xno ; then
 
107
   AC_MSG_NOTICE([enabled support for inotify monitoring])
 
108
   AC_DEFINE(RCL_MONITOR, 1, [Real time monitoring option])
 
109
   AC_DEFINE(RCL_USE_INOTIFY, 1, [Compile the inotify interface])
 
110
else
 
111
   AC_MSG_NOTICE([inotify monitoring disabled])
 
112
fi
 
113
 
 
114
##### Look for iconv. We first look for libiconv in /usr/local/lib:/usr/lib
 
115
##    then in libc (Linux, solaris)
 
116
AC_LANG(C)
 
117
LIBICONV=""
 
118
S_LDFLAGS=$LDFLAGS
 
119
dir=/usr/local/lib
 
120
LDFLAGS="$S_LDFLAGS -L$dir"
 
121
unset ac_cv_lib_iconv_iconv_open
 
122
AC_CHECK_LIB(iconv, iconv_open, LIBICONV="-L$dir -liconv";INCICONV=-I/usr/local/include)
 
123
if test A"$LIBICONV" = A ; then
 
124
  dir=/usr/lib
 
125
  LDFLAGS="$S_LDFLAGS -L$dir"
 
126
  unset ac_cv_lib_iconv_iconv_open
 
127
  AC_CHECK_LIB(iconv, iconv_open, LIBICONV="-L$dir -liconv";INCICONV=-I/usr/include)
 
128
  if test A"$LIBICONV" = A; then
 
129
    dir=/usr/lib
 
130
    LDFLAGS="$S_LDFLAGS -L$dir"
 
131
    unset ac_cv_lib_iconv_iconv_open
 
132
    AC_CHECK_LIB(c, iconv_open, LIBICONV=NONE;INCICONV=-I/usr/include)
 
133
  fi
 
134
fi
 
135
LDFLAGS=$S_LDFLAGS
 
136
if test A"$LIBICONV" = A ; then
 
137
   AC_MSG_ERROR([Cannot find iconv_open anywhere. Please install iconv])
 
138
   exit 1
 
139
fi
 
140
if test A"$LIBICONV" = ANONE ; then
 
141
   LIBICONV=""
 
142
fi
 
143
#echo LIBICONV $LIBICONV
 
144
#echo INCICONV $INCICONV
 
145
 
 
146
#### Look for Xapian
 
147
AC_PATH_PROG(XAPIAN_CONFIG, xapian-config, no)
 
148
if test "$XAPIAN_CONFIG" = "no" ; then
 
149
   AC_MSG_ERROR([Cannot find xapian-config command in $PATH. Is
 
150
xapian-core installed ?])
 
151
   exit 1
 
152
fi
 
153
LIBXAPIAN=`$XAPIAN_CONFIG --libs`
 
154
# Workaround for problem in xapian-config in some versions: wrongly lists
 
155
# libstdc++.la in the lib list
 
156
for i in $LIBXAPIAN ; do
 
157
    case $i in
 
158
    *stdc++*|-lm|-lgcc_s|-lc);;
 
159
    *) tmpxaplib="$tmpxaplib $i";;
 
160
    esac
 
161
done
 
162
LIBXAPIAN=$tmpxaplib
 
163
XAPIANCXXFLAGS=`$XAPIAN_CONFIG --cxxflags`
 
164
 
 
165
#echo XAPIAN_CONFIG: $XAPIAN_CONFIG 
 
166
#echo LIBXAPIAN: $LIBXAPIAN
 
167
#echo XAPIANCXXFLAGS: $XAPIANCXXFLAGS
 
168
 
 
169
#### QT
 
170
# The way qt and its tools (qmake especially) are installed is very
 
171
# different between systems (and maybe qt versions)
 
172
#
 
173
# In general we need QTDIR to be set, because it is used inside the
 
174
# qmake-generated makefiles. But there are exceptions: ie on debian3.1 (at
 
175
# least on the sourceforge compile farm), QTDIR is not needed because qmake
 
176
# generates hard paths (and is installed in /usr/bin). We don't want to
 
177
# force the user to set QTDIR if it is not needed.
 
178
#
 
179
# The logic is then to first look for qmake, possibly using QTDIR if it is
 
180
# set.
 
181
 
182
# If QTDIR is not set, we then generate a bogus qt project and check if
 
183
# QTDIR is needed in the Makefile, in which case we complain.
 
184
#
 
185
# QMAKESPEC: on most Linux system, there is a 'default' link inside the
 
186
# mkspecs directory, so that QMAKESPEC is not needed.
 
187
# If QMAKESPEC is not set and needed, the qmake test at the previous test
 
188
# will have failed, and we tell the user to check his environment.
 
189
#
 
190
# Note about qt4: if --enable-qt4 (enables the qt4gui directory), and the 
 
191
# QTDIR variable are inconsistent, too bad.
 
192
#
 
193
AC_ARG_ENABLE(qt4,
 
194
    AC_HELP_STRING([--enable-qt4],
 
195
        [Use qt version 4]),
 
196
        rcl_cv_qt4=$enableval, rcl_cv_qt4=no)
 
197
AC_MSG_NOTICE(rcl_cv_qt4 $rcl_cv_qt4)
 
198
if test X$rcl_cv_qt4 = Xyes ; then 
 
199
   QTGUI=qt4gui
 
200
else
 
201
   QTGUI=qtgui
 
202
fi
 
203
 
 
204
if test X$QTDIR != X ; then
 
205
   PATH=$QTDIR/bin:$PATH
 
206
   export PATH
 
207
fi
 
208
 
 
209
AC_PATH_PROG([QMAKE], [qmake], NOTFOUND)
 
210
if test X$QMAKE = XNOTFOUND ; then 
 
211
   AC_MSG_ERROR([Cannot find the qmake program. Maybe you need to install
 
212
it and/or set the QTDIR environment variable?])
 
213
fi
 
214
 
 
215
cd $QTGUI
 
216
# We just want a .pro file: no problem with unsubstituted variables at 
 
217
# this point.
 
218
test -f uifrom3 && sh uifrom3
 
219
test -f recoll.pro && chmod +w recoll.pro
 
220
cp recoll.pro.in recoll.pro
 
221
${QMAKE} recoll.pro
 
222
if test $? != 0 ; then
 
223
   AC_MSG_ERROR([Cannot use qmake to generate a Makefile. Maybe you need to
 
224
check the QTDIR and QMAKESPEC environment variables?])
 
225
fi
 
226
# is QTDIR set and do we actually need it ?
 
227
if test X$QTDIR = X ; then
 
228
   QTDIRNEEDED=`grep INCPATH Makefile | grep = | grep QTDIR`
 
229
   if test "X$QTDIRNEEDED" != "X" ; then
 
230
       AC_MSG_ERROR([You need to set the QTDIR variable to point to the QT
 
231
installation. If there is no default mkspecs, you should also set QMAKESPEC])
 
232
   fi
 
233
fi
 
234
cd ..
 
235
 
 
236
##################### End QT detection
 
237
 
 
238
### X11: this is needed for the session monitoring code (in recollindex -m)
 
239
AC_PATH_XTRA
 
240
#echo X_CFLAGS "'$X_CFLAGS'" X_PRE_LIBS "'$X_PRE_LIBS'" X_LIBS "'$X_LIBS'" X_EXTRA_LIBS "'$X_EXTRA_LIBS'"
 
241
 
 
242
# We have to expand prefix in here, couldn't find a way to do it inside 
 
243
# the qt gui .pro file or Makefile. This just means that you can't change
 
244
# prefix at build time. It works at install time because we dont' use the
 
245
# qtgui Makefile
 
246
m_prefix=$prefix
 
247
test "X$m_prefix" = "XNONE" && m_prefix=/usr/local
 
248
m_datadir=${m_prefix}/share
 
249
QTRECOLL_DATADIR=${m_datadir}/recoll
 
250
 
 
251
AC_SUBST(X_CFLAGS)
 
252
AC_SUBST(X_PRE_LIBS)
 
253
AC_SUBST(X_LIBS)
 
254
AC_SUBST(X_EXTRA_LIBS)
 
255
AC_SUBST(INCICONV)
 
256
AC_SUBST(LIBICONV)
 
257
AC_SUBST(LIBXAPIAN)
 
258
AC_SUBST(LIBFAM)
 
259
AC_SUBST(QMAKE)
 
260
AC_SUBST(QTGUI)
 
261
AC_SUBST(QTRECOLL_DATADIR)
 
262
AC_SUBST(XAPIANCXXFLAGS)
 
263
 
 
264
AC_CONFIG_FILES(mk/localdefs)
 
265
AC_CONFIG_FILES(recollinstall)
 
266
AC_CONFIG_FILES(Makefile)
 
267
AC_CONFIG_FILES(sampleconf/recoll.conf)
 
268
AC_CONFIG_FILES($QTGUI/recoll.pro)
 
269
 
 
270
for d in bincimapmime index lib query
 
271
do 
 
272
    rm -f $d/alldeps.stamp
 
273
    cp -f /dev/null $d/alldeps
 
274
done
 
275
 
 
276
(cd lib;test -f Makefile && chmod +w Makefile;sh mkMake)
 
277
 
 
278
AC_OUTPUT
 
279
chmod a+x recollinstall