[OpenWrt-Devel] [PATCH] get rid of misleading FORCE=1 message

2015-07-24 Thread Lawrence D';Anna
Signed-off-by: Lawrence D'Anna 
---
 include/toplevel.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/toplevel.mk b/include/toplevel.mk
index 11b2dd9..b9393ea 100644
--- a/include/toplevel.mk
+++ b/include/toplevel.mk
@@ -140,7 +140,7 @@ staging_dir/host/.prereq-build: include/prereq-build.mk
mkdir -p tmp
rm -f tmp/.host.mk
@$(_SINGLE)$(NO_TRACE_MAKE) -j1 -r -s -f 
$(TOPDIR)/include/prereq-build.mk prereq 2>/dev/null || { \
-   echo "Prerequisite check failed. Use FORCE=1 to override."; \
+   echo "Prerequisite check failed."; \
false; \
}
   ifneq ($(realpath $(TOPDIR)/include/prepare.mk),)
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 3/3] prereq-build: check for gnu date, dd

2015-07-21 Thread Lawrence D';Anna
Needed to make sure we get gdate and gdd from Homebrew on Darwin instead of the
ones built-in to the OS.

Signed-off-by: Lawrence D'Anna 
---
 include/prereq-build.mk | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 6c8cbf1..39704e1 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -148,6 +148,13 @@ $(eval $(call SetupHostCommand,file,Please install the 
'file' package, \
 $(eval $(call SetupHostCommand,openssl,Please install the 'openssl' utility, \
openssl version | grep OpenSSL))
 
+$(eval $(call SetupHostCommand,date,Please install GNU 'date', \
+   date --help, \
+   gdate --help))
+
+$(eval $(call SetupHostCommand,dd,Please install GNU 'dd', \
+   dd --help, \
+   gdd --help))
 
 # Install ldconfig stub
 $(eval $(call TestHostCommand,ldconfig-stub,Failed to install stub, \
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 2/3] prereq-build: use HOST* variables to test host compiler

2015-07-21 Thread Lawrence D';Anna
We might need HOST_CPPFLAGS and HOST_LDFLAGS to find libraries.
---
 include/prereq-build.mk | 28 +---
 1 file changed, 9 insertions(+), 19 deletions(-)

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 53eac37..6c8cbf1 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -26,49 +26,39 @@ $(eval $(call TestHostCommand,case-sensitive-fs, \
 
 $(eval $(call SetupHostCommand,gcc, \
Please install the GNU C Compiler (gcc), \
-   $(CC) --version | grep gcc, \
-   gcc --version | grep gcc, \
-   gcc49 --version | grep gcc, \
-   gcc48 --version | grep gcc, \
-   gcc47 --version | grep gcc, \
-   gcc46 --version | grep gcc, \
-   gcc --version | grep Apple.LLVM ))
+   $(HOSTCC) --version | grep gcc, \
+   $(HOSTCC) --version | grep Apple.LLVM ))
 
 $(eval $(call TestHostCommand,working-gcc, \
Please reinstall the GNU C Compiler - it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
-   gcc -x c -o $(TMP_DIR)/a.out -))
+   $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -x c -o 
$(TMP_DIR)/a.out -))
 
 $(eval $(call SetupHostCommand,g++, \
Please install the GNU C++ Compiler (g++), \
-   $(CXX) --version | grep g++, \
-   g++ --version | grep g++, \
-   g++49 --version | grep g++, \
-   g++48 --version | grep g++, \
-   g++47 --version | grep g++, \
-   g++46 --version | grep g++, \
-   g++ --version | grep Apple.LLVM ))
+   $(HOSTCXX) --version | grep g++, \
+   $(HOSTCXX) --version | grep Apple.LLVM ))
 
 $(eval $(call TestHostCommand,working-g++, \
Please reinstall the GNU C++ Compiler - it appears to be broken, \
echo 'int main(int argc, char **argv) { return 0; }' | \
-   g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \
+   $(HOSTCXX) $(HOST_CFLAGS) $(HOST_LDFLAGS) -x c++ -o 
$(TMP_DIR)/a.out - -lstdc++ && \
$(TMP_DIR)/a.out))
 
 $(eval $(call TestHostCommand,ncurses, \
Please install ncurses. (Missing libncurses.so or ncurses.h), \
echo 'int main(int argc, char **argv) { initscr(); return 0; }' | \
-   gcc -include ncurses.h -x c -o $(TMP_DIR)/a.out - -lncurses))
+   $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -include ncurses.h -x 
c -o $(TMP_DIR)/a.out - -lncurses))
 
 $(eval $(call TestHostCommand,zlib, \
Please install zlib. (Missing libz.so or zlib.h), \
echo 'int main(int argc, char **argv) { gzdopen(0, "rb"); return 0; }' 
| \
-   gcc -include zlib.h -x c -o $(TMP_DIR)/a.out - -lz))
+   $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -include zlib.h -x c 
-o $(TMP_DIR)/a.out - -lz))
 
 $(eval $(call TestHostCommand,libssl, \
Please install the openssl library (with development headers), \
echo 'int main(int argc, char **argv) { SSL_library_init(); return 0; 
}' | \
-   gcc -include openssl/ssl.h -x c -o $(TMP_DIR)/a.out - -lcrypto 
-lssl))
+   $(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) -include openssl/ssl.h 
-x c -o $(TMP_DIR)/a.out - -lcrypto -lssl))
 
 
 $(eval $(call SetupHostCommand,tar,Please install GNU 'tar', \
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH 1/3] When building on darwin, add paths for Homebrew.

2015-07-21 Thread Lawrence D';Anna
Various host-side tools and libraries that we need are not provided by Mac OS
such as:

 * openssl
 * gnugetopt

Homebrew seems to be the standard way to install these things, so on when
building on Darwin we need to add some paths to Homebrew-installed things to
PATH, HOST_CPPFLAGS, and HOST_LDFLAGS.
---
 include/prereq-build.mk | 7 ++-
 rules.mk| 8 +++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 211201a..53eac37 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -107,11 +107,16 @@ $(eval $(call SetupHostCommand,grep,Please install GNU 
'grep', \
ggrep --version 2>&1 | grep GNU, \
grep --version 2>&1 | grep GNU))
 
+ifeq ($(HOST_OS),Darwin)
+HOMEBREW_GETOPT:= /usr/local/opt/gnu-getopt/bin/getopt -o t --long test -- 
--test | grep '^ *--test *--'
+endif
+
 $(eval $(call SetupHostCommand,getopt, \
Please install an extended getopt version that supports --long, \
gnugetopt -o t --long test -- --test | grep '^ *--test *--', \
/usr/local/bin/getopt -o t --long test -- --test | grep '^ *--test 
*--', \
-   getopt -o t --long test -- --test | grep '^ *--test *--'))
+   getopt -o t --long test -- --test | grep '^ *--test *--', \
+   $(HOMEBREW_GETOPT)))
 
 $(eval $(call SetupHostCommand,stat,Cannot find a file stat utility, \
gnustat -c%s $(TMP_DIR)/.host.mk, \
diff --git a/rules.mk b/rules.mk
index 58b9f3e..b72fb86 100644
--- a/rules.mk
+++ b/rules.mk
@@ -198,8 +198,14 @@ export PKG_CONFIG
 HOSTCC:=gcc
 HOSTCXX:=g++
 HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include
-HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
 HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib
+ifeq ($(shell uname),Darwin)
+# add Homebrew to our flags
+HOST_CPPFLAGS+= -I/usr/local/include -I/usr/local/opt/openssl/include
+HOST_LDFLAGS+= -L/usr/local/lib -L/usr/local/opt/openssl/lib
+endif
+HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
+
 
 ifeq 
($(CONFIG_GCC_VERSION_4_4)$(CONFIG_GCC_VERSION_4_6)$(CONFIG_EXTERNAL_TOOLCHAIN),)
   TARGET_AR:=$(TARGET_CROSS)gcc-ar
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] gcc: add a darwin-compatibility patch for ansidecl.h

2015-07-20 Thread Lawrence D';Anna
Sorry!   disregard this patch please.

The problem I was seeing had nothing to do with Xcode.   It was because 
Homebrew’s binutils
had installed its own ansidecl.h which was being used instead of the ansidecl.h 
that came with 
the gcc sources.

> On Jul 19, 2015, at 6:52 PM, Lawrence D'Anna  wrote:
> 
> ansidecl.h is using _ANSIDECL_H as it's guard #ifdef.  But names that start 
> with
> underscore are reserved, and the latest version of Xcode seems to be 
> exercising
> its prerogative to define _ANSIDECL_H.
> 
> Signed-off-by: Lawrence D'Anna 
> ---
> toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch | 13 +
> 1 file changed, 13 insertions(+)
> create mode 100644 toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch
> 
> diff --git a/toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch 
> b/toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch
> new file mode 100644
> index 000..d7267b3
> --- /dev/null
> +++ b/toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch
> @@ -0,0 +1,13 @@
> +--- a/include/ansidecl.h
>  b/include/ansidecl.h
> +@@ -112,8 +112,8 @@ Foundation, Inc., 51 Franklin Street - F
> +CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
> +AND, DOTS, NOARGS.  Don't use them.  */
> + 
> +-#ifndef _ANSIDECL_H
> +-#define _ANSIDECL_H 1
> ++#ifndef ANSIDECL_H
> ++#define ANSIDECL_H  1
> + 
> + #ifdef __cplusplus
> + extern "C" {
> -- 
> 2.3.8 (Apple Git-58)
> 



smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] bugfix: FORCE=1 doesn't work to override prereq checks

2015-07-20 Thread Lawrence D';Anna

> 
> What prereq can be forced that makes force even a worthwhile option?  If
> it works anyway, why not just drop the prereq check?  If it still won't
> work, what's the point in allowing a force?
> 

In my case it was because the prereq checks didn’t think I had openssl because 
they 
didn’t use HOST_CPPFLAGS.





smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-20 Thread Lawrence D';Anna

> On Jul 20, 2015, at 1:57 AM, Felix Fietkau  wrote:
> 
> On 2015-07-20 05:25, Lawrence D'Anna wrote:
>> These HOST* variables are used to configure all the build-time tools, but the
>> user has no ability to modify them without editing makefiles.
>> 
>> This patch adds a new menu to menuconfig which allows the user to set the 
>> host
>> compilers and flags.
>> 
>> Signed-off-by: Lawrence D'Anna 
> Based on our discussion, I don't want to merge this patch. I think the
> user shouldn't have to manually set host compiler and flags in
> menuconfig. I'd prefer to fix stuff by adding missing host builds, or by
> including extra directories in HOST_CFLAGS/HOST_LDFLAGS automatically
> based on the detected host system.
> 
> - Felix

So it should look for homebrew and add /usr/local/include and 
/usr/local/opt/openssl/include?

smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-20 Thread Lawrence D';Anna
> 
>>> I’ve also found some of the tools include  some headers from linux or
>>> glibc that you wouldn’t find on mac os,
>>> like linux/types.h and elf.h.I’ve extracted a sufficient set of
>>> these headers and I install them /usr/local
>>> 
>>> ( https://github.com/smoofra/fake-glibc  )
>> If something relies on having linux/types.h on the host, then this is a
>> bug that should be reported and fixed.
> 
> I agree!  There’s a bunch of bugs like this.   I’ll send in some reports for 
> them.
> 

Ugh!  I’ve been carrying these silly headers around and fixing bugs in them.  I 
fixed one today!
But I uninstalled them and the same stuff that was breaking before isn’t 
breaking.   

I guess various autoconf scripts were just probing for linux headers regardless 
of whether they 
were building for linux or not.

So it appears whatever bug first prompted me to create that silly headers repo 
has since been fixed, 
and i’ve been carrying it around for no reason :/




smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-19 Thread Lawrence D';Anna

> On Jul 19, 2015, at 10:45 PM, Lawrence D'Anna  wrote:
> 
> 
>> On Jul 19, 2015, at 10:33 PM, Felix Fietkau  wrote:
>> 
>> On 2015-07-20 07:27, Lawrence D'Anna wrote:
>>> I’m using homebrew.One of the libraries that seems to be needed is a
>>> modern version of openssl. 
>>> The openssl included on mac os is kind of old and isn’t compatible
>>> Homebrew installs most things to /usr/local, but Xcode doesn’t look
>>> there.   It installs openssl to /usr/local/opt
>>> to avoid overlapping with the system’s openssl. 
>> Where is a newer version of openssl needed?
>> 
> tools/mkimage fails with on #import 
> 

Just realized this isn’t due to an old version, but because openssl is 
deprecated on mac os.   The dylibs are
there for bin compat, but the headers aren’t included in os x or xcode anymore 
(for the betas of mac os 10.11 and Xcode 7)



smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-19 Thread Lawrence D';Anna

> On Jul 19, 2015, at 10:33 PM, Felix Fietkau  wrote:
> 
> On 2015-07-20 07:27, Lawrence D'Anna wrote:
>> I’m using homebrew.One of the libraries that seems to be needed is a
>> modern version of openssl. 
>> The openssl included on mac os is kind of old and isn’t compatible
>> Homebrew installs most things to /usr/local, but Xcode doesn’t look
>> there.   It installs openssl to /usr/local/opt
>> to avoid overlapping with the system’s openssl. 
> Where is a newer version of openssl needed?
> 
tools/mkimage fails with on #import 

>> I’ve also found some of the tools include  some headers from linux or
>> glibc that you wouldn’t find on mac os,
>> like linux/types.h and elf.h.I’ve extracted a sufficient set of
>> these headers and I install them /usr/local
>> 
>> ( https://github.com/smoofra/fake-glibc  )
> If something relies on having linux/types.h on the host, then this is a
> bug that should be reported and fixed.

I agree!  There’s a bunch of bugs like this.   I’ll send in some reports for 
them.

> 
>> I’m surprised to hear you can build on mac os without any of these kinds
>> of problems.
> It's not entirely without problems, sometimes some packages don't build.
> I try to fix all the build breakage I encounter though.
> 
>> Could you tell me
>> what version of OS X and Xcode you’re on?   It I’m on mac os 10.11 /
>> Xcode 7 so these issues might be new, 
>> but then again I can’t imagine what version of mac os would have had
>> linux/types.h.
> I haven't upgraded yet, I think I'll wait for the final release.

Anyway, I’d argue that being able to set the host compiler and flags is useful 
enough in general.These kind 
of little build breakages tend to happen whenever you build things on a unix 
flavor that isn’t what they’re normally
built on.   Usually the most obvious workaround is to add some -I and -L flags. 
  




smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-19 Thread Lawrence D';Anna
I’m using homebrew.One of the libraries that seems to be needed is a modern 
version of openssl. 
The openssl included on mac os is kind of old and isn’t compatible
Homebrew installs most things to /usr/local, but Xcode doesn’t look there.   It 
installs openssl to /usr/local/opt
to avoid overlapping with the system’s openssl. 

I’ve also found some of the tools include  some headers from linux or glibc 
that you wouldn’t find on mac os,
like linux/types.h and elf.h.I’ve extracted a sufficient set of these 
headers and I install them /usr/local

( https://github.com/smoofra/fake-glibc <https://github.com/smoofra/fake-glibc> 
 )

I’m surprised to hear you can build on mac os without any of these kinds of 
problems.   Could you tell me
what version of OS X and Xcode you’re on?   It I’m on mac os 10.11 / Xcode 7 so 
these issues might be new, 
but then again I can’t imagine what version of mac os would have had 
linux/types.h.


> On Jul 19, 2015, at 10:16 PM, Felix Fietkau  wrote:
> 
> On 2015-07-20 06:57, Lawrence D'Anna wrote:
>> I like to build openwrt on a mac. Some of the host-side tools it
>> builds need libraries and headers that aren’t
>> included in mac os, so I need to point these variables at an
>> alternate location where they are installed.
> I also build openwrt on a mac, and so far I have not needed a change
> like this. Are you using macports or homebrew? Or are you
> building/installing the missing host tools/libs manually somewhere else?
> 
> - Felix



smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-19 Thread Lawrence D';Anna
I like to build openwrt on a mac.   Some of the host-side tools it builds need 
libraries and headers that aren’t 
included in mac os, so I need to point these variables at an alternate location 
where they are installed.

> On Jul 19, 2015, at 9:54 PM, Felix Fietkau  wrote:
> 
> On 2015-07-20 05:25, Lawrence D'Anna wrote:
>> These HOST* variables are used to configure all the build-time tools, but the
>> user has no ability to modify them without editing makefiles.
>> 
>> This patch adds a new menu to menuconfig which allows the user to set the 
>> host
>> compilers and flags.
>> 
>> Signed-off-by: Lawrence D'Anna 
> What do you need this for?
> 
> - Felix



smime.p7s
Description: S/MIME cryptographic signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] allow HOST* variables to be set from config.

2015-07-19 Thread Lawrence D';Anna
These HOST* variables are used to configure all the build-time tools, but the
user has no ability to modify them without editing makefiles.

This patch adds a new menu to menuconfig which allows the user to set the host
compilers and flags.

Signed-off-by: Lawrence D'Anna 
---
 Config.in |  2 ++
 config/Config-host.in | 49 +
 rules.mk  | 10 +-
 3 files changed, 56 insertions(+), 5 deletions(-)
 create mode 100644 config/Config-host.in

diff --git a/Config.in b/Config.in
index d30c048..d794be8 100644
--- a/Config.in
+++ b/Config.in
@@ -15,6 +15,8 @@ config HAVE_DOT_CONFIG
bool
default y
 
+source "config/Config-host.in"
+
 source "target/Config.in"
 
 source "config/Config-images.in"
diff --git a/config/Config-host.in b/config/Config-host.in
new file mode 100644
index 000..fb999e6
--- /dev/null
+++ b/config/Config-host.in
@@ -0,0 +1,49 @@
+# Copyright (C) 2006-2013 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+menu "Host build settings"
+
+   config HOSTCC
+   string
+   prompt "Host C compiler"
+   default "gcc"
+   help
+   Specifies the C compiler used to build programs which 
will run at
+   build time.
+
+   config HOSTCXX
+   string
+   prompt "Host C++ compiler"
+   default "g++"
+   help
+   Specifies the C++ compiler used to build programs which 
will run at
+   build time.
+
+   config HOST_CPPFLAGS
+   string
+   prompt "Host C preprocessor flags"
+   default ""
+   help
+   Specifies the C preprocessor flags used to build 
programs which will run
+   at build time.
+
+   config HOST_CFLAGS
+   string
+   prompt "Host C compiler flags"
+   default "-O2"
+   help
+   Specifies the C compiler flags used to build progams 
which will run
+   at build time.
+
+   config HOST_LDFLAGS
+   string
+   prompt "Host linker flags"
+   default ""
+   help
+   Specifies the linker flags used to build progams which 
will run
+   at build time.
+
+endmenu
diff --git a/rules.mk b/rules.mk
index 58b9f3e..ef0a7b0 100644
--- a/rules.mk
+++ b/rules.mk
@@ -195,11 +195,11 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
 
 export PKG_CONFIG
 
-HOSTCC:=gcc
-HOSTCXX:=g++
-HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include
-HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
-HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib
+HOSTCC:=$(call qstrip,$(CONFIG_HOSTCC))
+HOSTCXX:=$(call qstrip,$(CONFIG_HOSTCXX))
+HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include 
$(call qstrip,$(CONFIG_HOST_CPPFLAGS))
+HOST_CFLAGS:=$(HOST_CPPFLAGS) $(call qstrip,$(CONFIG_HOST_CFLAGS))
+HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(call 
qstrip,$(CONFIG_HOST_LDFLAGS))
 
 ifeq 
($(CONFIG_GCC_VERSION_4_4)$(CONFIG_GCC_VERSION_4_6)$(CONFIG_EXTERNAL_TOOLCHAIN),)
   TARGET_AR:=$(TARGET_CROSS)gcc-ar
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] gcc: add a darwin-compatibility patch for ansidecl.h

2015-07-19 Thread Lawrence D';Anna
ansidecl.h is using _ANSIDECL_H as it's guard #ifdef.  But names that start with
underscore are reserved, and the latest version of Xcode seems to be exercising
its prerogative to define _ANSIDECL_H.

Signed-off-by: Lawrence D'Anna 
---
 toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch | 13 +
 1 file changed, 13 insertions(+)
 create mode 100644 toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch

diff --git a/toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch 
b/toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch
new file mode 100644
index 000..d7267b3
--- /dev/null
+++ b/toolchain/gcc/patches/4.8-linaro/999-ansidecl-h.patch
@@ -0,0 +1,13 @@
+--- a/include/ansidecl.h
 b/include/ansidecl.h
+@@ -112,8 +112,8 @@ Foundation, Inc., 51 Franklin Street - F
+CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
+AND, DOTS, NOARGS.  Don't use them.  */
+ 
+-#ifndef   _ANSIDECL_H
+-#define _ANSIDECL_H   1
++#ifndef   ANSIDECL_H
++#define ANSIDECL_H1
+ 
+ #ifdef __cplusplus
+ extern "C" {
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] bugfix: FORCE=1 doesn't work to override prereq checks

2015-07-19 Thread Lawrence D';Anna
If the build prereq checks fail, you get the message

   Prerequisite check failed. Use FORCE=1 to override.

But re-trying with "make menuconfig FORCE=1" gives you the same result.

This patch fixes that.

Signed-off-by: Lawrence D'Anna 
---
 include/prereq.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/prereq.mk b/include/prereq.mk
index 33ac278..770dafd 100644
--- a/include/prereq.mk
+++ b/include/prereq.mk
@@ -14,7 +14,7 @@ prereq:
cat $(TMP_DIR)/.prereq-error; \
rm -f $(TMP_DIR)/.prereq-error; \
echo; \
-   false; \
+   $(if $(FORCE),true,false); \
fi
 
 .SILENT: prereq
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] mkimage: cross compile fix: pass HOST_*FLAGS in to uboot's makefile

2015-07-17 Thread Lawrence D';Anna
The HOST_*FLAGS are for compiling programs which will run on the machine that is
running the build.  Setting these flags is frequently required for unusual
cross-compiles.

Signed-off-by: Lawrence D'Anna 
---
 tools/mkimage/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/mkimage/Makefile b/tools/mkimage/Makefile
index a65eedf..f73cc56 100644
--- a/tools/mkimage/Makefile
+++ b/tools/mkimage/Makefile
@@ -31,8 +31,8 @@ define Host/Prepare
 endef
 
 define Host/Compile
-   $(MAKE) -C $(HOST_BUILD_DIR) defconfig
-   $(MAKE) -C $(HOST_BUILD_DIR) tools-only
+   $(MAKE) -C $(HOST_BUILD_DIR) defconfig   HOSTCFLAGS="$(HOST_CPPFLAGS) 
$(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS)"
+   $(MAKE) -C $(HOST_BUILD_DIR) tools-only  HOSTCFLAGS="$(HOST_CPPFLAGS) 
$(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS)"
 endef
 
 define Host/Install
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] strace: cross compile fix: pass HOST_*FLAGS in to ./configure

