xref: /openssh-portable/.github/configs (revision 41d232e2)
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	TEST_TARGET=USE_VALGRIND=1
60	;;
61    *)
62	echo "Unknown configuration $config"
63	exit 1
64	;;
65esac
66
67# The Solaris 64bit targets are special since they need a non-flag arg.
68case "$config" in
69    sol64*)
70	CONFIGFLAGS="x86_64 --with-cflags=-m64 --with-ldflags=-m64 ${CONFIGFLAGS}"
71	LIBCRYPTOFLAGS="--with-ssl-dir=/usr/local/ssl64"
72	;;
73esac
74
75case "${TARGET_HOST}" in
76    sol10|sol11)
77	# sol10 VM is 32bit and the unit tests are slow.
78	# sol11 has 4 test configs so skip unit tests to speed up.
79	TEST_TARGET="tests SKIP_UNIT=1"
80	;;
81esac
82
83# If we have a local openssl/libressl, use that.
84if [ -z "${LIBCRYPTOFLAGS}" ]; then
85	# last-match
86	for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do
87		if [ -x ${i}/bin/openssl ]; then
88			LIBCRYPTOFLAGS="--with-ssl-dir=${i}"
89		fi
90	done
91fi
92
93CONFIGFLAGS="${CONFIGFLAGS} ${LIBCRYPTOFLAGS}"
94
95export LTESTS SUDO TEST_TARGET TEST_SSH_UNSAFE_PERMISSIONS
96