Install js-config to $(STAGING_DIR)/host/bin rather then
[openwrt/svn-archive/archive.git] / libs / ossp-js / Makefile
index 3110c3d..bb289d3 100644 (file)
@@ -15,12 +15,12 @@ PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=ftp://ftp.ossp.org/pkg/lib/js/
 PKG_MD5SUM:=07f6cad7e03fd74a949588c3d4b333de
-
-PKG_BUILD_DEPENDS:= libreadline
-PKG_FIXUP = libtool
+PKG_FIXUP:=libtool
 
 include $(INCLUDE_DIR)/package.mk
 
+PKG_INSTALL=1
+
 define Package/js/Default
  TITLE:=Mozilla JavaScript Engine
  URL:=http://www.ossp.org/pkg/lib/js/
@@ -42,6 +42,16 @@ $(call Package/js/Default)
  TITLE+= (library)
 endef
 
+TARGET_CFLAGS += $(FPIC)
+
+CONFIGURE_ARGS += \
+       --enable-shared \
+       --enable-static \
+       --with-dso \
+       --with-editline \
+       --with-file \
+       --without-perl
+
 define Build/Configure
        (cd $(PKG_BUILD_DIR); rm -f config.cache; \
                ./configure \
@@ -63,65 +73,46 @@ define Build/Configure
                        --enable-static \
        );
        $(MAKE) -C $(PKG_BUILD_DIR) src/jsautocfg.h
-       (cd $(PKG_BUILD_DIR); rm -f config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="$(TARGET_CPPFLAGS)" \
-               LDFLAGS="$(TARGET_LDFLAGS)" \
-               ./configure \
-                       --target=$(GNU_TARGET_NAME) \
-                       --host=$(GNU_TARGET_NAME) \
-                       --build=$(GNU_HOST_NAME) \
-                       --program-prefix="" \
-                       --program-suffix="" \
-                       --prefix=/usr \
-                       --exec-prefix=/usr \
-                       --bindir=/usr/bin \
-                       --datadir=/usr/share \
-                       --includedir=/usr/include \
-                       --infodir=/usr/share/info \
-                       --libdir=/usr/lib \
-                       --libexecdir=/usr/lib \
-                       --localstatedir=/var \
-                       --mandir=/usr/share/man \
-                       --sbindir=/usr/sbin \
-                       --sysconfdir=/etc \
-                       $(DISABLE_NLS) \
-                       $(DISABLE_LARGEFILE) \
-                       --enable-shared \
-                       --enable-static \
-                       --with-dso \
-                       --with-editline \
-                       --with-file \
-                       --without-perl \
-       );
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) \
-               DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install
+       $(call Build/Configure/Default)
 endef
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/js-config $(1)/usr/bin/
+       $(INSTALL_DIR) $(2)/bin
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/js-config \
+               $(2)/bin/
+       $(SED) \
+               's,^\(prefix\|exec_prefix\)=.*,\1=$(STAGING_DIR)/usr,g' \
+               $(2)/bin/js-config
+
        $(INSTALL_DIR) $(1)/usr/include
-       $(CP) $(PKG_INSTALL_DIR)/usr/include/js $(1)/usr/include/       
+       $(CP) \
+               $(PKG_INSTALL_DIR)/usr/include/js \
+               $(1)/usr/include/
+
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.{a,so*} $(1)/usr/lib/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/libjs.{la,so*} \
+               $(1)/usr/lib/
+
        $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc $(1)/usr/lib/pkgconfig/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/js.pc \
+               $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/js/install
        $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/js $(1)/usr/bin/
+       $(INSTALL_BIN) \
+               $(PKG_INSTALL_DIR)/usr/bin/js \
+               $(1)/usr/bin/
 endef
 
 define Package/libjs/install
        $(INSTALL_DIR) $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* $(1)/usr/lib/
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/libjs.so.* \
+               $(1)/usr/lib/
 endef
 
 $(eval $(call BuildPackage,js))