2015-07-17 Thread Lawrence D';Anna
The HOST_*FLAGS are for compiling programs which will run on the machine that is
running the build.  Setting these flags is frequently required for unusual
cross-compiles.

Signed-off-by: Lawrence D'Anna 
---
 package/devel/strace/Makefile | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile
index eb80791..b9ed201 100644
--- a/package/devel/strace/Makefile
+++ b/package/devel/strace/Makefile
@@ -27,6 +27,12 @@ PKG_INSTALL:=1
 
 include $(INCLUDE_DIR)/package.mk
 
+CONFIGURE_VARS+= \
+   LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
+   CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \
+   CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
+   CC_FOR_BUILD="$(HOST_CC)"
+
 define Package/strace
   SECTION:=utils
   CATEGORY:=Utilities
-- 
2.3.8 (Apple Git-58)
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


Re: [OpenWrt-Devel] [PATCH] tools/e2fsprogs: add a darwin-compat patch

2015-03-29 Thread Lawrence D';Anna

> On Mar 28, 2015, at 10:22 PM, Felix Fietkau  wrote:
> 
> On 2015-03-17 07:41, Lawrence D'Anna wrote:
>> On darwin we need to import stdint to get these integer typedefs.
> It works for me on darwin without this patch. What version are you
> using, and what does the error look like?

