## Process this file with automake to produce Makefile.in
DEFS = -I$(srcdir) $(CFLAGS) @DEFS@
-EXTRA_DIST = starttls.el addrinfo.h basename.c getaddrinfo.c
+LIBOBJS = @LIBOBJS@
+EXTRA_DIST = starttls.el bittypes.h sockstorage.h addrinfo.h basename.c getaddrinfo.c getopt.c getopt.h getopt1.c
bin_PROGRAMS= starttls
lisp_LISP = starttls.el
-starttls_SOURCES = starttls.c getopt.c getopt.h getopt1.c
-
+starttls_SOURCES = starttls.c
+starttls_LDADD = $(LIBOBJS)
AC_INIT(starttls.el)
+AC_PREREQ(2.13)
AM_INIT_AUTOMAKE(starttls, 0.6)
AM_PATH_LISPDIR
AC_CHECK_LIB(nsl, gethostbyname)
AC_CHECK_LIB(socket, socket)
AC_CHECK_TYPE(fd_set, int)
+AC_CHECK_FUNC(getopt_long,,LIBOBJS="$LIBOBJS getopt.o getopt1.o")
AC_REPLACE_FUNCS(basename getaddrinfo)
AC_CHECK_FUNC(poll)
AC_ARG_WITH(openssl,[ --with-openssl=PATH use OpenSSL from PATH])
if test -n "$with_openssl"; then
- CPPFLAGS="${CPPFLAGS} -I${with_openssl}/include"
- LDFLAGS="${LDFLAGS} -L${with_openssl}/lib"
+ CPPFLAGS="$CPPFLAGS -I${with_openssl}/include"
+ LDFLAGS="$LDFLAGS -L${with_openssl}/lib"
fi
AC_CHECK_HEADER(openssl/ssl.h, [
- AC_CHECK_LIB(crypto, BIO_accept, LIBS="-lcrypto ${LIBS}")
- AC_CHECK_LIB(ssl, SSL_CTX_new, LIBS="-lssl ${LIBS}")],
+ AC_CHECK_LIB(crypto, BIO_accept, LIBS="-lcrypto $LIBS")
+ AC_CHECK_LIB(ssl, SSL_CTX_new, LIBS="-lssl $LIBS")],
AC_MSG_ERROR([OpenSSL not installed - please install first]))
AC_OUTPUT(Makefile)