Switch to unified view

a/src/configure.ac b/src/configure.ac
1
AC_INIT([Recoll], m4_esyscmd_s(cat VERSION))
1
AC_INIT([Recoll], m4_esyscmd_s(cat VERSION))
2
AC_CONFIG_HEADERS([common/autoconfig.h])
2
AC_CONFIG_HEADERS([common/autoconfig.h])
3
AC_PREREQ(2.53)
3
AC_PREREQ(2.53)
4
AC_CONFIG_SRCDIR(index/recollindex.cpp)
4
AC_CONFIG_SRCDIR(index/recollindex.cpp)
5
5
6
AM_INIT_AUTOMAKE([1.10 no-define subdir-objects foreign])
7
AC_DISABLE_STATIC
8
LT_INIT
9
AC_CONFIG_MACRO_DIR([m4])
10
6
AC_PROG_CXX
11
AC_PROG_CXX
7
if test C$CXX = C ; then
12
if test C$CXX = C ; then
8
   AC_MSG_ERROR([C++ compiler needed. Please install one (ie: gnu g++)])
13
   AC_MSG_ERROR([C++ compiler needed. Please install one (ie: gnu g++)])
9
fi
14
fi
10
15
16
AC_PROG_YACC
17
18
AC_PROG_LIBTOOL
11
AC_C_BIGENDIAN
19
AC_C_BIGENDIAN
12
13
sys=`uname | tr / _ | awk -F_ '{print $1}'`
14
15
if test ! -f mk/$sys ; then
16
   AC_MSG_NOTICE([
17
    No system configuration file found in mk/ for uname = '$sys'. 
18
    Trying with Default file. 
19
    If the build fails, you'll need to write a configuration file, starting 
20
    from one of the existing ones.])
21
22
    sys=Default   
23
fi
24
(cd mk; rm -f sysconf; ln -s $sys sysconf)
25
26
# There a few Recoll users on Mac OS X and a few things are just not worth
27
# supporting
28
if test X$sys = XDarwin ; then
29
   NODYNLIB=#
30
fi
31
20
32
AC_SYS_LARGEFILE
21
AC_SYS_LARGEFILE
33
22
34
# OpenBSD needs sys/param.h for mount.h to compile
23
# OpenBSD needs sys/param.h for mount.h to compile
35
AC_CHECK_HEADERS([sys/param.h, spawn.h])
24
AC_CHECK_HEADERS([sys/param.h, spawn.h])
...
...
197
# resources used).
186
# resources used).
198
AC_ARG_ENABLE(idxthreads,
187
AC_ARG_ENABLE(idxthreads,
199
    AC_HELP_STRING([--disable-idxthreads],
188
    AC_HELP_STRING([--disable-idxthreads],
200
   [Disable multithread indexing.]),
189
   [Disable multithread indexing.]),
201
        idxthreadsEnabled=$enableval, idxthreadsEnabled=yes)
190
        idxthreadsEnabled=$enableval, idxthreadsEnabled=yes)
202
191
AM_CONDITIONAL(NOTHREADS, [test X$idxthreadsEnabled = Xno])
203
if test X$idxthreadsEnabled = Xyes ; then
192
if test X$idxthreadsEnabled = Xyes ; then
204
  AC_DEFINE(IDX_THREADS, 1, [Use multiple threads for indexing])
193
  AC_DEFINE(IDX_THREADS, 1, [Use multiple threads for indexing])
205
  NOTHREADS=""
206
else
207
  NOTHREADS="#"
208
fi
194
fi
209
195
210
# Enable CamelCase word splitting. This is optional because it causes 
196
# Enable CamelCase word splitting. This is optional because it causes 
211
# problems with phrases: with camelcase enabled, "MySQL manual"
197
# problems with phrases: with camelcase enabled, "MySQL manual"
212
# will be matched by "MySQL manual" and "my sql manual" but not 
198
# will be matched by "MySQL manual" and "my sql manual" but not 
...
...
219
   case in the phrase query to get a match. Ie querying for 
205
   case in the phrase query to get a match. Ie querying for 
220
   "MySQL manual" and "my sql manual" are the same, but not the same as
206
   "MySQL manual" and "my sql manual" are the same, but not the same as
221
   "mysql manual" (in phrases only and you could raise the phrase slack to
207
   "mysql manual" (in phrases only and you could raise the phrase slack to
222
   get a match).]),
208
   get a match).]),
223
        camelcaseEnabled=$enableval, camelcaseEnabled=no)
