-
Notifications
You must be signed in to change notification settings - Fork 147
Description
Greetings,
we are seeing build failures on FreeBSD if and only if pkg-config is available while cmake is being run. Our bug report is at https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=245514
I couldn't find terribly much in the history of https://github.com/librsync/librsync/commits/master/cmake/FindPOPT.cmake but at any rate, the -L/usr/local/lib argument does not show up in the linker command line if pkg-config is found. This is our pkg-config output, which looks sane to me:
$ pkg-config --cflags popt
-I/usr/local/include
$ pkg-config --libs popt
-L/usr/local/lib -lpopt
If pkg-config is found, then configure prints --- POPT_LIBRARIES = popt and the workaround is forcing down LDFLAGS=-L/usr/local/lib from our build rig, if pkg-config is NOT found, then FindPOPT will guess the library path directly as --- POPT_LIBRARIES = /usr/local/lib/libpopt.so.
[69/69] : && /usr/local/libexec/ccache/cc -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -std=c99 -pedantic -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong CMakeFiles/rdiff.dir/src/rdiff.c.o CMakeFiles/rdiff.dir/src/isprefix.c.o -o rdiff -Wl,-rpath,/usr/ports.svn/net/librsync/work/.build: librsync.so.2.3.0 -lpopt && :
FAILED: rdiff
: && /usr/local/libexec/ccache/cc -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -Wall -std=c99 -pedantic -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fstack-protector-strong CMakeFiles/rdiff.dir/src/rdiff.c.o CMakeFiles/rdiff.dir/src/isprefix.c.o -o rdiff -Wl,-rpath,/usr/ports.svn/net/librsync/work/.build: librsync.so.2.3.0 -lpopt && :
ld: error: unable to find library -lpopt
cc: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.