All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Auty <mike.auty@gmail.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org
Subject: iw Makefile patch to allow compilation using --as-needed
Date: Fri, 12 Dec 2008 21:32:03 +0000	[thread overview]
Message-ID: <4942D853.10105@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 672 bytes --]

Hiya,
	I've got a patch for the iw program to allow it to compile properly
with the --as-needed linker flag.  This flag requires that files and
libraries are listed in a particular order, with required libraries
listed after the functions that call them.
	The original Makefile for iw adds the libraries to the LDFLAGS
variable, which is processed before the OBJS are listed (so the
libraries are removed).  This patch adds a LIBS variable and applies it
after the OBJS variable.
	For more information on as-needed, please see
http://www.gentoo.org/proj/en/qa/asneeded.xml.  If you have any problems
or issues with the patch, please let me know, thanks...  5:)
	Mike  5:)

[-- Attachment #2: iw-0.9.7-as-needed.patch --]
[-- Type: text/plain, Size: 715 bytes --]

diff --git a/Makefile b/Makefile
index df59b51..8a97bae 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ CC ?= "gcc"
 
 CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration `pkg-config --cflags libnl-1`
 CFLAGS += -O2 -g
-LDFLAGS += `pkg-config --libs libnl-1`
+LIBS += `pkg-config --libs libnl-1`
 NLVERSION = 1.0
 
 OBJS = iw.o info.o phy.o interface.o station.o util.o mpath.o reg.o mesh.o genl.o
@@ -42,7 +42,7 @@ version.h: version.sh
 
 iw:	$(OBJS)
 	@$(NQ) ' CC  ' iw
-	$(Q)$(CC) $(LDFLAGS) $(OBJS) -o iw
+	$(Q)$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o iw
 
 check:
 	$(Q)$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc"

             reply	other threads:[~2008-12-12 21:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-12 21:32 Mike Auty [this message]
2008-12-12 21:48 ` iw Makefile patch to allow compilation using --as-needed Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4942D853.10105@gmail.com \
    --to=mike.auty@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.