209
        camelcaseEnabled=$enableval, camelcaseEnabled=no)
224
225
if test X$camelcaseEnabled = Xyes ; then
210
if test X$camelcaseEnabled = Xyes ; then
226
  AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words])
211
  AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words])
227
fi
212
fi
228
213
229
# Disable building the python module. This is built by default, because
214
# Disable building the python module.
230
# it's really the easiest way to interface and extend recoll. It forces PIC
231
# objects for everything (indexing performance impact: 1%), because it's
232
# just not worth building the lib twice
233
# You can still have a non-pic recoll with:
234
#   configure --disable-python-module; make; make install;make clean
235
#   configure; make; cd python/recoll; make install
236
#
237
if test X$sys != XDarwin ; then
215
if test X$sys != XDarwin ; then
238
AC_ARG_ENABLE(python-module,
216
  AC_ARG_ENABLE(python-module,
239
    AC_HELP_STRING([--disable-python-module],
217
    AC_HELP_STRING([--disable-python-module],
240
   [Do not build the Python module.]),
218
    [Do not build the Python module.]),
241
        pythonEnabled=$enableval, pythonEnabled=yes)
219
        pythonEnabled=$enableval, pythonEnabled=yes)
242
if test X$pythonEnabled = Xyes ; then
243
  NOPYTHON=""
244
else
220
else
245
  NOPYTHON="#"
221
  pythonEnabled=no
246
fi
222
fi
247
else
248
  NOPYTHON="#"
249
fi
250
223
251
# Build PIC objects for the library ?
224
AM_CONDITIONAL(MAKEPYTHON, [test X$pythonEnabled = Xyes])
252
AC_ARG_ENABLE(pic,
253
    AC_HELP_STRING([--disable-pic],
254
   [Do not compile library objects as position independant code. 
255
    This is incompatible with the php or python extensions.]),
256
        picEnabled=$enableval, picEnabled=forpython)
257
case $picEnabled in
258
forpython) picEnabled=$pythonEnabled; NOPIC=$NOPYTHON;;
259
yes) NOPIC="";;
260
*) NOPIC="#";;
261
esac
262
225
263
if test X$pythonEnabled = Xyes -a X$picEnabled != Xyes; then
264
   AC_MSG_ERROR([Python build needs PIC library])
265
fi
266
267
if test X$NOPIC != X; then
268
    NODYNLIB=#
269
fi
270
226
271
AC_CHECK_FUNCS(mkdtemp)
227
AC_CHECK_FUNCS(mkdtemp)
228
AC_CHECK_LIB([pthread], [pthread_create], [], [])
229
AC_CHECK_LIB([dl], [dlopen], [], [])
230
AC_CHECK_LIB([z], [zlibVersion], [], [])
272
231
273
##### Look for iconv. This can exist in either libc (ie: Linux, solaris) or
232
##### Look for iconv. This can exist in either libc (ie: Linux, solaris) or
274
##### libiconv. We'd need a --with-libiconv= option
233
##### libiconv. We'd need a --with-libiconv= option
275
AC_LANG(C++)
234
AC_LANG(C++)
276
LIBICONV=""
235
LIBICONV=""
...
...
371
    *stdc++*|-lm|-lgcc_s|-lc);;
330
    *stdc++*|-lm|-lgcc_s|-lc);;
372
    *) tmpxaplib="$tmpxaplib $i";;
331
    *) tmpxaplib="$tmpxaplib $i";;
373
    esac
332
    esac
374
done
333
done
375
LIBXAPIAN=$tmpxaplib
334
LIBXAPIAN=$tmpxaplib
376
# Also recent xapian libs need lz even when they think they don't...
377
LIBXAPIAN="$LIBXAPIAN -lz"
378
LIBXAPIANDIR=`$XAPIAN_CONFIG --libs | awk '{print $1}'`
335
LIBXAPIANDIR=`$XAPIAN_CONFIG --libs | awk '{print $1}'`
379
case A"$LIBXAPIANDIR" in
336
case A"$LIBXAPIANDIR" in
380
  A-L*) LIBXAPIANDIR=`echo $LIBXAPIANDIR | sed -e 's/-L//'`;;
337
  A-L*) LIBXAPIANDIR=`echo $LIBXAPIANDIR | sed -e 's/-L//'`;;
381
  *) LIBXAPIANDIR="";;
338
  *) LIBXAPIANDIR="";;
