X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=configure.ng;h=d1f731bc8c05093b65fd55f3a451653a932bfc02;hb=ab62dd27dc8482c9df0d6bcc64627708371699c0;hp=0b0a6588d6c1ec3cf8e3ac1949b23e2be57938cd;hpb=8872653ef6155bdaabd15c62ee67bd23d119305b;p=ngircd.git diff --git a/configure.ng b/configure.ng index 0b0a6588..d1f731bc 100644 --- a/configure.ng +++ b/configure.ng @@ -29,7 +29,7 @@ AC_CONFIG_SRCDIR([src/ngircd/ngircd.c]) AC_CONFIG_HEADER([src/config.h]) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([-Wall 1.10 ]ng_color_tests) +AM_INIT_AUTOMAKE([-Wall 1.10 foreign ]ng_color_tests) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -66,6 +66,7 @@ AC_PROG_AWK AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +AC_PROG_MKDIR_P AC_PROG_RANLIB # -- Compiler Features -- @@ -153,15 +154,30 @@ AC_HEADER_TIME # Required header files AC_CHECK_HEADERS([ \ - fcntl.h netdb.h netinet/in.h stdlib.h string.h \ - strings.h sys/socket.h sys/time.h unistd.h \ + fcntl.h \ + netdb.h \ + netinet/in.h \ + stdlib.h \ + string.h \ + strings.h \ + sys/socket.h \ + sys/time.h \ + sys/types.h \ + unistd.h \ ],,AC_MSG_ERROR([required C header missing!])) # Optional header files AC_CHECK_HEADERS_ONCE([ \ - arpa/inet.h inttypes.h malloc.h netinet/in_systm.h netinet/ip.h \ - stdbool.h stddef.h stdint.h varargs.h \ - ]) + arpa/inet.h \ + inttypes.h \ + malloc.h \ + netinet/in_systm.h \ + netinet/ip.h \ + stdbool.h \ + stddef.h \ + stdint.h \ + varargs.h \ +]) # -- Datatypes -- @@ -211,17 +227,50 @@ AC_FUNC_STRFTIME # Required functions AC_CHECK_FUNCS([ \ - alarm dup2 endpwent gethostbyaddr gethostbyname gethostname \ - gettimeofday inet_ntoa memmove memset setsid socket strcasecmp \ - strchr strcspn strerror strncasecmp strrchr strspn strstr \ + alarm \ + dup2 \ + endpwent \ + gethostbyaddr \ + gethostbyname \ + gethostname \ + gettimeofday \ + inet_ntoa \ + memmove \ + memset \ + setsid \ + socket \ + strcasecmp \ + strchr \ + strcspn \ + strerror \ + strncasecmp \ + strrchr \ + strspn \ + strstr \ ],, AC_MSG_ERROR([required function missing!])) # Optional functions AC_CHECK_FUNCS_ONCE([ - arc4random arc4random_stir gai_strerror getnameinfo inet_aton \ - sigaction sigprocmask snprintf vsnprintf strdup strndup strlcpy strlcat \ - strtok_r unsetenv waitpid]) + arc4random \ + arc4random_stir \ + gai_strerror \ + getnameinfo \ + inet_aton \ + setgroups \ + sigaction \ + sigprocmask \ + snprintf \ + strdup \ + strlcat \ + strlcpy \ + strndup \ + strsignal \ + strtok_r \ + unsetenv \ + vsnprintf \ + waitpid \ +]) WORKING_GETADDRINFO @@ -416,9 +465,13 @@ AC_ARG_WITH(openssl, CPPFLAGS="-I$withval/include $CPPFLAGS" LDFLAGS="-L$withval/lib $LDFLAGS" fi - AC_CHECK_LIB(crypto, BIO_s_mem) - AC_CHECK_LIB(ssl, SSL_library_init) - AC_CHECK_FUNCS(SSL_library_init, x_ssl_openssl=yes, + PKG_CHECK_MODULES([OPENSSL], [libssl libcrypto], + [LIBS="$LIBS $OPENSSL_LIBS" CFLAGS="$CFLAGS $OPENSSL_CFLAGS" + AC_DEFINE(HAVE_LIBSSL, 1)], + [AC_CHECK_LIB(crypto, BIO_s_mem) + AC_CHECK_LIB(ssl, SSL_new)] + ) + AC_CHECK_FUNCS(SSL_new, x_ssl_openssl=yes, AC_MSG_ERROR([Can't enable openssl]) ) fi @@ -466,8 +519,12 @@ AC_ARG_WITH(tcp-wrappers, LDFLAGS="-L$withval/lib $LDFLAGS" fi AC_MSG_CHECKING(for hosts_access) + saved_LIBS="$LIBS" LIBS="-lwrap $LIBS" + LIBS_END="-lwrap $LIBS_END" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +#include +#include #include int allow_severity = 0; int deny_severity = 0; @@ -481,6 +538,7 @@ int deny_severity = 0; AC_MSG_RESULT(no) AC_MSG_ERROR([Can't enable TCP wrappers!]) ]) + LIBS="$saved_LIBS" fi ] ) @@ -636,9 +694,12 @@ AC_DEFINE_UNQUOTED(HOST_CPU, "$host_cpu" ) AC_DEFINE_UNQUOTED(HOST_VENDOR, "$host_vendor" ) AC_DEFINE_UNQUOTED(HOST_OS, "$host_os" ) -# Add additional CFLAGS, eventually specified on the command line, but after -# running this configure script. Useful for "-Werror" for example. +# Add additional CFLAGS, LDFLAGS and LIBS which were specified on the command +# line or by some tests from above, but after running this script. Useful for +# adding "-Werror", for example: test -n "$CFLAGS_END" && CFLAGS="$CFLAGS $CFLAGS_END" +test -n "$LDFLAGS_END" && LDFLAGS="$LDFLAGS $LDFLAGS_END" +test -n "$LIBS_END" && LIBS="$LIBS $LIBS_END" # -- Generate files -- @@ -667,7 +728,9 @@ if test $? -eq 0; then # Generate debian/ link if the dpkg command exists # (read: if we are running on a debian compatible system) echo "creating Debian-specific links ..." - test -f debian/rules || ln -s contrib/Debian debian + if test ! -f debian/rules -a -f contrib/Debian/rules; then + ln -s contrib/Debian debian + fi fi # -- Result --