xref: /openssh-portable/.github/configs (revision ffcdd3d9)
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=""
15SKIP_LTESTS=""
16SUDO=sudo	# run with sudo by default
17TEST_SSH_UNSAFE_PERMISSIONS=1
18
19CONFIGFLAGS=""
20LIBCRYPTOFLAGS=""
21
22case "$config" in
23    default|sol64)
24	;;
25    kitchensink)
26	CONFIGFLAGS="--with-kerberos5 --with-libedit --with-pam"
27	CONFIGFLAGS="${CONFIGFLAGS} --with-security-key-builtin --with-selinux"
28	CONFIGFLAGS="${CONFIGFLAGS} --with-cflags=-DSK_DEBUG"
29	;;
30    hardenedmalloc)
31	CONFIGFLAGS="--with-ldflags=-lhardened_malloc"
32	;;
33    kerberos5)
34	CONFIGFLAGS="--with-kerberos5"
35	;;
36    libedit)
37	CONFIGFLAGS="--with-libedit"
38	;;
39    *pam)
40	CONFIGFLAGS="--with-pam"
41	SSHD_CONFOPTS="UsePam yes"
42	;;
43    libressl-head)
44	LIBCRYPTOFLAGS="--with-ssl-dir=/opt/libressl/head --with-rpath=-Wl,-rpath,"
45	;;
46    openssl-head)
47	LIBCRYPTOFLAGS="--with-ssl-dir=/opt/openssl/head --with-rpath=-Wl,-rpath,"
48	;;
49    selinux)
50	CONFIGFLAGS="--with-selinux"
51	;;
52    sk)
53	CONFIGFLAGS="--with-security-key-builtin"
54        ;;
55    without-openssl)
56	LIBCRYPTOFLAGS="--without-openssl"
57	TEST_TARGET=t-exec
58	;;
59    valgrind-1)
60	# rlimit sandbox and FORTIFY_SOURCE confuse Valgrind.
61	CONFIGFLAGS="--without-sandbox --without-hardening"
62	CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0"
63	# Valgrind slows things down enough that the agent timeout test
64	# won't reliably pass, and the unit tests run longer than allowed
65	# by github.
66	TEST_TARGET="t-exec USE_VALGRIND=1"
67	SKIP_LTESTS="agent-timeout rekey try-ciphers cert-userkey integrity"
68	;;
69    valgrind-2)
70	CONFIGFLAGS="--without-sandbox --without-hardening"
71	CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0"
72	# The rekey test takes >30 min so run separately.
73	TEST_TARGET="t-exec USE_VALGRIND=1"
74	LTESTS="rekey try-ciphers cert-userkey integrity"
75	;;
76    *)
77	echo "Unknown configuration $config"
78	exit 1
79	;;
80esac
81
82# The Solaris 64bit targets are special since they need a non-flag arg.
83case "$config" in
84    sol64*)
85	CONFIGFLAGS="x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}"
86	LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64"
87	;;
88esac
89
90case "${TARGET_HOST}" in
91    sol10|sol11)
92	# sol10 VM is 32bit and the unit tests are slow.
93	# sol11 has 4 test configs so skip unit tests to speed up.
94	TEST_TARGET="tests SKIP_UNIT=1"
95	;;
96esac
97
98# If we have a local openssl/libressl, use that.
99if [ -z "${LIBCRYPTOFLAGS}" ]; then
100	# last-match
101	for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do
102		if [ -x ${i}/bin/openssl ]; then
103			LIBCRYPTOFLAGS="--with-ssl-dir=${i}"
104		fi
105	done
106fi
107
108CONFIGFLAGS="${CONFIGFLAGS} ${LIBCRYPTOFLAGS}"
109
110export LTESTS SUDO TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS
111