View | Details | Raw Unified | Return to bug 880 | Differences between
and this patch

Collapse All | Expand All

(-)configure.ac (-24 / +41 lines)
Lines 1044-1051 AC_ARG_WITH(tcp-wrappers, Link Here
1044
					CPPFLAGS="-I${withval} ${CPPFLAGS}"
1044
					CPPFLAGS="-I${withval} ${CPPFLAGS}"
1045
				fi
1045
				fi
1046
			fi
1046
			fi
1047
			LIBWRAP="-lwrap"
1047
			SSHDLIBS="-lwrap"
1048
			LIBS="$LIBWRAP $LIBS"
1048
			LIBS="$SSHDLIBS $LIBS"
1049
			AC_MSG_CHECKING(for libwrap)
1049
			AC_MSG_CHECKING(for libwrap)
1050
			AC_TRY_LINK(
1050
			AC_TRY_LINK(
1051
				[
1051
				[
Lines 1061-1067 AC_ARG_WITH(tcp-wrappers, Link Here
1061
					AC_DEFINE(LIBWRAP, 1,
1061
					AC_DEFINE(LIBWRAP, 1,
1062
						[Define if you want
1062
						[Define if you want
1063
						TCP Wrappers support])
1063
						TCP Wrappers support])
1064
					AC_SUBST(LIBWRAP)
1065
					TCPW_MSG="yes"
1064
					TCPW_MSG="yes"
1066
				],
1065
				],
1067
				[
1066
				[
Lines 1644-1649 PAM_MSG="no" Link Here
1644
AC_ARG_WITH(pam,
1643
AC_ARG_WITH(pam,
1645
	[  --with-pam              Enable PAM support ],
1644
	[  --with-pam              Enable PAM support ],
1646
	[
1645
	[
1646
		saved_LIBS="$LIBS"
1647
		if test "x$withval" != "xno" ; then
1647
		if test "x$withval" != "xno" ; then
1648
			if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1648
			if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1649
			   test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
1649
			   test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
Lines 1651-1657 AC_ARG_WITH(pam, Link Here
1651
			fi
1651
			fi
1652
1652
1653
			AC_CHECK_LIB(dl, dlopen, , )
1653
			AC_CHECK_LIB(dl, dlopen, , )
1654
			AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1654
			AC_CHECK_LIB(pam, pam_set_item,
1655
			    [ SSHDLIBS="-lpam $SSHDLIBS" ],
1656
			    AC_MSG_ERROR([*** libpam missing]))
1655
			AC_CHECK_FUNCS(pam_getenvlist)
1657
			AC_CHECK_FUNCS(pam_getenvlist)
1656
			AC_CHECK_FUNCS(pam_putenv)
1658
			AC_CHECK_FUNCS(pam_putenv)
1657
1659
Lines 1660-1671 AC_ARG_WITH(pam, Link Here
1660
			AC_DEFINE(USE_PAM, 1,
1662
			AC_DEFINE(USE_PAM, 1,
1661
				[Define if you want to enable PAM support])
1663
				[Define if you want to enable PAM support])
1662
			if test $ac_cv_lib_dl_dlopen = yes; then
1664
			if test $ac_cv_lib_dl_dlopen = yes; then
1663
				LIBPAM="-lpam -ldl"
1665
				SSHDLIBS="$SSHDLIBS -lpam -ldl"
1664
			else
1666
			else
1665
				LIBPAM="-lpam"
1667
				SSHDLIBS="$SSHDLIBS -lpam"
1666
			fi
1668
			fi
1667
			AC_SUBST(LIBPAM)
1668
		fi
1669
		fi
1670
		LIBS="$saved_LIBS"
1669
	]
1671
	]
1670
)
1672
)
1671
1673
Lines 1726-1732 AC_ARG_WITH(ssl-dir, Link Here
1726
		fi
1728
		fi
1727
	]
1729
	]
1728
)
1730
)
1729
LIBS="-lcrypto $LIBS"
1731
saved_LIBS="$LIBS"
1732
CRYPTOLIBS="-lcrypto"
1733
LIBS="$CRYPTOLIBS $LIBS"
1730
AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
1734
AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL, 1,
1731
	[Define if your ssl headers are included
1735
	[Define if your ssl headers are included
1732
	with #include <openssl/header.h>]),
1736
	with #include <openssl/header.h>]),
Lines 1875-1897 int main(void) { exit(EVP_aes_192_cbc() Link Here
1875
	]
1879
	]
1876
)
1880
)
1877
1881
1882
# Search for SHA256 support in libc and/or OpenSSL
1883
AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
1884
1878
# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1885
# Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1879
# because the system crypt() is more featureful.
1886
# because the system crypt() is more featureful.
1880
if test "x$check_for_libcrypt_before" = "x1"; then
1887
if test "x$check_for_libcrypt_before" = "x1"; then
1881
	AC_CHECK_LIB(crypt, crypt)
1888
	AC_CHECK_LIB(crypt, crypt, SSHDLIBS="-lcrypt $SSHDLIBS")
1882
fi
1889
fi
1883
1890
1884
# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1891
# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1885
# version in OpenSSL.
1892
# version in OpenSSL.
1886
if test "x$check_for_libcrypt_later" = "x1"; then
1893
if test "x$check_for_libcrypt_later" = "x1"; then
1887
	AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1894
	AC_CHECK_LIB(crypt, crypt, SSHDLIBS="$SSHDLIBS -lcrypt")
1888
fi
1895
fi
1889
1896
1890
# Search for SHA256 support in libc and/or OpenSSL
1891
AC_CHECK_FUNCS(SHA256_Update EVP_sha256)
1892
1893
AC_CHECK_LIB(iaf, ia_openinfo)
1894
1895
### Configure cryptographic random number support
1897
### Configure cryptographic random number support
1896
1898
1897
# Check wheter OpenSSL seeds itself
1899
# Check wheter OpenSSL seeds itself
Lines 1920-1925 int main(void) { exit(RAND_status() == 1 Link Here
1920
	]
1922
	]
1921
)
1923
)
1922
1924
1925
# We are now done with the OpenSSL tests.
1926
LIBS="$saved_LIBS"
1927
1928
AC_CHECK_LIB(iaf, ia_openinfo)
1923
1929
1924
# Do we want to force the use of the rand helper?
1930
# Do we want to force the use of the rand helper?
1925
AC_ARG_WITH(rand-helper,
1931
AC_ARG_WITH(rand-helper,
Lines 3000-3005 int main() Link Here
3000
			[#include <arpa/nameser.h>])
3006
			[#include <arpa/nameser.h>])
3001
	])
3007
	])
3002
3008
3009
# Check whether user wants SELinux support
3010
SELINUX_MSG="no"
3011
AC_ARG_WITH(selinux,
3012
	[  --with-selinux   Enable SELinux support],
3013
	[ if test "x$withval" != "xno" ; then
3014
		AC_DEFINE(WITH_SELINUX,1,[Define if you want SELinux support.])
3015
		SELINUX_MSG="yes"
3016
		AC_CHECK_HEADER([selinux/selinux.h], ,
3017
		    AC_MSG_ERROR(SELinux support requires selinux.h header))
3018
		AC_CHECK_LIB(selinux, setexeccon,
3019
		    [ SSHDLIBS="-lselinux $SSHDLIBS" ],
3020
		    AC_MSG_ERROR(SELinux support requires libselinux library))
3021
		AC_CHECK_FUNCS(getseuserbyname get_default_context_with_level)
3022
	fi ]
3023
)
3024
3003
# Check whether user wants Kerberos 5 support
3025
# Check whether user wants Kerberos 5 support
3004
KRB5_MSG="no"
3026
KRB5_MSG="no"
3005
AC_ARG_WITH(kerberos5,
3027
AC_ARG_WITH(kerberos5,
Lines 3762-3779 if test ! -z "$blibpath" ; then Link Here
3762
	AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3784
	AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
3763
fi
3785
fi
3764
3786
3765
dnl remove pam and dl because they are in $LIBPAM
3766
if test "$PAM_MSG" = yes ; then
3767
	LIBS=`echo $LIBS | sed 's/-lpam //'`
3768
fi
3769
if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
3770
	LIBS=`echo $LIBS | sed 's/-ldl //'`
3771
fi
3772
3773
dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3787
dnl Adding -Werror to CFLAGS early prevents configure tests from running.
3774
dnl Add now.
3788
dnl Add now.
3775
CFLAGS="$CFLAGS $werror_flags"
3789
CFLAGS="$CFLAGS $werror_flags"
3776
3790
3791
AC_SUBST(SSHDLIBS CRYPTOLIBS)
3792
3777
AC_EXEEXT
3793
AC_EXEEXT
3778
AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3794
AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \
3779
	openbsd-compat/regress/Makefile scard/Makefile ssh_prng_cmds survey.sh])
3795
	openbsd-compat/regress/Makefile scard/Makefile ssh_prng_cmds survey.sh])
Lines 3818-3823 fi Link Here
3818
echo "                    Manpage format: $MANTYPE"
3834
echo "                    Manpage format: $MANTYPE"
3819
echo "                       PAM support: $PAM_MSG"
3835
echo "                       PAM support: $PAM_MSG"
3820
echo "                 KerberosV support: $KRB5_MSG"
3836
echo "                 KerberosV support: $KRB5_MSG"
3837
echo "                   SELinux support: $SELINUX_MSG"
3821
echo "                 Smartcard support: $SCARD_MSG"
3838
echo "                 Smartcard support: $SCARD_MSG"
3822
echo "                     S/KEY support: $SKEY_MSG"
3839
echo "                     S/KEY support: $SKEY_MSG"
3823
echo "              TCP Wrappers support: $TCPW_MSG"
3840
echo "              TCP Wrappers support: $TCPW_MSG"
Lines 3838-3844 echo " Compiler: ${CC}" Link Here
3838
echo "    Compiler flags: ${CFLAGS}"
3855
echo "    Compiler flags: ${CFLAGS}"
3839
echo "Preprocessor flags: ${CPPFLAGS}"
3856
echo "Preprocessor flags: ${CPPFLAGS}"
3840
echo "      Linker flags: ${LDFLAGS}"
3857
echo "      Linker flags: ${LDFLAGS}"
3841
echo "         Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
3858
echo "         Libraries: LIBS='${LIBS}' SSHDLIBS='${SSHDLIBS}' CRYPTO='${CRYPTOLIBS}'"
3842
3859
3843
echo ""
3860
echo ""
3844
3861
(-)Makefile.in (-14 / +14 lines)
Lines 43-51 LD=@LD@ Link Here
43
CFLAGS=@CFLAGS@
43
CFLAGS=@CFLAGS@
44
CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
44
CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
45
LIBS=@LIBS@
45
LIBS=@LIBS@
46
CRYPTOLIBS=@CRYPTOLIBS@
47
SSHDLIBS=@SSHDLIBS@
46
LIBEDIT=@LIBEDIT@
48
LIBEDIT=@LIBEDIT@
47
LIBPAM=@LIBPAM@
48
LIBWRAP=@LIBWRAP@
49
AR=@AR@
49
AR=@AR@
50
AWK=@AWK@
50
AWK=@AWK@
51
RANLIB=@RANLIB@
51
RANLIB=@RANLIB@
Lines 133-169 libssh.a: $(LIBSSH_OBJS) Link Here
133
	$(RANLIB) $@
133
	$(RANLIB) $@
134
134
135
ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
135
ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
136
	$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
136
	$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(CRYPTOLIBS) $(LIBS)
137
137
138
sshd$(EXEEXT): libssh.a	$(LIBCOMPAT) $(SSHDOBJS)
138
sshd$(EXEEXT): libssh.a	$(LIBCOMPAT) $(SSHDOBJS)
139
	$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBS)
