Re: New port with USES=gmake will not stage

Euan Thoms euan at
Fri Jun 12 05:12:11 UTC 2015

On Friday, June 12, 2015 11:24 SGT, Shane Ambler <FreeBSD at ShaneWare.Biz> wrote: 
> On 11/06/2015 15:03, Euan Thoms wrote:
> >
> > On Thursday, June 11, 2015 13:18 SGT, "Chris H" <bsd-lists at> wrote:
> >
> >> On Thu, 11 Jun 2015 11:33:03 +0800 "Euan Thoms" <euan at> wrote
> >>
> >>> I'm making a port for OpenSIPS. It builds successfully, but the even with
> >>> just "make" it installs files to the system instead of to stage (i.e. to
> >>> /usr/local/... instead of /usr/ports/net/opensips/work/stage/usr/local/...).
> >>>
> >>> I am using gmake and gcc since that's what's required for OpenSIPS.
> >>>
> >>> I've done a similar port before and the FreeBSD ports macros do the staging
> >>> for me. However, even when I tell gmake the DESTDIR=${STAGEDIR} in do-build
> >>> and do-install, a "make" just installs the files to /usr/local/... .
> > MAKE_ARGS+=             PREFIX=${LOCALBASE}
> > MAKE_ARGS+=             exclude_modules="${EXCLUDE_MODULES}" include_modules="${INCLUDE_MODULES}"
> While MAKE_ARGS should send options to gmake, what about backing up a
> step to configure?
> Try setting PREFIX in CONFIGURE_ENV or maybe MAKE_ENV to specify
> environment variables instead of arguments.
> Do you need USE_AUTOTOOLS=autoconf or to add a custom do-configure: ?

Well that's the thing, it doesn't seem to use autotools or any kind of ./configure script. It seems to use it's own ncurses style menuconfig to generate a Makefile.conf. Unlike it's fork sister Kamailio, it doesn't use a "make $ARGS cfg" either.

So, you're right, it's about the Makefile preparation, only it has to be done more manually.

I'm going through the Makefile and Makefile.def just now. I've already found a few things that need FreeBSDisms added. For example; SMP detection has a ifeq($(OS),solaris) statement, but I need to add one for freebsd. Currently I'm going with the following, unless anyone can suggest a better way:

else ifeq ($(OS),freebsd)
        SMP_STR = $(shell sysctl | grep 1)
        ifeq (,$(SMP_STR))
                ISSMP ?= no
                ISSMP ?= yes

Also, I added a rule for FreeBSD to set LIBDIR to "lib" regardless of architecture. It was being set to "lib64" which is normal for Linux I guess.

I notice there are several paths mentioned in the OpenSIPS Makefile.defs that may effect the staging process. This is taken from the file:

 # install location
prefix = $(PREFIX)
# install path is $(basedir) $(prefix)
# example:
#  creating a bin. archive in /tmp, which unpacks in /usr/local
#  basedir=/tmp
#  prefix=/usr/local

I noticed there is support for FreeBSD added to the Makefile and Makfile.defs, but it was probably added a while back. It's clearly not compatible with the Ports staging requirements. I'll keep going, should have something to report back soon. 
Regards, Euan Thoms 

More information about the freebsd-ports mailing list