kumquat-buildroot/package/netsurf/netsurf.mk
Peter Korsgaard 6da049f8ae package/netsurf: fix build
Fixes:
http://autobuild.buildroot.net/results/a5b/a5bd8969c398fc3101ffaec4aa715a827aec5770/
http://autobuild.buildroot.net/results/441/44112e8ad03f47125bbf4b231d800ebd5beef24b/

After commit 122089ad (package/netsurf: use TMP_PREFIX inside the build
directory), the build fails with:

 COMPILE: src/stylesheet.c
In file included from src/stylesheet.c:12:0:
src/stylesheet.h:14:39: fatal error: libwapcaplet/libwapcaplet.h: No such file or directory
 #include <libwapcaplet/libwapcaplet.h>

The reason is that netsurf installs its internal libraries to TMP_PREFIX
during the build, and uses pkg-config to add the correct include/linker
flags when building/linking the rest.  Unfortunately this fails badly, as we
prefix STAGING_DIR to the paths returned by pkg-config, causing gcc to fail
to find the header / library files.

This worked (by accident) when we pointed TMP_PREFIX to STAGING_DIR/usr, as
STAGING_DIR/usr/include and STAGING_DIR/usr/lib are in the standard
include/library search paths.

Fix it by adding TMP_PREFIX/include and TMP_PREFIX/lib to the
include/library search paths.  We cannot easily add them to CFLAGS/LDFLAGS
as the makefiles do not use override when appending to them, so instead pass
both in CC (which is also used for linking).

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2019-02-05 13:17:44 +01:00

97 lines
2.7 KiB
Makefile

################################################################################
#
# netsurf
#
################################################################################
NETSURF_VERSION = 3.8
NETSURF_SOURCE = netsurf-all-$(NETSURF_VERSION).tar.gz
NETSURF_SITE = http://download.netsurf-browser.org/netsurf/releases/source-full
NETSURF_LICENSE = GPL-2.0
NETSURF_LICENSE_FILES = netsurf/COPYING
NETSURF_DEPENDENCIES = expat jpeg libpng \
host-bison host-flex host-gperf host-pkgconf
ifeq ($(BR2_PACKAGE_NETSURF_GTK),y)
NETSURF_DEPENDENCIES += libgtk2
NETSURF_FRONTEND = gtk
endif
ifeq ($(BR2_PACKAGE_NETSURF_GTK3),y)
NETSURF_DEPENDENCIES += libgtk3
NETSURF_FRONTEND = gtk3
endif
ifeq ($(BR2_PACKAGE_NETSURF_GTK)$(BR2_PACKAGE_NETSURF_GTK3),y)
ifeq ($(BR2_PACKAGE_LIBRSVG),y)
NETSURF_DEPENDENCIES += librsvg
define NETSURF_SVG_CONFIGURE_CMDS
echo "override NETSURF_USE_RSVG := YES" >> $(@D)/netsurf/Makefile.config
echo "override NETSURF_USE_NSSVG := NO" >> $(@D)/netsurf/Makefile.config
endef
endif
endif
ifeq ($(BR2_PACKAGE_NETSURF_SDL),y)
NETSURF_DEPENDENCIES += sdl host-libpng
NETSURF_FRONTEND = framebuffer
NETSURF_CONFIG = \
HOST_CFLAGS='$(HOST_CFLAGS)' \
HOST_LDFLAGS='$(HOST_LDFLAGS) -lpng'
ifeq ($(BR2_PACKAGE_FREETYPE),y)
NETSURF_DEPENDENCIES += freetype
define NETSURF_FONTLIB_CONFIGURE_CMDS
echo "override NETSURF_FB_FONTLIB := freetype" >> $(@D)/netsurf/Makefile.config
endef
endif
endif
ifeq ($(BR2_PACKAGE_LIBICONV),y)
NETSURF_DEPENDENCIES += libiconv
define NETSURF_ICONV_CONFIGURE_CMDS
echo "CFLAGS += -DWITH_ICONV_FILTER" >> $(@D)/libparserutils/Makefile.config.override
echo "override NETSURF_USE_LIBICONV_PLUG := NO" >> $(@D)/netsurf/Makefile.config
endef
endif
ifeq ($(BR2_PACKAGE_LIBCURL),y)
NETSURF_DEPENDENCIES += libcurl openssl
else
define NETSURF_CURL_CONFIGURE_CMDS
echo "override NETSURF_USE_CURL := NO" >> $(@D)/netsurf/Makefile.config
echo "override NETSURF_USE_OPENSSL := NO" >> $(@D)/netsurf/Makefile.config
endef
endif
define NETSURF_CONFIGURE_CMDS
$(NETSURF_ICONV_CONFIGURE_CMDS)
$(NETSURF_SVG_CONFIGURE_CMDS)
$(NETSURF_FONTLIB_CONFIGURE_CMDS)
$(NETSURF_CURL_CONFIGURE_CMDS)
endef
NETSURF_MAKE_OPTS = \
TARGET=$(NETSURF_FRONTEND) \
BISON="$(HOST_DIR)/bin/bison" \
FLEX="$(HOST_DIR)/bin/flex" \
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
BUILD_CC="$(HOSTCC)" \
CC="$(TARGET_CC) -I$(@D)/tmpusr/include -L$(@D)/tmpusr/lib" \
AR="$(TARGET_AR)" \
TMP_PREFIX=$(@D)/tmpusr \
NETSURF_CONFIG="$(NETSURF_CONFIG)" \
PREFIX=/usr
define NETSURF_BUILD_CMDS
mkdir -p $(@D)/tmpusr
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(NETSURF_MAKE_OPTS) \
build
endef
define NETSURF_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(NETSURF_MAKE_OPTS) \
DESTDIR=$(TARGET_DIR) install
endef
$(eval $(generic-package))