Skip to content

Commit 59246a0

Browse files
committed
initial import of libspnav
git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/libspnav@2 ef983eb1-d774-4af8-acfd-baaf7b16a646
0 parents  commit 59246a0

13 files changed

Lines changed: 1413 additions & 0 deletions

.spnav.c.swp

24 KB
Binary file not shown.

.spnav.h.swp

12 KB
Binary file not shown.

.spnav_magellan.c.swp

16 KB
Binary file not shown.

.spnav_magellan.h.swp

12 KB
Binary file not shown.

COPYING

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

Makefile.in

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
obj = spnav.o $(magellan_obj)
3+
hdr = spnav.h spnav_magellan.h spnav_config.h
4+
lib_a = libspnav.a
5+
lib_so = libspnav.so
6+
7+
CC = gcc
8+
AR = ar
9+
CFLAGS = $(opt) $(dbg) -std=c89 -fpic -pedantic -Wall -Wno-strict-aliasing -g -I.
10+
LDFLAGS = $(xlib)
11+
12+
.PHONY: all
13+
all: $(lib_a) $(lib_so)
14+
15+
$(lib_a): $(obj)
16+
$(AR) rcs $@ $(obj)
17+
18+
$(lib_so): $(obj)
19+
$(CC) $(CFLAGS) -shared -o $@ $(obj)
20+
21+
.PHONY: clean
22+
clean:
23+
rm -f $(obj)
24+
25+
.PHONY: cleandist
26+
distclean:
27+
rm -f $(obj) $(lib_a) $(lib_so) Makefile
28+
29+
.PHONY: install
30+
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+
35+
.PHONY: uninstall
36+
uninstall:
37+
rm -f $(PREFIX)/lib/$(lib_a)
38+
rm -f $(PREFIX)/lib/$(lib_so)
39+
for i in $(hdr); do rm -f $(PREFIX)/include/$$i; done
40+

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
to be written...

configure

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
#!/bin/sh
2+
3+
echo 'configuring spacenav library...'
4+
5+
PREFIX=/usr/local
6+
OPT=yes
7+
DBG=yes
8+
X11=yes
9+
10+
for arg; do
11+
case "$arg" in
12+
--prefix=*)
13+
value=`echo $arg | sed 's/--prefix=//'`
14+
PREFIX=${value:-$prefix}
15+
;;
16+
17+
--enable-opt)
18+
OPT=yes;;
19+
--disable-opt)
20+
OPT=no;;
21+
22+
--enable-debug)
23+
DBG=yes;;
24+
--disable-debug)
25+
DBG=no;;
26+
27+
--enable-x11)
28+
X11=yes;;
29+
--disable-x11)
30+
X11=no;;
31+
32+
--help)
33+
echo 'usage: ./configure [options]'
34+
echo 'options:'
35+
echo ' --prefix=<path>: installation path (default: /usr/local)'
36+
echo ' --enable-x11: enable X11 communication mode (default)'
37+
echo ' --disable-x11: disable X11 communication mode'
38+
echo ' --enable-opt: enable speed optimizations (default)'
39+
echo ' --disable-opt: disable speed optimizations'
40+
echo ' --enable-debug: include debugging symbols (default)'
41+
echo ' --disable-debug: do not include debugging symbols'
42+
echo 'all invalid options are silently ignored'
43+
exit 0
44+
;;
45+
esac
46+
done
47+
48+
echo " prefix: $PREFIX"
49+
echo " optimize for speed: $OPT"
50+
echo " include debugging symbols: $DBG"
51+
echo " x11 communication method: $X11"
52+
echo ""
53+
54+
if [ "$X11" = "no" ]; then
55+
echo "WARNING: you have disabled the X11 interface, the resulting library won't be compatible with the proprietary 3Dconnexion daemon (3dxserv)!"
56+
echo ""
57+
fi
58+
59+
# create makefile
60+
echo 'creating makefile ...'
61+
echo "PREFIX = $PREFIX" >Makefile
62+
63+
if [ "$DBG" = 'yes' ]; then
64+
echo 'dbg = -g' >>Makefile
65+
fi
66+
67+
if [ "$OPT" = 'yes' ]; then
68+
echo 'opt = -O3' >>Makefile
69+
fi
70+
71+
if [ "$X11" = 'yes' ]; then
72+
echo 'magellan_obj = spnav_magellan.o' >>Makefile
73+
echo 'xlib = -lX11' >>Makefile
74+
fi
75+
76+
cat Makefile.in >>Makefile
77+
78+
# create spnav_config.h
79+
echo 'creating spnav_config.h ...'
80+
echo '#ifndef SPNAV_CONFIG_H_' >spnav_config.h
81+
echo '#define SPNAV_CONFIG_H_' >>spnav_config.h
82+
echo '' >>spnav_config.h
83+
if [ "$X11" = 'yes' ]; then
84+
echo '#define USE_X11' >>spnav_config.h
85+
echo '' >>spnav_config.h
86+
fi
87+
echo '#endif /* SPNAV_CONFIG_H_ */' >>spnav_config.h
88+
89+
#done
90+
echo ''
91+
echo 'Done. You can now type make (or gmake) to compile libspnav.'
92+
echo ''

0 commit comments

Comments
 (0)