public inbox for trinity@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] configure.sh: use colors only with terminal
@ 2013-10-16 10:43 Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 02/12] configure.sh: use gcc as default compiler Mikko Rapeli
                   ` (10 more replies)
  0 siblings, 11 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

The color codes mess up less and log files.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 configure.sh |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/configure.sh b/configure.sh
index 3b3823f..d7f16cb 100755
--- a/configure.sh
+++ b/configure.sh
@@ -2,9 +2,11 @@
 
 DEVEL=0
 
-RED="^[[1;31m"
-GREEN="^[[1;32m"
-COL_RESET="^[[0;m"
+if [ -t 1 ]; then
+	RED="^[[1;31m"
+	GREEN="^[[1;32m"
+	COL_RESET="^[[0;m"
+fi
 
 MISSING_DEFS=0
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 02/12] configure.sh: use gcc as default compiler
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-17  4:23   ` Michael Ellerman
  2013-10-16 10:43 ` [PATCH 03/12] configure.sh: expand tilde from CROSS_COMPILE variable Mikko Rapeli
                   ` (9 subsequent siblings)
  10 siblings, 1 reply; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Cross compilers might not have cc symlink but do have gcc.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 configure.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.sh b/configure.sh
index d7f16cb..c1a5ad2 100755
--- a/configure.sh
+++ b/configure.sh
@@ -10,7 +10,7 @@ fi
 
 MISSING_DEFS=0
 
-[ -z "$CC" ] && CC=cc
+[ -z "$CC" ] && CC=gcc
 
 CC=${CROSS_COMPILE}${CC}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 03/12] configure.sh: expand tilde from CROSS_COMPILE variable
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 02/12] configure.sh: use gcc as default compiler Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 04/12] configure.sh: show error output when something is not found Mikko Rapeli
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Users can define cross compiler paths like
CROSS_COMPILE="ccache ~/bin/arm/bin/..." and would like this to work.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 configure.sh |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure.sh b/configure.sh
index c1a5ad2..824abea 100755
--- a/configure.sh
+++ b/configure.sh
@@ -12,7 +12,8 @@ MISSING_DEFS=0
 
 [ -z "$CC" ] && CC=gcc
 
