configure.in 2.45 KB
Newer Older
1 2
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
3
# $Revision: 334 $ -  $Date: 2007-12-07 15:08:03 +0100 (Fri, 07 Dec 2007) $ $Author: mlampard $
4 5 6


AC_PREREQ(2.59)
7
AC_INIT(g15daemon, [1.9.1], [mlampard@users.sf.net])
8 9
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_AUX_DIR(config)
10 11
AC_CANONICAL_TARGET()

12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
AM_INIT_AUTOMAKE()
AC_CONFIG_HEADER([config.h])

# Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_RANLIB

# Checks for libraries.
AC_CHECK_LIB([g15], [initLibG15],,AC_MSG_ERROR(["libg15 (or its devel package) not found. please install it"]))
AC_CHECK_LIB([g15render], [g15r_loadWbmpSplash],,AC_MSG_ERROR([">=libg15render-1.2 (or its devel package) not found.  please install it"]))
AC_CHECK_LIB([m], [sin])
AC_CHECK_LIB([pthread], [pthread_mutex_init])

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([ linux/input.h ])
AC_CHECK_HEADERS([ linux/uinput.h arpa/inet.h fcntl.h stdlib.h string.h sys/socket.h unistd.h libg15.h], [], [], 
[#if HAVE_LINUX_INPUT_H
#include <linux/input.h>
#endif
])
35

36 37 38 39 40 41 42 43 44 45
#if HAVE_LINUX_UINPUT_H 
	dnl check for uinput.h version 2.4 or 2.6 ?
	AC_CHECK_MEMBER([struct uinput_user_dev.id],
              [AC_DEFINE(HAVE_UINPUT_USER_DEV_ID, 1,
              [Define if struct uinput_user_dev has id member.])],,
              [
			#include <linux/input.h>
			#include <linux/uinput.h>
	     ]
	)
46
	uinput=true
47 48 49
	dnl end of uinput version checks
#endif

50 51
AM_CONDITIONAL(UINPUT_INTERFACE_PLUGIN, [test x$uinput = xtrue])

52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
case $host_os in
	*linux*) 
	  AC_DEFINE([OSTYPE_LINUX], [1],[Target OS is Linux])
	  ;;
	*darwin*)
	  AC_DEFINE([OSTYPE_DARWIN], [1],[Target OS is Darwin])
	  AC_SUBST(KEXT_LOCATION,["/System/Library/Extensions/"])
          install_kext=true
	  ;;
	*) 
	  AC_DEFINE([OSTYPE_OTHER], [1],[Target OS is unknown])
	  ;;
esac
AM_CONDITIONAL([KEXT_INSTALL], [test x$install_kext = xtrue])

67 68 69
CPPFLAGS=$CPPFLAGS_save
CPPFLAGS="$CPPFLAGS "'-DDATADIR="\"$(datadir)\""'

70 71 72
AC_SUBST(G15DAEMON_PLUGIN_DIR,["$libdir/g15daemon/$PACKAGE_VERSION/plugins"])
CPPFLAGS="$CPPFLAGS "'-DPLUGINDIR=\"$(G15DAEMON_PLUGIN_DIR)\"'

73 74 75 76 77 78 79 80 81 82 83 84 85 86
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T

# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STRFTIME
AC_CHECK_FUNCS([memset select socket strerror])

AC_CONFIG_FILES([Makefile g15daemon/Makefile libg15daemon_client/Makefile plugins/Makefile])

AC_OUTPUT