382
esac
339
esac
...
...
385
#echo XAPIAN_CONFIG: $XAPIAN_CONFIG 
342
#echo XAPIAN_CONFIG: $XAPIAN_CONFIG 
386
#echo LIBXAPIAN: $LIBXAPIAN
343
#echo LIBXAPIAN: $LIBXAPIAN
387
#echo LIBXAPIANDIR: $LIBXAPIANDIR
344
#echo LIBXAPIANDIR: $LIBXAPIANDIR
388
#echo LIBXAPIANSTATICEXTRA: $LIBXAPIANSTATICEXTRA
345
#echo LIBXAPIANSTATICEXTRA: $LIBXAPIANSTATICEXTRA
389
#echo XAPIANCXXFLAGS: $XAPIANCXXFLAGS
346
#echo XAPIANCXXFLAGS: $XAPIANCXXFLAGS
347
348
AC_ARG_ENABLE(xadump, 
349
    AC_HELP_STRING([--enable-xadump],
350
   [Enable building the xadump low level Xapian access program.]),
351
        enableQT=$enableval, enableXADUMP="no")
352
AM_CONDITIONAL(MAKEXADUMP, [test X$enableXADUMP = Xyes])
390
353
391
#### QT
354
#### QT
392
# The way qt and its tools (qmake especially) are installed is very
355
# The way qt and its tools (qmake especially) are installed is very
393
# different between systems (and maybe qt versions)
356
# different between systems (and maybe qt versions)
394
#
357
#
...
...
412
AC_ARG_ENABLE(qtgui, 
375
AC_ARG_ENABLE(qtgui, 
413
    AC_HELP_STRING([--disable-qtgui],
376
    AC_HELP_STRING([--disable-qtgui],
414
   [Disable the QT-based graphical user interface.]),
377
   [Disable the QT-based graphical user interface.]),
415
        enableQT=$enableval, enableQT="yes")
378
        enableQT=$enableval, enableQT="yes")
416
379
380
AM_CONDITIONAL(MAKEQT, [test X$enableQT = Xyes])
381
AM_CONDITIONAL(MAKECMDLINE, [test X$enableQT = Xno])
382
417
if test "$enableQT" != "yes" ; then
383
if test X$enableQT = Xyes ; then
418
   NOQTMAKE="#"
419
   NOCMDLINE=""
420
else
421
  NOQTMAKE=""
422
  NOCMDLINE="#"
423
384
424
  if test X$QTDIR != X ; then
385
  if test X$QTDIR != X ; then
425
     PATH=$PATH:$QTDIR/bin
386
     PATH=$PATH:$QTDIR/bin
426
     export PATH
387
     export PATH
427
  fi
388
  fi
...
...
447
  if test X$sys = XDarwin ; then
408
  if test X$sys = XDarwin ; then
448
     # The default is xcode
409
     # The default is xcode
449
     QMAKE="${QMAKE} -spec macx-g++"
410
     QMAKE="${QMAKE} -spec macx-g++"
450
  fi
411
  fi
451
  
412
  
452
  # Discriminate qt3/4. Qt3 qmake prints its version on stderr but we don't
413
  # Check Qt version
453
  # depend on this. We try to detect the qt 4 version string instead.
454
  qmakevers="`${QMAKE} --version 2>&1`"
414
  qmakevers="`${QMAKE} --version 2>&1`"
455
  #echo "qmake version: $qmakevers"
415
  #echo "qmake version: $qmakevers"
456
  v4=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*4.*'`
416
  v4=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*4.*'`
457
  v5=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*5.*'`
417
  v5=`expr "$qmakevers" : '.*Qt[ ][ ]*version[ ][ ]*5.*'`
458
  if test X$v4 = X0 -a X$v5 = X0; then 
418
  if test X$v4 = X0 -a X$v5 = X0; then 
459
     AC_MSG_ERROR([qmake seems to be using Qt version 3 which is not supported any more])
419
     AC_MSG_ERROR([qmake seems to be using Qt version 3 which is not supported any more])
460
     QTGUI=qtgui
461
  else
420
  else
462
    if test X$v4 != X0 ; then
421
    if test X$v4 != X0 ; then
463
       AC_MSG_NOTICE([using qt version 4 user interface])
422
       AC_MSG_NOTICE([using qt version 4 user interface])
464
    else
423
    else
465
       AC_MSG_NOTICE([using qt version 5 user interface])
424
       AC_MSG_NOTICE([using qt version 5 user interface])
...
...
471
  # We just want a .pro file: no problem with unsubstituted variables at 
430
  # We just want a .pro file: no problem with unsubstituted variables at 
