grosjo / fts-xapian

Dovecot FTS plugin based on Xapian
GNU Lesser General Public License v2.1
93 stars 20 forks source link

syntax error near unexpected token `PKG_CHECK_MODULES' #131

Closed LukaszSellmann closed 3 months ago

LukaszSellmann commented 1 year ago

Hi

I've got a syntax error while ./configure --with-dovecot=/usr/lib/dovecot it ends with this:

Screenshot 2022-10-12 at 12 13 44

My system is Ubuntu 16.04.7 LTS Dependiencies described in README.txt are installed.

What i did wrong ? :)

Regards

basil-conto commented 1 year ago

My guess is your /usr/share/aclocal/pkg.m4 either doesn't exist, is too old, or its containing directory isn't searched during autoreconf.

Do you have pkg-config installed? What do you get for pkg-config --version?

LukaszSellmann commented 1 year ago

File /usr/share/aclocal/pkg.m4 exists , creation date is year 2016 I have pkg-config --version 0.29.1

basil-conto commented 1 year ago

So if pkg.m4 exists and defines the macro PKG_CHECK_MODULES, but you get a syntax error during autoreconf, then that probably means pkg.m4 isn't found during autoreconf despite being in a standard system directory.

Does it work if you explicitly include the directory? E.g. autoreconf -vi -I /usr/share/aclocal. See also https://gnu.org/s/automake/manual/html_node/Macro-Search-Path.html

LukaszSellmann commented 1 year ago

ok after installing pkgconf (pkg-config has been installed already) i did autoreconf as You mentioned autoreconf -vi -I /usr/share/aclocal , configure passed successfully , program compiled also with no errors. But make install has put compiled modules to /usr/local/lib/dovecot/ instead of /usr/lib/dovecot/modules - which is path for dovecot modules i have in /usr/lib/dovecot/dovecot-config. Is it enough to mv that files from /usr/local/lib/dovecot/ to /usr/lib/dovecot/modules ?

basil-conto commented 1 year ago

ok after installing pkgconf (pkg-config has been installed already)

FWIW, pkgconf is a different project and is not needed to build fts-xapian; pkg-config is sufficient.

i did autoreconf as You mentioned autoreconf -vi -I /usr/share/aclocal, configure passed successfully

Did you manage to figure out why /usr/share/aclocal wasn't being picked up by default as it should, based on the documentation I linked?

But make install has put compiled modules to /usr/local/lib/dovecot/ instead of /usr/lib/dovecot/modules

Did you specify the right --with-dovecot=DIR to configure? What are the values of the variables moduledir, dovecot_moduledir, and dovecot_installed_moduledir in your config.log file?

Is it enough to mv that files from /usr/local/lib/dovecot/ to /usr/lib/dovecot/modules ?

I don't know, maybe someone else does. Personally I would try making sure the build is correct rather than manually moving files to the correct locations.

LukaszSellmann commented 1 year ago

about aclocal, there is a /usr/share/aclocal which contains pkg.m4 and /usr/share/aclocal-1.15 which doesn't. aclocal --print-ac-dir shows /usr/share/aclocal aclocal-1.15 --print-ac-dir shows the same /usr/share/aclocal

as i understand search path are acdir-APIVERSION and next is acdir, i have no idea why autoreconf didn't manage that, but option -I with path did the job

yes i used ./configure --with-dovecot=/usr/lib/dovecot and this folder contains dovecot-config:

in config.log there are: moduledir='${exec_prefix}/lib/dovecot' dovecot_moduledir='/usr/lib/dovecot/modules' dovecot_installed_moduledir='/usr/lib/dovecot/modules' exec_prefix='${prefix}' 'prefix='/usr/local'

i wonder if prefix should be /usr/local

basil-conto commented 1 year ago

i wonder if prefix should be /usr/local

Maybe, but I don't know if that will have any adverse affects.

Other than suggesting to try to tracing/debugging make install, what it's doing and why, I'm afraid I probably won't be of much more help with this. FWIW, it works fine for me on Debian.