[Packages] liboil: Fix compilation
[openwrt/svn-archive/archive.git] / libs / liboil / Makefile
1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id:$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=liboil
12 PKG_VERSION:=0.3.12
13 PKG_RELEASE:=1
14
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=http://liboil.freedesktop.org/download/
17 PKG_MD5SUM:=96ee4c627ffb0db3999cef3c7454b1d9
18
19 include $(INCLUDE_DIR)/package.mk
20
21 define Package/liboil
22 SECTION:=libs
23 CATEGORY:=Libraries
24 DEPENDS:=+libnotimpl
25 TITLE:=simple functions optimized for various CPUs
26 URL:=http://liboil.freedesktop.org/wiki/
27 endef
28
29 define Package/liboil/description
30 Liboil is a library of simple functions that are optimized for various CPUs.
31 These functions are generally loops implementing simple algorithms, such as
32 converting an array of N integers to floating-point numbers or multiplying
33 and summing an array of N numbers. Such functions are candidates for significant
34 optimization using various techniques, especially by using extended instructions
35 provided by modern CPUs (Altivec, MMX, SSE, etc.).
36 endef
37
38 CONFIGURE_ARGS += \
39 --enable-shared \
40 --enable-static \
41
42 CONFIGURE_VARS += \
43 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libiconv/include" \
44 CPPFLAGS="$$$$CPPFLAGS -I$(STAGING_DIR)/usr/lib/libintl/include" \
45 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libiconv/lib" \
46 LDFLAGS="$$$$LDFLAGS -L$(STAGING_DIR)/usr/lib/libintl/lib" \
47 LIBS="-lnotimpl" \
48 ac_cv_lib_m_rintf=no \
49
50 define Build/Configure
51 $(call Build/Configure/Default)
52 $(call libtool_disable_rpath)
53 endef
54
55 define Build/Compile
56 $(MAKE) -C $(PKG_BUILD_DIR) all
57 $(call libtool_fixup_libdir,$(PKG_INSTALL_DIR))
58 $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" install
59 endef
60
61 define Build/InstallDev
62 mkdir -p $(1)/usr/include
63 $(CP) $(PKG_INSTALL_DIR)/usr/include/liboil-0.3/ $(1)/usr/include/
64 mkdir -p $(1)/usr/lib
65 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboil-0.3.{a,so*} $(1)/usr/lib/
66 mkdir -p $(1)/usr/lib/pkgconfig
67 $(CP) $(PKG_BUILD_DIR)/liboil.pc $(1)/usr/lib/pkgconfig/
68 $(SED) 's,$(TARGET_LDFLAGS),,g' $(1)/usr/lib/pkgconfig/liboil.pc
69 endef
70
71 define Build/UninstallDev
72 rm -rf $(STAGING_DIR)/usr/include/liboil-0.3 \
73 $(STAGING_DIR)/usr/lib/liboil-0.3.{a,so*} \
74 $(STAGING_DIR)/usr/lib/pkgconfig/liboil.pc
75 endef
76
77 define Package/liboil/install
78 $(INSTALL_DIR) $(1)/usr/lib
79 $(CP) $(PKG_INSTALL_DIR)/usr/lib/liboil-0.3.so* $(1)/usr/lib/
80 endef
81
82 $(eval $(call BuildPackage,liboil))