$FreeBSD$ --- configure.orig Mon Mar 11 14:42:53 2002 +++ configure Tue Mar 12 16:33:49 2002 @@ -7189,9 +7189,9 @@ rm -f conf.glibtest -GMODULE_CFLAGS=`glib-config --cflags gmodule` +GMODULE_CFLAGS=`$GLIB_CONFIG --cflags gmodule` -GMODULE_LIBS=`glib-config --libs gmodule` +GMODULE_LIBS=`$GLIB_CONFIG --libs gmodule` for ac_prog in 'bison -y' byacc do @@ -9298,39 +9298,33 @@ fi -if test "$cross_compiling" = yes; then - cat >>confdefs.h <<\EOF -#define HAVE_LIMITED_WRITEV 1 -EOF +echo $ac_n "checking how many vectors writev is capable to handle""... $ac_c" 1>&6 +echo "configure:3761: checking how many vectors writev is capable to handle" >&5 +if test "$cross_compiling" = yes; then + MAXIOV=16 else cat >conftest.$ac_ext <<_ACEOF #line 9308 "configure" #include "confdefs.h" -#include +#include #include -#define NIOVECS 50 +#include +#include int main(int argc, char *argv[]) { - char dumbuf[20] = "\n"; - struct iovec iovecs[NIOVECS]; - int i,fd; - - for(i = 0; i < NIOVECS; i++) { - iovecs[i].iov_base = dumbuf; - iovecs[i].iov_len = 1; - } - - fd=open("/dev/null", O_WRONLY); - if(fd==-1) - return(1); - - if(writev(fd, iovecs, NIOVECS) < 0) - return 1; - - close(fd); - return 0; + FILE *f; + int fd, i; + static struct iovec iovecs[4097]; + if ((f = fopen("conftestval", "w")) == NULL || \ + (fd = open("/dev/null", O_WRONLY)) < 0) + exit(1); + for (i = 1; i < 4098 && writev(fd, iovecs, i) >= 0; i++); + fprintf(f, "%d\n", i - 1); + fclose(f); + close(fd); + exit(0); } _ACEOF @@ -9345,18 +9339,16 @@ ac_status=$? echo "$as_me:9346: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + MAXIOV=`cat conftestval` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -cat >>confdefs.h <<\EOF -#define HAVE_LIMITED_WRITEV 1 -EOF - + MAXIOV=16 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +echo "$ac_t""$MAXIOV" 1>&6 ####################### # type alignment test # @@ -10755,7 +10747,7 @@ s,@LIB_WRAP@,$LIB_WRAP,;t t s,@HAVE_HOSTS_ACCESS_TRUE@,$HAVE_HOSTS_ACCESS_TRUE,;t t s,@HAVE_HOSTS_ACCESS_FALSE@,$HAVE_HOSTS_ACCESS_FALSE,;t t -s,@HAVE_LIMITED_WRITEV@,$HAVE_LIMITED_WRITEV,;t t +s,@MAXIOV@,$MAXIOV,;t t s,@subdirs@,$subdirs,;t t s,@pkglibdir@,$pkglibdir,;t t CEOF