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  (obr...@freebsd.org)
_______________________________________________
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to