xref: /openssh-portable/.github/configs (revision 5fcb0514)
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    valgrind)
59	# rlimit sandbox and FORTIFY_SOURCE confuse Valgrind.
60	CONFIGFLAGS="--without-sandbox --without-hardening"
61	CONFIGFLAGS="$CONFIGFLAGS --with-cppflags=-D_FORTIFY_SOURCE=0"
62	# Valgrind slows things down enough that the agent timeout test
63	# won't reliably pass, and the unit tests run longer than allowed
64	# by github.
65	TEST_TARGET="t-exec USE_VALGRIND=1 SKIP_LTESTS=agent-timeout"
66	;;
67    *)
68	echo "Unknown configuration $config"
69	exit 1
70	;;
71esac
72
73# The Solaris 64bit targets are special since they need a non-flag arg.
74case "$config" in
75    sol64*)
76	CONFIGFLAGS="x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}"
77	LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64"
78	;;
79esac
80
81case "${TARGET_HOST}" in
82    sol10|sol11)
83	# sol10 VM is 32bit and the unit tests are slow.
84	# sol11 has 4 test configs so skip unit tests to speed up.
85	TEST_TARGET="tests SKIP_UNIT=1"
86	;;
87esac
88
89# If we have a local openssl/libressl, use that.
90if [ -z "${LIBCRYPTOFLAGS}" ]; then
91	# last-match
92	for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do
93		if [ -x ${i}/bin/openssl ]; then
94			LIBCRYPTOFLAGS="--with-ssl-dir=${i}"
95		fi
96	done
97fi
98
99CONFIGFLAGS="${CONFIGFLAGS} ${LIBCRYPTOFLAGS}"
100
101export LTESTS SUDO TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS
102