Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ bin = spacenavd
ctl = spnavd_ctl

CC ?= gcc
CFLAGS = $(cc_cflags) $(dbg) $(opt) -I$(srcdir)/src $(xinc) $(add_cflags)
LDFLAGS = $(xlib) $(add_ldflags) -lm
CFLAGS = $(cc_cflags) $(dbg) $(opt) -I$(srcdir)/src $(xinc) $(lcd_cflags) $(add_cflags)
LDFLAGS = $(xlib) $(lcd_ldflags) $(add_ldflags) -lm

$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)
Expand Down
33 changes: 33 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ X11=yes
HOTPLUG=yes
XINPUT=yes
UINPUT=yes
SPACELCD=auto
VER=`git describe --tags 2>/dev/null`
CFGDIR=/etc

Expand Down Expand Up @@ -146,6 +147,11 @@ for arg in $*; do
--disable-uinput)
UINPUT=no;;

--enable-spacelcd)
SPACELCD=yes;;
--disable-spacelcd)
SPACELCD=no;;

--help)
echo 'usage: ./configure [options]'
echo 'options:'
Expand All @@ -156,6 +162,7 @@ for arg in $*; do
echo ' x11: X11 support, needed for 3dxsrv compatibility (default: on)'
echo ' hotplug: enable hotplug device detection (default: on)'
echo ' uinput: use uinput for keyboard emulation on linux (default: on)'
echo ' spacelcd: SpaceMouse Enterprise LCD support (default: auto-detect)'
echo 'all invalid options are silently ignored'
exit 0
;;
Expand Down Expand Up @@ -218,6 +225,20 @@ less reliable (fallback to XSendEvent)."
fi
fi

# Check for SpaceMouse Enterprise LCD support (needs cairo, libusb, zlib)
if [ "$SPACELCD" = auto ]; then
if pkg-config --exists cairo libusb-1.0 zlib 2>/dev/null; then
SPACELCD=yes
else
SPACELCD=no
fi
elif [ "$SPACELCD" = yes ]; then
if ! pkg-config --exists cairo libusb-1.0 zlib 2>/dev/null; then
echo "WARNING: LCD dependencies not found (cairo, libusb-1.0, zlib), disabling"
SPACELCD=no
fi
fi

HAVE_VSNPRINTF=`check_func vsnprintf`

# print configuration results
Expand All @@ -232,6 +253,7 @@ echo " use hotplug: $HOTPLUG"
if [ "$sys" = Linux ]; then
echo " uinput for keyboard emulation: $UINPUT"
fi
echo " SpaceLCD support: $SPACELCD"
if [ "$UINPUT" != yes -a "$X11" = yes ]; then
[ -n "$HAVE_XTEST_H" ] && foo=yes || foo=no
echo " XTest for keyboard emulation: $foo"
Expand Down Expand Up @@ -269,6 +291,13 @@ if [ "$X11" = 'yes' ]; then
echo 'xlib += -lX11 -lXext' >>Makefile
fi

if [ "$SPACELCD" = yes ]; then
lcd_cflags=`pkg-config --cflags cairo libusb-1.0 zlib`
lcd_ldflags=`pkg-config --libs cairo libusb-1.0 zlib`
echo "lcd_cflags = $lcd_cflags" >>Makefile
echo "lcd_ldflags = $lcd_ldflags" >>Makefile
fi

if $cc_is_gcc; then
echo 'cc_cflags = -pedantic -Wall -MMD' >>Makefile
fi
Expand Down Expand Up @@ -301,6 +330,10 @@ fi
echo '#define VERSION "'$VER'"' >>$cfgheader
echo >>$cfgheader

if [ "$SPACELCD" = yes ]; then
echo '#define HAVE_SPACELCD' >>$cfgheader
echo >>$cfgheader
fi
[ -n "$HAVE_ALLOCA_H" ] && echo $HAVE_ALLOCA_H >>$cfgheader
[ -n "$HAVE_MALLOC_H" ] && echo $HAVE_MALLOC_H >>$cfgheader
[ -n "$HAVE_STDINT_H" ] && echo $HAVE_STDINT_H >>$cfgheader
Expand Down
12 changes: 12 additions & 0 deletions doc/example-spnavrc
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,15 @@
# the re-centering power of the device.
#
#repeat-interval = -1


# Per-application profiles
# Profiles override global settings for specific applications.
# The "class" value is matched (case-insensitive substring) against
# the WM_CLASS of the currently focused window.
#
#profile "Blender" class=blender
# kbmap0 = Escape
# kbmap1 = Return
# sensitivity = 2.0
#end
Loading