Hi Tamas,

Great, thank you very much.

I've committed, along with hbmk2 patch, so in theory 
the last issue with HB_USER_LDFLAGS should be fixed.
(since the /pkg dir is already hardcoded when checking 
for slang2, I think it's just fine to also add it to 
lib list in hbmk2)

Viktor

On 2010 May 25, at 15:54, Tamas TEVESZ wrote:

> 
> hi,
> 
> the following adds dragonfly support to the bsd support chunk.
> 
> some notes:
> 
> --- config/bsd/libs.mk  (revision 14580)
> +++ config/bsd/libs.mk  (working copy)
> -      SYSLIBS += slang
> +      ifneq ($(wildcard /usr/pkg/lib/libslang2.so),)
> +         SYSLIBS += slang2
> +      else
> +         SYSLIBS += slang
> +      endif
> 
> this is gross in several ways, but i have no better idea. first 
> grossness is that it has /usr/pkg hardcoded (that path can 
> theoretically be set to anything else upon installing pkgsrc, though i 
> don't know how common it is to change it); second grossness is it 
> being called slang2 (apparently, with pkgsrc, slang1 and slang2 can 
> coexist).
> 
> 
> -_DET_INC_HEAD := /X11/Xlib.h
> +_DET_INC_HEAD := /X11/X.h
> 
> the reason for this is that (again with pkgsrc) you can apparently get 
> in a situation where you have Xlib.h (libx11), but no X.h (xproto). 
> without X.h but with Xlib.h, harbour thinks there is x, tries to 
> compile support for it, and then hell breaks lose. i've checked (both 
> pkgsrc and debian stuff) that xproto depends on libx11, so this seems 
> a safe and fair change.
> 
> the patch also adds some /usr/pkg locations to det funs (again, 
> pkgsrc) - i suspect this will help netbsd too.
> 
> hbtest output is below, tested so far as the result is able to compile 
> and link small programs, although it needs some manual intervention by 
> means of having to specify HB_USER_LDFLAGS="-L/usr/pkg/lib" (runtime 
> linking is ok). i am not familiar enough with pkgsrc customs to know 
> what to do with it, but i have a hunch that this should be left as-is 
> for the user to set.
> 
> 
> Index: src/common/hbprintf.c
> ===================================================================
> --- src/common/hbprintf.c     (revision 14580)
> +++ src/common/hbprintf.c     (working copy)
> @@ -163,7 +163,7 @@
> #     define _x_long_dbl      long double
> #     if defined( __WATCOMC__ ) || defined( __MINGW32CE__ ) || defined( 
> __CYGWIN__ ) || \
>          defined( HB_OS_BEOS ) || defined( HB_OS_IPHONE ) || \
> -         defined( __OpenBSD__ ) || defined( __NetBSD__ ) || \
> +         defined( __OpenBSD__ ) || defined( __NetBSD__ ) || defined( 
> __DragonFly__ ) || \
>          ( defined( HB_OS_WIN_CE ) && defined( __POCC__ ) )
> #        define _HB_WRAP_MODFL_
> #        define _MODFD( x, p )   _hb_modfl( x, p )
> Index: include/hbsetup.h
> ===================================================================
> --- include/hbsetup.h (revision 14580)
> +++ include/hbsetup.h (working copy)
> @@ -381,7 +381,7 @@
> 
> #ifndef HB_OS_BSD
>    #if defined( __FreeBSD__ ) || defined( __NetBSD__ ) || defined( 
> __OpenBSD__ ) || \
> -       defined( HB_OS_DARWIN )
> +       defined( HB_OS_DARWIN ) || defined( __DragonFly__ )
>       #define HB_OS_BSD
>    #endif
> #endif
> Index: config/global.mk
> ===================================================================
> --- config/global.mk  (revision 14580)
> +++ config/global.mk  (working copy)
> @@ -100,6 +100,8 @@
>       HB_HOST_PLAT := bsd
>    else ifneq ($(findstring bsd,$(1)),)
>       HB_HOST_PLAT := bsd
> +   else ifneq ($(findstring DragonFly,$(1)),)
> +      HB_HOST_PLAT := bsd
>    else ifneq ($(findstring OS/2,$(1)),)
>       HB_HOST_PLAT := os2
>    else ifneq ($(findstring MS-DOS,$(1)),)
> Index: config/bsd/libs.mk
> ===================================================================
> --- config/bsd/libs.mk        (revision 14580)
> +++ config/bsd/libs.mk        (working copy)
> @@ -12,7 +12,11 @@
>       SYSLIBS += $(HB_LIBNAME_CURSES)
>    endif
>    ifneq ($(HB_HAS_SLANG),)
> -      SYSLIBS += slang
> +      ifneq ($(wildcard /usr/pkg/lib/libslang2.so),)
> +         SYSLIBS += slang2
> +      else
> +         SYSLIBS += slang
> +      endif
>       # In BSD, slang still needs curses :(
>       ifneq ($(HB_HAS_CURSES),)
>          SYSLIBS += $(HB_LIBNAME_CURSES)
> @@ -23,7 +27,7 @@
>       SYSLIBPATHS += /usr/X11R6/lib
>    endif
> 
> -   SYSLIBPATHS += /usr/local/lib
> +   SYSLIBPATHS += /usr/local/lib /usr/pkg/lib
> 
>    ifneq ($(HB_HAS_PCRE),)
>       ifeq ($(HB_HAS_PCRE_LOCAL),)
> Index: config/detect.mk
> ===================================================================
> --- config/detect.mk  (revision 14580)
> +++ config/detect.mk  (working copy)
> @@ -60,7 +60,7 @@
> _DET_VAR_HAS_ := HB_HAS_PCRE
> _DET_FLT_PLAT :=
> _DET_FLT_COMP :=
> -_DET_INC_DEFP := /usr/include /usr/local/include /opt/local/include
> +_DET_INC_DEFP := /usr/include /usr/local/include /usr/pkg/include 
> /opt/local/include
> _DET_INC_LOCL := $(realpath $(TOP)$(ROOT)external/pcre)
> _DET_INC_HEAD := /pcre.h
> 
> @@ -104,6 +104,7 @@
> _DET_INC_DEFP += /usr/local/include /usr/local/include/slang
> _DET_INC_DEFP += /sw/include /sw/include/slang
> _DET_INC_DEFP += /opt/local/include /opt/local/include/slang
> +_DET_INC_DEFP += /usr/pkg/include/slang2
> 
> include $(TOP)$(ROOT)config/detfun.mk
> 
> @@ -130,8 +131,8 @@
> _DET_VAR_HAS_ := HB_HAS_X11
> _DET_FLT_PLAT :=
> _DET_FLT_COMP :=
> -_DET_INC_DEFP := /usr/include /usr/local/include /usr/X11R6/include
> -_DET_INC_HEAD := /X11/Xlib.h
> +_DET_INC_DEFP := /usr/include /usr/local/include /usr/X11R6/include 
> /usr/pkg/include
> +_DET_INC_HEAD := /X11/X.h
> 
> include $(TOP)$(ROOT)config/detfun.mk
> 
> 
> hbtest output:
> 
> Harbour Regression Test Suite
> Copyright (c) 1999-2010, http://www.harbour-project.org/
> ---------------------------------------------------------------------------
>      Version: Harbour 2.1.0beta1 (Rev. 14580)
>     Compiler: GNU C 4.1.2 (32-bit)
>           OS: DragonFly 2.6-RELEASE i386
>   Date, Time: 2010.05.25 15:21:28
> Shortcut opt.: ON
>     Switches:  
> ===========================================================================
> R No.  Line            TestCall()                               -> Result     
>                                                                            | 
> Expected                                                                      
>        
> ---------------------------------------------------------------------------
> !  612 MAIN_HVMA(373)  saArray[ 1000 ]                         
>       Result: "E 2 BASE 1132 Bound error (array access) OS:0 #:0 
> A:2:A:{.[1].};N:1000 "
>     Expected: "E 2 BASE 1132 Bound error (array access) OS:0 #:0 "
> !  613 MAIN_HVMA(374)  saArray[ 1000 ] := 1                    
>       Result: "E 2 BASE 1133 Bound error (array assign) OS:0 #:0 A:1:N:1000 "
>     Expected: "E 2 BASE 1133 Bound error (array assign) OS:0 #:0 "
> !  742 MAIN_HVMA(542)  RTSTR( 00000500000000000000 )           
>       Result: " 16  500000000000000"
>     Expected: " 21       500000000000000"
> !  743 MAIN_HVMA(543)  RTSTR( 0500000000000000 )               
>       Result: " 16  500000000000000"
>     Expected: " 17   500000000000000"
> ! 1087 MAIN_MATH(359)  Str(1234567890 * 1234567890 )           
>       Result: " 1524157875019052100"
>     Expected: " 1524157875019052000"
> ! 2889 MAIN_ARRAY(164) ASize( NIL )                            
>       Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:1:U:NIL "
>     Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 "
> ! 2890 MAIN_ARRAY(165) ASize( {} )                             
>       Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:1:A:{.[0].} "
>     Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 "
> ! 2891 MAIN_ARRAY(166) ASize( ErrorNew() )                     
>       Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:1:O:ERROR 
> Object "
>     Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 "
> ! 2892 MAIN_ARRAY(175) ASize( NIL, 0 )                         
>       Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:2:U:NIL;N:0 "
>     Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 "
> ! 2893 MAIN_ARRAY(176) ASize( NIL, 1 )                         
>       Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:2:U:NIL;N:1 "
>     Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 "
> ! 2894 MAIN_ARRAY(177) ASize( NIL, -1 )                        
>       Result: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 A:2:U:NIL;N:-1 "
>     Expected: "E 1 BASE 2023 Argument error (ASIZE) OS:0 #:0 "
> ! 2916 MAIN_ARRAY(214) Array( -1 )                             
>       Result: "E 2 BASE 1131 Bound error (array dimension) OS:0 #:0 A:1:N:-1 "
>     Expected: "E 2 BASE 1131 Bound error (array dimension) OS:0 #:0 "
> ! 2917 MAIN_ARRAY(215) Array( 1, 0, -10 )                      
>       Result: "E 2 BASE 1131 Bound error (array dimension) OS:0 #:0 
> A:3:N:1;N:0;N:-10 "
>     Expected: "E 2 BASE 1131 Bound error (array dimension) OS:0 #:0 "
> ! 3056 MAIN_ARRAY(395) TAEVSM()                                
>       Result: "N10N 9N 8N 7N 6         5"
>     Expected: "N10N 9N 8N 7N 6N 5N 4N 3N 2N 1         0"
> ! 3057 MAIN_ARRAY(396) TASOSM1()                               
>       Result: "NN 5NN 4NN 3NN 2         1{ 3 }"
>     Expected: "NN 5NN 4NN 3NN 2NN 1NN 0NN 0NN 0NN 0NN 0NN 0NN 0         0{  }"
> ! 3058 MAIN_ARRAY(397) TASOSM2()                               
>       Result: "NN 5NN 4NN 3NN 2         1{ 3 }"
>     Expected: "NN 5NN 4NN 3NN 2NN 1NN 0NN 0NN 0NN 0NN 0         0{  }"
> ! 3178 MAIN_MISC(94)   Set( 40  )                              
>       Result: 0
>     Expected: NIL
> ! 3187 MAIN_MISC(104)  Set( 40 , -1 )                          
>       Result: 0
>     Expected: NIL
> ===========================================================================
> Test calls passed:       4743 ( 99.62 % )
> Test calls failed:         18 ( 0.38 % )
>                   ----------
>            Total:       4761 ( Time elapsed: 0.35 seconds )
> 
> WARNING ! Failures detected
> 
> -- 
> [-]
> 
> mkdir /nonexistent<dfly.diff>_______________________________________________
> Harbour mailing list (attachment size limit: 40KB)
> Harbour@harbour-project.org
> http://lists.harbour-project.org/mailman/listinfo/harbour

_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to