xref: /openssh-portable/.github/configs (revision 93c31a62)
1#!/bin/sh
2#
3# usage: configs vmname test_config (or '' for default)
4#
5# Sets the following variables:
6# CONFIGFLAGS           options to ./configure
7# SSHD_CONFOPTS         sshd_config options
8# TEST_TARGET           make target used when testing.  defaults to "tests".
9# LTESTS
10
11config=$1
12
13TEST_TARGET="tests"
14LTESTS=""
15SUDO=sudo	# run with sudo by default
16TEST_SSH_UNSAFE_PERMISSIONS=1
17
18CONFIGFLAGS=""
19LIBCRYPTOFLAGS=""
20
21case "$config" in
22    default|sol64)
23	;;
24    kitchensink)
25	CONFIGFLAGS="--with-kerberos5 --with-libedit --with-pam"
26	CONFIGFLAGS="${CONFIGFLAGS} --with-security-key-builtin --with-selinux"
27	CONFIGFLAGS="${CONFIGFLAGS} --with-cflags=-DSK_DEBUG"
28	;;
29    hardenedmalloc)
30	CONFIGFLAGS="--with-ldflags=-lhardened_malloc"
31	;;
32    kerberos5)
33	CONFIGFLAGS="--with-kerberos5"
34	;;
35    libedit)
36	CONFIGFLAGS="--with-libedit"
37	;;
38    *pam)
39	CONFIGFLAGS="--with-pam"
40	SSHD_CONFOPTS="UsePam yes"
41	;;
42    libressl-head)
43	LIBCRYPTOFLAGS="--with-ssl-dir=/opt/libressl/head --with-rpath=-Wl,-rpath,"
44	;;
45    openssl-head)
46	LIBCRYPTOFLAGS="--with-ssl-dir=/opt/openssl/head --with-rpath=-Wl,-rpath,"
47	;;
48    selinux)
49	CONFIGFLAGS="--with-selinux"
50	;;
51    sk)
52	CONFIGFLAGS="--with-security-key-builtin"
53        ;;
54    without-openssl)
55	LIBCRYPTOFLAGS="--without-openssl"
56	TEST_TARGET=t-exec
57	;;
58    *)
59	echo "Unknown configuration $config"
60	exit 1
61	;;
62esac
63
64# The Solaris 64bit targets are special since they need a non-flag arg.
65case "$config" in
66    sol64*)
67	CONFIGFLAGS="x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}"
68	LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64"
69	;;
70esac
71
72case "${TARGET_HOST}" in
73    sol10|sol11)
74	# sol10 VM is 32bit and the unit tests are slow.
75	# sol11 has 4 test configs so skip unit tests to speed up.
76	TEST_TARGET="tests SKIP_UNIT=1"
77	;;
78esac
79
80# If we have a local openssl/libressl, use that.
81if [ -z "${LIBCRYPTOFLAGS}" ]; then
82	# last-match
83	for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do
84		if [ -x ${i}/bin/openssl ]; then
85			LIBCRYPTOFLAGS="--with-ssl-dir=${i}"
86		fi
87	done
88fi
89
90CONFIGFLAGS="${CONFIGFLAGS} ${LIBCRYPTOFLAGS}"
91
92export LTESTS SUDO TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS
93