-CC=${CROSS_COMPILE}${CC}
+# expand tilde
+CC="$(eval echo ${CROSS_COMPILE}${CC})"
 
 echo "/* This file is auto-generated by configure.sh */" > config.h
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 04/12] configure.sh: show error output when something is not found
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 02/12] configure.sh: use gcc as default compiler Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 03/12] configure.sh: expand tilde from CROSS_COMPILE variable Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-18 18:00   ` Dave Jones
  2013-10-16 10:43 ` [PATCH 05/12] " Mikko Rapeli
                   ` (7 subsequent siblings)
  10 siblings, 1 reply; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

It can be a configuration or ortherwise important warning/error.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 configure.sh |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/configure.sh b/configure.sh
index 824abea..3bececc 100755
--- a/configure.sh
+++ b/configure.sh
@@ -32,6 +32,7 @@ check_header()
 		echo "#define $2 1" >> config.h
 	else
 		echo $RED "[NO]" $COL_RESET
+		cat "$TMP.log"
 		MISSING_DEFS=1
 	fi
 }
@@ -68,6 +69,7 @@ ${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
 
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
+	cat "$TMP.log"
 	MISSING_DEFS=1
 else
 	echo $GREEN "[YES]" $COL_RESET
@@ -97,6 +99,7 @@ ${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
 
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
+	cat "$TMP.log"
 	MISSING_DEFS=1
 else
 	echo $GREEN "[YES]" $COL_RESET
@@ -126,6 +129,7 @@ ${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
 
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
+	cat "$TMP.log"
 	MISSING_DEFS=1
 else
 	echo $GREEN "[YES]" $COL_RESET
@@ -153,6 +157,7 @@ ${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
 
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
+	cat "$TMP.log"
 	MISSING_DEFS=1
 else
 	echo $GREEN "[YES]" $COL_RESET
@@ -180,6 +185,7 @@ ${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
 
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
+	cat "$TMP.log"
 	MISSING_DEFS=1
 else
 	echo $GREEN "[YES]" $COL_RESET
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 05/12] configure.sh: support cross compilation with sysroot
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (2 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 04/12] configure.sh: show error output when something is not found Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 06/12] Makefile: use gcc as compiler Mikko Rapeli
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

SYSROOT points to the path where libs and headers are to be searched
from.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 configure.sh |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/configure.sh b/configure.sh
index 3bececc..8d1927e 100755
--- a/configure.sh
+++ b/configure.sh
@@ -15,6 +15,11 @@ MISSING_DEFS=0
 # expand tilde
 CC="$(eval echo ${CROSS_COMPILE}${CC})"
 
+CFLAGS=""
+if [ "${SYSROOT}xx" != "xx" ]; then
+	CFLAGS="$(eval echo --sysroot=${SYSROOT} )"
+fi
+
 echo "/* This file is auto-generated by configure.sh */" > config.h
 
 TMP=$(mktemp)
@@ -26,7 +31,7 @@ check_header()
 	rm -f "$TMP" || exit 1
 	echo "#include <$1>" >"$TMP.c"
 
-	${CC} "$TMP.c" -E &>"$TMP.log"
+	${CC} ${CFLAGS} "$TMP.c" -E &>"$TMP.log"
 	if [ $? -eq 0 ]; then
 		echo $GREEN "[YES]" $COL_RESET
 		echo "#define $2 1" >> config.h
@@ -65,8 +70,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	cat "$TMP.log"
@@ -95,8 +99,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	cat "$TMP.log"
@@ -125,8 +128,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	cat "$TMP.log"
@@ -153,8 +155,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	cat "$TMP.log"
@@ -181,8 +182,7 @@ int main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	cat "$TMP.log"
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 06/12] Makefile: use gcc as compiler
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (3 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 05/12] " Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 07/12] Makefile: support sysroot for libs and includes Mikko Rapeli
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Cross compilers might not have cc symlink to gcc.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 Makefile |    1 +
 1 file changed, 1 insertion(+)

diff --git a/Makefile b/Makefile
index 298065c..eb7ac9a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ VERSION=1.3pre
 INSTALL_PREFIX ?= $(DESTDIR)
 INSTALL_PREFIX ?= $(HOME)
 
+CC := gcc
 CC := $(CROSS_COMPILE)$(CC)
 LD := $(CROSS_COMPILE)$(LD)
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 07/12] Makefile: support sysroot for libs and includes
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (4 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 06/12] Makefile: use gcc as compiler Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 08/12] Define IP_MULTICAST_ALL if header files don't have it Mikko Rapeli
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Helps with cross compilation when correct lib and include files
are used.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 Makefile |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index eb7ac9a..037a04e 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,10 @@ CC := gcc
 CC := $(CROSS_COMPILE)$(CC)
 LD := $(CROSS_COMPILE)$(LD)
 
-CFLAGS = -Wall -W -g -O2 -I. -Iinclude/ -Wimplicit -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
+CFLAGS := -Wall -W -g -O2 -I. -Iinclude/ -Wimplicit -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
+ifneq ($(SYSROOT),)
+CFLAGS += --sysroot=$(SYSROOT)
+endif
 #CFLAGS += $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-m32"; fi)
 CFLAGS += -Wdeclaration-after-statement
 CFLAGS += -Wformat=2
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 08/12] Define IP_MULTICAST_ALL if header files don't have it
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (5 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 07/12] Makefile: support sysroot for libs and includes Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 09/12] net/irda_setsockopt.c: workaround for old irda headers Mikko Rapeli
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Older systems have it defined in <linux/in.h> which conflicts with
<netinet/in.h>.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 net/ip_setsockopt.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/ip_setsockopt.c b/net/ip_setsockopt.c
index 3d7c126..af4b873 100644
--- a/net/ip_setsockopt.c
+++ b/net/ip_setsockopt.c
@@ -12,6 +12,11 @@
 #include "random.h"
 #include "trinity.h"	// ARRAY_SIZE
 
+/* workaround for <linux/in.h> vs. <netinet/in.h> */
+#ifndef IP_MULTICAST_ALL
+#define IP_MULTICAST_ALL 49
+#endif
+
 #define NR_SOL_IP_OPTS ARRAY_SIZE(ip_opts)
 static const unsigned int ip_opts[] = { IP_TOS, IP_TTL, IP_HDRINCL, IP_OPTIONS,
 	IP_ROUTER_ALERT, IP_RECVOPTS, IP_RETOPTS, IP_PKTINFO,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 09/12] net/irda_setsockopt.c: workaround for old irda headers
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (6 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 08/12] Define IP_MULTICAST_ALL if header files don't have it Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 10/12] net/netlink.c: support older kernels and headers Mikko Rapeli
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 net/irda_setsockopt.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/irda_setsockopt.c b/net/irda_setsockopt.c
index e6255b2..692ef52 100644
--- a/net/irda_setsockopt.c
+++ b/net/irda_setsockopt.c
@@ -1,5 +1,9 @@
 #include <stdlib.h>
 #include <sys/socket.h> /* old irda.h is broken */
+
+/* old irda.h does not include something which defines sa_family_t */
+#include <netinet/in.h>
+
 #include <linux/irda.h>
 #include "net.h"
 #include "maps.h"	// page_rand
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 10/12] net/netlink.c: support older kernels and headers
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (7 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 09/12] net/irda_setsockopt.c: workaround for old irda headers Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 11/12] net/netlink_setsockopt.c: workaround for old headers Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 12/12] Makefile: install depends on trinity target Mikko Rapeli
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 net/netlink.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/net/netlink.c b/net/netlink.c
index 6192184..4b7eed8 100644
--- a/net/netlink.c
+++ b/net/netlink.c
@@ -8,6 +8,17 @@
 #include "net.h"
 #include "random.h"
 
+/* Current highest netlink socket. Supports some older kernels. */
+#ifdef NETLINK_CRYPTO
+#define _NETLINK_MAX NETLINK_CRYPTO
+#else
+	#ifdef NETLINK_RDMA
+	#define _NETLINK_MAX NETLINK_RDMA
+	#else
+		#define _NETLINK_MAX NETLINK_ECRYPTFS
+	#endif /* NETLINK_RDMA */
+#endif /* NETLINK_CRYPTO */
+
 void netlink_gen_sockaddr(unsigned long *addr, unsigned long *addrlen)
 {
 	struct sockaddr_nl *nl;
@@ -30,5 +41,5 @@ void netlink_rand_socket(struct socket_triplet *st)
 	else
 		st->type = SOCK_DGRAM;
 
-	st->protocol = rand() % (NETLINK_CRYPTO + 1);       // Current highest netlink socket.
+	st->protocol = rand() % (_NETLINK_MAX + 1);
 }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 11/12] net/netlink_setsockopt.c: workaround for old headers
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (8 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 10/12] net/netlink.c: support older kernels and headers Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  2013-10-16 10:43 ` [PATCH 12/12] Makefile: install depends on trinity target Mikko Rapeli
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 net/netlink_setsockopt.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/netlink_setsockopt.c b/net/netlink_setsockopt.c
index 549c3f0..76e458f 100644
--- a/net/netlink_setsockopt.c
+++ b/net/netlink_setsockopt.c
@@ -1,5 +1,9 @@
 #include <stdlib.h>
 #include <sys/socket.h> /* old netlink.h is broken */
