Skip to content

Commit 84dfaf8

Browse files
committed
- removed init script installation from spacenavd's install target, added
message to the user instead. Applied Hans Meine's patches: - allow build dir != source dir - install into /lib64 if /lib64 exists (modified that one to use uname -m in the configure script, debian seems to have a lib64 even on 32bit systems) - display X11 connection closing in verbose mode, too (not only init) git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/trunk/libspnav@47 ef983eb1-d774-4af8-acfd-baaf7b16a646
1 parent 0043331 commit 84dfaf8

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

Makefile.in

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ $(lib_a): $(obj)
1616
$(AR) rcs $@ $(obj)
1717

1818
$(lib_so): $(obj)
19-
$(CC) $(CFLAGS) -shared -o $@ $(obj)
19+
$(CC) -shared -o $@ $(obj)
20+
21+
%.o: $(srcdir)/%.c
22+
$(CC) $(CFLAGS) -c $< -o $@
2023

2124
.PHONY: clean
2225
clean:
@@ -28,13 +31,13 @@ distclean:
2831

2932
.PHONY: install
3033
install: $(lib_a) $(lib_so)
31-
cp $(lib_a) $(PREFIX)/lib/$(lib_a)
32-
cp $(lib_so) $(PREFIX)/lib/$(lib_so)
33-
cp $(hdr) $(PREFIX)/include/
34+
cp $(lib_a) $(PREFIX)/$(libdir)/$(lib_a)
35+
cp $(lib_so) $(PREFIX)/$(libdir)/$(lib_so)
36+
for h in $(hdr); do cp -p $(srcdir)/$$h $(PREFIX)/include/; done
3437

3538
.PHONY: uninstall
3639
uninstall:
37-
rm -f $(PREFIX)/lib/$(lib_a)
38-
rm -f $(PREFIX)/lib/$(lib_so)
40+
rm -f $(PREFIX)/$(libdir)/$(lib_a)
41+
rm -f $(PREFIX)/$(libdir)/$(lib_so)
3942
for i in $(hdr); do rm -f $(PREFIX)/include/$$i; done
4043

configure

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ OPT=yes
77
DBG=yes
88
X11=yes
99

10+
srcdir="`dirname "$0"`"
11+
libdir=lib
12+
13+
if [ "`uname -m`" = 'x86_64' ]; then
14+
libdir=lib64
15+
fi
16+
1017
for arg; do
1118
case "$arg" in
1219
--prefix=*)
@@ -56,9 +63,11 @@ if [ "$X11" = "no" ]; then
5663
echo ""
5764
fi
5865

59-
# create makefile
60-
echo 'creating makefile ...'
66+
# create Makefile
67+
echo 'creating Makefile ...'
6168
echo "PREFIX = $PREFIX" >Makefile
69+
echo "srcdir = $srcdir" >>Makefile
70+
echo "libdir = $libdir" >>Makefile
6271

6372
if [ "$DBG" = 'yes' ]; then
6473
echo 'dbg = -g' >>Makefile
@@ -73,7 +82,7 @@ if [ "$X11" = 'yes' ]; then
7382
echo 'xlib = -lX11' >>Makefile
7483
fi
7584

76-
cat Makefile.in >>Makefile
85+
cat "$srcdir/Makefile.in" >>Makefile
7786

7887
# create spnav_config.h
7988
echo 'creating spnav_config.h ...'

0 commit comments

Comments
 (0)