don't use included ltdl lib, standardize
authorNicolas Thill <nico@openwrt.org>
Tue, 3 Oct 2006 17:25:17 +0000 (17:25 +0000)
committerNicolas Thill <nico@openwrt.org>
Tue, 3 Oct 2006 17:25:17 +0000 (17:25 +0000)
SVN-Revision: 4897

libs/libgphoto2/Makefile
multimedia/gphoto2/Makefile

index eeefe67..a416eb8 100644 (file)
@@ -12,122 +12,108 @@ PKG_NAME:=libgphoto2
 PKG_VERSION:=2.2.1
 PKG_RELEASE:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/gphoto
 PKG_MD5SUM:=69827311733e39fafa9f77bb05e55b77
 PKG_CAT:=bzcat
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/libgphoto2
+
+define Package/libgphoto2/Default
   SECTION:=libs
   CATEGORY:=Libraries
-  MENU:=1
-  TITLE:=The basic library of the gphoto2 program.
-  DESCRIPTION:=The ports library of the gphoto2 program.
   URL:=http://www.gphoto.org/
+endef
+
+define Package/libgphoto2
+  $(call Package/libgphoto2/Default)
   DEPENDS:=+libusb +libexif +libjpeg +libpthread
+  TITLE:=The basic library of the gphoto2 program.
+  MENU:=1
 endef
 
 define Package/libgphoto2-drivers
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE:=Gphoto2 drivers for various cameras
-  DESCRIPTION:=Gphoto2 drivers for various cameras
-  URL:=http://www.gphoto.org/
+  $(call Package/libgphoto2/Default)
   DEPENDS:=libgphoto2
+  TITLE:=Gphoto2 drivers for various cameras
 endef
 
 BIG_ENDIAN:=no
 ifeq ($(ARCH),mips)
-BIG_ENDIAN:=yes
+  BIG_ENDIAN:=yes
 endif
 ifeq ($(ARCH),armeb)
-BIG_ENDIAN:=yes
+  BIG_ENDIAN:=yes
 endif
 ifeq ($(ARCH),powerpc)
-BIG_ENDIAN:=yes
+  BIG_ENDIAN:=yes
 endif
 
 define Build/Configure
-       (cd $(PKG_BUILD_DIR); rm -f config.cache; \
-               $(TARGET_CONFIGURE_OPTS) \
-               CFLAGS="$(TARGET_CFLAGS)" \
-               CPPFLAGS="-I$(STAGING_DIR)/usr/include"  \
-               LDFLAGS="-L$(STAGING_DIR)/usr/lib" \
-               LIBUSB_CFLAGS="-I$(STAGING_DIR)/usr/include" \
-               LIBUSB_LIBS="-L$(STAGING_DIR)/usr/lib -lusb" \
-               LIBEXIF_CFLAGS="-I$(STAGING_DIR)/usr/include" \
-               LIBEXIF_LIBS="-L$(STAGING_DIR)/usr/lib -lexif" \
+       $(call Build/Configure/Default, \
+               --enable-shared \
+               --enable-static \
+               --disable-rpath \
+               --with-gnu-ld \
+               --with-drivers=all \
+               --without-included-ltdl \
+               --without-libiconv-prefix \
+               --without-libintl-prefix \
+               , \
+               LIBEXIF_CFLAGS="$$$$CPPFLAGS" \
+               LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
+               LIBUSB_CFLAGS="$$$$CPPFLAGS" \
+               LIBUSB_LIBS="$$$$LDFLAGS -lusb" \
+               LIBS="-lltdl" \
                ac_cv_c_gettext_without_libintl=yes \
                ac_cv_c_bigendian=$(BIG_ENDIAN) \
-               ./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 \
-                       --without-libiconv-prefix \
-                       --without-libintl-prefix \
-                       --without-libiconv \
-                       --without-libintl \
-                       --disable-nls \
-                       $(DISABLE_LARGEFILE) \
-                       --enable-shared \
-                       --enable-static \
-                       --with-drivers=all \
-       );
+       )
 endef
 
 define Build/Compile
-$(call Build/Compile/Default,-j$(CONFIG_JLEVEL) \
-               CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld ARCH=$(ARCH) \
+       $(MAKE) -C $(PKG_BUILD_DIR) -j$(CONFIG_JLEVEL) \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-               all install)
-endef
-
-define Package/libgphoto2/install
-       install -m0755 -d $(1)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
-endef
-
-define Package/libgphoto2-drivers/install
-       install -m0755 -d $(1)/usr/lib/
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2 $(1)/usr/lib/
+               LIBLTDL="" \
+               all install
 endef
 
 define Build/InstallDev
        mkdir -p $(STAGING_DIR)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2-config $(STAGING_DIR)/usr/bin/
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2-port-config $(STAGING_DIR)/usr/bin/
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/gphoto2{,-port}-config $(STAGING_DIR)/usr/bin/
        mkdir -p $(STAGING_DIR)/usr/include
        $(CP) $(PKG_INSTALL_DIR)/usr/include/gphoto2 $(STAGING_DIR)/usr/include/
        mkdir -p $(STAGING_DIR)/usr/lib
