patch (fwd)

nazard at dragoninc.on.ca nazard at dragoninc.on.ca
Tue Mar 14 18:29:53 GMT 2000


On 15 Mar, Michael Breuer wrote:
> Ok... consider me an autoconf newbie.  In this particular case, IRIX requires that <standards.h> be included before <netinet/*.h>.
> The "patch" I created seemed reasonable to me... if configure is running on IRIX and standards.h exists then source it in.  I'm not
> sure how creating a new macro is warranted here, and this patch should only be invoked on IRIX.
> 
> That said, could you suggest an alternative which would not break other implementations?

If you follow the code for AC_CHECK_HEADERS thru you end up with this
call chain

AC_CHECK_HEADERS -> AC_CHECK_HEADER -> AC_TRY_CPP -> AC_REQUIRE_CPP ->
AC_REQUIRE([AC_PROG_CPP])

What this boils down to is that whenever the macro is processed by m4
(autoconf) if AC_PROG_CPP has not been outputed, it will output it. So
what happens is the configure script ends up with a section like this:

    *irix*)
    echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1282: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
  CPP=
fi
if test -z "$CPP"; then
if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  echo $ac_n "(cached) $ac_c" 1>&6

and so on. This means that for everyone not irix, the configure script
has no idea how to run the pre-processor, and all the further calls to
AC_CHECK_HEADERS fail.

If you explicitly add a call to AC_PROG_CPP at the top (with the other
checks) then this issue does not happen.

BTW: You can call AC_CHECK_HEADER if you are only interested in one
header.


>> Index: configure.in
>> ===================================================================
>> RCS file: /cvsroot/samba/source/configure.in,v
>> retrieving revision 1.102.2.19
>> diff -u -w -r1.102.2.19 configure.in
>> --- configure.in        2000/03/10 19:53:25     1.102.2.19
>> +++ configure.in        2000/03/14 07:40:48
>> @@ -34,6 +34,7 @@
>>
>>  dnl Checks for programs.
>>  AC_PROG_CC
>> +AC_PROG_CPP
>>  AC_PROG_INSTALL
>>  AC_PROG_AWK
>>
>>

-- 
Doug Nazar
Dragon Computer Consultants Inc.
Tel: (416) 708-1578     Fax: (416) 708-8081



More information about the samba-ntdom mailing list