Re: [workaroud/fix for] buildworld fails on FreeBSD 7.x for HEAD from 19.04.2012

From: David O'Brien <obrien_at_freebsd.org>
Date: Fri, 27 Apr 2012 20:08:05 -0700
On Fri, Apr 27, 2012 at 02:05:37PM +0200, Jan Sieka wrote:
> --- a/lib/libmagic/Makefile
> +++ b/lib/libmagic/Makefile
> _at__at_ -10,9 +10,16 _at__at_ DPADD=	${LIBZ}
>  LDADD=	-lz
>  MAN=	libmagic.3 magic.5
>  
> +HOSTOSRELDATE!=	echo ${VERSION} | cut -d " " -f 4

    $ cd lib/libmagic
    $ make -V VERSION
    {empty}

Where is VERSION set?


> +.if ${HOSTOSRELDATE} < 800000
> +GETLINE_C=	getline.c
> +.else
> +GETLINE_C=
> +.endif
>  SRCS=	apprentice.c apptype.c ascmagic.c cdf.c cdf_time.c compress.c \
>  	encoding.c fsmagic.c funcs.c \
> -	is_tar.c magic.c print.c readcdf.c readelf.c softmagic.c
> +	is_tar.c magic.c print.c readcdf.c readelf.c softmagic.c ${GETLINE_C}

Just 
    .if ${HOSTOSRELDATE} < 800000
    GETLINE_C=	getline.c
    .endif
is shorter.

Also r189136 (which added getline(3)) bumped __FreeBSD_version from
800066 to 800067.  So your patch is broken for some systems.  Getting
this right is one reason I'm loath to carry around this type of hack
in -CURRENT.


> --- a/lib/libmagic/config.h
> +++ b/lib/libmagic/config.h
>  /* Define to 1 if you have the `getline' function. */
> -#define HAVE_GETLINE 1
> +#if (__FreeBSD_version >= 800000)

Where is "__FreeBSD_version" getting set?

> +#else
> +#define	HAVE_GETLINE 0
> +#endif

You've basically defined HAVE_GETLINE always as "0".

-- 
-- David  (obrien_at_FreeBSD.org)
Received on Sat Apr 28 2012 - 01:08:11 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:26 UTC