472
  # this point.
431
  # this point.
473
  test -f recoll.pro && chmod +w recoll.pro
432
  test -f recoll.pro && chmod +w recoll.pro
474
  cp recoll.pro.in recoll.pro
433
  cp recoll.pro.in recoll.pro
475
  #echo QMAKE ${QMAKE}
434
  #echo QMAKE ${QMAKE}
476
  ${QMAKE} recoll.pro
435
  ${QMAKE} PREFIX=${prefix} recoll.pro
477
  if test $? != 0 ; then
436
  if test $? != 0 ; then
478
     AC_MSG_ERROR([Cannot use qmake to generate a Makefile. Maybe you need to
437
     AC_MSG_ERROR([Cannot use qmake to generate a Makefile. Maybe you need to
479
  check the QTDIR and QMAKESPEC environment variables?])
438
  check the QTDIR and QMAKESPEC environment variables?])
480
  fi
439
  fi
481
  # is QTDIR set and do we actually need it ?
440
  # is QTDIR set and do we actually need it ?
...
...
484
     if test "X$QTDIRNEEDED" != "X" ; then
443
     if test "X$QTDIRNEEDED" != "X" ; then
485
         AC_MSG_ERROR([You need to set the QTDIR variable to point to the QT
444
         AC_MSG_ERROR([You need to set the QTDIR variable to point to the QT
486
  installation. If there is no default mkspecs, you should also set QMAKESPEC])
445
  installation. If there is no default mkspecs, you should also set QMAKESPEC])
487
     fi
446
     fi
488
  fi
447
  fi
448
  rm -f Makefile recoll.pro
489
  cd ..
449
  cd ..
490
450
491
451
492
 ##### Using Qt webkit for reslist display? Else Qt textbrowser
452
 ##### Using Qt webkit for reslist display? Else Qt textbrowser
