From 31229c5d334f195a3d0fc204ae990886933090bc Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 22 Jan 2002 09:54:20 +0000 Subject: [PATCH] * configure.in: Don't compile getopt.c and getopt1.c if there is getopt_long. * Makefile.am: Don't compile getopt.c and getopt1.c if there is getopt_long; use autoconf's output variable $(LIBOBJS). --- Makefile.am | 7 ++++--- configure.in | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3a4c44a..78b2b04 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,9 +1,10 @@ ## 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) diff --git a/configure.in b/configure.in index d54facb..63df020 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,5 @@ AC_INIT(starttls.el) +AC_PREREQ(2.13) AM_INIT_AUTOMAKE(starttls, 0.6) AM_PATH_LISPDIR @@ -14,6 +15,7 @@ AC_CHECK_HEADERS(libgen.h sys/select.h sys/poll.h) 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) @@ -26,13 +28,13 @@ fi 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) -- 1.7.10.4