slightly better tslib checking - use pkgconfig first.

SVN revision: 39483
This commit is contained in:
Carsten Haitzler 2009-03-15 02:46:24 +00:00
parent 8153df719c
commit f13fb4b769
1 changed files with 38 additions and 8 deletions

View File

@ -191,18 +191,48 @@ AC_DEFUN([ECORE_CHECK_TSLIB],
[
_ecore_want_tslib=$1
_ecore_have_tslib="no"
tslib_libs=""
TSLIB_LIBS=""
TSLIB_CFLAGS=""
if test "x${_ecore_want_tslib}" = "xyes" -o "x${_ecore_want_tslib}" = "xauto" ; then
AC_CHECK_HEADER([tslib.h],
[
AC_CHECK_LIB([ts], [ts_open], [tslib_libs="-lts", tslib_libs="-ltslib"])
AC_DEFINE(HAVE_TSLIB, 1, [Build Ecore_FB Touchscreen Code])
_ecore_have_ts="yes"
])
PKG_CHECK_MODULES(TSLIB, tslib-1.0,
[
AC_DEFINE(HAVE_TSLIB, 1, [Build Ecore_FB Touchscreen Code])
_ecore_have_ts="yes"
],
[
PKG_CHECK_MODULES(TSLIB, tslib,
[
AC_DEFINE(HAVE_TSLIB, 1, [Build Ecore_FB Touchscreen Code])
_ecore_have_ts="yes"
],
[
AC_CHECK_HEADER([tslib.h],
[
AC_CHECK_LIB([ts], [ts_open],
[
TSLIB_LIBS="-lts"
TSLIB_CFLAGS=""
AC_DEFINE(HAVE_TSLIB, 1, [Build Ecore_FB Touchscreen Code])
_ecore_have_ts="yes"
,
AC_CHECK_LIB([tslib], [ts_open],
[
TSLIB_LIBS="-ltslib"
TSLIB_CFLAGS=""
AC_DEFINE(HAVE_TSLIB, 1, [Build Ecore_FB Touchscreen Code])
_ecore_have_ts="yes"
,
_ecore_have_ts="no"
])
])
])
])
])
fi
AC_SUBST(tslib_libs)
AC_SUBST(TSLIB_LIBS)
AC_SUBST(TSLIB_CFLAGS)
if test "x$_ecore_have_tslib" = "xyes" ; then
m4_default([$2], [:])