[Freeipa-devel] [PATCH][bind-dyndb-ldap] AUTOCONF: Improve detection of bind9 header files

Lukas Slebodnik lslebodn at redhat.com
Wed Nov 26 14:57:16 UTC 2014


On (12/11/14 15:30), Petr Spacek wrote:
>On 24.7.2014 11:00, Petr Spacek wrote:
>> On 27.2.2014 15:19, Lukas Slebodnik wrote:
>>> ehlo,
>>>
>>> I did some reviews of bind-dyndb-ldap last week  and it was little bit annoying
>>> to export special CFLAGS for bind9 header files. It can be automatically
>>> detected in configure script using utility isc-config.
>>>
>>> Attached patch should improve this and CFLAGS needn't be exported.
>> 
>> Kind NACK. It would be valuable to test if isc/errno2result.h header is
>> present and throw appropriate error.
>> 
>> Current check with isc-config.sh only will pass if you have bind-devel package
>> installed but you are missing bind-lite-devel package.
>> 
>> 
>> I have a question: How
>> +ldap_la_CFLAGS = $(BIND9_CFLAGS) -Wall -Wextra @WERROR@ -std=gnu99
>> works?
>> 
>> Will it take user-defined CFLAGS into account? I would like to place
>> user-defined flags at the end of the list so you can easily override settings
>> given by autotools.
>> 
>> Thank you for clarification :-)
>> 
>> 
>> I will be really happy to commit complete fix. Thank you for cleaning this
>> autotools mess!
>
>This version actually works. Previous version did not take CFLAGS from
>isc-config.sh into account during libdns version check so it actually did not
>work at all :-)
>
>Please review it (and send me a modified patch if you see a problem).
>
>Thank you for your time!
>
>-- 
>Petr^2 Spacek

>From 4b17099abe2169ddb86b24e53cd2769b76f3ea2d Mon Sep 17 00:00:00 2001
>From: Lukas Slebodnik <lslebodn at redhat.com>
>Date: Tue, 25 Feb 2014 10:46:50 +0100
>Subject: [PATCH] Improve detection of BIND 9 header files and necessary
> CFLAGS.
>
>BIND 9 header files can be stored in non-default path (/usr/include/bind9).
>The isc-config.sh utility can provide necessary CFLAGS.
>---
> configure.ac                 | 43 ++++++++++++++++++++++++++++++++++---------
> contrib/bind-dyndb-ldap.spec |  1 -
> 2 files changed, 34 insertions(+), 10 deletions(-)
>
>diff --git a/configure.ac b/configure.ac
>index d471038ada54c07dcfc211c8a2572850e3b28205..c985908c760c974f7c02b6fa3d183e839bbeb9ad 100644
>--- a/configure.ac
>+++ b/configure.ac
>@@ -15,14 +15,6 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
> AC_PROG_CC
> AC_PROG_LIBTOOL
> 
>-# Checks for libraries.
>-AC_CHECK_LIB([dns], [dns_name_init], [],
>-	AC_MSG_ERROR([Install BIND9 development files]))
>-AC_CHECK_LIB([ldap], [ldap_initialize], [],
>-	AC_MSG_ERROR([Install OpenLDAP development files]))
>-AC_CHECK_LIB([krb5], [krb5_cc_initialize], [],
>-	AC_MSG_ERROR([Install Kerberos 5 development files]))
>-
> # Checks for header files.
> AC_CHECK_HEADERS([stddef.h stdlib.h string.h strings.h])
> 
>@@ -47,6 +39,39 @@ AC_TRY_COMPILE([
> [CFLAGS="$SAVED_CFLAGS"
>  AC_MSG_RESULT([no])])
> 
>+# Get CFLAGS from isc-config.sh
>+AC_ARG_VAR([BIND9_CFLAGS],
>+           [C compiler flags for bind9, overriding isc-config.sh])
>+AC_SUBST(BIND9_CFLAGS)
>+
>+dnl do not override enviroment variables BIND9_CFLAGS
>+if test -z "$BIND9_CFLAGS"; then
  ^^^^^^^^^^^^^^^^^^^^^^^^^
What is a purpose of this condition.
IIRC "AC_SUBST(BIND9_CFLAGS)" should allow you to override BIND9_CFLAGS
from command line.

If it does not wok I need to fix it.

LS




More information about the Freeipa-devel mailing list