mac os 10.10.2

make[5]: Entering directory 
'/Volumes/CaseSensitive/openwrt.foo/build_dir/host/e2fsprogs-1.42.8/lib/e2p'
CC fgetflags.c
In file included from fgetflags.c:36:
In file included from ./e2p.h:14:
In file included from ../../lib/ext2fs/ext2_fs.h:19:
../../lib/ext2fs/ext2_types.h:20:9: error: unknown type name 'uint8_t'
typedef __U8_TYPEDEF __u8;
^
../../lib/ext2fs/ext2_types.h:14:22: note: expanded from macro '__U8_TYPEDEF'
#define __U8_TYPEDEF uint8_t
 ^
../../lib/ext2fs/ext2_types.h:32:9: error: unknown type name 'uint16_t'
typedef __U16_TYPEDEF __u16;
^
../../lib/ext2fs/ext2_types.h:15:23: note: expanded from macro '__U16_TYPEDEF'
#define __U16_TYPEDEF uint16_t
  ^
../../lib/ext2fs/ext2_types.h:61:9: error: unknown type name 'uint32_t'
typedef __U32_TYPEDEF __u32;
^
../../lib/ext2fs/ext2_types.h:16:23: note: expanded from macro '__U32_TYPEDEF'
#define __U32_TYPEDEF uint32_t
  ^
