[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed on #95010



On Tue, Jun 19, 2001 at 03:13:31PM +0200, Samuel Tardieu wrote:
> could one of you have a look at 95010? I cannot find an Alpha machine
> with Debian and X installed (vic needs X11 headers) to debug that
> (this is probably a minor problem, or 64 bits machines will be removed
> from vic Architecture line).
It is and it isn't, here is a patch.

The problems
  configure was not defining HAVE_INET_NTOP and HAVE_INET_PTON
  time() is in <time.h>
  if (<some-int> == <some-long>) is dumb as long != int, casting added
  to provide sanity

enjoy
  - Craig

diff -ur vic-2.8ucl1.1.3.orig/common/config.h.in vic-2.8ucl1.1.3/common/config.h.in
--- vic-2.8ucl1.1.3.orig/common/config.h.in	Thu Feb 17 23:59:35 2000
+++ vic-2.8ucl1.1.3/common/config.h.in	Tue Jun 26 13:10:19 2001
@@ -93,3 +93,10 @@
 #endif
 
 
+
+/* Define if you have the inet_ntop function.  */
+#undef HAVE_INET_NTOP
+
+/* Define if you have the inet_pton function.  */
+#undef HAVE_INET_PTON
+
diff -ur vic-2.8ucl1.1.3.orig/common/config_unix.h vic-2.8ucl1.1.3/common/config_unix.h
--- vic-2.8ucl1.1.3.orig/common/config_unix.h	Thu Feb 17 23:59:35 2000
+++ vic-2.8ucl1.1.3/common/config_unix.h	Tue Jun 26 13:12:44 2001
@@ -46,6 +46,7 @@
 #include <limits.h>
 #include <sys/types.h>
 #include <sys/time.h>
+#include <time.h>
 #include <sys/resource.h>
 
 #include <pwd.h>
diff -ur vic-2.8ucl1.1.3.orig/common/configure vic-2.8ucl1.1.3/common/configure
--- vic-2.8ucl1.1.3.orig/common/configure	Tue Jun 26 13:22:36 2001
+++ vic-2.8ucl1.1.3/common/configure	Tue Jun 26 13:08:31 2001
@@ -1876,17 +1876,127 @@
 fi
 
 
+for ac_func in inet_pton
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1883: 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 <<EOF
+#line 1888 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* 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:1911: \"$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 <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_func in inet_ntop
+do
+echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
+echo "configure:1938: 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 <<EOF
+#line 1943 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func(); below.  */
+#include <assert.h>
+/* 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:1966: \"$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 <<EOF
+#define $ac_tr_func 1
+EOF
+ 
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
 
 
 echo $ac_n "checking for library containing socket""... $ac_c" 1>&6
-echo "configure:1883: checking for library containing socket" >&5
+echo "configure:1993: checking for library containing socket" >&5
 if eval "test \"`echo '$''{'ac_cv_search_socket'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_socket="no"
 cat > conftest.$ac_ext <<EOF
-#line 1890 "configure"
+#line 2000 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1897,7 +2007,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_socket="none required"
 else
@@ -1908,7 +2018,7 @@
 test "$ac_cv_search_socket" = "no" && for i in socket; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1912 "configure"
+#line 2022 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1919,7 +2029,7 @@
 socket()
 ; return 0; }
 EOF
-if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_socket="-l$i"
 break
@@ -1941,14 +2051,14 @@
 fi
 
 echo $ac_n "checking for library containing inet_addr""... $ac_c" 1>&6
-echo "configure:1945: checking for library containing inet_addr" >&5
+echo "configure:2055: checking for library containing inet_addr" >&5
 if eval "test \"`echo '$''{'ac_cv_search_inet_addr'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_func_search_save_LIBS="$LIBS"
 ac_cv_search_inet_addr="no"
 cat > conftest.$ac_ext <<EOF
-#line 1952 "configure"
+#line 2062 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1959,7 +2069,7 @@
 inet_addr()
 ; return 0; }
 EOF
-if { (eval echo configure:1963: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_inet_addr="none required"
 else
@@ -1970,7 +2080,7 @@
 test "$ac_cv_search_inet_addr" = "no" && for i in nsl; do
 LIBS="-l$i  $ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1974 "configure"
+#line 2084 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1981,7 +2091,7 @@
 inet_addr()
 ; return 0; }
 EOF
-if { (eval echo configure:1985: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_search_inet_addr="-l$i"
 break
@@ -2097,12 +2207,12 @@
 # not defined.  They are kept outside IPv6 enable check to keep code readable.
 
 echo $ac_n "checking for getipnodebyname in <netdb.h>""... $ac_c" 1>&6
-echo "configure:2101: checking for getipnodebyname in <netdb.h>" >&5
+echo "configure:2211: checking for getipnodebyname in <netdb.h>" >&5
 if eval "test \"`echo '$''{'ucl_cv_getipnodebyname_in_netdb_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2106 "configure"
+#line 2216 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 EOF
@@ -2131,17 +2241,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2135: checking for $ac_hdr" >&5
+echo "configure:2245: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2140 "configure"
+#line 2250 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2255: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2169,12 +2279,12 @@
 
 
 echo $ac_n "checking for struct addrinfo in <netdb.h>""... $ac_c" 1>&6
-echo "configure:2173: checking for struct addrinfo in <netdb.h>" >&5
+echo "configure:2283: checking for struct addrinfo in <netdb.h>" >&5
 if eval "test \"`echo '$''{'ucl_cv_st_addrinfo_in_netdb_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2178 "configure"
+#line 2288 "configure"
 #include "confdefs.h"
 #include <netdb.h>
 EOF
@@ -2200,12 +2310,12 @@
 fi
 
 echo $ac_n "checking for sin6_len in struct sockaddr_in6""... $ac_c" 1>&6
-echo "configure:2204: checking for sin6_len in struct sockaddr_in6" >&5
+echo "configure:2314: checking for sin6_len in struct sockaddr_in6" >&5
 if eval "test \"`echo '$''{'ucl_cv_sin6_len'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2209 "configure"
+#line 2319 "configure"
 #include "confdefs.h"
 
 		#ifdef HAVE_NETINET6_IN6_H
@@ -2221,7 +2331,7 @@
 	
 ; return 0; }
 EOF
-if { (eval echo configure:2225: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2335: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ucl_cv_sin6_len=yes
 else
@@ -2246,7 +2356,7 @@
 # GCC-specific warning flags
 if test "$GCC" = yes
 then
-        CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -Wbad-function-cast -Wmissing-prototypes -Wcast-qual -Wmissing-declarations"
+        CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -Wbad-function-cast -Wmissing-prototypes -Wcast-qual -Wmissing-declarations -Werror"
 fi
 
 # Done, create the output files....
diff -ur vic-2.8ucl1.1.3.orig/common/configure.in vic-2.8ucl1.1.3/common/configure.in
--- vic-2.8ucl1.1.3.orig/common/configure.in	Thu Feb 17 23:59:36 2000
+++ vic-2.8ucl1.1.3/common/configure.in	Tue Jun 26 13:08:24 2001
@@ -131,6 +131,8 @@
 AC_SUBST(LIBOBJS)
 
 dnl AC_REPLACE_FUNCS(inet_pton inet_ntop)
+AC_CHECK_FUNCS(inet_pton)
+AC_CHECK_FUNCS(inet_ntop)
 
 AC_SEARCH_LIBS(socket, socket)
 AC_SEARCH_LIBS(inet_addr, nsl)
diff -ur vic-2.8ucl1.1.3.orig/common/mbus_parser.c vic-2.8ucl1.1.3/common/mbus_parser.c
--- vic-2.8ucl1.1.3.orig/common/mbus_parser.c	Thu Feb 17 23:59:36 2000
+++ vic-2.8ucl1.1.3/common/mbus_parser.c	Tue Jun 26 13:17:03 2001
@@ -167,7 +167,7 @@
         }
 
 	*i = strtol(m->buffer, &p, 10);
-	if (((*i == LONG_MAX) || (*i == LONG_MIN)) && (errno == ERANGE)) {
+	if (((*i == (int)LONG_MAX) || (*i == (int)LONG_MIN)) && (errno == ERANGE)) {
 		debug_msg("integer out of range\n");
 		return FALSE;
 	}
Only in vic-2.8ucl1.1.3.orig/vic/codec/tmn: TAGS
Only in vic-2.8ucl1.1.3.orig/vic/codec/tmndec: Makefile.bak
-- 
Craig Small VK2XLZ  GnuPG:1C1B D893 1418 2AF4 45EE  95CB C76C E5AC 12CA DFA5
Eye-Net Consulting http://www.eye-net.com.au/        <csmall@eye-net.com.au>
MIEEE <csmall@ieee.org>                 Debian developer <csmall@debian.org>



Reply to: