diff --git a/src/Makefile.am b/src/Makefile.am index bf15623c..5b5f7aef 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -247,6 +247,23 @@ librecoll_la_LDFLAGS = -release $(VERSION) \ librecoll_la_LIBADD = $(LIBXAPIAN) $(LIBICONV) $(X_LIBX11) $(LIBTHREADS) +# There is probably a better way to do this. The KIO needs to be linked +# with librecoll, but librecoll is installed into a non-standard place +# (/usr/lib/recoll). Debian packaging has something against setting an +# rpath on the kio (cause it's not the same package as the lib), so I don't +# know how to link it dynamically. The other thing I don't know is how to +# force automake to build a static lib with the PIC objects. So the +# following target, which is only used from the KIO build, deletes any .a +# and .so and rebuilds the .a with the pic objs (the kio build calls +# configured --disable-static). +# Of course this is very uncomfortably close to automake/libtool internals +# and may not work on all systems. +PicStatic: $(librecoll_la_OBJECTS) + rm -f .libs/librecoll.a + rm -f .libs/librecoll.so + libtool --mode=link gcc -g -O -o librecoll.la \ + $(librecoll_la_OBJECTS) + bin_PROGRAMS = recollindex if MAKECMDLINE bin_PROGRAMS += recollq @@ -477,7 +494,8 @@ if MAKEQT all-local: recollqt recollqt: librecoll.la (cd $(QTGUI); ${QMAKE} PREFIX=${prefix} recoll.pro) - $(MAKE) -C $(QTGUI) LFLAGS="$(LDFLAGS)" + $(MAKE) -C $(QTGUI) LFLAGS="$(LDFLAGS)" prefix=$(prefix) \ + exec_prefix=$(exec_prefix) libdir=$(libdir) clean-local: recollqt-clean recollqt-clean: -$(MAKE) -C $(QTGUI) clean diff --git a/src/configure.ac b/src/configure.ac index 8c855854..28defa84 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -211,14 +211,7 @@ if test X$camelcaseEnabled = Xyes ; then AC_DEFINE(RCL_SPLIT_CAMELCASE, 1, [Split camelCase words]) fi -# Disable building the python module. This is built by default, because -# it's really the easiest way to interface and extend recoll. It forces PIC -# objects for everything (indexing performance impact: 1%), because it's -# just not worth building the lib twice -# You can still have a non-pic recoll with: -# configure --disable-python-module; make; make install;make clean -# configure; make; cd python/recoll; make install -# +# Disable building the python module. if test X$sys != XDarwin ; then AC_ARG_ENABLE(python-module, AC_HELP_STRING([--disable-python-module], @@ -516,19 +509,21 @@ fi #echo X_CFLAGS "'$X_CFLAGS'" X_PRE_LIBS "'$X_PRE_LIBS'" X_LIBS \ # "'$X_LIBS'" X_LIBX11 "'$X_LIBX11'" 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 +# For communicating the value of RECOLL_DATADIR to non-make-based +# subpackages like python-recoll, we have to expand prefix in here, because +# things like "datadir = ${prefix}/share" (which is what we'd get by +# expanding @datadir@) don't mean a thing in Python... I guess we could +# have a piece of shell-script text to be substituted into and executed by +# setup.py for getting the value of pkgdatadir, but really... m_prefix=$prefix test "X$m_prefix" = "XNONE" && m_prefix=/usr/local m_datadir=${m_prefix}/share -QTRECOLL_DATADIR=${m_datadir}/recoll +RECOLL_DATADIR=${m_datadir}/recoll RCLVERSION=`cat VERSION` RCLLIBVERSION=$RCLVERSION +AC_SUBST(RECOLL_DATADIR) AC_SUBST(X_CFLAGS) AC_SUBST(X_PRE_LIBS) AC_SUBST(X_LIBS) @@ -542,19 +537,12 @@ AC_SUBST(LIBXAPIANSTATICEXTRA) AC_SUBST(LIBFAM) AC_SUBST(QMAKE) AC_SUBST(QTGUI) -AC_SUBST(QTRECOLL_DATADIR) AC_SUBST(XAPIANCXXFLAGS) -AC_SUBST(HAVE_MKDTEMP) -AC_SUBST(NOQTMAKE) -AC_SUBST(NOCMDLINE) AC_SUBST(QMAKE_ENABLE_WEBKIT) AC_SUBST(QMAKE_DISABLE_WEBKIT) AC_SUBST(QMAKE_ENABLE_ZEITGEIST) AC_SUBST(QMAKE_DISABLE_ZEITGEIST) AC_SUBST(LIBQZEITGEIST) -AC_SUBST(NOPIC) -AC_SUBST(NOTHREADS) -AC_SUBST(NODYNLIB) AC_SUBST(RCLVERSION) AC_SUBST(RCLLIBVERSION) @@ -563,7 +551,6 @@ AC_SUBST(RCLLIBVERSION) AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(common/rclversion.h) AC_CONFIG_FILES(python/recoll/setup.py) -AC_CONFIG_FILES(recollinstall) AC_CONFIG_FILES(sampleconf/recoll.conf) AC_OUTPUT diff --git a/src/kde/kioslave/kio_recoll/CMakeLists.txt b/src/kde/kioslave/kio_recoll/CMakeLists.txt index 2a2700bc..c8dbd240 100644 --- a/src/kde/kioslave/kio_recoll/CMakeLists.txt +++ b/src/kde/kioslave/kio_recoll/CMakeLists.txt @@ -16,14 +16,11 @@ set(rcltop ${CMAKE_CURRENT_SOURCE_DIR}/../../../) # Execute recoll configuration to create autoconfig.h and version.h and # generate a PIC lib -execute_process(COMMAND ${rcltop}/configure --disable-qtgui --disable-x11mon --enable-pic --prefix=${CMAKE_INSTALL_PREFIX} --mandir=${CMAKE_INSTALL_PREFIX}/share/man +execute_process(COMMAND ${rcltop}/configure --disable-static --disable-qtgui --disable-x11mon --prefix=${CMAKE_INSTALL_PREFIX} --mandir=${CMAKE_INSTALL_PREFIX}/share/man WORKING_DIRECTORY ${rcltop} ) -execute_process(COMMAND /bin/sh mkMake - WORKING_DIRECTORY ${rcltop}/lib -) -link_directories(${rcltop}/lib ${CMAKE_INSTALL_PREFIX}/lib) +link_directories(${rcltop}/.libs ${CMAKE_INSTALL_PREFIX}/lib) include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES} ${rcltop}/aspell @@ -52,21 +49,16 @@ ENDIF(PTHREAD_IN_LIBPTHREAD) # Had the idea to add e.g. /usr/lib/recoll to the rpath so that the dyn lib # will be found at run time. But this does not seem to work with debian # which strips RPATH by default (I think there is a way for libs in app-specific -# paths but I did not find it. Link with the .a instead. +# paths but I did not find it). Link with the .a instead. #SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib/recoll") kde4_add_plugin(kio_recoll ${kio_recoll_SRCS}) -add_custom_target(parser - COMMAND make wasaparse.tab.cpp - WORKING_DIRECTORY ${rcltop}/query -) add_custom_target(rcllib - COMMAND make librecoll.a - WORKING_DIRECTORY ${rcltop}/lib + COMMAND make PicStatic + WORKING_DIRECTORY ${rcltop} ) -add_dependencies(rcllib parser) -add_dependencies(kio_recoll parser rcllib) +add_dependencies(kio_recoll rcllib) target_link_libraries(kio_recoll recoll xapian z ${EXTRA_LIBS} ${KDE4_KIO_LIBS}) diff --git a/src/python/recoll/setup.py.in b/src/python/recoll/setup.py.in index 23edb280..5a4b91c2 100644 --- a/src/python/recoll/setup.py.in +++ b/src/python/recoll/setup.py.in @@ -22,7 +22,7 @@ module1 = Extension('recoll', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '0'), ('UNAC_VERSION', '"1.0.7"'), - ('RECOLL_DATADIR', '"@QTRECOLL_DATADIR@"') + ('RECOLL_DATADIR', '"@RECOLL_DATADIR@"') ], include_dirs = ['/usr/local/include', os.path.join(top, 'utils'), @@ -40,7 +40,7 @@ module2 = Extension('rclextract', define_macros = [('MAJOR_VERSION', '1'), ('MINOR_VERSION', '0'), ('UNAC_VERSION', '"1.0.7"'), - ('RECOLL_DATADIR', '"@QTRECOLL_DATADIR@"') + ('RECOLL_DATADIR', '"@RECOLL_DATADIR@"') ], include_dirs = ['/usr/local/include', os.path.join(top, 'utils'),