3 errors generated.
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] tools/e2fsprogs: add a darwin-compat patch

2015-03-16 Thread Lawrence D';Anna
On darwin we need to import stdint to get these integer typedefs.
---
 tools/e2fsprogs/patches/005-darwin-compat.patch | 26 +
 1 file changed, 26 insertions(+)
 create mode 100644 tools/e2fsprogs/patches/005-darwin-compat.patch

diff --git a/tools/e2fsprogs/patches/005-darwin-compat.patch 
b/tools/e2fsprogs/patches/005-darwin-compat.patch
new file mode 100644
index 000..8a1db91
--- /dev/null
+++ b/tools/e2fsprogs/patches/005-darwin-compat.patch
@@ -0,0 +1,26 @@
+--- a/lib/blkid/blkid_types.h.in
 b/lib/blkid/blkid_types.h.in
+@@ -9,6 +9,10 @@
+ 
+ @ASM_TYPES_HEADER@
+ 
++#if __APPLE__
++#include 
++#endif
++
+ #ifdef __U8_TYPEDEF
+ typedef __U8_TYPEDEF __u8;
+ #else
+--- a/lib/ext2fs/ext2_types.h.in
 b/lib/ext2fs/ext2_types.h.in
+@@ -9,6 +9,10 @@
+ 
+ @ASM_TYPES_HEADER@
+ 
++#if __APPLE__
++#include 
++#endif
++
+ #ifdef __U8_TYPEDEF
+ typedef __U8_TYPEDEF __u8;
+ #else
-- 
2.3.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel