Compiling libg15 - libusb not found though installed

Just installed OpenSuse 12.1, so I’m once again building the tools to support my G15 keyboard. This time though, configure is not finding libusb, though it is installed.

I found a G15 repo on build.opensuse.org, at https://build.opensuse.org/project/show?project=home%3Ammichna%3Ag15-tools but I’d rather build it myself, and I’d like to understand autoconf better and learn why it is not finding libusb.

Configure does not appear to accept arguments for libusb_libs (nothing shown in configure --help, and no AC_ARG_WITH options defined in aclocal.m4?) I did try just using ./configure --libdir=/lib64 but libusb is still not found.

It seems like automake is just not finding it, though I don’t know why:

configure.in:AC_CHECK_LIB([usb], [main], ,AC_MSG_ERROR("libusb not found. please install it"])

Any help would be appreciated!

Cheers,
Pete

All the gory details:

Build Error:

svn co https://g15tools.svn.sourceforge.net/svnroot/g15tools g15tools-new
cd g15tools-new/trunk/libg15
./bootstrap
./configure
...
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for main in -lusb... no
configure: error: "libusb not found. please install it"

Installed libs:

rpm -qa | grep libusb
libusb-1_0-0-1.0.8-9.1.2.x86_64
libusb-0_1-4-0.1.13-14.1.2.x86_64
libusb-1_0-devel-1.0.8-9.1.2.x86_64

ld.so.conf is:

cat /etc/ld.so.conf
/usr/local/lib64
/usr/local/lib
/lib64
/usr/lib64
include /etc/ld.so.conf.d/*.conf

Where things are:

lrwxrwxrwx 1 root root    19 Nov 10 11:12 /lib64/libusb-0.1.so.4 -> libusb-0.1.so.4.4.4
-rwxr-xr-x 1 root root 18768 Oct 29 11:44 /lib64/libusb-0.1.so.4.4.4
lrwxrwxrwx 1 root root    19 Nov 10 11:12 /lib64/libusb-1.0.so.0 -> libusb-1.0.so.0.0.0
-rwxr-xr-x 1 root root 56000 Oct 29 06:13 /lib64/libusb-1.0.so.0.0.
-rw-r--r-- 1 root root 41693 Oct 29 06:13 /usr/include/libusb-1.0/libusb.h

On 2012-01-29 17:06, LewsTherinTelemon wrote:
>
> Just installed OpenSuse 12.1, so I’m once again building the tools to
> support my G15 keyboard. This time though, configure is not finding
> libusb, though it is installed.

Did you search for the corresponding -devel library?

Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi there,

Yep - libusb-1_0-devel-1.0.8-9.1.2.x86_64 installed.

Pete

Ah . . . it is written against libusb_0.1 and so libusb-compat-devel is needed to compile on 12.1

That allowed libg15 and g15daemon to compiled, however when starting g15daemon it gave:

/home/paracelsus/compiled-packages/g15-rpms # g15daemon -d
open(/usr/local/var/run/g15daemon.pid): No such file or directory
Unable to create PID File! Exiting

Looks like g15daemon now expects this directory path (it didn’t use to), so simply create it:

 mkdir -p /usr/local/var/run

g15daemon now runs and the greeting message and clock are displayed! (Don’'t forget modprobe uinput is needed)

libg15render (from g15tools) also compiled fine, though you must use ./configure --prefix=/usr/local or you will get font errors when running clients (like g15stats) as the font dive will be undefined:

libg15render: Unable to load font "NONE/share/g15tools/fonts/G15/default-01.fnt"

You can then do a zypper install libgtop libgtop-devel allowing g15stats (from g15-daemon clients) to compile.

The g15 keyboard lives on for OpenSuse 12.1!

Pete

On 2012-01-29 19:56, LewsTherinTelemon wrote:
>
> Ah . . . it is written against libusb_0.1 and so libusb-compat-devel is
> needed to compile on 12.1

Good! I mean good that you found it :slight_smile:

> Looks like g15daemon now expects this directory path (it didn’t use
> to), so simply create it:

It happens when you compile things locally, I think. Instead of the normal
paths, they use /usr/local instead.

> Now, I nearly have g15stats working - however, it only displays the
> bars on the LCD panel and not the descriptions, giving:

Of those problems, I don’t know.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)