diff mbox

[v2] aiccu: patched Makefile to enable static linking

Message ID 1380563862-4241-1-git-send-email-rommel@layer-7.net
State Accepted
Commit b9e7f642c3ca0def4453e91c0f739573a8694289
Headers show

Commit Message

Michael Rommel Sept. 30, 2013, 5:57 p.m. UTC
Fixes autobuild errors:
http://autobuild.buildroot.net/results/308087e1f85e822dec8b73a3ed892c7cd2376cbd/
http://autobuild.buildroot.net/results/9fb298d4e09a6f9b88207909d583dce05392048e/

Signed-off-by: Michael Rommel <rommel@layer-7.net>
---
v1: initial patch to add required libraries for static linking to LDFLAGS
    and reorder the CC commandline

v2: added signed-off line and commit msg to patch, added autobuild URIs to 
    commit msg

 ...cu-0002-makefile-reorder-linked-libraries.patch |   24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch

Comments

Peter Korsgaard Oct. 1, 2013, 7:55 a.m. UTC | #1
>>>>> "M" == Michael Rommel <rommel@layer-7.net> writes:

 M> Fixes autobuild errors:
 M> http://autobuild.buildroot.net/results/308087e1f85e822dec8b73a3ed892c7cd2376cbd/
 M> http://autobuild.buildroot.net/results/9fb298d4e09a6f9b88207909d583dce05392048e/

 M> Signed-off-by: Michael Rommel <rommel@layer-7.net>
 M> ---
 M> v1: initial patch to add required libraries for static linking to LDFLAGS
 M>     and reorder the CC commandline

 M> v2: added signed-off line and commit msg to patch, added autobuild URIs to 
 M>     commit msg

 M>  ...cu-0002-makefile-reorder-linked-libraries.patch |   24 ++++++++++++++++++++
 M>  1 file changed, 24 insertions(+)
 M>  create mode 100644 package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch

 M> diff --git a/package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch b/package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch
 M> new file mode 100644
 M> index 0000000..cc189b2
 M> --- /dev/null
 M> +++ b/package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch
 M> @@ -0,0 +1,24 @@
 M> +Makefile: changed LDFLAGS contents and order on the compile line for --static
 M> +
 M> +Signed-off-by: Michael Rommel <rommel@layer-7.net>
 M> +
 M> +--- aiccu_20070115.orig/unix-console/Makefile	2007-01-15 12:04:27.000000000 +0100
 M> ++++ aiccu_20070115/unix-console/Makefile	2013-09-29 22:54:42.742963861 +0200
 M> +@@ -42,7 +42,7 @@ CFLAGS	+= -D AICCU_CONSOLE
 M> + # Currently defaultly builds only on Linux, but other platforms might easily also support it
 M> + ifeq ($(shell uname | grep -c "Linux"),1)
 M> + CFLAGS	+= -D AICCU_GNUTLS
 M> +-LDFLAGS += -lgnutls
 M> ++LDFLAGS += -lgnutls -lhogweed -lnettle -lgmp -lz

Thanks. The problem is that zlib (and libidn, p11-kit and libtasn1) are
all optional for gnutls (but needed in LDFLAGS when statically linking),
so this doesn't really work.

Perhaps we should handle it in aiccu.mk instead, either manually or
using pkg-config --static --libs gnutls
Peter Korsgaard Oct. 1, 2013, 5:46 p.m. UTC | #2
>>>>> "Peter" == Peter Korsgaard <jacmet@uclibc.org> writes:

 M> + ifeq ($(shell uname | grep -c "Linux"),1)
 M> + CFLAGS	+= -D AICCU_GNUTLS
 M> +-LDFLAGS += -lgnutls
 M> ++LDFLAGS += -lgnutls -lhogweed -lnettle -lgmp -lz

 Peter> Thanks. The problem is that zlib (and libidn, p11-kit and libtasn1) are
 Peter> all optional for gnutls (but needed in LDFLAGS when statically linking),
 Peter> so this doesn't really work.

 Peter> Perhaps we should handle it in aiccu.mk instead, either manually or
 Peter> using pkg-config --static --libs gnutls

Committed with that changed, thanks.
diff mbox

Patch

diff --git a/package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch b/package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch
new file mode 100644
index 0000000..cc189b2
--- /dev/null
+++ b/package/aiccu/aiccu-0002-makefile-reorder-linked-libraries.patch
@@ -0,0 +1,24 @@ 
+Makefile: changed LDFLAGS contents and order on the compile line for --static
+
+Signed-off-by: Michael Rommel <rommel@layer-7.net>
+
+--- aiccu_20070115.orig/unix-console/Makefile	2007-01-15 12:04:27.000000000 +0100
++++ aiccu_20070115/unix-console/Makefile	2013-09-29 22:54:42.742963861 +0200
+@@ -42,7 +42,7 @@ CFLAGS	+= -D AICCU_CONSOLE
+ # Currently defaultly builds only on Linux, but other platforms might easily also support it
+ ifeq ($(shell uname | grep -c "Linux"),1)
+ CFLAGS	+= -D AICCU_GNUTLS
+-LDFLAGS += -lgnutls
++LDFLAGS += -lgnutls -lhogweed -lnettle -lgmp -lz
+ endif
+ 
+ # Linux
+@@ -144,7 +144,7 @@ endif
+ all: aiccu
+ 
+ aiccu:	$(OBJS) ${SRCS} ${INCS}
+-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS)
++	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
+ ifeq ($(shell echo $(CFLAGS) | grep -c "DEBUG"),0)
+ ifeq ($(shell echo "$(RPM_OPT_FLAGS)" | wc -c),1)
+ 	strip $@