added a configure script

git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/trunk/spacenavd@30 ef983eb1-d774-4af8-acfd-baaf7b16a646
pull/1/head v0.3
John Tsiombikas 2008-04-09 07:25:15 +00:00
rodzic 6b8ca7ea98
commit b91b2cdf15
5 zmienionych plików z 116 dodań i 45 usunięć

Wyświetl plik

@ -1,39 +0,0 @@
# change the prefix to install elsewhere
PREFIX = /usr/local
obj = spnavd.o cfgfile.o
bin = spacenavd
ctl = spnavd_ctl
CC = gcc
INSTALL = install
CFLAGS = -pedantic -Wall -g -DUSE_X11
LDFLAGS = -lX11 -lm
$(bin): $(obj)
$(CC) $(CFLAGS) -o $@ $(obj) $(LDFLAGS)
.PHONY: clean
clean:
rm -f $(obj) $(bin)
.PHONY: install
install: $(bin)
$(INSTALL) -d $(PREFIX)/bin
$(INSTALL) -m 755 $(bin) $(PREFIX)/bin/$(bin)
$(INSTALL) -m 755 $(ctl) $(PREFIX)/bin/$(ctl)
./setup_init
# -- this is not done automatically any more, see README.
# $(INSTALL) -m 755 init_script /etc/init.d/$(bin)
# cd /etc/rc2.d && rm -f S99$(bin) && ln -s ../init.d/$(bin) S99$(bin)
# if [ -z "`grep $(ctl) /etc/X11/Xsession`" ]; then echo "$(PREFIX)/bin/$(ctl) x11 start" >>/etc/X11/Xsession; fi
.PHONY: uninstall
uninstall:
rm -f $(PREFIX)/bin/$(bin)
rm -f $(PREFIX)/bin/$(ctl)
./setup_init remove
# rm -f /etc/init.d/$(bin)
# rm -f /etc/rc2.d/S99$(bin)

28
Makefile.in 100644
Wyświetl plik

@ -0,0 +1,28 @@
obj = spnavd.o cfgfile.o
bin = spacenavd
ctl = spnavd_ctl
CC = gcc
INSTALL = install
CFLAGS = -pedantic -Wall $(dbg) $(opt) $(x11)
LDFLAGS = $(xlib) -lm
$(bin): $(obj)
$(CC) $(CFLAGS) -o $@ $(obj) $(LDFLAGS)
.PHONY: clean
clean:
rm -f $(obj) $(bin)
.PHONY: install
install: $(bin)
$(INSTALL) -d $(PREFIX)/bin
$(INSTALL) -m 755 $(bin) $(PREFIX)/bin/$(bin)
$(INSTALL) -m 755 $(ctl) $(PREFIX)/bin/$(ctl)
./setup_init
.PHONY: uninstall
uninstall:
rm -f $(PREFIX)/bin/$(bin)
rm -f $(PREFIX)/bin/$(ctl)
./setup_init remove

8
README
Wyświetl plik

@ -22,10 +22,10 @@ spacenavd - 0.3
go through the X window system.
3. Installation
If you have the dependencies installed, just run ``make'' to compile the
daemon, and ``make install'', to install it. The default installation prefix
is ``/usr/local''. If you wish to install somewhere else, just change the
PREFIX variable in the first line of the Makefile.
If you have the dependencies installed, just run ``./configure'' and then
``make'' to compile the daemon, and ``make install'', to install it. The
default installation prefix is ``/usr/local''. If you wish to install
somewhere else, you may pass --prefix=/whatever to the configure script.
4. Running spacenavd
If your system uses SysV init, then everything should be set up to have

82
configure vendored 100755
Wyświetl plik

@ -0,0 +1,82 @@
#!/bin/sh
echo 'configuring spacenavd...'
PREFIX=/usr/local
OPT=yes
DBG=yes
X11=yes
for arg; do
case "$arg" in
--prefix=*)
value=`echo $arg | sed 's/--prefix=//'`
PREFIX=${value:-$prefix}
;;
--enable-opt)
OPT=yes;;
--disable-opt)
OPT=no;;
--enable-debug)
DBG=yes;;
--disable-debug)
DBG=no;;
--enable-x11)
X11=yes;;
--disable-x11)
X11=no;;
--help)
echo 'usage: ./configure [options]'
echo 'options:'
echo ' --prefix=<path>: installation path (default: /usr/local)'
echo ' --enable-x11: enable X11 communication mode (default)'
echo ' --disable-x11: disable X11 communication mode'
echo ' --enable-opt: enable speed optimizations (default)'
echo ' --disable-opt: disable speed optimizations'
echo ' --enable-debug: include debugging symbols (default)'
echo ' --disable-debug: do not include debugging symbols'
echo 'all invalid options are silently ignored'
exit 0
;;
esac
done
echo " prefix: $PREFIX"
echo " optimize for speed: $OPT"
echo " include debugging symbols: $DBG"
echo " x11 communication method: $X11"
echo ""
if [ "$X11" = "no" ]; then
echo "WARNING: you have disabled the X11 interface, the resulting daemon \
won't be compatible with applications written for the proprietary 3Dconnexion \
daemon (3dxserv)!"
echo
fi
# create makefile
echo 'creating makefile ...'
echo "PREFIX = $PREFIX" >Makefile
if [ "$DBG" = 'yes' ]; then
echo 'dbg = -g' >>Makefile
fi
if [ "$OPT" = 'yes' ]; then
echo 'opt = -O3' >>Makefile
fi
if [ "$X11" = 'yes' ]; then
echo 'x11 = -DUSE_X11' >>Makefile
echo 'xlib = -lX11' >>Makefile
fi
cat Makefile.in >>Makefile
echo ''
echo 'Done. You can now type make (or gmake) to compile spacenavd.'
echo ''

Wyświetl plik

@ -566,7 +566,7 @@ void send_uevent(struct input_event *inp)
static struct timeval prev_motion_time;
struct client *citer;
int i, data[8];
unsigned int period;
unsigned int period = 0;
if(!lsock) return;
@ -719,7 +719,7 @@ void send_xevent(struct input_event *inp)
int (*prev_xerr_handler)(Display*, XErrorEvent*);
int i;
XEvent xevent;
unsigned int period;
unsigned int period = 0;
if(!dpy) return;