aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-02-16 16:52:35 -0500
committerAndrew G. Morgan <morgan@kernel.org>2008-02-17 08:09:18 -0800
commit35db49303a933a7afd108354facb7b7cfce9d2ca (patch)
treea9bfef86986d821423511ffd0e26687eb14801cf
parenta9d23408b0594ffa763add70f0998438bd89c68a (diff)
downloadlibcap-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.Rules4
-rw-r--r--libcap/Makefile4
2 files changed, 5 insertions, 3 deletions
diff --git a/Make.Rules b/Make.Rules
index 9bccbb7..3f38e72 100644
--- a/Make.Rules
+++ b/Make.Rules
@@ -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)