Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Apr 2012 20:08:05 -0700
From:      "David O'Brien" <obrien@freebsd.org>
To:        Jan Sieka <jps@semihalf.com>
Cc:        Garrett Cooper <yanegomi@gmail.com>, Current FreeBSD <freebsd-current@freebsd.org>, Dimitry Andric <dim@freebsd.org>, Doug Barton <dougb@freebsd.org>
Subject:   Re: [workaroud/fix for] buildworld fails on FreeBSD 7.x for HEAD from 19.04.2012
Message-ID:  <20120428030805.GD80419@dragon.NUXI.org>
In-Reply-To: <4F9A8B91.6060005@semihalf.com>
References:  <4F915384.6070308@semihalf.com> <4F919C50.70809@FreeBSD.org> <9B9312D3-489E-4EF1-85CB-0353024F6B94@gmail.com> <4F9428ED.6060902@FreeBSD.org> <3862F1CA-C1C8-49E6-B768-114A0A212496@gmail.com> <4F944139.4070309@FreeBSD.org> <D5342A23-878F-4F48-8E8A-41203B0FF918@gmail.com> <4F9A8B91.6060005@semihalf.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 27, 2012 at 02:05:37PM +0200, Jan Sieka wrote:
> --- a/lib/libmagic/Makefile
> +++ b/lib/libmagic/Makefile
> @@ -10,9 +10,16 @@ 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@FreeBSD.org)



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