From 552cb4bfcac4acc97661217bad3c5dcfc4abbc34 Mon Sep 17 00:00:00 2001 From: "W.C.A. Wijngaards" Date: Fri, 29 Nov 2013 17:10:09 +0100 Subject: [PATCH] Put -g-O2 back by reorder tests, fixup lib search --- configure.ac | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index cc7022e9..d0b44bc0 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,9 @@ AC_CONFIG_SRCDIR([src/getdns/getdns.h]) # LT_INIT AC_CONFIG_MACRO_DIR([m4]) +AC_PROG_CC +AC_PROG_CPP + # Checks for programs. AC_CANONICAL_HOST case "$host_os" in @@ -21,9 +24,6 @@ case "$host_os" in ;; esac -AC_PROG_CC -AC_PROG_CPP - # always use ./libtool unless override from commandline (libtool=mylibtool) if test -z "$libtool"; then libtool="`pwd`/libtool" @@ -60,16 +60,17 @@ AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=pathname], if test x_$withval = x_yes; then for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do if test -f "$dir/include/idna.h"; then - CPPFLAGS="$CPPFLAGS -I$dir/include" + CFLAGS="$CFLAGS -I$dir/include" LDFLAGS="$LDFLAGS -L$dir/lib" AC_MSG_NOTICE([Found libidn in $dir]) break fi done -fi -if test x_$withval != x_no; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" +else + if test x_$withval != x_no; then + CFLAGS="$CFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + fi fi # find libldns @@ -79,16 +80,17 @@ AC_ARG_WITH(libldns, AC_HELP_STRING([--with-libldns=pathname], if test x_$withval = x_yes; then for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do if test -f "$dir/include/ldns/ldns.h"; then - CPPFLAGS="$CPPFLAGS -I$dir/include" + CFLAGS="$CFLAGS -I$dir/include" LDFLAGS="$LDFLAGS -L$dir/lib" AC_MSG_NOTICE([Found libldns in $dir]) break fi done -fi -if test x_$withval != x_no; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" +else + if test x_$withval != x_no; then + CFLAGS="$CFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + fi fi # find libunbound @@ -98,16 +100,17 @@ AC_ARG_WITH(libunbound, AC_HELP_STRING([--with-libunbound=pathname], if test x_$withval = x_yes; then for dir in /usr/local /opt/local /usr/pkg /usr/sfw; do if test -f "$dir/include/unbound.h"; then - CPPFLAGS="$CPPFLAGS -I$dir/include" + CFLAGS="$CFLAGS -I$dir/include" LDFLAGS="$LDFLAGS -L$dir/lib" AC_MSG_NOTICE([Found libunbound in $dir]) break fi done -fi -if test x_$withval != x_no; then - CPPFLAGS="$CPPFLAGS -I$withval/include" - LDFLAGS="$LDFLAGS -L$withval/lib" +else + if test x_$withval != x_no; then + CFLAGS="$CFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + fi fi # Checks for libraries.