diff --git a/Makefile b/Makefile index 4d8a96e..24c1b64 100644 --- a/Makefile +++ b/Makefile @@ -22,4 +22,5 @@ install: $(patsubst %, %.install, $(SUB)) clean: $(patsubst %, %.clean, $(SUB)) spotless: $(patsubst %, %.spotless, $(SUB)) - rm -f MCONFIG config.* *~ + rm -f MCONFIG config.cache config.log config.h *~ \#* + find . -type f \( -name \*.orig -o -name \*.rej \) | xargs -r rm -f diff --git a/aclocal.m4 b/aclocal.m4 index fc82c1d..0d538e0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -16,15 +16,41 @@ AC_DEFUN(PA_ADD_CFLAGS, dnl -------------------------------------------------------------------------- dnl PA_SIGSETJMP dnl -dnl Do we have sigsetjmp/siglongjmp? +dnl Do we have sigsetjmp/siglongjmp? (AC_CHECK_FUNCS doesn't seem to work +dnl for these particular functions.) dnl -------------------------------------------------------------------------- AC_DEFUN(PA_SIGSETJMP, [AC_MSG_CHECKING([for sigsetjmp]) AC_TRY_LINK( [#include ], [sigjmp_buf buf; - sigsetjmp(buf,1);], + sigsetjmp(buf,1); + siglongjmp(buf,2);], AC_MSG_RESULT([yes]) $1, AC_MSG_RESULT([no]) $2)]) + +dnl -------------------------------------------------------------------------- +dnl PA_MSGHDR_MSG_CONTROL +dnl +dnl Does struct msghdr have the msg_control field? +dnl -------------------------------------------------------------------------- +AC_DEFUN(PA_MSGHDR_MSG_CONTROL, +[AC_MSG_CHECKING([for msg_control in struct msghdr]) + AC_TRY_COMPILE( +[ +#include +#include +], +[ + struct msghdr msg; + void *p = (void *) &msg.msg_control; +], +[ + AC_DEFINE(HAVE_MSGHDR_MSG_CONTROL) + AC_MSG_RESULT([yes]) +], +[ + AC_MSG_RESULT([no]) +])]) diff --git a/config.h.in b/config.h.in index c8d8c69..b00d74f 100644 --- a/config.h.in +++ b/config.h.in @@ -15,5 +15,6 @@ * Pattern file for configurations */ +#undef HAVE_SIGSETJMP #undef HAVE_MSGHDR_MSG_CONTROL #undef HAVE_RECVMSG diff --git a/configure b/configure index a91294c..e63d48a 100755 --- a/configure +++ b/configure @@ -860,19 +860,109 @@ EOF esac +for ac_func in recvmsg +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:867: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +echo $ac_n "checking for msg_control in struct msghdr""... $ac_c" 1>&6 +echo "configure:920: checking for msg_control in struct msghdr" >&5 + cat > conftest.$ac_ext < +#include + +int main() { + + struct msghdr msg; + void *p = (void *) &msg.msg_control; + +; return 0; } +EOF +if { (eval echo configure:935: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + cat >> confdefs.h <<\EOF +#define HAVE_MSGHDR_MSG_CONTROL 1 +EOF + + echo "$ac_t""yes" 1>&6 + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + echo $ac_n "checking if $CC accepts -Wall""... $ac_c" 1>&6 -echo "configure:865: checking if $CC accepts -Wall" >&5 +echo "configure:955: checking if $CC accepts -Wall" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wall" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:876: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -884,18 +974,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -W""... $ac_c" 1>&6 -echo "configure:888: checking if $CC accepts -W" >&5 +echo "configure:978: checking if $CC accepts -W" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -W" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:899: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:989: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -907,18 +997,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wpointer-arith""... $ac_c" 1>&6 -echo "configure:911: checking if $CC accepts -Wpointer-arith" >&5 +echo "configure:1001: checking if $CC accepts -Wpointer-arith" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wpointer-arith" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:922: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -930,18 +1020,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wbad-function-cast""... $ac_c" 1>&6 -echo "configure:934: checking if $CC accepts -Wbad-function-cast" >&5 +echo "configure:1024: checking if $CC accepts -Wbad-function-cast" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wbad-function-cast" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1035: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -953,18 +1043,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wcast-equal""... $ac_c" 1>&6 -echo "configure:957: checking if $CC accepts -Wcast-equal" >&5 +echo "configure:1047: checking if $CC accepts -Wcast-equal" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wcast-equal" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1058: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -976,18 +1066,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wstrict-prototypes""... $ac_c" 1>&6 -echo "configure:980: checking if $CC accepts -Wstrict-prototypes" >&5 +echo "configure:1070: checking if $CC accepts -Wstrict-prototypes" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wstrict-prototypes" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:991: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1081: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -999,18 +1089,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wmissing-prototypes""... $ac_c" 1>&6 -echo "configure:1003: checking if $CC accepts -Wmissing-prototypes" >&5 +echo "configure:1093: checking if $CC accepts -Wmissing-prototypes" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wmissing-prototypes" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:1014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1022,18 +1112,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wmissing-declarations""... $ac_c" 1>&6 -echo "configure:1026: checking if $CC accepts -Wmissing-declarations" >&5 +echo "configure:1116: checking if $CC accepts -Wmissing-declarations" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wmissing-declarations" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:1037: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1127: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1045,18 +1135,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wnested-externs""... $ac_c" 1>&6 -echo "configure:1049: checking if $CC accepts -Wnested-externs" >&5 +echo "configure:1139: checking if $CC accepts -Wnested-externs" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wnested-externs" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:1060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1068,18 +1158,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Winline""... $ac_c" 1>&6 -echo "configure:1072: checking if $CC accepts -Winline" >&5 +echo "configure:1162: checking if $CC accepts -Winline" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Winline" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:1083: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1091,18 +1181,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -Wcast-align""... $ac_c" 1>&6 -echo "configure:1095: checking if $CC accepts -Wcast-align" >&5 +echo "configure:1185: checking if $CC accepts -Wcast-align" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -Wcast-align" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:1106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1114,18 +1204,18 @@ else fi rm -f conftest* echo $ac_n "checking if $CC accepts -pipe""... $ac_c" 1>&6 -echo "configure:1118: checking if $CC accepts -pipe" >&5 +echo "configure:1208: checking if $CC accepts -pipe" >&5 pa_add_cflags__old_cflags="$CFLAGS" CFLAGS="$CFLAGS -pipe" cat > conftest.$ac_ext < int main() { printf("Hello, World!\n"); ; return 0; } EOF -if { (eval echo configure:1129: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1138,20 +1228,24 @@ fi rm -f conftest* echo $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 -echo "configure:1142: checking for sigsetjmp" >&5 +echo "configure:1232: checking for sigsetjmp" >&5 cat > conftest.$ac_ext < int main() { sigjmp_buf buf; sigsetjmp(buf,1); + siglongjmp(buf,2); ; return 0; } EOF -if { (eval echo configure:1152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 - CFLAGS="$CFLAGS -DHAVE_SIGSETJMP=1" + cat >> confdefs.h <<\EOF +#define HAVE_SIGSETJMP 1 +EOF + else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 @@ -1165,14 +1259,14 @@ LIBXTRA=0 echo $ac_n "checking for library containing xmalloc""... $ac_c" 1>&6 -echo "configure:1169: checking for library containing xmalloc" >&5 +echo "configure:1263: checking for library containing xmalloc" >&5 if eval "test \"`echo '$''{'ac_cv_search_xmalloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_xmalloc="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_xmalloc="none required" else @@ -1194,7 +1288,7 @@ rm -f conftest* test "$ac_cv_search_xmalloc" = "no" && for i in iberty; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_xmalloc="-l$i" break @@ -1227,14 +1321,14 @@ else : fi echo $ac_n "checking for library containing xstrdup""... $ac_c" 1>&6 -echo "configure:1231: checking for library containing xstrdup" >&5 +echo "configure:1325: checking for library containing xstrdup" >&5 if eval "test \"`echo '$''{'ac_cv_search_xstrdup'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_xstrdup="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_xstrdup="none required" else @@ -1256,7 +1350,7 @@ rm -f conftest* test "$ac_cv_search_xstrdup" = "no" && for i in iberty; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_xstrdup="-l$i" break @@ -1289,14 +1383,14 @@ else : fi echo $ac_n "checking for library containing bsd_signal""... $ac_c" 1>&6 -echo "configure:1293: checking for library containing bsd_signal" >&5 +echo "configure:1387: checking for library containing bsd_signal" >&5 if eval "test \"`echo '$''{'ac_cv_search_bsd_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_func_search_save_LIBS="$LIBS" ac_cv_search_bsd_signal="no" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_bsd_signal="none required" else @@ -1318,7 +1412,7 @@ rm -f conftest* test "$ac_cv_search_bsd_signal" = "no" && for i in bsd; do LIBS="-l$i $ac_func_search_save_LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1427: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_search_bsd_signal="-l$i" break @@ -1359,7 +1453,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1363: checking for $ac_word" >&5 +echo "configure:1457: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1417,7 +1511,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1421: checking for a BSD compatible install" >&5 +echo "configure:1515: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1470,6 +1564,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -1533,19 +1628,7 @@ fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - +DEFS=-DHAVE_CONFIG_H # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} @@ -1583,7 +1666,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "MCONFIG" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "MCONFIG config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + EOF cat >> $CONFIG_STATUS < #include +#include "../config.h" #include "extern.h" void bsd_signal(int, void (*)(int)); diff --git a/tftp/tftp.c b/tftp/tftp.c index d089106..8c40eea 100644 --- a/tftp/tftp.c +++ b/tftp/tftp.c @@ -62,6 +62,7 @@ static const char *rcsid = "tftp-hpa $Id$"; #include #include +#include "../config.h" #include "extern.h" #include "tftpsubs.h" diff --git a/tftpd/recvfrom.c b/tftpd/recvfrom.c index 4f3b4b4..280800f 100644 --- a/tftpd/recvfrom.c +++ b/tftpd/recvfrom.c @@ -25,7 +25,9 @@ #include #include #include + #include "../config.h" +#include "recvfrom.h" #if defined(HAVE_RECVMSG) && defined(HAVE_MSGHDR_MSG_CONTROL) diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c index 4e3efa3..2e86da7 100644 --- a/tftpd/tftpd.c +++ b/tftpd/tftpd.c @@ -72,6 +72,7 @@ static const char *rcsid = "tftp-hpa $Id$"; #include #include +#include "../config.h" #include "tftpsubs.h" #include "recvfrom.h" @@ -95,7 +96,6 @@ void bsd_signal(int, void (*)(int)); #endif extern char *__progname; -struct sockaddr_in s_in; int peer; int timeout = TIMEOUT; int rexmtval = TIMEOUT; @@ -155,6 +155,7 @@ main(int argc, char **argv) struct tftphdr *tp; struct passwd *pw; struct options *opt; + struct sockaddr_in myaddr; int n = 0; int on = 1; int fd = 0; @@ -329,7 +330,7 @@ struct formats { } formats[] = { { "netascii", validate_access, sendfile, recvfile, 1 }, { "octet", validate_access, sendfile, recvfile, 0 }, - { NULL } + { NULL, NULL, NULL, NULL, 0 } }; /*