Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2000 20:45:21 +0100 (CET)
From:      marc.vanwoerkom@science-factory.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        3d@freebsd.org
Subject:   ports/23301: ports/graphics/opendx does not compile due to bug in package
Message-ID:  <200012051945.eB5JjLK57241@nil.science-factory.com>
Resent-Message-ID: <200012051950.eB5Jo1t19225@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         23301
>Category:       ports
>Synopsis:       ports/graphics/opendx does not compile due to bug in package
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 05 11:50:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Marc van Woerkom
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD nil.science-factory.com 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Tue Nov 7 15:12:53 CET 2000 mvw@nil.science-factory.com:/usr/obj/usr/src/sys/NIL i386


	
>Description:
	ports/graphics/opendx (Open Data Explorer) 
        fails to compile

	  buffer.c: In function `decode_24bit':
	  buffer.c:1034: `int32' undeclared (first use in this function)
	  buffer.c:1034: (Each undeclared identifier is reported only once
	  buffer.c:1034: for each function it appears in.)
	  buffer.c: In function `encode_24bit':
	  buffer.c:1116: `int32' undeclared (first use in this function)
	  buffer.c: In function `decode_32bit':
	  buffer.c:1339: `int32' undeclared (first use in this function)
	  buffer.c: In function `encode_32bit':
	  buffer.c:1421: `int32' undeclared (first use in this function)


>How-To-Repeat:
	build port

>Fix:
        Analysis:
        ---------

	IMHO the autoconf test macro DX_CHECK_TYPE(some_type, its_default)

	  AC_DEFUN(DX_CHECK_TYPE,
	  [ AC_REQUIRE([AC_HEADER_STDC])dnl
	    AC_MSG_CHECKING(for $1)
	  AC_CACHE_VAL(ac_cv_type_$1,
	  [AC_EGREP_CPP(dnl
	  changequote(<<,>>)dnl
	  <<$1[^a-zA-Z_0-9]>>dnl
	  changequote([,]), [#include <sys/types.h>
	  #if STDC_HEADERS
	  #include <stdlib.h>
	  #include <stddef.h>
	  #endif
	  #if defined(HAVE_WINDOWS_H)
	  #include <windows.h>
	  #endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl
	  AC_MSG_RESULT($ac_cv_type_$1)
	  if test $ac_cv_type_$1 = no; then
	    AC_DEFINE($1, $2)
	  fi
	  ])

        does not work correctly. In case of my FreeBSD box, it shows. :-)


        For "int32" the opendx configure script builds this testcode

	  #line 8117 "configure"
	  #include "confdefs.h"
	  #include <sys/types.h>
	  #if STDC_HEADERS
	  #include <stdlib.h>
	  #include <stddef.h>
	  #endif
	  #if defined(HAVE_WINDOWS_H)
	  #include <windows.h>
	  #endif

        with such a "confdefs.h"

	  #define PACKAGE "dx"
	  /* ... */
	  #define HAVE_VPRINTF 1
	  #define byte char
	  #define ubyte unsigned char
	  #define ulong unsigned long
	  #define int8 char
	  #define uint8 unsigned char

        and effectively runs this test	

          bash-2.04# if gcc -E Xconftest.C | egrep "int32[^a-zA-Z_0-9]"; \
          then echo true; else echo false; fi 
          __uint16_swap_uint32(unsigned int __x)
          __uint8_swap_uint32(unsigned int __x)
          true
          bash-2.04# 

        As you see, the "int32[^a-zA-Z_0-9]" regexp matches, because
        we have some "(PREFIX)int32" declarations in our FreeBSD headers.


     Fix:
     ----

     Writing a working test.
     I believe the best one would be one that assembles a test fragment
     with the type to be tested for availability 

         /* lot of includes like above */
         int32 foo;

     and to check if it will compile fine.
    
     Alas these guys settle for some simple regexp matching, and because
     I have no time now to dive deeper into autoconf mechanics, I suggest
     improving their match pattern like this:

         "typedef.*[^a-zA-Z_0-9]int32[\\t ]*;"

     This patch to aclocal.m4

	 --- aclocal.m4~	Fri Mar 31 22:06:54 2000
	 +++ aclocal.m4	Tue Dec  5 20:26:54 2000
	 @@ -717,7 +717,7 @@
	  AC_CACHE_VAL(ac_cv_type_$1,
	  [AC_EGREP_CPP(dnl
	  changequote(<<,>>)dnl
	 -<<$1[^a-zA-Z_0-9]>>dnl
	 +<<typedef.*[^a-zA-Z_0-9]$1[\\t ]*;>>dnl
	  changequote([,]), [#include <sys/types.h>
	  #if STDC_HEADERS
	  #include <stdlib.h>

     plus running autoconf to generate a new configure script, 
     will result in this configure run on my box

       checking for uint... yes
       checking for byte... no
       checking for ubyte... no
       checking for short... no
       checking for ushort... yes
       checking for ulong... no
       checking for int8... no
       checking for uint8... no
       checking for int16... no
       checking for uint16... no
       checking for int32... no
       checking for uint32... no
       checking for int64... no
       checking for __int64... no
       checking for uint64... no
       checking for float32... no
       checking for float64... no

     which seems fine to me, as these manual results show

       bash-2.04# if gcc -E Xconftest.C | \
                  egrep "typedef.*[^a-zA-Z_0-9]uint[\\t ]*;";then echo yes; else echo no;fi
       typedef	unsigned int	uint;		 
       yes
       bash-2.04# if gcc -E Xconftest.C | \
                  egrep "typedef.*[^a-zA-Z_0-9]ushort[\\t ]*;";then echo yes; else echo no;fi
       typedef	unsigned short	ushort;		 
       yes

     This results in "buffer.c" compiling fine. 
     I don't know yet (big package) if more problems will show up.

     If you need a better patch, please tell me.

     Regards,
     Marc van Woerkom

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012051945.eB5JjLK57241>