493
  AC_ARG_ENABLE(webkit,
453
  AC_ARG_ENABLE(webkit,
...
...
501
  else
461
  else
502
   QMAKE_ENABLE_WEBKIT="#"
462
   QMAKE_ENABLE_WEBKIT="#"
503
   QMAKE_DISABLE_WEBKIT=""
463
   QMAKE_DISABLE_WEBKIT=""
504
  fi
464
  fi
505
465
506
507
508
 ##### Using QZeitGeist lib ? Default no for now
466
 ##### Using QZeitGeist lib ? Default no for now
509
  AC_ARG_WITH(qzeitgeist,
467
  AC_ARG_WITH(qzeitgeist,
510
    AC_HELP_STRING([--with-qzeitgeist],
468
    AC_HELP_STRING([--with-qzeitgeist],
511
      [Enable the use of the qzeitgeist library to send zeitgeist events.]),
469
      [Enable the use of the qzeitgeist library to send zeitgeist events.]),
512
        withQZeitgeist=$withval, withQZeitgeist="no")
470
        withQZeitgeist=$withval, withQZeitgeist="no")
...
...
549
  X_LIBX11=""
507
  X_LIBX11=""
550
fi
508
fi
551
#echo X_CFLAGS "'$X_CFLAGS'" X_PRE_LIBS "'$X_PRE_LIBS'" X_LIBS \
509
#echo X_CFLAGS "'$X_CFLAGS'" X_PRE_LIBS "'$X_PRE_LIBS'" X_LIBS \
552
#      "'$X_LIBS'" X_LIBX11 "'$X_LIBX11'" X_EXTRA_LIBS "'$X_EXTRA_LIBS'"
510
#      "'$X_LIBS'" X_LIBX11 "'$X_LIBX11'" X_EXTRA_LIBS "'$X_EXTRA_LIBS'"
553
511
554
512
# For communicating the value of RECOLL_DATADIR to non-make-based
555
# We have to expand prefix in here, couldn't find a way to do it inside 
513
# subpackages like python-recoll, we have to expand prefix in here, because
556
# the qt gui .pro file or Makefile. This just means that you can't change
514
# things like "datadir = ${prefix}/share" (which is what we'd get by
557
# prefix at build time. It works at install time because we dont' use the
515
# expanding @datadir@) don't mean a thing in Python... I guess we could
558
# qtgui Makefile
516
# have a piece of shell-script text to be substituted into and executed by
517
# setup.py for getting the value of pkgdatadir, but really...
559
m_prefix=$prefix
518
m_prefix=$prefix
560
test "X$m_prefix" = "XNONE" && m_prefix=/usr/local
519
test "X$m_prefix" = "XNONE" && m_prefix=/usr/local
561
m_datadir=${m_prefix}/share
520
m_datadir=${m_prefix}/share
562
QTRECOLL_DATADIR=${m_datadir}/recoll
521
RECOLL_DATADIR=${m_datadir}/recoll
563
522
564
RCLVERSION=`cat VERSION`
523
RCLVERSION=$PACKAGE_VERSION
565
RCLLIBVERSION=$RCLVERSION
524
RCLLIBVERSION=$RCLVERSION
566
525
526
AC_SUBST(RECOLL_DATADIR)
567
AC_SUBST(X_CFLAGS)
527
AC_SUBST(X_CFLAGS)
568
AC_SUBST(X_PRE_LIBS)
528
AC_SUBST(X_PRE_LIBS)
569
AC_SUBST(X_LIBS)
529
AC_SUBST(X_LIBS)
570
AC_SUBST(X_LIBX11)
530
AC_SUBST(X_LIBX11)
571
AC_SUBST(X_EXTRA_LIBS)
531
AC_SUBST(X_EXTRA_LIBS)
...
...
575
AC_SUBST(LIBXAPIANDIR)
535
AC_SUBST(LIBXAPIANDIR)
576
AC_SUBST(LIBXAPIANSTATICEXTRA)
536
AC_SUBST(LIBXAPIANSTATICEXTRA)
577
AC_SUBST(LIBFAM)
537
AC_SUBST(LIBFAM)
578
AC_SUBST(QMAKE)
538
AC_SUBST(QMAKE)
579
AC_SUBST(QTGUI)
539
AC_SUBST(QTGUI)
580
AC_SUBST(QTRECOLL_DATADIR)
581
AC_SUBST(XAPIANCXXFLAGS)
540
AC_SUBST(XAPIANCXXFLAGS)
582
AC_SUBST(HAVE_MKDTEMP)
583
AC_SUBST(NOQTMAKE)
584
AC_SUBST(NOCMDLINE)
585
AC_SUBST(QMAKE_ENABLE_WEBKIT)
541
AC_SUBST(QMAKE_ENABLE_WEBKIT)
586
AC_SUBST(QMAKE_DISABLE_WEBKIT)
542
AC_SUBST(QMAKE_DISABLE_WEBKIT)
587
AC_SUBST(QMAKE_ENABLE_ZEITGEIST)
543
AC_SUBST(QMAKE_ENABLE_ZEITGEIST)
588
AC_SUBST(QMAKE_DISABLE_ZEITGEIST)
544
AC_SUBST(QMAKE_DISABLE_ZEITGEIST)
589
AC_SUBST(LIBQZEITGEIST)
545
AC_SUBST(LIBQZEITGEIST)
590
AC_SUBST(NOPIC)
591
AC_SUBST(NOTHREADS)
592
AC_SUBST(NOPYTHON)
593
AC_SUBST(NODYNLIB)
594
AC_SUBST(RCLVERSION)
546
AC_SUBST(RCLVERSION)
595
AC_SUBST(RCLLIBVERSION)
547
AC_SUBST(RCLLIBVERSION)
596
548
597
# All object files depend on localdefs which has the cc flags. Avoid
549
# All object files depend on localdefs which has the cc flags. Avoid
598
# changing it unless necessary
550
# changing it unless necessary
599
AC_CONFIG_FILES(Makefile)
551
AC_CONFIG_FILES(Makefile)
600
AC_CONFIG_FILES(common/rclversion.h)
552
AC_CONFIG_FILES(common/rclversion.h)
601
AC_CONFIG_FILES(lib/mkMake)
602
AC_CONFIG_FILES(mk/localdefs.new:mk/localdefs.in)
603
AC_CONFIG_FILES(python/recoll/setup.py)
553
AC_CONFIG_FILES(python/recoll/setup.py)
604
AC_CONFIG_FILES(recollinstall)
605
AC_CONFIG_FILES(sampleconf/recoll.conf)
554
AC_CONFIG_FILES(sampleconf/recoll.conf)
606
555
607
for d in bincimapmime index lib query
608
do 
609
    rm -f $d/alldeps.stamp
610
    cp -f /dev/null $d/alldeps
611
done
612
613
AC_OUTPUT
556
AC_OUTPUT
614
615
if cmp -s mk/localdefs mk/localdefs.new ; then
616
  rm -f mk/localdefs.new
617
else
618
  mv -f mk/localdefs.new mk/localdefs
619
fi
620