I am attempting to build devel/pkgconf from the ports collection (to replace pkg-config) on a FreeBSD 7.1-RELEASE-p6 system, but running into an error because there is no strndup function. This is what I get:
From what I've read, this function wasn't incorporated until 7.2. This is a customer's server, so upgrading is not a possibility right now.
I've tried installing the devel/libstrfunc port and linking to that in the Makefile of pkgconf and was unsuccessful, but I was very likely doing it wrong.
Does anyone have any suggestions on how I might fix this? Or am I out of luck until I can upgrade the system to 7.2 or newer?
Thanks in advance for your time.
Code:
dependency.c: In function 'pkg_dependency_add':
dependency.c:45: warning: implicit declaration of function 'strndup'
dependency.c:45: warning: incompatible implicit declaration of built-in function 'strndup'
cc -O2 -fno-strict-aliasing -pipe -DLIBDIR=\"/usr/local/lib\" -DINCLUDEDIR=\"/usr/local/include\" -DPKG_DEFAULT_PATH=\"/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig\" -DSYSTEM_INCLUDEDIR=\"/usr/include\" -DSYSTEM_LIBDIR=\"/usr/lib\" -Wall -Wextra -Wformat=2 -std=gnu99 -D_FORTIFY_SOURCE=2 -c queue.c -o queue.o
cc -o pkgconf main.o cache.o pkg.o bsdstubs.o getopt_long.o fragment.o argvsplit.o fileio.o tuple.o dependency.o queue.o
dependency.o(.text+0x1a2): In function `pkg_dependency_parse_str':
: undefined reference to `strndup'
dependency.o(.text+0x39b): In function `pkg_dependency_parse_str':
: undefined reference to `strndup'
dependency.o(.text+0x4ab): In function `pkg_dependency_parse_str':
: undefined reference to `strndup'
*** Error code 1
Stop in /usr/ports/devel/pkgconf/work/pkgconf-0.9.2.
*** Error code 1
Stop in /usr/ports/devel/pkgconf.
From what I've read, this function wasn't incorporated until 7.2. This is a customer's server, so upgrading is not a possibility right now.
I've tried installing the devel/libstrfunc port and linking to that in the Makefile of pkgconf and was unsuccessful, but I was very likely doing it wrong.
Does anyone have any suggestions on how I might fix this? Or am I out of luck until I can upgrade the system to 7.2 or newer?
Thanks in advance for your time.