diff -Npur spacenavd-0.5.orig/Makefile.in spacenavd-0.5/Makefile.in --- spacenavd-0.5.orig/Makefile.in 2012-01-31 22:22:20.460368687 +0100 +++ spacenavd-0.5/Makefile.in 2012-01-31 22:23:18.170367675 +0100 @@ -6,8 +6,8 @@ ctl = spnavd_ctl CC = gcc INSTALL = install -CFLAGS = -pedantic -Wall $(dbg) $(opt) -fno-strict-aliasing -I$(srcdir)/src -LDFLAGS = $(xlib) +CFLAGS = $(opt) -fno-strict-aliasing -I$(srcdir)/src +LDFLAGS = $(ldopt) $(xlib) $(bin): $(obj) $(CC) -o $@ $(obj) $(LDFLAGS) diff -Npur spacenavd-0.5.orig/configure spacenavd-0.5/configure --- spacenavd-0.5.orig/configure 2012-01-31 22:22:20.460368687 +0100 +++ spacenavd-0.5/configure 2012-01-31 22:22:49.257368187 +0100 @@ -28,6 +28,7 @@ test_kver() { PREFIX=/usr/local OPT=yes +LDOPT=yes DBG=yes X11=yes HOTPLUG=yes @@ -70,6 +71,11 @@ for arg; do --disable-opt) OPT=no;; + --enable-ldopt) + LDOPT=yes;; + --disable-ldopt) + LDOPT=no;; + --enable-debug) DBG=yes;; --disable-debug) @@ -95,6 +101,8 @@ for arg; do echo ' --disable-hotplug: disable hotplug, fallback to polling for the device' echo ' --enable-opt: enable speed optimizations (default)' echo ' --disable-opt: disable speed optimizations' + echo ' --enable-ldopt: enable link optimizations (default)' + echo ' --disable-ldopt: disable link optimizations' echo ' --enable-debug: include debugging symbols (default)' echo ' --disable-debug: do not include debugging symbols' echo 'all invalid options are silently ignored' @@ -105,6 +113,7 @@ done echo " prefix: $PREFIX" echo " optimize for speed: $OPT" +echo " optimize link: $LDOPT" echo " include debugging symbols: $DBG" echo " x11 communication method: $X11" echo " use hotplug: $HOTPLUG" @@ -128,7 +137,11 @@ if [ "$DBG" = 'yes' ]; then fi if [ "$OPT" = 'yes' ]; then - echo 'opt = -O3' >>Makefile + echo "opt = ${CFLAGS:--O3}" >>Makefile +fi + +if [ "$LDOPT" = 'yes' ]; then + echo "ldopt = ${LDFLAGS}" >>Makefile fi if [ "$X11" = 'yes' ]; then