dnl This file is part of the Lineak libraries/packages dnl Copyright (C) 2003 Sheldon Lee-Wen (leewsb@hotmail.com) dnl This file is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Library General Public dnl License as published by the Free Software Foundation; either dnl version 2 of the License, or (at your option) any later version. dnl This library is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU dnl Library General Public License for more details. dnl You should have received a copy of the GNU Library General Public License dnl along with this library; see the file COPYING.LIB. If not, write to dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. dnl ------------------------------------------------------------------------ dnl Find the lineak plugin directory. dnl ------------------------------------------------------------------------ dnl AC_DEFUN([AC_LINEAK_FIND_PLUGINDIR], [ AC_ARG_WITH(lineak_plugindir,[ --with-lineak-plugindir=DIR Location of the lineak plugins directory], [lineakplugins=${withval}]) AC_MSG_CHECKING(Looking for the plugin directory) if test "$lineakplugins" = ""; then for i in /usr /usr/local / /opt do if test -d "${i}/lib/lineakd/plugins" ; then pdir="${i}/lib/lineakd/plugins" AC_MSG_RESULT(${pdir}) break fi done else pdir="$lineakplugins" AC_MSG_RESULT(${pdir}) fi if test ! -d $pdir ; then AC_MSG_ERROR(Lineak plugin directory not found. Please install lineakd version 0.8 or higher.) exit 0 fi if test "$pdir" != ""; then AC_DEFINE_UNQUOTED(PLUGINDIR, "$pdir", [Define the plugin directory]) PLUGINDIR="${pdir}" AC_SUBST(PLUGINDIR) else echo The lineakd plugin directory could not be found. Please install lineakd version 0.8 or higher. exit 0 fi ]) AC_DEFUN([AC_LINEAK_CHECK_LIBS], [ AC_PATH_X LDFLAGS="$all_libraries -L${x_libraries} $X_LDFLAGS -lX11 -lXext -ldl" CPPFLAGS="$all_includes -I${x_includes} ${CPPFLAGS} " dnl $X_INCLUDES $X_LIBS $X_LDFLAGS AC_CHECK_LIB(lineak,ac_check_lineak, [LIBLINEAK="-llineak"],[AC_MSG_ERROR([lib lineak not found. Please install lineakd 0.8 or later.])]) if test "x$LIBLINEAK" != "x"; then LIBS="-llineak" AC_DEFINE(HAVE_LIBLINEAK,1,[Define if you have liblineak installed]) dnl AC_MSG_RESULT(found) fi AC_SUBST(LIBLINEAK) ]) AC_DEFUN([AC_LINEAK_CHECK_INCLUDES], [ AC_ARG_WITH(lineak-includedir,[ --with-lineak-includedir=DIR location of the lineak include directory], [lineakincludes=${withval}]) AC_MSG_CHECKING(Looking for lineak headers) if test "$lineakincludes" = ""; then for i in /usr/include /usr/local/include /opt/include $lineakincludes do if test -f "${i}/lineak/lconfig.h" ; then lineak_includedir="${i}/lineak" CPPFLAGS="${CPPFLAGS} -I${lineak_includedir} -I${i}" AC_MSG_RESULT(${lineak_includedir}) break fi done else lineak_includedir="$lineakincludes" CPPFLAGS="${CPPFLAGS} -I${lineak_includedir} -I${i}" AC_MSG_RESULT(${lineak_includedir}) fi if test ! -d "$lineak_includedir" ; then AC_MSG_ERROR(Lineak includes not found. Check your installation or try ./configure --with-lineak-includedir=) exit 0 fi if test "$lineak_includedir" != ""; then AC_DEFINE_UNQUOTED(INCLUDEDIR, "$lineak_includedir", [Define the plugin directory]) AC_SUBST(INCLUDEDIR) else echo The lineak development headers could not be found. Please install lineakd version 0.8 or higher. exit 0 fi ]) AC_DEFUN([AC_LINEAK_HELPER_SUID], [ AC_ARG_ENABLE([suid-helpers], AS_HELP_STRING([--enable-suid-helpers], [Install the helper applications SUID root (default=false)]), [lineak_suid_helpers=yes],[lineak_suid_helpers=no]) AC_MSG_CHECKING([whether we install the helper applications suid root]) AC_DEFINE_UNQUOTED(HELPER_SUID, "${lineak_suid_helpers}", [Install the helper applications SUID root]) HELPER_SUID="${lineak_suid_helpers}" AC_SUBST(HELPER_SUID) AC_MSG_RESULT(${lineak_suid_helpers}) ]) AC_DEFUN([AC_CYGWIN], [ if test "$target_os" == "cygwin"; then cygwin_os=true else cygwin_os=false fi AC_MSG_CHECKING([Are we compiling on Cygwin?]) AC_DEFINE_UNQUOTED(CYGWIN,"${cygwin_os}", [Cygwin]) AM_CONDITIONAL(CYGWIN, test "x$cygwin_os" = "xtrue" ) CYGWIN="${cygwin_os}" AC_SUBST(CYGWIN) AC_MSG_RESULT(${cygwin_os}) ]) AC_DEFUN([AC_LINEAK_SETKEYCODES_SUID], [ AC_ARG_ENABLE([setkeycodes-suid], AS_HELP_STRING([--enable-setkeycodes-suid], [Chown the setkeycodes command SUID root (default=false)]), [setkeycodes_suid=yes],[setkeycodes_suid=no]) AC_MSG_CHECKING([whether we will make setkeycodes suid root]) AC_DEFINE_UNQUOTED(SETKEYCODES_SUID, "${setkeycodes_suid}", [Chown setkeycodes SUID root]) SETKEYCODES_SUID="${setkeycodes_suid}" AC_SUBST(SETKEYCODES_SUID) AC_MSG_RESULT(${setkeycodes_suid}) ]) AC_DEFUN([AC_LINEAK_EVTEST], [ AC_MSG_CHECKING([whether we enable compilation of the evtest utility]) AC_ARG_ENABLE([evtest], AS_HELP_STRING([--enable-evtest], [Make and install the evtest utility. (default=false)]), [if test "x$enableval" = "xyes"; then lineak_enable_evtest=true else lineak_enable_evtest=false fi], [lineak_enable_evtest=false]) if test "x$lineak_enable_evtest" == "xtrue" ; then case $host in dnl Linux has an input event layer *-linux* ) lineak_enable_evtest=true ;; dnl Disable evtest for other unknown OS *) lineak_enable_evtest=false ;; esac fi if test x$lineak_enable_evtest = xtrue; then EVTEST="true" else EVTEST="false" fi AC_DEFINE_UNQUOTED(EVTEST, "${EVTEST}", [Make and install the evtest utility]) AM_CONDITIONAL(EVTEST, test "x$lineak_enable_evtest" = "xtrue" ) AC_SUBST(EVTEST) AC_MSG_RESULT($lineak_enable_evtest) ])