From 84dfaf861ccb605e889ced4232cb0c7e4b44d2ad Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Thu, 14 Aug 2008 02:10:34 +0000 Subject: [PATCH] - 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 --- Makefile.in | 15 +++++++++------ configure | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 7aa93c1..8d2e5ca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -16,7 +16,10 @@ $(lib_a): $(obj) $(AR) rcs $@ $(obj) $(lib_so): $(obj) - $(CC) $(CFLAGS) -shared -o $@ $(obj) + $(CC) -shared -o $@ $(obj) + +%.o: $(srcdir)/%.c + $(CC) $(CFLAGS) -c $< -o $@ .PHONY: clean clean: @@ -28,13 +31,13 @@ distclean: .PHONY: install install: $(lib_a) $(lib_so) - cp $(lib_a) $(PREFIX)/lib/$(lib_a) - cp $(lib_so) $(PREFIX)/lib/$(lib_so) - cp $(hdr) $(PREFIX)/include/ + cp $(lib_a) $(PREFIX)/$(libdir)/$(lib_a) + cp $(lib_so) $(PREFIX)/$(libdir)/$(lib_so) + for h in $(hdr); do cp -p $(srcdir)/$$h $(PREFIX)/include/; done .PHONY: uninstall uninstall: - rm -f $(PREFIX)/lib/$(lib_a) - rm -f $(PREFIX)/lib/$(lib_so) + rm -f $(PREFIX)/$(libdir)/$(lib_a) + rm -f $(PREFIX)/$(libdir)/$(lib_so) for i in $(hdr); do rm -f $(PREFIX)/include/$$i; done diff --git a/configure b/configure index 16c469b..3a1a4e0 100755 --- a/configure +++ b/configure @@ -7,6 +7,13 @@ OPT=yes DBG=yes X11=yes +srcdir="`dirname "$0"`" +libdir=lib + +if [ "`uname -m`" = 'x86_64' ]; then + libdir=lib64 +fi + for arg; do case "$arg" in --prefix=*) @@ -56,9 +63,11 @@ if [ "$X11" = "no" ]; then echo "" fi -# create makefile -echo 'creating makefile ...' +# create Makefile +echo 'creating Makefile ...' echo "PREFIX = $PREFIX" >Makefile +echo "srcdir = $srcdir" >>Makefile +echo "libdir = $libdir" >>Makefile if [ "$DBG" = 'yes' ]; then echo 'dbg = -g' >>Makefile @@ -73,7 +82,7 @@ if [ "$X11" = 'yes' ]; then echo 'xlib = -lX11' >>Makefile fi -cat Makefile.in >>Makefile +cat "$srcdir/Makefile.in" >>Makefile # create spnav_config.h echo 'creating spnav_config.h ...'