[PATCH 2/3] linkdir configure option
Michael Neuling
mikey at neuling.org
Sun Jan 1 22:59:05 EST 2006
This adds the ability to put the links (links to ccontrol called gcc,
cc, ld etc.) in a different directory than the ccontrol[-init] programs
using the --libdir= option.
Signed-off-by: Michael Neuling <mikey at neuling.org>
---
Makefile.in | 15 ++++++++++-----
configure | 6 +++++-
2 files changed, 15 insertions(+), 6 deletions(-)
Index: ccontrol-0.8.2/Makefile.in
===================================================================
--- ccontrol-0.8.2.orig/Makefile.in
+++ ccontrol-0.8.2/Makefile.in
@@ -5,13 +5,14 @@ GPERF_C_FILES:=extensions.c keywords.c
# Everything depends on makefile, headers, gperf files
ALLFILES=$(C_FILES) $(GPERF_C_FILES) Makefile stdrusty.h ccontrol.h
BINDIR=@BINDIR@
+LIBDIR=@LIBDIR@
MANDIR=@MANDIR@
XMLTO=@XMLTO@
ASCIIDOC=@ASCIIDOC@
VALGRIND=@VALGRIND@
VERSION=@VERSION@
-LINKS=$(foreach l,gcc cc g++ c++ ld make,$(BINDIR)/$l)
+LINKS=$(foreach l,gcc cc g++ c++ ld make,$(LIBDIR)/$l)
ccontrol: $(ALLFILES) ccontrol.1
$(CC) $(CFLAGS) -DVERSION='"$(VERSION) (@VERSION_NAME@)"' -o $@ $(C_FILES)
@@ -28,10 +29,14 @@ ccontrol_test: $(ALLFILES)
$(GPERF_C_FILES): %.c: %.gperf
gperf $< > $@
-$(BINDIR) $(MANDIR)/man1:
+$(BINDIR) $(MANDIR)/man1 $(LIBDIR):
mkdir -p $@
-install: $(BINDIR) $(MANDIR)/man1 $(BINDIR)/ccontrol $(BINDIR)/ccontrol-init $(LINKS) $(MANDIR)/man1/ccontrol.1 $(MANDIR)/man1/ccontrol-init.1
+install: installbin installlib installman
+
+installman: $(MANDIR)/man1 $(MANDIR)/man1/ccontrol.1 $(MANDIR)/man1/ccontrol-init.1
+
+installbin: $(BINDIR) $(BINDIR)/ccontrol $(BINDIR)/ccontrol-init
$(BINDIR)/ccontrol: ccontrol
cp $< $@
@@ -39,10 +44,10 @@ $(BINDIR)/ccontrol: ccontrol
$(BINDIR)/ccontrol-init: ccontrol-init
cp $< $@
-links: $(LINKS)
+installlib: $(LINKS) $(LIBDIR)
$(LINKS): %: ccontrol
- ln -sf ccontrol $@
+ ln -sf $(BINDIR)/ccontrol $@
$(MANDIR)/man1/ccontrol.1: ccontrol.1
cp $< $@
Index: ccontrol-0.8.2/configure
===================================================================
--- ccontrol-0.8.2.orig/configure
+++ ccontrol-0.8.2/configure
@@ -12,7 +12,8 @@ if [ x"$1" = "x--reconfigure" ]; then
exit
fi
-BINDIR=/usr/local/lib/ccontrol
+BINDIR=/usr/local/bin
+LIBDIR=/usr/local/lib/ccontrol
MANDIR=/usr/local/share/man
XMLTO=`which xmlto`
ASCIIDOC=`which asciidoc`
@@ -23,6 +24,7 @@ VERSION_NAME="Krisztian Kovacs"
while [ $# -gt 0 ]; do
case "$1" in
--bindir=*) BINDIR=`echo $1 | cut -d= -f2-`;;
+ --libdir=*) LIBDIR=`echo $1 | cut -d= -f2-`;;
--mandir=*) MANDIR=`echo $1 | cut -d= -f2-`;;
--xmlto=*) XMLTO=`echo $1 | cut -d= -f2-`;;
--asciidoc=*) ASCIIDOC=`echo $1 | cut -d= -f2-`;;
@@ -33,6 +35,7 @@ while [ $# -gt 0 ]; do
echo "Usage: configure [<options>]" >&2
echo "Valid options, with defaults:">&2
echo " --bindir=$BINDIR" >&2
+ echo " --libdir=$LIBDIR" >&2
echo " --mandir=$MANDIR" >&2
echo " --xmlto=$XMLTO" >&2
echo " --asciidoc=$ASCIIDOC" >&2
@@ -80,6 +83,7 @@ fi
echo sed -e \""s, at CC@,$CC,g\"" \
-e \""s, at BINDIR@,$BINDIR,g\"" \
+ -e \""s, at LIBDIR@,$LIBDIR,g\"" \
-e \""s, at MANDIR@,$MANDIR,g\"" \
-e \""s, at XMLTO@,$XMLTO,g\"" \
-e \""s, at ASCIIDOC@,$ASCIIDOC,g\"" \
More information about the ccontrol
mailing list