+
+/* For sa_family_t needed by <linux/netlink.h> */
+#include <netinet/in.h>
+
 #include <linux/netlink.h>
 #include "net.h"
 #include "maps.h"	// page_rand
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 12/12] Makefile: install depends on trinity target
  2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
                   ` (9 preceding siblings ...)
  2013-10-16 10:43 ` [PATCH 11/12] net/netlink_setsockopt.c: workaround for old headers Mikko Rapeli
@ 2013-10-16 10:43 ` Mikko Rapeli
  10 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-16 10:43 UTC (permalink / raw)
  To: trinity; +Cc: mikko.rapeli

After this 'make install' just works.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 Makefile |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 037a04e..b0bdb36 100644
--- a/Makefile
+++ b/Makefile
@@ -107,7 +107,7 @@ tarball:
 	git prune-packed
 	git archive --format=tar.gz --prefix=trinity-$(VERSION)/ HEAD > trinity-$(VERSION).tgz
 
-install:
+install: trinity
 	install -d -m 755 $(INSTALL_PREFIX)/bin
 	install trinity $(INSTALL_PREFIX)/bin
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 02/12] configure.sh: use gcc as default compiler
  2013-10-16 10:43 ` [PATCH 02/12] configure.sh: use gcc as default compiler Mikko Rapeli
