diff mbox

freetype: fix includedir

Message ID 1371094112-7523-1-git-send-email-gustavo@zacarias.com.ar
State Superseded
Headers show

Commit Message

Gustavo Zacarias June 13, 2013, 3:28 a.m. UTC
Set includedir to point to staging because freetype-config and
freetype2.pc otherwise point to /usr/include causing all kind of havoc
because it expands configure --prefix now instead of using the
.pc/-config one.

Fixes:
http://autobuild.buildroot.net/results/1c7/1c70ce0ff350623cc38baf4b8b61c8a7a8586aba/
...and many others.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
---
 package/freetype/freetype.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Arnout Vandecappelle June 13, 2013, 6:08 a.m. UTC | #1
On 13/06/13 05:28, Gustavo Zacarias wrote:
> Set includedir to point to staging because freetype-config and
> freetype2.pc otherwise point to /usr/include causing all kind of havoc
> because it expands configure --prefix now instead of using the
> .pc/-config one.

  I think this is the wrong fix.

  The FREETYPE_CONFIG_SCRIPTS approach doesn't work in this case because 
this script doesn't use ${prefix} in front of it's includedir. I think 
the better fix is to use a custom POST_INSTALL_STAGING_HOOK that sets 
SYSROOT=$(STAGING_DIR) at the beginning of the script.

  The .pc file should be handled by our modified pkg-config.

  Regards,
  Arnout

>
> Fixes:
> http://autobuild.buildroot.net/results/1c7/1c70ce0ff350623cc38baf4b8b61c8a7a8586aba/
> ...and many others.
>
> Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
> ---
>   package/freetype/freetype.mk | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/package/freetype/freetype.mk b/package/freetype/freetype.mk
> index 16f00fe..4ea678b 100644
> --- a/package/freetype/freetype.mk
> +++ b/package/freetype/freetype.mk
> @@ -9,6 +9,7 @@ FREETYPE_SOURCE = freetype-$(FREETYPE_VERSION).tar.bz2
>   FREETYPE_SITE = http://downloads.sourceforge.net/project/freetype/freetype2/$(FREETYPE_VERSION)
>   FREETYPE_INSTALL_STAGING = YES
>   FREETYPE_MAKE_OPT = CCexe="$(HOSTCC)"
> +FREETYPE_CONF_OPT = --includedir="$(STAGING_DIR)/usr/include"
>   FREETYPE_LICENSE = Dual FTL/GPLv2+
>   FREETYPE_LICENSE_FILES = docs/FTL.TXT docs/GPLv2.TXT
>   FREETYPE_DEPENDENCIES = host-pkgconf \
>
Gustavo Zacarias June 13, 2013, 10:28 a.m. UTC | #2
On 06/13/2013 03:08 AM, Arnout Vandecappelle wrote:
>  I think this is the wrong fix.
> 
>  The FREETYPE_CONFIG_SCRIPTS approach doesn't work in this case because
> this script doesn't use ${prefix} in front of it's includedir. I think
> the better fix is to use a custom POST_INSTALL_STAGING_HOOK that sets
> SYSROOT=$(STAGING_DIR) at the beginning of the script.
> 
>  The .pc file should be handled by our modified pkg-config.
> 
>  Regards,
>  Arnout

I've actually mentioned the pkgconfig file because of late fixing /
killing time, so as you said it really doesn't matter, it's handled
elsewhere.
Setting SYSROOT at the beginning of the script is wrong too IMHO, it's
very unconventional, we should just revert it back to the tried and
tested way that every other -config script works fine with:

includedir="${prefix}/include"
libdir="${exec_prefix}/lib"

I'll spin a V2.
Regards.
Sagaert Johan June 13, 2013, 12:25 p.m. UTC | #3
Hi 

Just saw that it will be fixed.

I bumped into the error while building mplayer

