packages/libs/glib2/Makefile
Jo-Philipp Wich 767e5bbd9c glib2: fix missing gobject library when linking glib-compile-resources (#826)
The automake template does not specify libgobject-2.0.la as _LDADD dependency
for glib-compile-resources, leading to the following linker error:

  .../ld: warning: libgmodule-2.0.so.0, needed by ./.libs/libgio-2.0.so, not found (try using -rpath or -rpath-link)
  ./.libs/libgio-2.0.so: undefined reference to `g_module_supported'
  ./.libs/libgio-2.0.so: undefined reference to `g_module_symbol'
  ./.libs/libgio-2.0.so: undefined reference to `g_module_close'
  ./.libs/libgio-2.0.so: undefined reference to `g_module_error'
  ./.libs/libgio-2.0.so: undefined reference to `g_module_open'
  collect2: error: ld returned 1 exit status

This commit introduces a patch to add the missing libtool archive to the list
of libraries to link.

Due to the update of the .am file, a full autoreconf is required to update
configure and Makefile, leading to the following error:

  error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL

Therfore another patch is added to properly fix the conditional when using
automake-1.15.

Finally extend the copyright year in the Makefile and enable the generic
autoreconf fixup to properly build and link glib2.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-01-27 22:43:55 +01:00

104 lines
2.3 KiB
Makefile

#
# Copyright (C) 2007-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=glib2
PKG_VERSION:=2.43.3
PKG_RELEASE:=1
PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
PKG_SOURCE_URL:=@GNOME/glib/2.43
PKG_MD5SUM:=2727c4dee79c5449f364cd5e27b17099
PKG_BUILD_DEPENDS:=glib2/host libpthread zlib libintl libffi
HOST_BUILD_DEPENDS:=libintl/host libiconv/host libffi/host
PKG_INSTALL:=1
PKG_USE_MIPS16:=0
PKG_FIXUP:=autoreconf
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
define Package/glib2
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) +zlib +libpthread +libffi +libattr
TITLE:=glib 2.0
MAINTAINER:=Peter Wagner <tripolar@gmx.at>
URL:=http://www.gtk.org/
endef
define Package/glib2/description
The GLib library of C routines
endef
HOST_CONFIGURE_ARGS += \
--disable-selinux
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
--enable-debug=no \
--disable-selinux \
--disable-fam \
$(if $(ICONV_FULL),--with-libiconv=gnu)
CONFIGURE_VARS += \
glib_cv_stack_grows=no \
glib_cv_uscore=no \
ac_cv_path_GLIB_GENMARSHAL=$(STAGING_DIR_HOST)/bin/glib-genmarshal \
ac_cv_func_mmap_fixed_mapped=yes \
ac_cv_func_posix_getpwuid_r=yes \
ac_cv_func_posix_getgrgid_r=yes
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
$(1)/usr/include/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
$(1)/usr/include/glib-2.0/
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
$(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
$(1)/usr/lib/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
$(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
$(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(2)/share/aclocal/
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
$(2)/share/aclocal/
endef
define Package/glib2/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/*.so* \
$(1)/usr/lib/
endef
$(eval $(call HostBuild))
$(eval $(call BuildPackage,glib2))