|
From: Patrick M. <ume...@us...> - 2007-06-18 19:40:12
|
Update of /cvsroot/radmind/radmind In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15907 Modified Files: aclocal.m4 config.h.in configure configure.ac daemon.c ktcheck.c lapply.c largefile.h lcreate.c lfdiff.c repo.c Log Message: A port to HP/UX. Thanks to Jim Foraker for the patch. [ PATCH 1733645 ] Changes include: * no wait4(), so emulated with wait3(). Another option would be to just use wait3() on all platforms, since the extra arg of wait4() isn't currently being used. * check for strtoll() and use strtol if it doesn't exist, even if off_t is 64-bit. Some people have used __strtoll() on HP/UX, but in radmind it's only used for progress reporting, so it didn't seem worth it to use an unapproved function. * use = instead of == in aclocal, since HP/UX /bin/sh doesn't support that test * define _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED=1 on HP/UX. This not only fixes a bunch of prototypes, but is necessary to get gcc to successfully parse the HP/UX includes. * #include <arpa/inet.h> a few places it probably should have been anyways, for hton* and ntoh*. threw in a cast in repo.c to fix a compiler warning probably occuring on multiple platforms. Index: config.h.in =================================================================== RCS file: /cvsroot/radmind/radmind/config.h.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** config.h.in 22 Sep 2006 20:44:41 -0000 1.9 --- config.h.in 18 Jun 2007 19:40:05 -0000 1.10 *************** *** 29,32 **** --- 29,35 ---- #undef HAVE_ZLIB + #undef HAVE_WAIT4 + #undef HAVE_STRTOLL + #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) Index: configure =================================================================== RCS file: /cvsroot/radmind/radmind/configure,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** configure 23 May 2007 18:33:45 -0000 1.51 --- configure 18 Jun 2007 19:40:05 -0000 1.52 *************** *** 5416,5420 **** fi done ! if test x_$found_zlib == x_yes; then if test "$dir" != "/usr"; then CPPFLAGS="$CPPFLAGS -I$zlibdir/include"; --- 5416,5420 ---- fi done ! if test x_$found_zlib = x_yes; then if test "$dir" != "/usr"; then CPPFLAGS="$CPPFLAGS -I$zlibdir/include"; *************** *** 5440,5446 **** # Miscellaneous: ! if test x_$GCC = x_yes; then ! OPTOPTS=${OPTOPTS:-"-Wall -Wmissing-prototypes"} fi --- 5440,5556 ---- + # HPUX lacks wait4 and strtoll + + + for ac_func in wait4 strtoll + do + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_func" >&5 + echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 + if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ + #define $ac_func innocuous_$ac_func + + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + + #ifdef __STDC__ + # include <limits.h> + #else + # include <assert.h> + #endif + + #undef $ac_func + + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + { + #endif + /* 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 (); + /* 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 + char (*f) () = $ac_func; + #endif + #ifdef __cplusplus + } + #endif + + int + main () + { + return f != $ac_func; + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" + fi + rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 + if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF + #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 + _ACEOF + + fi + done + + # Miscellaneous: ! if test x_$OPTOPTS = x_; then ! if test x_$GCC = x_yes; then ! OPTOPTS="$OPTOPTS -Wall -Wmissing-prototypes" ! fi ! if test x_$build_vendor = x_hp; then ! OPTOPTS="$OPTOPTS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" ! fi fi Index: daemon.c =================================================================== RCS file: /cvsroot/radmind/radmind/daemon.c,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** daemon.c 25 May 2007 02:47:20 -0000 1.81 --- daemon.c 18 Jun 2007 19:40:05 -0000 1.82 *************** *** 479,483 **** --- 479,487 ---- child_signal = 0; /* check to see if any children need to be accounted for */ + #ifdef HAVE_WAIT4 while (( pid = wait4( 0, &status, WNOHANG, &usage )) > 0 ) { + #else + while (( pid = wait3(&status, WNOHANG, &usage )) > 0 ) { + #endif connections--; Index: lcreate.c =================================================================== RCS file: /cvsroot/radmind/radmind/lcreate.c,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** lcreate.c 13 Oct 2006 20:20:20 -0000 1.87 --- lcreate.c 18 Jun 2007 19:40:05 -0000 1.88 *************** *** 11,14 **** --- 11,15 ---- #include <sys/time.h> #include <netinet/in.h> + #include <arpa/inet.h> #include <errno.h> #include <fcntl.h> Index: configure.ac =================================================================== RCS file: /cvsroot/radmind/radmind/configure.ac,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** configure.ac 23 May 2007 18:33:45 -0000 1.41 --- configure.ac 18 Jun 2007 19:40:05 -0000 1.42 *************** *** 73,79 **** CHECK_ZLIB # Miscellaneous: ! if test x_$GCC = x_yes; then ! OPTOPTS=${OPTOPTS:-"-Wall -Wmissing-prototypes"} fi AC_SUBST(OPTOPTS) --- 73,87 ---- CHECK_ZLIB + # HPUX lacks wait4 and strtoll + AC_CHECK_FUNCS(wait4 strtoll) + # Miscellaneous: ! if test x_$OPTOPTS = x_; then ! if test x_$GCC = x_yes; then ! OPTOPTS="$OPTOPTS -Wall -Wmissing-prototypes" ! fi ! if test x_$build_vendor = x_hp; then ! OPTOPTS="$OPTOPTS -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" ! fi fi AC_SUBST(OPTOPTS) Index: repo.c =================================================================== RCS file: /cvsroot/radmind/radmind/repo.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** repo.c 27 Feb 2007 15:33:00 -0000 1.9 --- repo.c 18 Jun 2007 19:40:05 -0000 1.10 *************** *** 10,13 **** --- 10,14 ---- #include <sys/time.h> #include <netinet/in.h> + #include <arpa/inet.h> #include <ctype.h> #include <netdb.h> *************** *** 135,139 **** } else { for ( i = 0; i < len; i++ ) { ! if ( isspace( event[ i ] )) { err++; break; --- 136,140 ---- } else { for ( i = 0; i < len; i++ ) { ! if ( isspace( (int)event[ i ] )) { err++; break; Index: ktcheck.c =================================================================== RCS file: /cvsroot/radmind/radmind/ktcheck.c,v retrieving revision 1.122 retrieving revision 1.123 diff -C2 -d -r1.122 -r1.123 *** ktcheck.c 31 May 2007 20:47:16 -0000 1.122 --- ktcheck.c 18 Jun 2007 19:40:05 -0000 1.123 *************** *** 11,14 **** --- 11,15 ---- #include <sys/time.h> #include <netinet/in.h> + #include <arpa/inet.h> #include <dirent.h> #include <fcntl.h> Index: aclocal.m4 =================================================================== RCS file: /cvsroot/radmind/radmind/aclocal.m4,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** aclocal.m4 1 Aug 2006 16:48:05 -0000 1.16 --- aclocal.m4 18 Jun 2007 19:40:05 -0000 1.17 *************** *** 70,74 **** fi done ! if test x_$found_zlib == x_yes; then if test "$dir" != "/usr"; then CPPFLAGS="$CPPFLAGS -I$zlibdir/include"; --- 70,74 ---- fi done ! if test x_$found_zlib = x_yes; then if test "$dir" != "/usr"; then CPPFLAGS="$CPPFLAGS -I$zlibdir/include"; Index: lapply.c =================================================================== RCS file: /cvsroot/radmind/radmind/lapply.c,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** lapply.c 18 May 2007 19:10:27 -0000 1.137 --- lapply.c 18 Jun 2007 19:40:05 -0000 1.138 *************** *** 10,13 **** --- 10,14 ---- #include <sys/param.h> #include <netinet/in.h> + #include <arpa/inet.h> #include <errno.h> #include <netdb.h> Index: lfdiff.c =================================================================== RCS file: /cvsroot/radmind/radmind/lfdiff.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** lfdiff.c 13 Oct 2006 20:20:20 -0000 1.58 --- lfdiff.c 18 Jun 2007 19:40:05 -0000 1.59 *************** *** 11,14 **** --- 11,15 ---- #include <sys/param.h> #include <netinet/in.h> + #include <arpa/inet.h> #include <fcntl.h> #include <netdb.h> Index: largefile.h =================================================================== RCS file: /cvsroot/radmind/radmind/largefile.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** largefile.h 20 Sep 2004 04:50:59 -0000 1.6 --- largefile.h 18 Jun 2007 19:40:05 -0000 1.7 *************** *** 9,13 **** #if SIZEOF_OFF_T == 8 ! #define strtoofft(x,y,z) (strtoll((x),(y),(z))) #define PRIofft "ll" #else /* a bit of an assumption, here */ --- 9,17 ---- #if SIZEOF_OFF_T == 8 ! #ifdef HAVE_STRTOLL ! #define strtoofft(x,y,z) (strtoll((x),(y),(z))) ! #else ! #define strtoofft(x,y,z) (strtol((x),(y),(z))) ! #endif #define PRIofft "ll" #else /* a bit of an assumption, here */ |