[OpenWrt-Devel] [PATCH] projects/uci: lua: use built in pkg-config support for alternatives

2016-04-15 Thread Karl Palsson
From: Karl Palsson 

Different distributions have different names for the lua 5.1 package.
Use cmake's built in pkg-config support to search for the first one,
rather than running it explicitly and searching for a single version.

Signed-off-by: Karl Palsson 
---

This is the same as https://patchwork.ozlabs.org/patch/507965/ but for "uci"
 instead of libubox.
This fixes compiling and basic usage on fedora23 with compat-lua-devel

 lua/CMakeLists.txt | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt
index 4ba8e37..b9f513a 100644
--- a/lua/CMakeLists.txt
+++ b/lua/CMakeLists.txt
@@ -5,14 +5,8 @@ PROJECT(uci C)
 SET(CMAKE_INSTALL_PREFIX /)
 
 IF(NOT LUA_CFLAGS)
-   FIND_PROGRAM(PKG_CONFIG pkg-config)
-   IF(PKG_CONFIG)
-   EXECUTE_PROCESS(
-   COMMAND pkg-config --silence-errors --cflags lua5.1
-   OUTPUT_VARIABLE LUA_CFLAGS
-   OUTPUT_STRIP_TRAILING_WHITESPACE
-   )
-   ENDIF()
+   INCLUDE(FindPkgConfig)
+   pkg_search_module(LUA lua5.1 lua-5.1)
 ENDIF()
 
 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -I.. ${LUA_CFLAGS})
-- 
2.4.11
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: enable UCLIBC_HAS_OBSOLETE_BSD_SIGNAL

2016-04-15 Thread Alexey Brodkin
Hi Karl,

On Fri, 2016-04-15 at 10:01 +, Karl Palsson wrote:
> Alexey Brodkin  wrote:
> > 
> > This is required to build net-snmp.
> What version of net-snmp are you using? Is this because ARC is
> still on uclibc instead of musl like everyone else?

Indeed as of today the only libc for ARC is uClibc.
We're working now on glibc port for ARC and once done will look
at musl.

> net-snmp (5.4.4) built fine (and still builds fine) on uclibc in the 15.05
> branch.

Well frankly I haven't tried to build 15.05 so not really sure
if net-snmp will be built with uClibc. But I'll be surprised if it will.
Because from what I saw uClibc 0.9.33.2 used in 15.05 has no
differences in regard of sighold and friends. I think I'll try it.
Still IMHO observation that I made when building from current master is
pretty valid but let's see what gives 15.05 building.

> When are you planning on moving off uclibc?

Well I don't have a solid answer for this. As I said we're working on
glibc now and I think soon we'll be sending patches for upstream review
but it will take some time before our port gets accepted upstream.
In comparison ARC port of uClibc is now completely upstream in both
olde good uClibc and its new and shiny uClibc-ng fork. And that's exactly
what we want - use upstream projects but not a fork on our GitHub etc.

> snmpnetstat isn't even installed, could you just disable building it?

Essentially I may disable it but that's not a solution right?

-Alexey
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [UCI] uci import -m duplicates list options

2016-04-15 Thread Nemesis
On 04/15/2016 12:17 PM, Jo-Philipp Wich wrote:
> Hi.
> 
> Just truncate the destination file beforehand.

I'll resort to lua scripting to handle this, thanks.

Federico
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [UCI] uci import -m duplicates list options

2016-04-15 Thread Jo-Philipp Wich
Hi.

Just truncate the destination file beforehand.

~ Jow
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [UCI] uci import -m duplicates list options

2016-04-15 Thread Nemesis
On 04/13/2016 01:33 PM, Yousong Zhou wrote:
> On 13 April 2016 at 18:54, Nemesis  wrote:
>> Hi,
>>
>> I've incurred in weird behaviour when using the import feature of the uci
>> tool which seems to cause duplicates when importing configuration files that
>> have "list" settings.
>>
>> To test this you can try to create a file in /tmp/network:
>>
>> config interface 'lan'
>> list ipaddr '192.168.99.1/24'
>>
>> and then import it with:
>>
>> uci import -m -f /tmp/network network
>> uci commit network
>>
>> then import it again:
>>
>> uci import -m -f /tmp/network network
>> uci commit network
>>
>> results in:
>>
>> config interface 'lan'
>> list ipaddr '192.168.99.1/24'
>> list ipaddr '192.168.99.1/24'
>>
>> two questions:
>>
>> is this intended behaviour or is it a bug?
>> can something like this break the configuration or OpenWRT will select just
>> the last one?
>>
>> Thanks
>> Federico
> 
> There is currently no rule against duplicate entries in list type
> options and there may exist a situation where values in a list are not
> unique to each other.  So I guess the result is expected.

If the operation could be idempotent it would be nice.

Federico
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] toolchain/uClibc: enable UCLIBC_HAS_OBSOLETE_BSD_SIGNAL

2016-04-15 Thread Karl Palsson

Alexey Brodkin  wrote:
> This is required to build net-snmp.

What version of net-snmp are you using? Is this because ARC is
still on uclibc instead of musl like everyone else? net-snmp
(5.4.4) built fine (and still builds fine) on uclibc in the 15.05
branch. When are you planning on moving off uclibc? snmpnetstat
isn't even installed, could you just disable building it?

Cheers,
Karl P

> 
> If that options is disabled in uClibc then net-snmp doesn't
> detect sighold support on its configuration stage and so
> defines HAVE_SIGHOLD as 0. That in its turn causes compilation
> of the following branch of timerPause() in apps/snmpnetstat:
> -->8
> int oldmask;
> oldmask = sigblock(sigmask(SIGALRM));
> if (!signalled) {
> sigpause(0);
> }
> sigsetmask(oldmask);
> -->8
> 
> Now in uClibc all 3 sigblock(), sigmask() and sigsetmask() were
> removed back in 2005, see:
> https://git.busybox.net/uClibc/commit/?id=5aa7aa7fa7ec2a0fe567ac0b2595b46add6f3594
> 
> And all that causes net-snmp linkage to fail this way:
> -->8 .libs/if.o: In function
> `intpr': if.c:(.text+0x908): undefined reference to `sigmask'
> if.c:(.text+0x90e): undefined reference to `sigblock'
> if.c:(.text+0x924): undefined reference to `sigsetmask'
> -->8
> 
> If we enable UCLIBC_HAS_OBSOLETE_BSD_SIGNAL in uClibc then
> branch with sighold is used in timerPause() and everything
> builds as expected.
> 
> Signed-off-by: Alexey Brodkin 
> ---
>  toolchain/uClibc/config/common | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/toolchain/uClibc/config/common
> b/toolchain/uClibc/config/common index ec72701..b476639 100644
> --- a/toolchain/uClibc/config/common
> +++ b/toolchain/uClibc/config/common
> @@ -144,7 +144,7 @@ UCLIBC_HAS_LIBUTIL=y
>  UCLIBC_HAS_LONG_DOUBLE_MATH=y
>  UCLIBC_HAS_NETWORK_SUPPORT=y
>  UCLIBC_HAS_NFTW=y
> -# UCLIBC_HAS_OBSOLETE_BSD_SIGNAL is not set
> +UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
>  # UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set
>  UCLIBC_HAS_PRINTF_M_SPEC=y
>  # UCLIBC_HAS_PROFILING is not set
> -- 
> 2.5.5
> ___
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

signature.asc
Description: OpenPGP Digital Signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel