LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Should LOCALBASE be a pre-defined environmental variable? (https://www.linuxquestions.org/questions/%2Absd-17/should-localbase-be-a-pre-defined-environmental-variable-4175646388/)

Andy Alt 01-17-2019 07:52 AM

Should LOCALBASE be a pre-defined environmental variable?
 
I've seen `${LOCALBASE}` used in a couple BSD makefiles recently for a couple different projects. Ex:

Code:

CONFIGURE_ENV=        CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"

I'm using OpenBSD 6.4 but that variable isn't in my environment. Is it normally present and defined on BSD systems?

jggimi 01-17-2019 05:36 PM

It's a variable used by the ports(7) infrastructure. Per bsd.port.mk(5), which describes all targets and usable variables:
Code:

    LOCALBASE
            where other ports have already been installed.  Default:
            /usr/local.

The pkg_add(1) man page is also helpful:
Code:

    -L localbase
              Install a package under localbase.  By default, localbase equals
              /usr/local, and specifying it is not necessary.  However,
              packages can be created using a different localbase (see
              pkg_create(1)), and those packages can only be installed by
              using the same localbase.  See bsd.port.mk(5) for a description
              of LOCALBASE.



All times are GMT -5. The time now is 01:26 AM.