@ 2013-10-17  4:23   ` Michael Ellerman
  2013-10-17  6:45     ` Mikko Rapeli
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Ellerman @ 2013-10-17  4:23 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: trinity

On Wed, 2013-10-16 at 13:43 +0300, Mikko Rapeli wrote:
> Cross compilers might not have cc symlink but do have gcc.

It's trivial to create a symlink from foo-cc to foo-gcc, and any decent
cross compiler script will do that for you.

cheers


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 02/12] configure.sh: use gcc as default compiler
  2013-10-17  4:23   ` Michael Ellerman
@ 2013-10-17  6:45     ` Mikko Rapeli
  2013-10-17 12:53       ` Michael Ellerman
  0 siblings, 1 reply; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-17  6:45 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: trinity

On Thu, Oct 17, 2013 at 03:23:50PM +1100, Michael Ellerman wrote:
> On Wed, 2013-10-16 at 13:43 +0300, Mikko Rapeli wrote:
> > Cross compilers might not have cc symlink but do have gcc.
> 
> It's trivial to create a symlink from foo-cc to foo-gcc, and any decent
> cross compiler script will do that for you.

True, but Mentor/Codesourcery Lite version that I had to use did not have
this and I did not want to fix it. I'm ok if this one is dropped.

-Mikko

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 02/12] configure.sh: use gcc as default compiler
  2013-10-17  6:45     ` Mikko Rapeli
@ 2013-10-17 12:53       ` Michael Ellerman
  2013-10-18 18:01         ` Dave Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Michael Ellerman @ 2013-10-17 12:53 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: trinity

On Thu, 2013-10-17 at 09:45 +0300, Mikko Rapeli wrote:
> On Thu, Oct 17, 2013 at 03:23:50PM +1100, Michael Ellerman wrote:
> > On Wed, 2013-10-16 at 13:43 +0300, Mikko Rapeli wrote:
> > > Cross compilers might not have cc symlink but do have gcc.
> > 
> > It's trivial to create a symlink from foo-cc to foo-gcc, and any decent
> > cross compiler script will do that for you.
> 
> True, but Mentor/Codesourcery Lite version that I had to use did not have
> this and I did not want to fix it. I'm ok if this one is dropped.

Here's a Nickel kid, buy yourself a symlink ;)

It's up to Dave but it seems like the wrong fix to me.

