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.

> 2. Detect library only - you assume that if library is present, the
> functionality exists, this is what important... no need to check for
> header, most probably this exists as well. This makes the code
> simpler, in the risk of compile failure if header is missing.

Which is less convenient for the user who expects _configure_ to
figure out those kinds of problems. My expectation would be: If
configure thinks everything is fine, the build should normally compile
without errors unless there's a bug in the lib / the program.

Your two alternatives don't really sound like whether or not we want
auto-detection but more like what kinds of problems to detect at
configure time.
  1. detect missing / misplaced libs and missing / misplaced headers
  2. detect missing / misplaced libs

Library auto-detection would IMHO be
  a) to enable / disable features based on which libraries were found and/or
  b) to search additional non-standard paths for the libraries and headers.

Some projects implement b), but I wouldn't recommend it. I tend to
also disagree with a), depending on the dependency. For example, I
could see configure enabling/disabling selinux automatically, unless
explicitly told to use a specific setting.

Cheers
Fabian

Reply via email to