- 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/spacenavd@47 ef983eb1-d774-4af8-acfd-baaf7b16a646
pull/1/head
John Tsiombikas 2008-08-14 02:10:34 +00:00
rodzic d406e77ebc
commit 23c52605e3
5 zmienionych plików z 35 dodań i 13 usunięć

Wyświetl plik

@ -8,7 +8,10 @@ CFLAGS = -pedantic -Wall $(dbg) $(opt) $(x11)
LDFLAGS = $(xlib) -lm
$(bin): $(obj)
$(CC) $(CFLAGS) -o $@ $(obj) $(LDFLAGS)
$(CC) -o $@ $(obj) $(LDFLAGS)
%.o: $(srcdir)/%.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
@ -18,11 +21,11 @@ clean:
install: $(bin)
$(INSTALL) -d $(PREFIX)/bin
$(INSTALL) -m 755 $(bin) $(PREFIX)/bin/$(bin)
$(INSTALL) -m 755 $(ctl) $(PREFIX)/bin/$(ctl)
./setup_init
$(INSTALL) -m 755 $(srcdir)/$(ctl) $(PREFIX)/bin/$(ctl)
cd $(srcdir) && ./setup_init --no-install
.PHONY: uninstall
uninstall:
rm -f $(PREFIX)/bin/$(bin)
rm -f $(PREFIX)/bin/$(ctl)
./setup_init remove
# cd $(srcdir) && ./setup_init remove

9
configure vendored
Wyświetl plik

@ -7,6 +7,8 @@ OPT=yes
DBG=yes
X11=yes
srcdir="`dirname "$0"`"
for arg; do
case "$arg" in
--prefix=*)
@ -58,9 +60,10 @@ daemon (3dxserv)!"
echo
fi
# create makefile
echo 'creating makefile ...'
# create Makefile
echo 'creating Makefile ...'
echo "PREFIX = $PREFIX" >Makefile
echo "srcdir = $srcdir" >>Makefile
if [ "$DBG" = 'yes' ]; then
echo 'dbg = -g' >>Makefile
@ -75,7 +78,7 @@ if [ "$X11" = 'yes' ]; then
echo 'xlib = -lX11' >>Makefile
fi
cat Makefile.in >>Makefile
cat "$srcdir/Makefile.in" >>Makefile
echo ''
echo 'Done. You can now type make (or gmake) to compile spacenavd.'

Wyświetl plik

@ -26,6 +26,18 @@ setup_bsd_init() {
echo "BSD init setup not implemented yet, you'll have to do it manually."
}
if [ "$1" = '--no-install' ]; then
echo
echo --- Spacenavd installation complete ---
echo To have spacenavd start automatically at bootup, you must add an appropriate
echo "init script. Refer to your system's manual for details on how to do that."
echo An example init script is available in the spacenavd source directory.
echo If you wish to attempt and install an init script automatically, run ./setup_init
echo
exit 0
fi
(stat /etc/init.d && stat /etc/rc0.d) >/dev/null 2>/dev/null
if [ $? = 0 ]; then
setup_sysv_init
@ -33,7 +45,7 @@ if [ $? = 0 ]; then
fi
(stat /etc/rc && stat /etc/rc.d) >/dev/null 2>/dev/null
if [ $? = 0]; then
if [ $? = 0 ]; then
setup_bsd_init
exit 0
fi

Wyświetl plik

@ -688,6 +688,10 @@ void close_x11(void)
if(!dpy) return;
if(verbose) {
printf("closing X11 connection to display \"%s\"\n", getenv("DISPLAY"));
}
/* first delete all the CommandEvent properties from all root windows */
scr_count = ScreenCount(dpy);
for(i=0; i<scr_count; i++) {

Wyświetl plik

@ -3,17 +3,17 @@
# this script, starts and stops the communication between spacenavd and the
# local X server. (:0).
if [ $1 != 'x11' ]; then
if [ "$1" != 'x11' ]; then
echo "the only valid control for the moment is x11 ($0 x11 start/stop)."
exit 1
fi
if [ -z $2 ]; then
if [ -z "$2" ]; then
echo 'you must specify either "start" or "stop".'
exit 1
fi
if [ $2 = 'start' ]; then
if [ "$2" = 'start' ]; then
# check to see there is a local X server running.
DISPLAY=":0"
xdpyinfo >/dev/null 2>/dev/null
@ -23,7 +23,7 @@ if [ $2 = 'start' ]; then
fi
sig=-usr1
elif [ $2 = "stop" ]; then
elif [ "$2" = "stop" ]; then
sig=-usr2
else
@ -46,7 +46,7 @@ if [ $? = 0 ]; then
if [ $sig = '-usr1' ]; then
echo 'signalled spacenavd, it should now start sending X events.'
else
echo 'signalled spacenavd, stopped sending X events.'
echo 'signalled spacenavd to stop sending X events.'
fi
else
echo 'sending signal to spacenavd failed.'