-       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto*.{a,so*} $(STAGING_DIR)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.{a,so*} $(STAGING_DIR)/usr/lib/
+       mkdir -p $(STAGING_DIR)/usr/lib/pkgconfig
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgphoto2.pc $(STAGING_DIR)/usr/lib/pkgconfig/
+       $(SED) 's,-I$$$${prefix}/include/gphoto2,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
+       $(SED) 's,-I$$$${prefix}/include,,g' $(STAGING_DIR)/usr/bin/gphoto2{,-port}-config
+       $(SED) 's,-L$$$${exec_prefix}/lib,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
+       $(SED) 's,-I$$$${includedir}/gphoto2,,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
+       $(SED) 's,-L$$$${libdir},,g' $(STAGING_DIR)/usr/lib/pkgconfig/libgphoto2.pc
 endef
 
 define Build/UninstallDev
-       rm -rf \
-               $(STAGING_DIR)/usr/bin/gphoto2-config \
+       rm -rf  $(STAGING_DIR)/usr/bin/gphoto2-config \
                $(STAGING_DIR)/usr/bin/gphoto2-port-config \
                $(STAGING_DIR)/usr/include/gphoto2* \
                $(STAGING_DIR)/usr/lib/libgphoto*.{a,so*}
 endef
 
+define Package/libgphoto2/install
+       install -m0755 -d $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port}.so.* $(1)/usr/lib/
+endef
+
+define Package/libgphoto2-drivers/install
+       install -d -m0755 $(1)/usr/lib/
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgphoto2{,_port} $(1)/usr/lib/
+       rm -rf $(1)/usr/lib/libgphoto2{,_port}/*/*.{,l}a
+endef
+
 $(eval $(call BuildPackage,libgphoto2))
 $(eval $(call BuildPackage,libgphoto2-drivers))
index 81665fc..73ab2fd 100644 (file)
@@ -12,12 +12,12 @@ PKG_NAME:=gphoto2
 PKG_VERSION:=2.2.0
 PKG_RELEASE:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=@SF/gphoto
 PKG_MD5SUM:=f5c1f83185db598b4ca52889964a5e84
 PKG_CAT:=bzcat
 
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
 
 include $(INCLUDE_DIR)/package.mk
@@ -25,42 +25,43 @@ include $(INCLUDE_DIR)/package.mk
 define Package/gphoto2
   SECTION:=multimedia
   CATEGORY:=Multimedia
-  DEPENDS:=+libusb +libexif +libpopt +libgphoto2
+  DEPENDS:=+libexif +libgphoto2 +libltdl +libpopt +libpthread
   TITLE:=Gphoto Digital Camera Control
   DESCRIPTION:=For downloading and controlling digital cameras
-  URL:=http://www.gphoto.org
+  URL:=http://www.gphoto.org/
 endef
 
 BIG_ENDIAN:=no
 ifeq ($(ARCH),mips)
-BIG_ENDIAN:=yes
+  BIG_ENDIAN:=yes
 endif
 ifeq ($(ARCH),armeb)
-BIG_ENDIAN:=yes
+  BIG_ENDIAN:=yes
 endif
 ifeq ($(ARCH),powerpc)
-BIG_ENDIAN:=yes
+  BIG_ENDIAN:=yes
 endif
 
 define Build/Configure
-$(call Build/Configure/Default,--without-libiconv-prefix \
+       $(call Build/Configure/Default, \
+               --without-libiconv-prefix \
                --without-libintl-prefix \
-               $(DISABLE_LARGEFILE) \
-               $(DISABLE_NLS) \
-               --enable-shared \
-               --enable-static,LIBGPHOTO2_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/usr/include/gphoto2" \
-               LIBGPHOTO2_LIBS="-L$(STAGING_DIR)/usr/lib -lgphoto2_port -lgphoto2" \
-               LIBEXIF_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
-               LIBEXIF_LIBS="-L$(STAGING_DIR)/usr/lib -lexif" \
-               POPT_CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include" \
-               POPT_LIBS="-L$(STAGING_DIR)/usr/lib -lpopt" \
-               ac_cv_c_bigendian=$(BIG_ENDIAN) \
-               ac_cv_func_malloc_0_nonnull=yes)
+               , \
+               LIBGPHOTO2_CFLAGS="$$$$CFLAGS -I$(STAGING_DIR)/usr/include/gphoto2 $$$$CPPFLAGS" \
+               LIBGPHOTO2_LIBS="$$$$LDFLAGS -lgphoto2 -lgphoto2_port -lltdl" \
+               LIBEXIF_CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
+               LIBEXIF_LIBS="$$$$LDFLAGS -lexif" \
+               POPT_CFLAGS="$$$$CFLAGS $$$$CPPFLAGS" \
+               POPT_LIBS="$$$$LDFLAGS -lpopt" \
+               ac_cv_c_bigendian="$(BIG_ENDIAN)" \
+               ac_cv_func_malloc_0_nonnull=yes \
+       )
 endef
 
 define Build/Compile
-$(call Build/Compile/Default,DESTDIR="$(PKG_INSTALL_DIR)" \
-       all install)
+       $(MAKE) -C $(PKG_BUILD_DIR) \
+               DESTDIR="$(PKG_INSTALL_DIR)" \
+               all install
 endef
 
 define Package/gphoto2/install