summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2015-01-24 13:53:43 (GMT)
committerOlliver Schinagl <oliver@schinagl.nl>2015-01-24 14:18:21 (GMT)
commit08cfb908c22c0c7b5aeb788569950718939b7465 (patch)
tree6602640dc6b8dafaa3605d9cc3e955e66581d1e9 /m4
parente13c3bc4aeba38f4f70754d8e73985eafb23a290 (diff)
downloadeulogium-08cfb908c22c0c7b5aeb788569950718939b7465.zip
eulogium-08cfb908c22c0c7b5aeb788569950718939b7465.tar.gz
eulogium-08cfb908c22c0c7b5aeb788569950718939b7465.tar.bz2
EFL empty project
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Diffstat (limited to 'm4')
-rw-r--r--m4/efl.m4123
-rw-r--r--m4/efl_attribute.m456
-rw-r--r--m4/efl_binary.m479
-rw-r--r--m4/efl_compiler_flag.m457
-rw-r--r--m4/efl_doxygen.m498
-rw-r--r--m4/efl_path_max.m436
-rw-r--r--m4/efl_tests.m465
7 files changed, 514 insertions, 0 deletions
diff --git a/m4/efl.m4 b/m4/efl.m4
new file mode 100644
index 0000000..098722f
--- /dev/null
+++ b/m4/efl.m4
@@ -0,0 +1,123 @@
+dnl file to manage modules in efl
+
+dnl EFL_VERSION(major, minor, micro, release)
+dnl This setup EFL version information and should be called BEFORE AC_INIT().
+dnl
+dnl release parameter is 'dev' to use from SVN or libtool -release field.
+dnl It may be empty if not dev (svn/live build) and no -release is to be used.
+dnl
+dnl Examples:
+dnl EFL_VERSION(1, 7, 99, dev)
+dnl EFL_VERSION(1, 7, 99, ver-1234)
+dnl This will define couple of m4 symbols:
+dnl v_maj = given major number (first parameter)
+dnl v_min = given minor number (second parameter)
+dnl v_mic = given micro number (third parameter)
+dnl v_rev = if release, it's 0, otherwise it's dev_version.
+dnl v_rel = if release, it's -release followed by fourth parameter,
+dnl otherwise it's empty. (mostly for libtool)
+dnl efl_version = if release, it's major.minor.micro, otherwise it's
+dnl major.minor.micro.dev_version
+dnl dev_version = development version (svn revision).
+dnl def_build_profile = dev or release based on 'dev' release parameter.
+AC_DEFUN([EFL_VERSION],
+[dnl
+m4_define([v_maj], [$1])dnl
+m4_define([v_min], [$2])dnl
+m4_define([v_mic], [$3])dnl
+m4_define([dev_version], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
+m4_define([v_rev], m4_if($4, dev, [dev_version], [0]))dnl
+m4_define([v_rel], [])dnl
+m4_define([def_build_profile], m4_if($4, dev, [dev], [release]))dnl
+m4_define([efl_version], m4_if($4, dev, [v_maj.v_min.v_mic.v_rev], [v_maj.v_min.v_mic]))dnl
+m4_define([efl_version], [v_maj.v_min.v_mic])dnl
+])
+
+dnl EFL_COLOR
+dnl will check if terminal supports color and if color is wanted by user.
+dnl
+dnl Used Variables:
+dnl WANT_COLOR: if no, forces no color output.
+dnl TERM: used to check if color should be enabled.
+dnl
+dnl Defined Variables:
+dnl COLOR_YES: to be used in positive/yes conditions
+dnl COLOR_NO: to be used in negative/no conditions
+dnl COLOR_OTHER: to be used to highlight some other condition
+dnl COLOR_RESET: to reset color
+dnl want_color: yes or no
+AC_DEFUN([EFL_COLOR],
+[dnl
+case "$TERM" in
+ xterm|xterm-color|xterm-256color|Eterm|aterm|kterm|rxvt*|screen|gnome|interix)
+ want_color="${WANT_COLOR:-yes}"
+ ;;
+ *)
+ want_color="no"
+ ;;
+esac
+
+if test "${want_color}" = "yes"; then
+ if test `echo -e x` = x; then
+ echoopt=-e
+ else
+ echoopt=
+ fi
+
+ COLOR_YES=`echo $echoopt "\033@<:@1;32m"`
+ COLOR_NO=`echo $echoopt "\033@<:@1;31m"`
+ COLOR_OTHER=`echo $echoopt "\033@<:@1;36m"`
+ COLOR_RESET=`echo $echoopt "\033@<:@0m"`
+
+else
+ COLOR_YES=""
+ COLOR_NO=""
+ COLOR_OTHER=""
+ COLOR_RESET=""
+fi
+])
+
+dnl EFL_INIT()
+dnl Will AC_DEFINE() the following:
+dnl VMAJ = v_maj
+dnl VMIN = v_min
+dnl VMIC = v_mic
+dnl VREV = v_rev
+dnl Will AC_SUBST() the following:
+dnl VMAJ = v_maj
+dnl VMIN = v_min
+dnl VMIC = v_mic
+dnl EFL_LTLIBRARY_FLAGS="-no-undefined -version-info ..."
+dnl EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
+dnl Will define the following m4:
+dnl lt_cur = libtool 'current' field of libtool's -version-info
+dnl lt_rev = libtool 'revision' field of libtool's -version-info
+dnl lt_age = libtool 'age' field of libtool's -version-info
+AC_DEFUN([EFL_INIT],
+[dnl
+AC_REQUIRE([EFL_COLOR])dnl
+AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])dnl
+AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])dnl
+AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])dnl
+AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])dnl
+VMAJ=v_maj
+VMIN=v_min
+VMIC=v_mic
+AC_SUBST([VMAJ])dnl
+AC_SUBST([VMIN])dnl
+AC_SUBST([VMIC])dnl
+dnl
+dnl TODO: warning - lt_cur:
+dnl the previous code assumed v_maj + v_min, but this will be a problem when
+dnl we bump v_maj and reset v_min. 1 + 7 == 7 + 1, so if v_maj is bumped
+dnl we multiply it by 100.
+m4_define([lt_cur], m4_if(m4_cmp(v_maj, 1), 0, m4_eval(v_maj + v_min), m4_eval(v_maj * 100 + v_min)))dnl
+m4_define([lt_rev], v_mic)dnl
+m4_define([lt_age], v_min)dnl
+dnl
+EFL_LTLIBRARY_FLAGS="-no-undefined -version-info lt_cur:lt_rev:lt_age v_rel"
+AC_SUBST(EFL_LTLIBRARY_FLAGS)dnl
+EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
+AC_SUBST([EFL_LTMODULE_FLAGS])dnl
+AC_MSG_NOTICE([Initialized AC_PACKAGE_NAME (AC_PACKAGE_VERSION) development=dev_version v_rel])
+])
diff --git a/m4/efl_attribute.m4 b/m4/efl_attribute.m4
new file mode 100644
index 0000000..78bff15
--- /dev/null
+++ b/m4/efl_attribute.m4
@@ -0,0 +1,56 @@
+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
diff --git a/m4/efl_binary.m4 b/m4/efl_binary.m4
new file mode 100644
index 0000000..91a26b2
--- /dev/null
+++ b/m4/efl_binary.m4
@@ -0,0 +1,79 @@
+dnl Copyright (C) 2010 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 a binary is built or not
+
+dnl Usage: EFL_ENABLE_BIN(binary)
+dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
+dnl Define have_binary (- is transformed into _)
+dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
+
+AC_DEFUN([EFL_ENABLE_BIN],
+[
+
+m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
+m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
+
+have_[]m4_defn([DOWN])="yes"
+
+dnl configure option
+
+AC_ARG_ENABLE([$1],
+ [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
+ [
+ if test "x${enableval}" = "xyes" ; then
+ have_[]m4_defn([DOWN])="yes"
+ else
+ have_[]m4_defn([DOWN])="no"
+ fi
+ ])
+
+AC_MSG_CHECKING([whether to build ]DOWN[ binary])
+AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
+
+if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
+ UP[]_PRG=DOWN[${EXEEXT}]
+fi
+
+AC_SUBST(UP[]_PRG)
+
+AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
+
+AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
+
+])
+
+
+dnl Macro that check if a binary is built or not
+
+dnl Usage: EFL_WITH_BIN(package, binary, default_value)
+dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
+
+AC_DEFUN([EFL_WITH_BIN],
+[
+
+m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
+m4_pushdef([UP], m4_translit([[$2]], [-a-z], [_A-Z]))dnl
+
+dnl configure option
+
+AC_ARG_WITH([$2],
+ [AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])],
+ [
+ _efl_with_binary=${withval}
+ _efl_binary_define="yes"
+ ],
+ [
+ _efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3
+ _efl_binary_define="no"
+ ])
+
+DOWN=${_efl_with_binary}
+AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
+
+with_binary_[]m4_defn([DOWN])=${_efl_with_binary}
+
+AM_CONDITIONAL(HAVE_[]UP, [test "x${_efl_binary_define}" = "xyes"])
+AC_SUBST(DOWN)
+
+])
diff --git a/m4/efl_compiler_flag.m4 b/m4/efl_compiler_flag.m4
new file mode 100644
index 0000000..25c285d
--- /dev/null
+++ b/m4/efl_compiler_flag.m4
@@ -0,0 +1,57 @@
+dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
+dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro that checks if a compiler flag is supported by the compiler.
+
+dnl Usage: EFL_COMPILER_FLAG(flag)
+dnl flag is added to CFLAGS if supported.
+
+AC_DEFUN([EFL_COMPILER_FLAG],
+[
+
+CFLAGS_save="${CFLAGS}"
+CFLAGS="${CFLAGS} $1"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $1])
+
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+if test "x${have_flag}" = "xno" ; then
+ CFLAGS="${CFLAGS_save}"
+fi
+AC_LANG_POP([C])
+
+])
+
+dnl Macro that checks if a linker flag is supported by the compiler.
+
+dnl Usage: EFL_LINKER_FLAG(flag)
+dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
+
+AC_DEFUN([EFL_LINKER_FLAG],
+[
+
+LDFLAGS_save="${LDFLAGS}"
+LDFLAGS="${LDFLAGS} $1"
+
+AC_LANG_PUSH([C])
+AC_MSG_CHECKING([whether the compiler supports $1])
+
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[]])],
+ [have_flag="yes"],
+ [have_flag="no"])
+AC_MSG_RESULT([${have_flag}])
+
+if test "x${have_flag}" = "xno" ; then
+ LDFLAGS="${LDFLAGS_save}"
+fi
+AC_LANG_POP([C])
+
+])
diff --git a/m4/efl_doxygen.m4 b/m4/efl_doxygen.m4
new file mode 100644
index 0000000..0c1452f
--- /dev/null
+++ b/m4/efl_doxygen.m4
@@ -0,0 +1,98 @@
+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 doxygen is available or not.
+
+dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Test for the doxygen program
+dnl Defines efl_doxygen
+dnl Defines the automake conditionnal EFL_BUILD_DOC
+dnl
+AC_DEFUN([EFL_CHECK_DOXYGEN],
+[
+
+dnl
+dnl Disable the build of the documentation
+dnl
+AC_ARG_ENABLE([doc],
+ [AC_HELP_STRING(
+ [--disable-doc],
+ [Disable documentation build @<:@default=enabled@:>@])],
+ [
+ if test "x${enableval}" = "xyes" ; then
+ efl_enable_doc="yes"
+ else
+ efl_enable_doc="no"
+ fi
+ ],
+ [efl_enable_doc="yes"]
+)
+
+if test "x${efl_enable_doc}" = "xyes" ; then
+
+dnl
+dnl Specify the full file name, with path
+dnl
+
+ efl_doxygen="doxygen"
+
+ AC_ARG_WITH([doxygen],
+ [AC_HELP_STRING(
+ [--with-doxygen=FILE],
+ [doxygen program to use @<:@default=doxygen@:>@])],
+dnl
+dnl Check the given doxygen program.
+dnl
+ [efl_doxygen=${withval}
+ AC_CHECK_PROG([efl_have_doxygen],
+ [${efl_doxygen}],
+ [yes],
+ [no])
+ if test "x${efl_have_doxygen}" = "xno" ; then
+ echo "WARNING:"
+ echo "The doxygen program you specified:"
+ echo "$efl_doxygen"
+ echo "was not found. Please check the path and make sure "
+ echo "the program exists and is executable."
+ AC_MSG_WARN([Warning: no doxygen detected. Documentation will not be built])
+ fi
+ ],
+ [AC_CHECK_PROG([efl_have_doxygen],
+ [${efl_doxygen}],
+ [yes],
+ [no])
+ if test "x${efl_have_doxygen}" = "xno" ; then
+ echo "WARNING:"
+ echo "The doxygen program was not found in your execute"
+ echo "You may have doxygen installed somewhere not covered by your path."
+ echo ""
+ echo "If this is the case make sure you have the packages installed, AND"
+ echo "that the doxygen program is in your execute path (see your"
+ echo "shell manual page on setting the \$PATH environment variable), OR"
+ echo "alternatively, specify the program to use with --with-doxygen."
+ AC_MSG_WARN([Warning: no doxygen detected. Documentation will not be built])
+ fi
+ ]
+ )
+fi
+
+dnl
+dnl Substitution
+dnl
+AC_SUBST([efl_doxygen])
+
+if ! test "x${efl_have_doxygen}" = "xyes" ; then
+ efl_enable_doc="no"
+fi
+
+AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_enable_doc}" = "xyes")
+
+if test "x${efl_enable_doc}" = "xyes" ; then
+ ifelse([$1], , :, [$1])
+else
+ ifelse([$2], , :, [$2])
+fi
+
+])
+
+dnl End of doxygen.m4
diff --git a/m4/efl_path_max.m4 b/m4/efl_path_max.m4
new file mode 100644
index 0000000..f57bfd2
--- /dev/null
+++ b/m4/efl_path_max.m4
@@ -0,0 +1,36 @@
+dnl Check for PATH_MAX in limits.h, and define a default value if not found
+dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd
+
+dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND])
+dnl
+dnl If PATH_MAX is not defined in <limits.h>, defines it
+dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback
+dnl to using 4096
+
+AC_DEFUN([EFL_CHECK_PATH_MAX],
+[
+
+default_max=m4_default([$1], "4096")
+AC_LANG_PUSH([C])
+
+AC_MSG_CHECKING([for PATH_MAX in limits.h])
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <limits.h>
+ ]],
+ [[
+int i = PATH_MAX;
+ ]])],
+ [AC_MSG_RESULT([yes])],
+ [
+ AC_DEFINE_UNQUOTED([PATH_MAX],
+ [${default_max}],
+ [default value since PATH_MAX is not defined])
+ AC_MSG_RESULT([no: using ${default_max}])
+ ])
+
+AC_LANG_POP([C])
+
+])
+dnl end of efl_path_max.m4
diff --git a/m4/efl_tests.m4 b/m4/efl_tests.m4
new file mode 100644
index 0000000..2b6106c
--- /dev/null
+++ b/m4/efl_tests.m4
@@ -0,0 +1,65 @@
+dnl Copyright (C) 2013 Cedric BAIL <cedric.bail at free dot fr>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro for checking availability of tests and coverage infra structure
+
+dnl Usage: EFL_TESTS(profile)
+dnl Valid profile are auto, tests, coverage, no
+dnl Call PKG_CHECK_MODULES, AC_CHECK_PROG, define CHECK_CFLAGS/CHECK_LIBS and modify CFLAGS/LIBS
+dnl It define EFL_HAVE_TESTS/EFL_HAVE_LCOV for use in Makefile.am
+dnl It set have_test and have_coverage to yes/no depending if found
+
+AC_DEFUN([EFL_TESTS],
+[
+build_tests=$1
+
+case "${build_tests}" in
+ auto)
+ check_tests="auto"
+ check_coverage="auto"
+ ;;
+ tests)
+ check_tests="yes"
+ check_coverage="auto"
+ ;;
+ coverage)
+ check_tests="yes"
+ check_coverage="yes"
+ ;;
+ no)
+ check_tests="no"
+ check_coverage="no"
+ ;;
+ *)
+ AC_MSG_ERROR([Unknow tests profile])
+esac
+
+have_tests="no"
+if test "x${check_tests}" = "xyes" -o "x${check_tests}" = "xauto"; then
+ PKG_CHECK_MODULES([CHECK], [check >= 0.9.5], [have_tests="yes"], [have_tests="no"])
+ if test "${check_tests}" = "xyes" -a "x${have_tests}" = "xno"; then
+ AC_MSG_ERROR([Impossible to find check package to build tests])
+ fi
+fi
+
+if test "x${have_tests}" = "xyes"; then
+ if test "x${check_coverage}" = "xyes" -o "x${check_coverage}" = "xauto"; then
+ AC_CHECK_PROG([have_lcov], [lcov], [yes], [no])
+ if test "x${have_lcov}" = "xyes" ; then
+ CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
+ LIBS="${LIBS} -lgcov"
+ fi
+ if test "x${have_lcov}" = "xno" -a "x${check_coverage}" = "xyes"; then
+ AC_MSG_ERROR([Impossible to find lcov package to build with coverage support])
+ fi
+ else
+ have_coverage="no"
+ fi
+else
+ have_coverage="no"
+fi
+
+AM_CONDITIONAL([EFL_HAVE_TESTS], [test "x${have_tests}" = "xyes"])
+AM_CONDITIONAL([EFL_HAVE_LCOV], [test "x${have_lcov}" = "xyes"])
+
+])