libcaca: assume & handle newly POSIX style endian.h (decision in 2011) Provide fallback definition that acts the same as the old code that existed. Add test target. Fixes build failure reported by John D Baker in pkgsrc-usersdiff -r1.35 -r1.36 pkgsrc/graphics/libcaca/Makefile
(maya)
@@ -1,26 +1,27 @@ | @@ -1,26 +1,27 @@ | |||
1 | # $NetBSD: Makefile,v 1.35 2016/02/25 13:37:47 jperkin Exp $ | 1 | # $NetBSD: Makefile,v 1.36 2017/12/03 03:57:31 maya Exp $ | |
2 | 2 | |||
3 | DISTNAME= libcaca-0.99.beta18 | 3 | DISTNAME= libcaca-0.99.beta18 | |
4 | PKGNAME= ${DISTNAME:S/beta//} | 4 | PKGNAME= ${DISTNAME:S/beta//} | |
5 | PKGREVISION= 2 | 5 | PKGREVISION= 2 | |
6 | CATEGORIES= graphics | 6 | CATEGORIES= graphics | |
7 | MASTER_SITES= http://caca.zoy.org/files/libcaca/ | 7 | MASTER_SITES= http://caca.zoy.org/files/libcaca/ | |
8 | 8 | |||
9 | MAINTAINER= pkgsrc-users@NetBSD.org | 9 | MAINTAINER= pkgsrc-users@NetBSD.org | |
10 | HOMEPAGE= http://caca.zoy.org/ | 10 | HOMEPAGE= http://caca.zoy.org/ | |
11 | COMMENT= Graphics library that outputs text instead of pixels, in colour | 11 | COMMENT= Graphics library that outputs text instead of pixels, in colour | |
12 | # LICENSE= wtfpl | 12 | # LICENSE= wtfpl | |
13 | 13 | |||
14 | TEST_TARGET= check | |||
14 | USE_LIBTOOL= yes | 15 | USE_LIBTOOL= yes | |
15 | USE_LANGUAGES= c c++ | 16 | USE_LANGUAGES= c c++ | |
16 | USE_TOOLS+= pkg-config | 17 | USE_TOOLS+= pkg-config | |
17 | USE_PKGLOCALEDIR= yes | 18 | USE_PKGLOCALEDIR= yes | |
18 | GNU_CONFIGURE= yes | 19 | GNU_CONFIGURE= yes | |
19 | PKGCONFIG_OVERRIDE+= caca/caca.pc.in | 20 | PKGCONFIG_OVERRIDE+= caca/caca.pc.in | |
20 | 21 | |||
21 | CHECK_FILES_SKIP+= ${PREFIX}/lib/libcucul.* | 22 | CHECK_FILES_SKIP+= ${PREFIX}/lib/libcucul.* | |
22 | 23 | |||
23 | CONFIG_GUESS_OVERRIDE+= .auto/config.guess | 24 | CONFIG_GUESS_OVERRIDE+= .auto/config.guess | |
24 | CONFIG_SUB_OVERRIDE+= .auto/config.sub | 25 | CONFIG_SUB_OVERRIDE+= .auto/config.sub | |
25 | 26 | |||
26 | .include "options.mk" | 27 | .include "options.mk" |
@@ -1,7 +1,9 @@ | @@ -1,7 +1,9 @@ | |||
1 | $NetBSD: distinfo,v 1.8 2015/11/03 21:34:07 agc Exp $ | 1 | $NetBSD: distinfo,v 1.9 2017/12/03 03:57:31 maya Exp $ | |
2 | 2 | |||
3 | SHA1 (libcaca-0.99.beta18.tar.gz) = 0cbf8075c01d59b53c3cdfec7df9818696a41128 | 3 | SHA1 (libcaca-0.99.beta18.tar.gz) = 0cbf8075c01d59b53c3cdfec7df9818696a41128 | |
4 | RMD160 (libcaca-0.99.beta18.tar.gz) = e7fe45bce798926789e48662038f1eb3ad2bece1 | 4 | RMD160 (libcaca-0.99.beta18.tar.gz) = e7fe45bce798926789e48662038f1eb3ad2bece1 | |
5 | SHA512 (libcaca-0.99.beta18.tar.gz) = b2a8264ec36b74a01ff415a1fd7cb1806c76e28795b73607d4f8fa5ed5cc776b215f2817f45f06c672688f010622ee5c5e2f9dc4d0c43417dedbff545d575ca5 | 5 | SHA512 (libcaca-0.99.beta18.tar.gz) = b2a8264ec36b74a01ff415a1fd7cb1806c76e28795b73607d4f8fa5ed5cc776b215f2817f45f06c672688f010622ee5c5e2f9dc4d0c43417dedbff545d575ca5 | |
6 | Size (libcaca-0.99.beta18.tar.gz) = 1168552 bytes | 6 | Size (libcaca-0.99.beta18.tar.gz) = 1168552 bytes | |
7 | SHA1 (patch-caca_caca.h) = 758527c49aa6f27eb82fa645bd80e8a87f4f4b96 | 7 | SHA1 (patch-caca_caca.h) = 758527c49aa6f27eb82fa645bd80e8a87f4f4b96 | |
8 | SHA1 (patch-caca_dither.c) = d2285e75eaec09840c38c2c54ce5e942d0a2e820 | |||
9 | SHA1 (patch-examples_font.c) = cc3e32a41c941e2c11a380e4e811ac4ba8b14f1d |
$NetBSD: patch-caca_dither.c,v 1.1 2017/12/03 03:57:31 maya Exp $
Assume POSIX style endian.h (POSIX introduced this in 2011)
Provide fallback definitions for the older code that has existed before.
--- caca/dither.c.orig 2010-02-15 23:45:36.000000000 +0000
+++ caca/dither.c
@@ -19,6 +19,12 @@
#if !defined(__KERNEL__)
# if defined(HAVE_ENDIAN_H)
# include <endian.h>
+# ifndef BYTE_ORDER
+# define BYTE_ORDER __BYTE_ORDER
+# endif
+# ifndef BIG_ENDIAN
+# define BIG_ENDIAN __BIG_ENDIAN
+# endif
# endif
# include <stdio.h>
# include <stdlib.h>
@@ -1324,7 +1330,7 @@ static void get_rgba_default(caca_dither
case 3:
{
#if defined(HAVE_ENDIAN_H)
- if(__BYTE_ORDER == __BIG_ENDIAN)
+ if(BYTE_ORDER == BIG_ENDIAN)
#else
/* This is compile-time optimised with at least -O1 or -Os */
uint32_t const tmp = 0x12345678;
$NetBSD: patch-examples_font.c,v 1.1 2017/12/03 03:57:31 maya Exp $
Assume POSIX style endian.h (POSIX introduced this in 2011)
Provide fallback definitions for the older code that has existed before.
--- examples/font.c.orig 2010-02-15 23:40:44.000000000 +0000
+++ examples/font.c
@@ -15,8 +15,13 @@
#if !defined(__KERNEL__)
# if defined(HAVE_ENDIAN_H)
# include <endian.h>
+# ifndef BYTE_ORDER
+# define BYTE_ORDER __BYTE_ORDER
+# endif
+# ifndef BIG_ENDIAN
+# define BIG_ENDIAN __BIG_ENDIAN
+# endif
# endif
-
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -79,7 +84,7 @@ int main(int argc, char *argv[])
{
#if defined(HAVE_ENDIAN_H)
- if(__BYTE_ORDER == __BIG_ENDIAN)
+ if(BYTE_ORDER == BIG_ENDIAN)
#else
/* This is compile-time optimised with at least -O1 or -Os */
uint32_t const tmp = 0x12345678;