Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2001 12:13:34 -0600
From:      Glenn Johnson <gjohnson@nola.srrc.usda.gov>
To:        ports@freebsd.org
Subject:   How to use SCRIPTS_ENV
Message-ID:  <20010111121334.A30947@node7.cluster.srrc.usda.gov>

next in thread | raw e-mail | index | archive | help
I need to have a script executed based on a conditional value in
the port Makefile.  I need to pass the values $WRKSRC and $PREFIX
to this script.  Looking in ports/Mk/bsd.port.mk I found the
SCRIPTS_ENV variable which seems like it should do the job.  From
ports/Mk/bsd.port.mk:

# SCRIPTS_ENV   - Additional environment vars passed to scripts in
#                 ${SCRIPTDIR} executed by bsd.port.mk (default: see below).

The default is:

SCRIPTS_ENV+=   PORTOBJFORMAT=${PORTOBJFORMAT}

So I set SCRIPTS_ENV in my Makefile as:

SCRIPTS_ENV+=	"WRKSRC=${WRKSRC} PREFIX=${PREFIX}"

I wrote a test script and put it in the scripts subdirectory.  The
contents of the script are:

#!/bin/sh

echo WRKSRC = $WRKSRC
echo PORTOBJFORMAT = $PORTOBJFORMAT
echo PREFIX = $PREFIX

The result of the script upon executing 'make' from the port directory
is:

WRKSRC =
PORTOBJFORMAT = elf
PREFIX =

So PORTOBJFORMAT is picked up but the other variables are not.  I
even tried a dummy variable that I set in the Makefile but nothing
is exported to the script.

If I change the name of my script to 'configure', then all of the
variables are exported to the script, without having to use SCRIPTS_ENV
in the Makefile of course.  So it seems that SCRIPTS_ENV is either
broken or I am doing something wrong.

Can anyone point me in the right direction?

Thanks in advance.

-- 
Glenn Johnson
USDA, ARS, SRRC			 Phone: (504) 286-4252
New Orleans, LA 70124		e-mail: gjohnson@nola.srrc.usda.gov


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010111121334.A30947>