]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - crypto/openssh/freebsd-configure.sh
bhyvectl(8): Normalize the man page date
[FreeBSD/FreeBSD.git] / crypto / openssh / freebsd-configure.sh
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 configure_args="
7     --prefix=/usr
8     --sysconfdir=/etc/ssh
9     --with-pam
10     --with-ssl-dir=/usr
11     --with-tcp-wrappers
12     --with-libedit
13     --with-ssl-engine
14     --without-xauth
15 "
16
17 set -e
18
19 openssh=$(dirname $(realpath $0))
20 cd $openssh
21
22 # Run autotools before we drop LOCALBASE out of PATH
23 (cd $openssh && libtoolize --copy && autoheader && autoconf)
24
25 # Ensure we use the correct toolchain and clean our environment
26 export CC=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCC)
27 export CPP=$(echo ".include <bsd.lib.mk>" | make -f /dev/stdin -VCPP)
28 unset CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH LIBS
29 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
30
31 # Generate config.h with krb5 and stash it
32 sh configure $configure_args --with-kerberos5=/usr
33 mv config.log config.log.orig
34 mv config.h config.h.orig
35
36 # Generate config.h without krb5
37 sh configure $configure_args --without-kerberos5
38
39 # Extract the difference
40 echo '/* $Free''BSD$ */' > krb5_config.h
41 diff -u config.h.orig config.h |
42         sed -n '/^-#define/s/^-//p' |
43         grep -Ff /dev/stdin config.h.orig >> krb5_config.h