139
	$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(CRYPTOLIBS) $(LIBS)
140
140
141
scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o
141
scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o bufaux.o
142
	$(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
142
	$(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CRYPTOLIBS)
143
143
144
ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o
144
ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o
145
	$(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
145
	$(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(CRYPTOLIBS) $(LIBS)
146
146
147
ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o
147
ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o
148
	$(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
148
	$(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(CRYPTOLIBS) $(LIBS)
149
149
150
ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
150
ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
151
	$(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
151
	$(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(CRYPTOLIBS) $(LIBS)
152
152
153
ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
153
ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
154
	$(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
154
	$(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(CRYPTOLIBS) $(LIBS)
155
155
156
ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o
156
ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o
157
	$(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
157
	$(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(CRYPTOLIBS) $(LIBS)
158
158
159
sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o
159
sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o
160
	$(LD) -o $@ sftp-server.o sftp-common.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
160
	$(LD) -o $@ sftp-server.o sftp-common.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CRYPTOLIBS)
161
161
162
sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o
162
sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o
163
	$(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT)
163
	$(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CRYPTOLIBS) $(LIBEDIT)
164
164
165
ssh-rand-helper${EXEEXT}: $(LIBCOMPAT) libssh.a ssh-rand-helper.o
165
ssh-rand-helper${EXEEXT}: $(LIBCOMPAT) libssh.a ssh-rand-helper.o
166
	$(LD) -o $@ ssh-rand-helper.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
166
	$(LD) -o $@ ssh-rand-helper.o $(LDFLAGS) -lssh -lopenbsd-compat $(CRYPTOLIBS) $(LIBS)
167
167
168
# test driver for the loginrec code - not built by default
168
# test driver for the loginrec code - not built by default
169
logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o
169
logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o

Return to bug 880