user2752471
user2752471

Reputation: 454

Configure ac code fails to detect libXI presence

I am currently executing the configure script of gtk. It tests for the presence of XInput, and it stops the execution with the error message:"configure: error: *** XInput2 extension not found. Check 'config.log' for more details.

Looking at config.log, it says "configure:23050: error: *** XInput2 extension not found. Check 'config.log' for more details." So, the same except for the line number.

Then I decided to look at configure.ac. There I found the full Xi detection test that it is:

if $PKG_CONFIG --exists "xi" ; then

X_PACKAGES="$X_PACKAGES xi"
GTK_PACKAGES_FOR_X="$GTK_PACKAGES_FOR_X xi"

AC_CHECK_HEADER(X11/extensions/XInput2.h,
                have_xinput2=yes
                AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))

gtk_save_LIBS="$LIBS"
LIBS="$LIBS -lXi"

# Note that we also check that the XIScrollClassInfo struct is defined,
# because at least Ubuntu Oneiric seems to have XIAllowTouchEvents(), but not the XIScrollClassInfo struct.
AC_CHECK_FUNC([XIAllowTouchEvents],
  [AC_CHECK_MEMBER([XIScrollClassInfo.number],
                   have_xinput2_2=yes
                   AC_DEFINE(XINPUT_2_2, 1, [Define to 1 if XInput 2.2 is available]),
                   have_xinput2_2=no,
                   [[#include <X11/extensions/XInput2.h>]])])
LIBS="$gtk_save_LIBS"

if test "x$have_xinput2_2" = "xyes"; then
  X_EXTENSIONS="$X_EXTENSIONS XI2.2"
else
  X_EXTENSIONS="$X_EXTENSIONS XI2"
fi

fi

AS_IF([test "x$have_xinput2" != "xyes"],
    [AC_MSG_ERROR([*** XInput2 extension not found. Check 'config.log' for more details.])])

I am no expert about setting configure.ac, but I thought that this line: "if $PKG_CONFIG --exists "xi" ; then" would be satisfied by this parameter that I pass to configure:

 PKG_CONFIG_PATH=:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/

Also this line:

AC_CHECK_HEADER(X11/extensions/XInput2.h,
                have_xinput2=yes
                AC_DEFINE(XINPUT_2, 1, [Define to 1 if XInput 2.0 is available]))

could not have been satisfied by this parameter that I pass to configure?

CPPFLAGS=-I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/include/

I am a bit lost as to why it doesn't detect nothing.

A curious point that I read in the documentation is that there is a parameter called: --disable-xinput. Well I am passing it to configure and it obviously didn't disable the test. So I would appreciate any suggestions about how to change the test to try to figure out what is wrong with it (or with my system)

Upvotes: 0

Views: 61

Answers (1)

user2752471
user2752471

Reputation: 454

Solution found

If I replace:

if $PKG_CONFIG --exists "xi" ; then

on configure.ac, by:

if $PKG_CONFIG --print-errors --exists "xi" ; then

and then execute autoconf, it will generate a new configure based on this "new" configure.ac that will print all the required libraries that should be passed to configure.

First it was the .pc file of libXi, then the pc. file of Inputproto (that I had to download and install) an so on. I also really had to add libXi's include dir to CPPFLAGS, so it could find XInput2.h.

My final configure command was:

LD_LIBRARY_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.41.2/lib/ CPPFLAGS="-I/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/include/ -I/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/include/" LDFLAGS="-L/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/" ./configure --prefix=/media/34GB/Arquivos-de-Programas-Linux/Gtk+-3.4.0 PKG_CONFIG_PATH=/media/34GB/Arquivos-de-Programas-Linux/Glib-2.41.2/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Atk-2.15.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pango-1.30.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Cairo-1.10.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Gdk-pixbuf-2.30.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Pixman-0.18.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Fontconfig-2.8.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Freetype-2.2.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/Png-1.2.14/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xi-1.5.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Inputproto-1.5.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/X11-1.4.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xorgproto-2018.1/share/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xcb-1.4/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Pthread-stubs-0.1/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xau-1.0.0/lib/pkgconfig/:/media/34GB/Arquivos-de-Programas-Linux/xorg/Xext-1.1.1/lib/pkgconfig/

Upvotes: 0

Related Questions