freecwmp
[Top] [All Lists]

Re: [PATCH] fix freecwmp Openwrt Makefile dependencies

To: Luka Perkov <freecwmp@lukaperkov.net>
Subject: Re: [PATCH] fix freecwmp Openwrt Makefile dependencies
From: Kaspar Schleiser <kaspar@schleiser.de>
Date: Fri, 17 Feb 2012 10:34:04 +0100
Cc: freecwmp@linux-mips.org
In-reply-to: <20120216210904.GA26359@w500.iskon.local>
Original-recipient: rfc822;freecwmp@linux-mips.org
References: <4F3CFA48.2040701@schleiser.de> <4F3D0107.8020803@schleiser.de> <20120216210904.GA26359@w500.iskon.local>
Sender: freecwmp-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111224 Thunderbird/9.0.1
Hey Luka,

well, this way the dependencies don't get set, so a cean rebuild will
not ensure a build order that makes the library headers accessible
during freecwmp build.

I think that adding

"+CONFIG_FREECWMP_HTTP_ZSTREAM:libzstream
+CONFIG_FREECWMP_HTTP_CURL:libcurl"

to DEPENDS fixes that.

Kaspar

On 02/16/2012 10:09 PM, Luka Perkov wrote:
> Hi Kaspar,
> 
> On Thu, Feb 16, 2012 at 02:13:43PM +0100, Kaspar Schleiser wrote:
>> well, no. It fixes visibility but breaks the build otherwise. Sorry
>> for your time.
> 
> No. The patch is ok, thank you. With this patch we have another problem,
> when user selects libcurl and then libzstream they both end up selected.
> Only one of them should. I have played with this a bit, trying to use
> options like:
> 
> default y if PACKAGE_libcurl
> deselect PACKAGE_libzstream
> 
> But I did not get it to work properly. Anway this is better than we had
> before. Here is a full patch for OpenWrt. You will notice that I have
> added USE_LOCAL part...
> 
> Regards,
> Luka
> 
> Index: utils/freecwmp/files/freecwmpd.init
> ===================================================================
> --- utils/freecwmp/files/freecwmpd.init       (revision 0)
> +++ utils/freecwmp/files/freecwmpd.init       (working copy)
> @@ -0,0 +1,12 @@
> +#!/bin/sh /etc/rc.common
> +# Copyright (C) 2012 OpenWrt.org
> +
> +START=90
> +
> +start() {
> +     freecwmpd 2>/dev/null >/dev/null &
> +}
> +
> +stop() {
> +     killall -9 freecwmpd 2>/dev/null >/dev/null
> +}
> Index: utils/freecwmp/Config.in
> ===================================================================
> --- utils/freecwmp/Config.in  (revision 0)
> +++ utils/freecwmp/Config.in  (working copy)
> @@ -0,0 +1,40 @@
> +menu "Configuration"
> +     depends on PACKAGE_freecwmp
> +
> +config FREECWMP_SCRIPTS_FULL
> +     bool "Install all freecwmp scripts"
> +     default y
> +
> +choice
> +     prompt "Select HTTP library"
> +     default FREECWMP_HTTP_ZSTREAM
> +
> +     config FREECWMP_HTTP_ZSTREAM
> +     bool "libzstream"
> +     select PACKAGE_libzstream
> +
> +     config FREECWMP_HTTP_CURL
> +     bool "libcurl"
> +     select PACKAGE_libcurl
> +endchoice
> +
> +choice
> +     prompt "Select ACS sever"
> +     default FREECWMP_ACS_MULTI
> +
> +config FREECWMP_ACS_MULTI
> +     bool "No specific ACS, follow standard"
> +
> +config FREECWMP_ACS_HDM
> +     bool "HDM"
> +endchoice
> +
> +config FREECWMP_DEBUG
> +     bool "Compile with debug options"
> +     default n
> +
> +config FREECWMP_DEVEL_DEBUG
> +     bool "Compile with development debug options"
> +     default n
> +
> +endmenu
> Index: utils/freecwmp/Makefile
> ===================================================================
> --- utils/freecwmp/Makefile   (revision 0)
> +++ utils/freecwmp/Makefile   (working copy)
> @@ -0,0 +1,101 @@
> +#
> +# Copyright (C) 2012 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:=freecwmp
> +PKG_VERSION:=2012-02-16
> +PKG_RELEASE=$(PKG_SOURCE_VERSION)
> +
> +PKG_SOURCE_PROTO:=git
> +PKG_SOURCE_URL:=http://dev.phrozen.org/githttp/freecwmp.git
> +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
> +PKG_SOURCE_VERSION:=cf85d155bddab7b6c18a59e31b18971aaf7dd2d1
> +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
> +
> +PKG_FIXUP:=autoreconf
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +define Package/freecwmp
> +  SECTION:=utils
> +  CATEGORY:=Utilities
> +  TITLE:=CWMP client
> +  DEPENDS:=+libubox +libmicroxml +shflags
> +  MENU:=1
> +endef
> +
> +define Package/freecwmp/config
> +     source "$(SOURCE)/Config.in"
> +endef
> +
> +define Package/freecwmp/description
> +  A free client implementation of CWMP (TR-069) protocol.
> +endef
> +
> +USE_LOCAL=$(shell ls ./src/ 2>/dev/null >/dev/null && echo 1)
> +ifneq ($(USE_LOCAL),)
> +define Build/Prepare
> +     $(CP) ./src/* $(PKG_BUILD_DIR)/
> +endef
> +endif
> +
> +TARGET_LDFLAGS += \
> +     -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
> +
> +ifeq ($(CONFIG_FREECWMP_HTTP_ZSTREAM),y)
> +CONFIGURE_ARGS += \
> +     --enable-http=zstream
> +endif
> +
> +ifeq ($(CONFIG_FREECWMP_HTTP_CURL),y)
> +CONFIGURE_ARGS += \
> +     --enable-http=curl
> +endif
> +
> +ifeq ($(CONFIG_FREECWMP_ACS_MULTI),y)
> +CONFIGURE_ARGS += \
> +     --enable-acs=multi
> +endif
> +
> +ifeq ($(CONFIG_FREECWMP_ACS_HDM),y)
> +CONFIGURE_ARGS += \
> +     --enable-acs=hdm
> +endif
> +
> +ifeq ($(CONFIG_FREECWMP_DEBUG),y)
> +CONFIGURE_ARGS += \
> +     --enable-debug
> +endif
> +
> +ifeq ($(CONFIG_FREECWMP_DEVEL_DEBUG),y)
> +CONFIGURE_ARGS += \
> +     --enable-devel-debug
> +endif
> +
> +define Package/freecwmp/conffiles
> +/etc/config/freecwmp
> +/usr/share/freecwmp/defaults
> +endef
> +
> +define Package/freecwmp/install
> +     $(INSTALL_DIR) $(1)/usr/sbin
> +     $(CP) $(PKG_BUILD_DIR)/bin/freecwmpd $(1)/usr/sbin
> +     $(INSTALL_DIR) $(1)/etc/config
> +     $(INSTALL_CONF) $(PKG_BUILD_DIR)/ext/openwrt/config/freecwmp 
> $(1)/etc/config
> +     $(INSTALL_DIR) $(1)/etc/init.d
> +     $(INSTALL_BIN) ./files/freecwmpd.init $(1)/etc/init.d/freecwmpd
> +ifeq ($(CONFIG_FREECWMP_SCRIPTS_FULL),y)
> +     $(INSTALL_DIR) $(1)/usr/share/freecwmp
> +     $(CP) $(PKG_BUILD_DIR)/ext/openwrt/scripts/defaults 
> $(1)/usr/share/freecwmp
> +     $(CP) $(PKG_BUILD_DIR)/ext/openwrt/scripts/functions 
> $(1)/usr/share/freecwmp
> +     $(INSTALL_DIR) $(1)/usr/sbin
> +     $(INSTALL_BIN) $(PKG_BUILD_DIR)/ext/openwrt/scripts/freecwmp.sh 
> $(1)/usr/sbin/freecwmp
> +endif
> +endef
> +
> +$(eval $(call BuildPackage,freecwmp))
> 
> 


Attachment: signature.asc
Description: OpenPGP digital signature

<Prev in Thread] Current Thread [Next in Thread>