-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 -I m4/common -I m4/evil
MAINTAINERCLEANFILES = \
aclocal.m4 \
AC_SUBST(version_info)
+### Needed information
+
+EFL_SELECT_WINDOWS_VERSION()
+
+
### Checks for programs
AM_PROG_AS
AC_PROG_CXX
AC_SUBST([win32_libs])
AC_SUBST([win32_dl_libs])
-EFL_CHECK_MPATROL([have_mpatrol="yes"], [have_mpatrol="no"])
-
### Checks for header files
AC_CHECK_HEADERS([errno.h])
### Checks for compiler characteristics
AC_C_CONST
-AC_C___ATTRIBUTE__
+EFL_ATTRIBUTE_UNUSED
win32_cppflags="-DEFL_EVIL_BUILD"
win32_cflags="-Wall -Wextra -Wshadow -Wdeclaration-after-statement -Wmissing-prototypes -Wstrict-prototypes -Wredundant-decls"
case "$host_os" in
mingw32ce*)
have_wince="yes"
- win32_cppflags="${win32_cppflags} -D_WIN32_WCE=0x0420"
+ win32_cppflags="${win32_cppflags}"
;;
*)
have_wince="no"
win32_cxxflags="-fno-rtti -fno-exceptions"
- win32_cppflags="${win32_cppflags} -D_WIN32_WINNT=0x0501 -DSECURITY_WIN32"
+ win32_cppflags="${win32_cppflags} -DSECURITY_WIN32"
;;
esac
AC_SUBST([win32_cppflags])
echo "Configuration Options Summary:"
echo
echo " OS...................: ${host_os}"
+echo " Windows version......: ${_efl_windows_version}"
echo
echo " Documentation........: ${build_doc}"
echo " Mpatrol..............: ${have_mpatrol}"
libdir=@libdir@
includedir=@includedir@
+winver=@_efl_windows_version@
+
Name: evil
Description: Library that ports on Windows some specific Unix functions.
Version: @VERSION@
Libs: -L${libdir} -levil
Libs.private:
-Cflags: -I${includedir}/evil-@VMAJ@
+Cflags: -I${includedir}/evil-@VMAJ@ @EFL_WINDOWS_VERSION_CFLAGS@
+++ /dev/null
-dnl Copyright (C) 2004-2008 Kim Woelders
-dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
-dnl That code is public domain and can be freely used or copied.
-dnl Originally snatched from somewhere...
-
-dnl Macro for checking if the compiler supports __attribute__
-
-dnl Usage: AC_C___ATTRIBUTE__
-dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
-dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
-dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
-dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
-dnl defined to nothing.
-
-AC_DEFUN([AC_C___ATTRIBUTE__],
-[
-
-AC_MSG_CHECKING([for __attribute__])
-
-AC_CACHE_VAL([ac_cv___attribute__],
- [AC_TRY_COMPILE(
- [
-#include <stdlib.h>
-
-int func(int x);
-int foo(int x __attribute__ ((unused)))
-{
- exit(1);
-}
- ],
- [],
- [ac_cv___attribute__="yes"],
- [ac_cv___attribute__="no"]
- )]
-)
-
-AC_MSG_RESULT($ac_cv___attribute__)
-
-if test "x${ac_cv___attribute__}" = "xyes" ; then
- AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
- AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
- else
- AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
-fi
-
-])
--- /dev/null
+dnl Copyright (C) 2011 Vincent Torri <vtorri at univ-evry dot fr>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macros for checking if the compiler supports some __attribute__ uses
+
+dnl Usage: EFL_ATTRIBUTE_UNUSED
+dnl call AC_DEFINE for __UNUSED__ if __attribute__((unused)) is available
+
+AC_DEFUN([EFL_ATTRIBUTE_UNUSED],
+[
+AC_MSG_CHECKING([for __attribute__ ((unused))])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+void foo(int x __attribute__ ((unused))) {}
+ ]],
+ [[
+ ]])],
+ [have_attribute_unused="yes"],
+ [have_attribute_unused="no"])
+AC_MSG_RESULT([${have_attribute_unused}])
+
+if test "x${have_attribute_unused}" = "xyes" ; then
+ AC_DEFINE([__UNUSED__], [__attribute__ ((unused))], [Macro declaring a function argument to be unused.])
+else
+ AC_DEFINE([__UNUSED__], [], [__attribute__ ((unused)) is not supported.])
+fi
+])
+
+dnl Usage: EFL_ATTRIBUTE_VECTOR
+dnl call AC_DEFINE for HAVE_GCC_ATTRIBUTE_VECTOR if __attribute__((vector)) is available
+
+AC_DEFUN([EFL_ATTRIBUTE_VECTOR],
+[
+AC_MSG_CHECKING([for __attribute__ ((vector))])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+typedef int v4si __attribute__ ((vector_size (16)));
+ ]],
+ [[
+if (sizeof(v4si) == 16)
+ return 0;
+else
+ return -1;
+ ]])],
+ [have_attribute_vector="yes"],
+ [have_attribute_vector="no"])
+AC_MSG_RESULT([${have_attribute_vector}])
+
+if test "x${have_attribute_vector}" = "xyes" ; then
+ AC_DEFINE([HAVE_GCC_ATTRIBUTE_VECTOR], [1], [Define to 1 if your compiler supports __attribute__ ((vector)).])
+fi
+])
+
+dnl End of efl_attribute.m4
+++ /dev/null
-dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
-dnl That code is public domain and can be freely used or copied.
-
-dnl Macro that check if mpatrol is wanted and if yes, if
-dnl it is available.
-
-dnl Usage: EFL_CHECK_MPATROL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-dnl Defines EFL_MPATROL_CPPFLAGS and EFL_MPATROL_LIBS variables
-
-AC_DEFUN([EFL_CHECK_MPATROL],
-[
-
-dnl configure options
-
-AC_ARG_ENABLE([mpatrol],
- [AC_HELP_STRING([--enable-mpatrol], [enable mpatrol @<:@default=no@:>@])],
- [
- if test "x${enableval}" = "xyes" ; then
- _efl_enable_mpatrol="yes"
- else
- _efl_enable_mpatrol="no"
- fi
- ],
- [_efl_enable_mpatrol="no"]
-)
-AC_MSG_CHECKING([whether mpatrol is used])
-AC_MSG_RESULT([${_efl_enable_mpatrol}])
-
-AC_ARG_WITH([mpatrol-dir],
- [AC_HELP_STRING([--enable-mpatrol-dir], [specify the directory of mpatrol @<:@default=/usr/local@:>@])],
- [_efl_with_mpatrol_dir=${withval}],
- [_efl_with_mpatrol_dir="/usr/local"]
-)
-
-AC_ARG_WITH([mpatrol-bindir],
- [AC_HELP_STRING([--enable-mpatrol-bindir], [specify the binary directory of mpatrol])],
- [_efl_with_mpatrol_bindir=${withval}]
-)
-
-AC_ARG_WITH([mpatrol-includedir],
- [AC_HELP_STRING([--enable-mpatrol-includedir], [specify the include directory of mpatrol])],
- [_efl_with_mpatrol_includedir=${withval}]
-)
-
-AC_ARG_WITH([mpatrol-libdir],
- [AC_HELP_STRING([--enable-mpatrol-libdir], [specify the library directory of mpatrol])],
- [_efl_with_mpatrol_libdir=${withval}]
-)
-
-if test "x${_efl_enable_mpatrol}" = "xyes" ; then
-
-dnl values of the different paths
-
- if test ! "x${_efl_with_mpatrol_bindir}" = "x" ; then
- _efl_mpatrol_bindir=${_efl_with_mpatrol_bindir}
- else
- _efl_mpatrol_bindir="${_efl_with_mpatrol_dir}/bin"
- fi
-
- if test ! "x${_efl_with_mpatrol_includedir}" = "x" ; then
- _efl_mpatrol_includedir=${_efl_with_mpatrol_includedir}
- else
- _efl_mpatrol_includedir="${_efl_with_mpatrol_dir}/include"
- fi
-
- if test ! "x${_efl_with_mpatrol_libdir}" = "x" ; then
- _efl_mpatrol_libdir=${_efl_with_mpatrol_libdir}
- else
- _efl_mpatrol_libdir="${_efl_with_mpatrol_dir}/lib"
- fi
-
-dnl check of mpatrol program
-
- AC_CHECK_PROG([_efl_have_mpatrol],
- [mpatrol],
- ["yes"],
- ["no"],
- [$PATH$PATH_SEPARATOR${_efl_mpatrol_bindir}]
- )
-
- SAVE_CPPFLAGS=${CPPFLAGS}
- SAVE_LIBS=${LDFLAGS}
- CPPFLAGS="-I${_efl_mpatrol_includedir}"
- LIBS="-L${_efl_mpatrol_libdir} -lmpatrol -lbfd -liberty -limagehlp"
-
-dnl check of mpatrol.h header file
-
- AC_CHECK_HEADER([mpatrol.h],
- [],
- [_efl_have_mpatrol="no"]
- )
-
-dnl check of mpatrol library and its needed dependencies
-
- AC_LINK_IFELSE(
- [AC_LANG_PROGRAM([[
-#include <mpatrol.h>
- ]],
- [[
-__mp_clearleaktable();
- ]])],
- [],
- [_efl_have_mpatrol="no"]
- )
-
- AC_MSG_CHECKING([whether libmpatrol is usuable])
- AC_MSG_RESULT([${_efl_have_mpatrol}])
-
- CPPFLAGS=${SAVE_CPPFLAGS}
- LIBS=${SAVE_LIBS}
-
-fi
-
-if test "x${_efl_enable_mpatrol}" = "xyes" ; then
- EFL_MPATROL_CPPFLAGS="-include ${_efl_mpatrol_includedir}/mpatrol.h"
- EFL_MPATROL_LIBS="-L${_efl_mpatrol_libdir} -lmpatrol -lbfd -liberty -limagehlp"
-fi
-
-AC_SUBST(EFL_MPATROL_CPPFLAGS)
-AC_SUBST(EFL_MPATROL_LIBS)
-
-AM_CONDITIONAL(EFL_HAVE_MPATROL, test "x${_efl_have_mpatrol}" = "xyes")
-
-if test "x${_efl_have_mpatrol}" = "xyes" ; then
- ifelse([$1], , :, [$1])
-else
- ifelse([$2], , :, [$2])
-fi
-
-])
--- /dev/null
+dnl Copyright (C) 2011 Vincent Torri <vincent dot torri at gmail dot com>
+dnl This code is public domain and can be freely used or copied.
+
+dnl Macro that select the Windows version (XP (default), Vista, 7)
+
+dnl Usage: EFL_SELECT_WINDOWS_VERSION()
+dnl Update CPPFLAGS accordingly
+
+AC_DEFUN([EFL_SELECT_WINDOWS_VERSION],
+[
+
+dnl configure option
+
+AC_ARG_WITH([windows-version],
+ [AC_HELP_STRING([--with-windows-version], [select the target Windows version (xp, vista, win7 or ce) @<:@default=xp@:>@])],
+ [
+ if test "x${with_windows_version}" = "xvista" ; then
+ _winver="vista"
+ else
+ if test "x${with_windows_version}" = "xwin7" ; then
+ _winver="win7"
+ else
+ if test "x${with_windows_version}" = "ce" ; then
+ _winver="ce"
+ else
+ _winver="xp"
+ fi
+ fi
+ fi
+ ],
+ [_winver="xp"])
+
+AC_MSG_CHECKING([which Windows version to target])
+AC_MSG_RESULT([${_winver}])
+
+case "${_winver}" in
+ ce)
+ EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WCE=0x0420"
+ _efl_windows_version="Windows CE"
+ ;;
+ vista)
+ EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0600"
+ _efl_windows_version="Windows Vista"
+ ;;
+ win7)
+ EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0601"
+ _efl_windows_version="Windows 7"
+ ;;
+ *)
+ EFL_WINDOWS_VERSION_CFLAGS="-D_WIN32_WINNT=0x0501"
+ _efl_windows_version="Windows XP"
+ ;;
+esac
+
+CPPFLAGS="${CPPFLAGS} ${EFL_WINDOWS_VERSION_CFLAGS}"
+AC_SUBST([EFL_WINDOWS_VERSION_CFLAGS])
+AC_SUBST([_efl_windows_version])
+
+])