cheers

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 04/12] configure.sh: show error output when something is not found
  2013-10-16 10:43 ` [PATCH 04/12] configure.sh: show error output when something is not found Mikko Rapeli
@ 2013-10-18 18:00   ` Dave Jones
  2013-10-18 18:07     ` Dave Jones
  0 siblings, 1 reply; 19+ messages in thread
From: Dave Jones @ 2013-10-18 18:00 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: trinity

On Wed, Oct 16, 2013 at 01:43:22PM +0300, Mikko Rapeli wrote:
 > It can be a configuration or ortherwise important warning/error.
 > 
 > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
 
I don't like this one, because in most cases, these aren't important.
On some machines, we even expect some of them to fail. Example, on a Fedora 19
system we run this test, which we expect to fail..


[*] Checking if glibc headers provide termios2..  [NO] 
/home/davej/tmp/tmp.U0xuPLOakW.c: In function ‘main’:
/home/davej/tmp/tmp.U0xuPLOakW.c:7:18: error: storage size of ‘test’ isn’t known
  struct termios2 test;
                  ^

Printing out an 'error' when there's nothing actually wrong seems alarmist.
Especially when we do the right thing, and include the right header afterwards.

	Dave

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 02/12] configure.sh: use gcc as default compiler
  2013-10-17 12:53       ` Michael Ellerman
@ 2013-10-18 18:01         ` Dave Jones
  0 siblings, 0 replies; 19+ messages in thread
From: Dave Jones @ 2013-10-18 18:01 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Mikko Rapeli, trinity

On Thu, Oct 17, 2013 at 11:53:45PM +1100, Michael Ellerman wrote:
 > On Thu, 2013-10-17 at 09:45 +0300, Mikko Rapeli wrote:
 > > On Thu, Oct 17, 2013 at 03:23:50PM +1100, Michael Ellerman wrote:
 > > > On Wed, 2013-10-16 at 13:43 +0300, Mikko Rapeli wrote:
 > > > > Cross compilers might not have cc symlink but do have gcc.
 > > > 
 > > > It's trivial to create a symlink from foo-cc to foo-gcc, and any decent
 > > > cross compiler script will do that for you.
 > > 
 > > True, but Mentor/Codesourcery Lite version that I had to use did not have
 > > this and I did not want to fix it. I'm ok if this one is dropped.
 > 
 > Here's a Nickel kid, buy yourself a symlink ;)
 > 
 > It's up to Dave but it seems like the wrong fix to me.

I don't have strong feelings either way as long everything carries on working for me.
Some of the later patches will reject if I do drop this though, so maybe it's
simpler to just apply it and move on.

	Dave


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 04/12] configure.sh: show error output when something is not found
  2013-10-18 18:00   ` Dave Jones
@ 2013-10-18 18:07     ` Dave Jones
  2013-10-28 10:48       ` [PATCH v2] configure.sh: support cross compilation with sysroot Mikko Rapeli
  0 siblings, 1 reply; 19+ messages in thread
From: Dave Jones @ 2013-10-18 18:07 UTC (permalink / raw)
  To: Mikko Rapeli; +Cc: trinity

On Fri, Oct 18, 2013 at 02:00:19PM -0400, Dave Jones wrote:
 > On Wed, Oct 16, 2013 at 01:43:22PM +0300, Mikko Rapeli wrote:
 >  > It can be a configuration or ortherwise important warning/error.
 >  > 
 >  > Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
 >  
 > I don't like this one, because in most cases, these aren't important.
 > On some machines, we even expect some of them to fail. Example, on a Fedora 19
 > system we run this test, which we expect to fail..
 > 
 > 
 > [*] Checking if glibc headers provide termios2..  [NO] 
 > /home/davej/tmp/tmp.U0xuPLOakW.c: In function ‘main’:
 > /home/davej/tmp/tmp.U0xuPLOakW.c:7:18: error: storage size of ‘test’ isn’t known
 >   struct termios2 test;
 >                   ^
 > 
 > Printing out an 'error' when there's nothing actually wrong seems alarmist.
 > Especially when we do the right thing, and include the right header afterwards.

[PATCH 05/12] configure.sh: support cross compilation with sysroot 
will need rebasing without this. I applied and pushed out everything else.

	Dave

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2] configure.sh: support cross compilation with sysroot
  2013-10-18 18:07     ` Dave Jones
@ 2013-10-28 10:48       ` Mikko Rapeli
  0 siblings, 0 replies; 19+ messages in thread
