varnishcache-friends / libvmod-geoip2

Varnish VMOD to query MaxMind GeoIP2 DB files
BSD 2-Clause "Simplified" License
39 stars 17 forks source link

Cant compile libvmod-geoip2 with latest Varnish5 #23

Closed vladbondarenko closed 6 years ago

vladbondarenko commented 6 years ago

Hello,

I exported varnish5 src dir like export PKG_CONFIG_PATH=/home/ec2-user/varnish5 (varnishapi.pc inside that dir)

then i run ./autogen.sh [root@ip-172-31-34-46 libvmod-geoip2]# ./autogen.sh autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal -I /usr/share/aclocal --force -I m4 -I ${VARNISH_DATAROOT}/aclocal autoreconf: configure.ac: tracing autoreconf: running: libtoolize --copy --force libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR,build-aux'. libtoolize: copying file build-aux/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR,m4'. libtoolize: copying file m4/libtool.m4' libtoolize: copying filem4/ltoptions.m4' libtoolize: copying file m4/ltsugar.m4' libtoolize: copying filem4/ltversion.m4' libtoolize: copying file m4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --include=/usr/share/aclocal --force autoreconf: running: /usr/bin/autoheader --include=/usr/share/aclocal --force autoreconf: running: automake --add-missing --copy --force-missing autoreconf: Leaving directory.'

and then [root@ip-172-31-34-46 libvmod-geoip2]# ./configure configure: error: varnish.m4 is required.

Where i need to put varnish.m4 to compile geoip2?

Thanks.

vladbondarenko commented 6 years ago

Found how to fix varnish.m4. But geoip2 compilation failed:

In file included from vmod_geoip2.c:35:0: /usr/include/varnish/vrt.h:35:4: error: #error "vrt.h included after cache.h - they are inclusive"

error "vrt.h included after cache.h - they are inclusive"

^~~~~

/usr/include/varnish/vrt.h:39:4: error: #error "vrt.h included multiple times"

error "vrt.h included multiple times"

^~~~~

In file included from vmod_geoip2.c:35:0: /usr/include/varnish/vrt.h:123:8: error: redefinition of 'struct strands' struct strands { ^~~ In file included from /usr/include/varnish/cache/cache.h:45:0, from vmod_geoip2.c:33: /usr/include/varnish/vrt.h:123:8: note: originally defined here struct strands { ^~~ In file included from vmod_geoip2.c:35:0: /usr/include/varnish/vrt.h:150:34: error: conflicting types for 'VCL_STRANDS' typedef const struct strands VCL_STRANDS; ^~~ In file included from /usr/include/varnish/cache/cache.h:45:0, from vmod_geoip2.c:33: /usr/include/varnish/vrt.h:150:34: note: previous declaration of 'VCL_STRANDS' was here typedef const struct strands VCL_STRANDS; ^~~ In file included from vmod_geoip2.c:35:0: /usr/include/varnish/vrt.h:156:8: error: redefinition of 'struct vrt_type' struct vrt_type { ^~~~ In file included from /usr/include/varnish/cache/cache.h:45:0, from vmod_geoip2.c:33: /usr/include/varnish/vrt.h:156:8: note: originally defined here struct vrt_type { ^~~~ In file included from vmod_geoip2.c:35:0: /usr/include/varnish/vrt.h:170:8: error: redefinition of 'struct vrt_ctx' struct vrt_ctx { ^~~ In file included from /usr/include/varnish/cache/cache.h:45:0, from vmod_geoip2.c:33: /usr/include/varnish/vrt.h:170:8: note: originally defined here

fgsch commented 6 years ago

Which branch are you using?

fgsch commented 6 years ago

And what is the latest varnish5 you are referring to?

vladbondarenko commented 6 years ago

Both master branches of geoip2 and varnish.

fgsch commented 6 years ago

You need the devel branch for Varnish master (it's in the README).

vladbondarenko commented 6 years ago

Thanks a lot. Closing this.