# A Plan9 APE MATRIX.
# $Id: M_plan9,v 1.24 2021/03/08 08:55:22 tlaronde Exp $
#
# Copyright 2010, 2016--2017, 2019, 2021 Thierry LARONDE <tlaronde@polynum.com>
# Public Domain. NO GUARANTEES!

# You need to switch to a restricted POSIX environment by:
# % ape/psh
#
# sed(1) uses the Plan9 regex library so has not all POSIX features
# (no range; no 'l' command to vis characters).

#----- MATRIX environment dependent

MATRIX="plan9"
MATRIX_ARCH=${MATRIX_ARCH:-$(uname -p)}
MATRIX_MACHINE=${MATRIX_MACHINE:-$(uname -m)}
MATRIX_RELEASE=${MATRIX_RELEASE:-$(uname -r)}
MATRIX_TYPE=plan9
MATRIX_NCPU=${MATRIX_NCPU:-1}
MATRIX_SUBTYPE=GENERIC

M_TOOLS_REQUIRED=

# Headers and libraries shall be the ones of the TARGET! But
# these have to be accessible on the MATRIX, perhaps in a dedicated
# place, hence the prefix for the cross-lib and cross-headers.
#
M_CROSS_PATH_PREFIX=${M_CROSS_PATH_PREFIX:-""}

# Symbolic links are not supported.
M_FSLINK="cp"

MATRIXRMDIR="rm"

#----- There shall be a compile environment
#
RK_COMPILE_ENV=${RK_COMPILE_ENV:-posix}
include C_$RK_COMPILE_ENV

	# Plan9 ar(1) doesn't take '-'.
	#
	ARFLAGS="crv"

# The names are set by the TARGET, but the search is made on the
# matrix.
#
CLIB=$(rk_which_lib_of $CLIB)
MATHLIB=$(rk_which_lib_of $MATHLIB)
YACCLIB=$(rk_which_lib_of $YACCLIB)
LEXLIB=$(rk_which_lib_of $LEXLIB)

if test "x$ICONVLIB" != x; then
	ICONVLIB=$(rk_which_lib_of $ICONVLIB)
fi
