Subject: Re: 'checking length of command line arguments' configure delays
To: Thomas Klausner <wiz@NetBSD.org>
From: Dick Davies <rasputnik@hellooperator.net>
List: tech-pkg
Date: 04/08/2004 20:57:08
Thomas Klausner wrote:
> On Thu, Apr 08, 2004 at 04:48:27PM +0100, Dick Davies wrote:
> 
>>I've only tried it on my 1.6X i386, are there any issues with it?
> 
> 
> Yes, it uses the empty string for all platforms where /sbin/sysctl
> doesn't exist or doesn't report anything useful....

Yeck. I think you're right - this little block of 'configure' is the
problem - if we end up setting the string to an empty value, then we 
keep that as the value.

====================================================================
# find the maximum length of command line arguments
echo "$as_me:$LINENO: checking the maximum length of command line 
arguments" >&5
echo $ECHO_N "checking the maximum length of command line arguments... 
$ECHO_C" >&6
if test "${lt_cv_sys_max_cmd_len+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
else
   # waste a little time
.
.
fi
====================================================================

The code does already check for sysctl though, if I just move the 
assignment into the if block that makes it better:

 > # Maximum command line length 

 > .if !defined(CONFIGURE_MAX_CMD_LEN) 

 > .if exists(/sbin/sysctl) 

 > CONFIGURE_MAX_CMD_LEN!= /sbin/sysctl -n kern.argmax 
 

 > CONFIGURE_ENV+=     lt_cv_sys_max_cmd_len=${CONFIGURE_MAX_CMD_LEN}
 > .endif 

 > .endif

And it should be easy to check the value returned by sysctl is a
number ( don't ask me how I'm a ruby programmer, all this sh malarkey
gives me a headache...)