>>> mplayer 1.1 Building
/usr/bin/make -j5 -C /home/buildroot12git/output/build/mplayer-1.1
make[1]: Entering directory `/home/buildroot12git/output/build/mplayer-1.1'
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o command.o
command.c
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o mplayer.o
mplayer.c
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o pnm_loader.o
pnm_loader.c
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o input/input.o
input/input.c
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o
libao2/ao_mpegpes.o libao2/ao_mpegpes.c
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o libao2/ao_null.o
libao2/ao_null.c
/home/buildroot12git/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabi-gcc -MD -MP -Wundef  -Wstrict-prototypes
-Wmissing-prototypes -Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement -std=gnu99  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -pipe -Os  -fno-tree-vectorize -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-D_LARGEFILE64_SOURCE -I. -Iffmpeg -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mfpu=neon -mfloat-abi=softfp -marm    -I/usr/include/freetype2 -c -o libao2/ao_pcm.o
libao2/ao_pcm.c
In file included from ./libmpdemux/aviheader.h:26:0,
                 from ./libmpdemux/stheader.h:23,
                 from gui/interface.h:24,
                 from mplayer.c:74:
./mpbswap.h:26:0: warning: "bswap_16" redefined [enabled by default]In file included from libmpdemux/aviheader.h:26:0,
                 from libmpdemux/stheader.h:23,
                 from command.c:29:
./mpbswap.h:26:0: warning: "bswap_16" redefined [enabled by default]

/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/byteswap.h:30:0: note: this is the
location of the previous
definition/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/byteswap.h:30:0: note: this is
the location of the previous definition

./mpbswap.h:27:0: warning: "bswap_32" redefined [enabled by default]./mpbswap.h:27:0: warning: "bswap_32" redefined [enabled by
default]

/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/byteswap.h:33:0: note: this is the
location of the previous
definition/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/byteswap.h:33:0: note: this is
the location of the previous definition

In file included from sub/font_load.h:25:0,
                 from mplayer.c:87:
/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/ft2build.h:56:38: fatal error:
freetype/config/ftheader.h: No such file or directory
compilation terminated.
make[1]: *** [mplayer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from libao2/ao_pcm.c:28:0:
./mpbswap.h:26:0: warning: "bswap_16" redefined [enabled by default]
/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/byteswap.h:30:0: note: this is the
location of the previous definition
./mpbswap.h:27:0: warning: "bswap_32" redefined [enabled by default]
/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/byteswap.h:33:0: note: this is the
location of the previous definition
In file included from sub/font_load.h:25:0,
                 from command.c:41:
/home/buildroot12git/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/include/ft2build.h:56:38: fatal error:
freetype/config/ftheader.h: No such file or directory
compilation terminated.
make[1]: *** [command.o] Error 1
make[1]: Leaving directory `/home/buildroot12git/output/build/mplayer-1.1'
make: *** [/home/buildroot12git/output/build/mplayer-1.1/.stamp_built] Error 2

Regards , Johan


-----Oorspronkelijk bericht-----
Van: buildroot-bounces@busybox.net [mailto:buildroot-bounces@busybox.net] Namens Gustavo Zacarias
Verzonden: donderdag 13 juni 2013 12:28
Aan: Arnout Vandecappelle
CC: buildroot@busybox.net
Onderwerp: Re: [Buildroot] [PATCH] freetype: fix includedir

On 06/13/2013 03:08 AM, Arnout Vandecappelle wrote:
>  I think this is the wrong fix.
> 
>  The FREETYPE_CONFIG_SCRIPTS approach doesn't work in this case 
> because this script doesn't use ${prefix} in front of it's includedir. 
> I think the better fix is to use a custom POST_INSTALL_STAGING_HOOK 
> that sets
> SYSROOT=$(STAGING_DIR) at the beginning of the script.
> 
>  The .pc file should be handled by our modified pkg-config.
> 
>  Regards,
>  Arnout

I've actually mentioned the pkgconfig file because of late fixing / killing time, so as you said it really doesn't matter, it's
handled elsewhere.
Setting SYSROOT at the beginning of the script is wrong too IMHO, it's very unconventional, we should just revert it back to the
tried and tested way that every other -config script works fine with:

includedir="${prefix}/include"
libdir="${exec_prefix}/lib"

I'll spin a V2.
Regards.
diff mbox

Patch

diff --git a/package/freetype/freetype.mk b/package/freetype/freetype.mk
index 16f00fe..4ea678b 100644
--- a/package/freetype/freetype.mk
+++ b/package/freetype/freetype.mk
@@ -9,6 +9,7 @@  FREETYPE_SOURCE = freetype-$(FREETYPE_VERSION).tar.bz2
 FREETYPE_SITE = http://downloads.sourceforge.net/project/freetype/freetype2/$(FREETYPE_VERSION)
 FREETYPE_INSTALL_STAGING = YES
 FREETYPE_MAKE_OPT = CCexe="$(HOSTCC)"
+FREETYPE_CONF_OPT = --includedir="$(STAGING_DIR)/usr/include"
 FREETYPE_LICENSE = Dual FTL/GPLv2+
 FREETYPE_LICENSE_FILES = docs/FTL.TXT docs/GPLv2.TXT
 FREETYPE_DEPENDENCIES = host-pkgconf \