jer         14/10/25 09:25:30

  Added:                iftop-1.0_pre4-ac_check_sizeof.patch
  Log:
  Replace broken sizeof checks.
  
  (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 
A792A613)

Revision  Changes    Path
1.1                  
net-analyzer/iftop/files/iftop-1.0_pre4-ac_check_sizeof.patch

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/iftop/files/iftop-1.0_pre4-ac_check_sizeof.patch?rev=1.1&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-analyzer/iftop/files/iftop-1.0_pre4-ac_check_sizeof.patch?rev=1.1&content-type=text/plain

Index: iftop-1.0_pre4-ac_check_sizeof.patch
===================================================================
--- a/configure.ac
+++ b/configure.ac
@@ -98,45 +98,14 @@
 AC_CHECK_FUNCS(inet_aton inet_pton)
 
 dnl
-dnl Find integers of known physical size. This is a pain in the arse because
-dnl we can't use AC_CHECK_SIZEOF to find the original variables, since that
-dnl function doesn't permit us to include a header file. Sigh.
+dnl Find integers of known physical size.
 dnl
 
-for type in u_int8_t u_int16_t u_int32_t ; do
-    AC_MSG_CHECKING([size of $type])
-    AC_RUN_IFELSE([AC_LANG_SOURCE([
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
-    $type dummy;
-    FILE *f=fopen("conftestval", "w");
-    if (!f) exit(1);
-    fprintf(f, "%d\n", sizeof($1));
-    exit(0);
-}
-    ])], [
-        x=`cat conftestval`
-        eval "size_$type=$x"
-        AC_MSG_RESULT([$x])
-    ], [
-        eval "size_$type=0"
-        AC_MSG_RESULT([unknown type])
-    ], [
-        eval "size_$type=0"
-        AC_MSG_RESULT([can't determine when cross-compiling])
-    ])
-done
-
-dnl Groan. Have to do things this way so that autoheader can do its thing....
-AC_DEFINE_UNQUOTED(SIZEOF_U_INT8_T,  [$size_u_int8_t],  [size of u_int8_t])
-AC_DEFINE_UNQUOTED(SIZEOF_U_INT16_T, [$size_u_int16_t], [size of u_int16_t])
-AC_DEFINE_UNQUOTED(SIZEOF_U_INT32_T, [$size_u_int32_t], [size of u_int32_t])
+AC_CHECK_SIZEOF([u_int8_t])
+AC_CHECK_SIZEOF([u_int16_t])
+AC_CHECK_SIZEOF([u_int32_t])
 
-dnl If we already have these types, don't piss about any more....
-
-if test $size_u_int8_t != 1 || test $size_u_int16_t != 2 || test 
$size_u_int32_t != 4 ; then
-dnl XXXif test $size_u_int8_t != 1 -o $size_u_int16_t != 2 -o $size_u_int32_t 
!= 4 ; then
+if test $ac_cv_sizeof_u_int8_t = 0 || test $ac_cv_sizeof_u_int16_t = 0 || test 
$ac_cv_sizeof_u_int32_t = 0; then
     do_int_types=1
     AC_CHECK_HEADERS(
         stdint.h             dnl C99
@@ -154,6 +123,10 @@
     fi
 fi
 
+AC_DEFINE_UNQUOTED([SIZEOF_U_INT8_T],[$ac_cv_sizeof_u_int8_t],[size of 
u_int8_t])
+AC_DEFINE_UNQUOTED([SIZEOF_U_INT16_T],[$ac_cv_sizeof_u_int16_t],[size of 
u_int16_t])
+AC_DEFINE_UNQUOTED([SIZEOF_U_INT32_T],[$ac_cv_sizeof_u_int32_t],[size of 
u_int32_t])
+
 dnl
 dnl Name resolution.
 dnl




Reply via email to