diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-02-16 16:52:35 -0500 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2008-02-17 08:09:18 -0800 |
commit | 35db49303a933a7afd108354facb7b7cfce9d2ca (patch) | |
tree | a9bfef86986d821423511ffd0e26687eb14801cf | |
parent | a9d23408b0594ffa763add70f0998438bd89c68a (diff) | |
download | libcap-35db49303a933a7afd108354facb7b7cfce9d2ca.tar.gz |
Do not hard code toolchain binaries
If you are cross-compiling, you cannot execute `ar` and `ranlib` on the
target library, otherwise things may break. Here we create standard AR
and RANLIB variables which can easily be overridden by the environment.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r-- | Make.Rules | 4 | ||||
-rw-r--r-- | libcap/Makefile | 4 |
2 files changed, 5 insertions, 3 deletions
@@ -42,7 +42,9 @@ MINOR=06 # Compilation specifics -CC=gcc +CC ?= gcc +AR ?= ar +RANLIB ?= ranlib COPTFLAGS=-O2 DEBUG=-O2 -g #-DDEBUG WARNINGS=-fPIC -Wall -Wwrite-strings \ diff --git a/libcap/Makefile b/libcap/Makefile index b108aa9..09a12d2 100644 --- a/libcap/Makefile +++ b/libcap/Makefile @@ -40,8 +40,8 @@ cap_names.sed: Makefile $(KERNEL_HEADERS)/linux/capability.h @sed -ne '/^#define[ \t]CAP[_A-Z]\+[ \t]\+[0-9]\+/{s/^#define \([^ \t]*\)[ \t]*\([^ \t]*\)/\{\"\1\",\2\},/;y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;p;}' < $(KERNEL_HEADERS)/linux/capability.h | fgrep -v 0x > $@ $(STALIBNAME): $(OBJS) - ar rcs $(STALIBNAME) $(OBJS) - ranlib $(STALIBNAME) + $(AR) rcs $(STALIBNAME) $(OBJS) + $(RANLIB) $(STALIBNAME) $(MINLIBNAME): $(OBJS) $(LD) $(LDFLAGS) $(COPTFLAG) -Wl,-soname,$(MAJLIBNAME) -o $@ $(OBJS) |