aboutsummaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2002-03-11 19:52:15 +0800
committerkris <kris@FreeBSD.org>2002-03-11 19:52:15 +0800
commit14a1925081160561d21882cd191c51cfad2a0a56 (patch)
tree3aa2ec72a379473596c4de81e29e4b44709ee68a /Tools
parentecfd5e72002ac7ae7c07746f181382df3a402e95 (diff)
downloadfreebsd-ports-gnome-14a1925081160561d21882cd191c51cfad2a0a56.tar.gz
freebsd-ports-gnome-14a1925081160561d21882cd191c51cfad2a0a56.tar.zst
freebsd-ports-gnome-14a1925081160561d21882cd191c51cfad2a0a56.zip
Set all of the <bsd.port.mk> control variables to be used in port/package
operations in one central place, instead of doing them piecemeal all over the place. This also includes the ability to customize settings per port branch (e.g. XFREE86_VERSION) Also, instead of hardcoding values of OSVERSION and OSREL which are going to get forgotten again, pull them out of the source tree in ${branch}/src so they track the head of the branch.
Diffstat (limited to 'Tools')
-rw-r--r--Tools/portbuild/scripts/buildenv44
1 files changed, 44 insertions, 0 deletions
diff --git a/Tools/portbuild/scripts/buildenv b/Tools/portbuild/scripts/buildenv
new file mode 100644
index 000000000000..0ac8ea603264
--- /dev/null
+++ b/Tools/portbuild/scripts/buildenv
@@ -0,0 +1,44 @@
+# Set up the build variables which are used by a given build
+#
+# Code fragment used by other scripts for commonality
+
+buildenv () {
+ branch=$1
+
+ case "x$branch" in
+ x4)
+ export XFREE86_VERSION=3
+ ;;
+ x4-exp)
+ export XFREE86_VERSION=3
+ ;;
+ x5)
+ export XFREE86_VERSION=4
+ ;;
+ *)
+ echo "buildvars: invalid branch"
+ exit 1
+ ;;
+ esac
+
+ # Have to use realpath because 'make index' doesn't deal with symlinks in PORTSDIR
+ # - kk 020311
+ export PORTSDIR=$(realpath ${pb}/${branch}/ports)
+ export SRCBASE=$(realpath ${pb}/${branch}/src)
+ export SRCPREFIX=${SRCBASE} #XXX Which one is canonical?
+
+ export OSVERSION=$(awk '/^#define __FreeBSD_version/ {print $3}' < ${SRCBASE}/sys/sys/param.h)
+ export OSREL=$(awk 'BEGIN {FS="\""}; /^REVISION/ {print $2}' < ${SRCBASE}/sys/conf/newvers.sh)
+ export BRANCH=$(awk 'BEGIN {FS="\""}; /^BRANCH/ {print $2}' < ${SRCBASE}/sys/conf/newvers.sh)
+
+ export BATCH=t
+ export HAVE_MOTIF=t
+ export PACKAGE_BUILDING=t
+ export PARALLEL_PACKAGE_BUILD=t
+ export PORTOBJFORMAT=elf
+
+ # XXX Probably old and mouldy
+ #export NO_RESTRICTED=t
+ #export FOR_CDROM=t
+ #export INDEX_NOSORT=t
+}