php4 port - undefined ref to getopt_long

Alexander Zhuravlev zaa at zaa.pp.ru
Fri Mar 16 03:20:27 UTC 2007


> 3) today i stopped being able to build php4 -- i get the following
> error
> that stops the upgrade:

> ext/standard/basic_functions.lo(.text+0x1507): undefined reference to
> `getopt_long'

If you still would like to build PHP on FreeBSD 4.11 you need to open
/usr/ports/Mk/bsd.port.mk and return the following code:

.if defined(USE_GETOPT_LONG)
.if ${OSVERSION} < 500041
LIB_DEPENDS+=   gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
CPPFLAGS+=              -I${LOCALBASE}/include
LDFLAGS+=               -L${LOCALBASE}/lib -lgnugetopt
CONFIGURE_ENV+= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}"
.endif
.endif

It can be added below this line:

.endif # USE_FAM

At least this resolved the issue for me.

PS. As an alternative you may move to pkgsrc (http://pkgsrc.org).
According to pkgsrc.org it supports FreeBSD and there is bootstrap code for
FreeBSD 4.7:
ftp://ftp.netbsd.org/pub/pkgsrc/packages/bootstrap-pkgsrc/bootstrap-pkgsrc-FreeBSD-4.7-RELEASE-i386-20021211.tar.gz



More information about the freebsd-ports mailing list