On Fri, Mar 16, 2012 at 5:25 PM, Fabian Knittel
<fabian.knit...@lettink.de> wrote:
> Hi Alon,
>
> sorry for digging up the dead, but our disagreements might have
> started earlier and just went unnoticed so far ... :)
>
> 2012/3/8 Alon Bar-Lev <alon.bar...@gmail.com>:
>> I wrote this in the introduction of the patch set.
>>
>> There are two approaches to detecting dependencies:
>>
>> 1. Detect all compile time dependences- you detect headers and
>> libraries, this is probably the safest way to go, but makes the code
>> very complex.
>
> Are you referring to the configure code? I might be missing something
> obvious, but
>
> AC_CHECK_LIB([selinux], [setcon], [SELINUX_LIBS="-lselinux"])
>
> versus
>
> AC_CHECK_HEADER([selinux/selinux.h], [
>    AC_CHECK_LIB([selinux], [setcon], [SELINUX_LIBS="-lselinux"],
>        [AC_MSG_RESULT([SELinux library not found.])]
>    )],  [AC_MSG_ERROR([SELinux headers not found.])]
> )
>
> doesn't really qualify as "very complex" to me.

This is untrue.
As most features needs custom CFLAGs as well, it looks like:

old_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${SOME_CFLAGS}"
AC_CHECK_HEADER([...])
CFLAGS="${old_CFLAGS}"

And as I wrote, in all build system I re-wrote I used this approach,
no negative impact what so ever.

I don't mind doing this differently in openvpn *IF* there is a good
reason to do so.
A good reason not to do this is to lower the line of code in autoconf.

Alon.

Reply via email to