From: Mikko Rapeli @ 2013-10-28 10:48 UTC (permalink / raw)
  To: trinity

SYSROOT points to the path where libs and headers are to be searched
from.

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
 configure.sh |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/configure.sh b/configure.sh
index 824abea..91916ba 100755
--- a/configure.sh
+++ b/configure.sh
@@ -15,6 +15,11 @@ MISSING_DEFS=0
 # expand tilde
 CC="$(eval echo ${CROSS_COMPILE}${CC})"
 
+CFLAGS=""
+if [ "${SYSROOT}xx" != "xx" ]; then
+	CFLAGS="$(eval echo --sysroot=${SYSROOT} )"
+fi
+
 echo "/* This file is auto-generated by configure.sh */" > config.h
 
 TMP=$(mktemp)
@@ -26,7 +31,7 @@ check_header()
 	rm -f "$TMP" || exit 1
 	echo "#include <$1>" >"$TMP.c"
 
-	${CC} "$TMP.c" -E &>"$TMP.log"
+	${CC} ${CFLAGS} "$TMP.c" -E &>"$TMP.log"
 	if [ $? -eq 0 ]; then
 		echo $GREEN "[YES]" $COL_RESET
 		echo "#define $2 1" >> config.h
@@ -64,8 +69,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	MISSING_DEFS=1
@@ -93,8 +97,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	MISSING_DEFS=1
@@ -122,8 +125,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	MISSING_DEFS=1
@@ -149,8 +151,7 @@ void main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	MISSING_DEFS=1
@@ -176,8 +177,7 @@ int main()
 }
 EOF
 
-${CC} "$TMP.c" -o "$TMP" &>"$TMP.log"
-
+${CC} ${CFLAGS} "$TMP.c" -o "$TMP" &>"$TMP.log"
 if [ ! -x "$TMP" ]; then
 	echo $RED "[NO]" $COL_RESET
 	MISSING_DEFS=1
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-10-28 10:48 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-16 10:43 [PATCH 01/12] configure.sh: use colors only with terminal Mikko Rapeli
2013-10-16 10:43 ` [PATCH 02/12] configure.sh: use gcc as default compiler Mikko Rapeli
2013-10-17  4:23   ` Michael Ellerman
2013-10-17  6:45     ` Mikko Rapeli
2013-10-17 12:53       ` Michael Ellerman
2013-10-18 18:01         ` Dave Jones
2013-10-16 10:43 ` [PATCH 03/12] configure.sh: expand tilde from CROSS_COMPILE variable Mikko Rapeli
2013-10-16 10:43 ` [PATCH 04/12] configure.sh: show error output when something is not found Mikko Rapeli
2013-10-18 18:00   ` Dave Jones
2013-10-18 18:07     ` Dave Jones
2013-10-28 10:48       ` [PATCH v2] configure.sh: support cross compilation with sysroot Mikko Rapeli
2013-10-16 10:43 ` [PATCH 05/12] " Mikko Rapeli
2013-10-16 10:43 ` [PATCH 06/12] Makefile: use gcc as compiler Mikko Rapeli
2013-10-16 10:43 ` [PATCH 07/12] Makefile: support sysroot for libs and includes Mikko Rapeli
2013-10-16 10:43 ` [PATCH 08/12] Define IP_MULTICAST_ALL if header files don't have it Mikko Rapeli
2013-10-16 10:43 ` [PATCH 09/12] net/irda_setsockopt.c: workaround for old irda headers Mikko Rapeli
2013-10-16 10:43 ` [PATCH 10/12] net/netlink.c: support older kernels and headers Mikko Rapeli
2013-10-16 10:43 ` [PATCH 11/12] net/netlink_setsockopt.c: workaround for old headers Mikko Rapeli
2013-10-16 10:43 ` [PATCH 12/12] Makefile: install depends on trinity target Mikko Rapeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox