Closed slavkoja closed 3 years ago
I'd need to see more information to reproduce this. Please upload your config.log and the build output. On my Mac, the exact setup you describe above (no legacy geoip, but libmaxminddb installed) works fine:
Neils-iMac:weakforced ncook$ ldd wforce/wforce | egrep "geoip|maxm"
/usr/local/opt/libmaxminddb/lib/libmaxminddb.0.dylib (compatibility version 1.0.0, current version 1.7.0)
There is essentially no link between the geoip source files and libraries and the maxmind source files and libraries, so there is no reason why one would affect the other. The legacy geoip source files are compiled if HAVE_GEOIP is defined, and the library is linked if configure finds a the legacy geoip library. Similarly the maxmind source files are compiled if HAVE_MMDB is defined, and the libmaxminddb library is linked if configure finds it.
To be sure, do you want log when it is build without legacy GeoIP installed?
To be sure, do you want log when it is build without legacy GeoIP installed?
yes
Finally i decided to attach both, as name suggests one is with and one without legacy GeoIP library installed. build_with_legacy.txt build_without_legacy.txt
Ok, so I see no issues with the "without legacy build":
/bin/bash ../libtool --tag=CXX --mode=link g++ -g -O2 -ffile-prefix-map=/build/weakforced-2.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -Wl,-z,relro -Wl,-z,now -o wforce wforce.o wforce-lua.o wforce-web.o wforce-sibling.o twmap.o twmap-wrapper.o blackwhitelist.o replication.o replication_sdb.o replication_bl.o replication_wl.o wforce-replication.o wforce-prometheus.o replication.pb.o -lreadline -lluajit-5.1 -L/build/weakforced-2.4.1/ext/yahttp/yahttp -lyahttp /build/weakforced-2.4.1/ext/ext/libext.la /build/weakforced-2.4.1/common/libweakforce.la -lsodium -lmaxminddb -lgetdns -lprotobuf -lsystemd -L/build/weakforced-2.4.1/ext/json11 -ljson11 -lboost_date_time -lboost_regex -lhiredis -lcurl -lcrypto -lyaml-cpp -L/usr/lib -lprometheus-cpp-core
libtool: link: g++ -g -O2 -ffile-prefix-map=/build/weakforced-2.4.1=. -fstack-protector-strong -Wformat -Werror=format-security -pthread -Wl,-z -Wl,relro -Wl,-z -Wl,now -o wforce wforce.o wforce-lua.o wforce-web.o wforce-sibling.o twmap.o twmap-wrapper.o blackwhitelist.o replication.o replication_sdb.o replication_bl.o replication_wl.o wforce-replication.o wforce-prometheus.o replication.pb.o -lreadline -lluajit-5.1 -L/build/weakforced-2.4.1/ext/yahttp/yahttp /build/weakforced-2.4.1/ext/yahttp/yahttp/.libs/libyahttp.a /build/weakforced-2.4.1/ext/ext/.libs/libext.a /build/weakforced-2.4.1/common/.libs/libweakforce.a -L/build/weakforced-2.4.1/ext/json11 -lboost_filesystem -lboost_system -lsodium -lmaxminddb -lgetdns -lprotobuf -lsystemd /build/weakforced-2.4.1/ext/json11/.libs/libjson11.a -lboost_date_time -lboost_regex -lhiredis -lcurl -lcrypto -lyaml-cpp -L/usr/lib -lprometheus-cpp-core -pthread
You can see that the link line is including -lmaxminddb
So I can't see any issues per-se. Just to check - HAVE_MMDB is defined to 1 in config.h?
So I can't see any issues per-se
Other than it doesn't work? ;-)
Just to check - HAVE_MMDB is defined to 1 in config.h?
There is not config.h
file inside sources, thus i guess that it is autogenerated by configure step. I have no access to files generated during build, as they are deleted after build (pbuilder), thus i cannot check it. But if it is missing, then i guess that here is some problem with its generation.
BTW, i am not alone with this problem, i found exactly the same problem mentioned in dovecot's ML sometime in 2019 (sorry, no link), from where i got workaround to install legacy GeoIP to get GeoIP2 to work...
Ok, I found the issue. I will PR this tomorrow.
Nice, i will test it then and report result back.
OK, i tested patch from PR, seems to build OK now
Describe the bug Have GeoIP2 libraries installed is not enough to build-in its support and the legacy GeoIP library is required.
To Reproduce I use configure from debian package, where i setup:
Which results in configure called with:
With installed only libmaxminddb library, the confgure script outputs:
Final binary is not linked against libmaxminddb:
Of course, GeoIP2 fails even to initialize DB.
With installed both, libgeoip and libmaxminddb, the configure script outputs:
Final binary shows:
And GeoIP2 initialize and lookup works:
Expected behavior
I would expect to be able to build GeoIP2 support without needing legacy libraries.
OS (please complete the following information):