Hi all,

I am trying to bootstrap the latest source snapshot on a RHEL system:

> > ggreif@mine [!138] uname -a
> > Linux mine 2.6.18-274.7.1.el5 #1 SMP Mon Oct 17 11:57:14 EDT 2011 x86_64 
> > x86_64 x86_64 GNU/Linux


causes compilation error when building base lib with a stage1 compiler:

> > "inplace/bin/ghc-stage1" -prof  -H32m -O    -package-name base-4.5.0.0 
> > -hide-all-packages -i -ilibraries/base/. 
> > -ilibraries/base/dist-install/build 
> > -ilibraries/base/dist-install/build/autogen 
> > -Ilibraries/base/dist-install/build 
> > -Ilibraries/base/dist-install/build/autogen -Ilibraries/base/include   
> > -optP-DOPTIMISE_INTEGER_GCD_LCM -optP-include 
> > -optPlibraries/base/dist-install/build/autogen/cabal_macros.h -package 
> > ghc-prim-0.2.0.0 -package integer-gmp-0.4.0.0 -package rts-1.0 -split-objs 
> > -package-name base -XHaskell98 -XCPP -O2  -no-user-package-conf -rtsopts    
> >  -odir libraries/base/dist-install/build -hidir 
> > libraries/base/dist-install/build -stubdir 
> > libraries/base/dist-install/build -hisuf p_hi -osuf  p_o -hcsuf p_hc -c 
> > libraries/base/./Foreign/C/Types.hs -o 
> > libraries/base/dist-install/build/Foreign/C/Types.p_o
> >
> > libraries/base/Foreign/C/Types.hs:210:31:
> >     Not in scope: type constructor or class `HTYPE_USECONDS_T'
> >
> > libraries/base/Foreign/C/Types.hs:210:189:
> >     Not in scope: type constructor or class `HTYPE_USECONDS_T'
> >
> > libraries/base/Foreign/C/Types.hs:210:269:
> >     Not in scope: type constructor or class `HTYPE_USECONDS_T'
> >
> > libraries/base/Foreign/C/Types.hs:210:385:
> >     Not in scope: type constructor or class `HTYPE_USECONDS_T'
> >
> > libraries/base/Foreign/C/Types.hs:210:462:
> >     Not in scope: type constructor or class `HTYPE_USECONDS_T'
> >
> > libraries/base/Foreign/C/Types.hs:210:545:
> >     Not in scope: type constructor or class `HTYPE_USECONDS_T'

looking at configury:

> > ./libraries/base/config.log:configure:12452: checking Haskell type for 
> > suseconds_t
> > ./libraries/base/config.log:fptools_cv_htype_sup_suseconds_t=yes
> > ./libraries/base/config.log:fptools_cv_htype_sup_useconds_t=no
> > ./libraries/base/config.log:fptools_cv_htype_suseconds_t=Int64
> > ./libraries/base/config.log:fptools_cv_htype_useconds_t=NotReallyAType

these checks end up in

> > ggreif@mine [!129] find . -name "*.h" | xargs grep useconds_t
> > ./libraries/base/include/HsBaseConfig.h:/* Define to Haskell type for 
> > suseconds_t */
> > ./libraries/base/include/HsBaseConfig.h:/* Define to Haskell type for 
> > useconds_t */

but without a #define for HTYPE_USECONDS_T!

So I edited the Foreign/C/Types.hs file to read

> > ggreif@mine [!127] xemacs +210 libraries/base/Foreign/C/Types.hs


-- | Haskell type representing the C @clock_t@ type.
ARITHMETIC_TYPE(CClock,tyConCClock,"CClock",HTYPE_CLOCK_T)
-- | Haskell type representing the C @time_t@ type.
ARITHMETIC_TYPE(CTime,tyConCTime,"CTime",HTYPE_TIME_T)
#ifdef HTYPE_USECONDS_T
-- | Haskell type representing the C @useconds_t@ type.
ARITHMETIC_TYPE(CUSeconds,tyConCUSeconds,"CUSeconds",HTYPE_USECONDS_T)
#elif defined(HTYPE_SUSECONDS_T)
ARITHMETIC_TYPE(CUSeconds,tyConCUSeconds,"CUSeconds",HTYPE_SUSECONDS_T)
#endif
#ifdef HTYPE_SUSECONDS_T
-- | Haskell type representing the C @suseconds_t@ type.
ARITHMETIC_TYPE(CSUSeconds,tyConCSUSeconds,"CSUSeconds",HTYPE_SUSECONDS_T)
#elif defined(HTYPE_USECONDS_T)
ARITHMETIC_TYPE(CSUSeconds,tyConCSUSeconds,"CSUSeconds",HTYPE_USECONDS_T)
#endif

The strategy is to offer the opposite signed type when either one is missing.

Does this make sense and should it be included into the next v7.4 snapshot
(as well as mainline)? The 7.2 branch could also get this change...

Cheers,

        Gabor

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to