* add m4 macro for documentation, unit tests and coverage

* put documentation related files in doc, remove gendoc and
   add a doc rule to create the documentation and a doc tarball
   named eet-doc-$(version).tar.bz2
 * minor cleanup in the autotools


SVN revision: 36706
This commit is contained in:
Vincent Torri 2008-10-16 08:41:40 +00:00
parent a3f8f5f27b
commit 3e4465c4fa
14 changed files with 304 additions and 398 deletions

View File

@ -1,139 +0,0 @@
PROJECT_NAME = Eet
PROJECT_NUMBER =
OUTPUT_DIRECTORY = doc
INPUT = eet.c src/lib/Eet.h
IMAGE_PATH = doc/img
OUTPUT_LANGUAGE = English
GENERATE_HTML = YES
HTML_OUTPUT = html
HTML_FILE_EXTENSION = .html
HTML_HEADER = doc/head.html
HTML_FOOTER = doc/foot.html
HTML_STYLESHEET = doc/e.css
HTML_ALIGN_MEMBERS = YES
ENUM_VALUES_PER_LINE = 1
GENERATE_HTMLHELP = NO
CHM_FILE =
HHC_LOCATION =
GENERATE_CHI = NO
BINARY_TOC = NO
TOC_EXPAND = NO
DISABLE_INDEX = YES
EXTRACT_ALL = NO
EXTRACT_PRIVATE = NO
EXTRACT_STATIC = NO
EXTRACT_LOCAL_CLASSES = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = YES
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = NO
STRIP_FROM_PATH =
INTERNAL_DOCS = NO
STRIP_CODE_COMMENTS = YES
CASE_SENSE_NAMES = YES
SHORT_NAMES = NO
HIDE_SCOPE_NAMES = NO
VERBATIM_HEADERS = NO
SHOW_INCLUDE_FILES = NO
JAVADOC_AUTOBRIEF = YES
MULTILINE_CPP_IS_BRIEF = NO
DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 2
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ALIASES =
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SHOW_USED_FILES = NO
QUIET = NO
WARNINGS = YES
WARN_IF_UNDOCUMENTED = YES
WARN_FORMAT = "$file:$line: $text"
WARN_LOGFILE =
FILE_PATTERNS =
RECURSIVE = NO
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS =
EXAMPLE_RECURSIVE = NO
INPUT_FILTER =
FILTER_SOURCE_FILES = NO
SOURCE_BROWSER = NO
INLINE_SOURCES = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
ALPHABETICAL_INDEX = YES
COLS_IN_ALPHA_INDEX = 2
IGNORE_PREFIX =
GENERATE_TREEVIEW = NO
TREEVIEW_WIDTH = 250
GENERATE_LATEX = YES
LATEX_OUTPUT = latex
LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
COMPACT_LATEX = NO
PAPER_TYPE = a4wide
EXTRA_PACKAGES =
LATEX_HEADER =
PDF_HYPERLINKS = YES
USE_PDFLATEX = NO
LATEX_BATCHMODE = NO
GENERATE_RTF = NO
RTF_OUTPUT = rtf
COMPACT_RTF = NO
RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
RTF_EXTENSIONS_FILE =
GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = YES
GENERATE_XML = NO
XML_SCHEMA =
XML_DTD =
GENERATE_AUTOGEN_DEF = NO
ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = NO
EXPAND_ONLY_PREDEF = NO
SEARCH_INCLUDES = NO
INCLUDE_PATH =
INCLUDE_FILE_PATTERNS =
PREDEFINED =
EXPAND_AS_DEFINED =
SKIP_FUNCTION_MACROS = YES
TAGFILES =
GENERATE_TAGFILE =
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = NO
HIDE_UNDOC_RELATIONS = YES
HAVE_DOT = NO
CLASS_GRAPH = NO
COLLABORATION_GRAPH = NO
TEMPLATE_RELATIONS = NO
INCLUDE_GRAPH = NO
INCLUDED_BY_GRAPH = NO
GRAPHICAL_HIERARCHY = NO
DOT_IMAGE_FORMAT = png
DOT_PATH =
DOTFILE_DIRS =
MAX_DOT_GRAPH_WIDTH = 512
MAX_DOT_GRAPH_HEIGHT = 512
GENERATE_LEGEND = YES
DOT_CLEANUP = YES
SEARCHENGINE = NO

View File

@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src
SUBDIRS = src doc
MAINTAINERCLEANFILES = \
Makefile.in \
@ -26,21 +26,26 @@ AUTHORS \
COPYING \
COPYING-PLAIN \
autogen.sh \
eet.c.in \
eet.pc.in \
eet.spec.in \
eet.spec \
README.in \
README \
Doxyfile \
doc \
gendoc
README
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = eet.pc
.PHONY: doc coverage
if EET_ENABLE_TESTS
# Documentation
doc:
@echo "entering doc/"
make -C doc doc
# Unit tests
if EFL_ENABLE_TESTS
check-local:
@./src/tests/eet_suite
@ -52,7 +57,9 @@ check-local:
endif
if EET_ENABLE_COVERAGE
# Coverage report
if EFL_ENABLE_COVERAGE
lcov-reset:
@rm -rf coverage
@find . -name "*.gcda" -exec rm {} \;

View File

@ -1,9 +1,10 @@
# get rid of that stupid cache mechanism
rm -f config.cache
AC_INIT(eet, 1.1.0, enlightenment-devel@lists.sourceforge.net)
AC_PREREQ(2.52)
AC_CONFIG_SRCDIR(configure.ac)
AC_INIT([eet], [1.1.0], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_ISC_POSIX
@ -16,6 +17,7 @@ AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_PROG_CC_C_O
AC_C___ATTRIBUTE__
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl
@ -33,70 +35,54 @@ PKG_PROG_PKG_CONFIG
WIN32_CFLAGS=""
WIN32_LIBS=""
lt_no_undefined=""
lt_enable_auto_import=""
case "$host_os" in
mingw*|cegcc)
mingw* | cegcc*)
PKG_CHECK_MODULES([EVIL], [evil])
AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed])
dnl needed for correct definition of EAPI
AC_DEFINE(EFL_EET_BUILD, 1, [Define to mention that eet is built])
if test "$host_os" = "cegcc" ; then
WIN32_CFLAGS="-mwin32"
WIN32_LIBS="-lws2"
lt_enable_auto_import="-Wl,--enable-auto-import"
else
WIN32_LIBS="-lws2_32"
fi
lt_no_undefined="-no-undefined"
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
case "$host_os" in
mingw32ce*)
WIN32_LIBS="-lws2"
;;
mingw*)
WIN32_LIBS="-lws2_32"
;;
cegcc*)
WIN32_CFLAGS="-mwin32"
WIN32_LIBS="-lws2"
;;
esac
AC_SUBST(WIN32_CFLAGS)
AC_SUBST(WIN32_LIBS)
AC_SUBST(lt_no_undefined)
AC_SUBST(lt_enable_auto_import)
dnl Checking for __attribute__ support
AC_MSG_CHECKING([for __attribute__])
AC_CACHE_VAL(_cv_have___attribute__,
[
AC_TRY_COMPILE([#include <stdlib.h>],
[int func(int x); int foo(int x __attribute__ ((unused))) { exit(1); }],
[_cv_have___attribute__="yes"],
[_cv_have___attribute__="no"])
]
)
if test "x${_cv_have___attribute__}" = "xyes" ; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has __attribute__])
fi
AC_MSG_RESULT(${_cv_have___attribute__})
AC_FUNC_ALLOCA
AC_CHECK_HEADER(zlib.h,, AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
AC_CHECK_HEADER(jpeglib.h,, AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"))
AC_CHECK_HEADER([zlib.h],
[dummy="yes"],
[AC_MSG_ERROR("Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
AC_CHECK_HEADER([jpeglib.h],
[dummy="yes"],
[AC_MSG_ERROR("Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file")])
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADER(fnmatch.h,, AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file]))
AC_CHECK_HEADER([fnmatch.h],
[dummy="yes"],
[AC_MSG_ERROR([Cannot find fnmatch.h. Make sure your CFLAGS environment variable contains include lines for the location of this file. MinGW users: see the INSTALL file])])
fnmatch_libs=""
AC_CHECK_FUNCS(fnmatch, res=yes, res=no)
AC_CHECK_FUNCS([fnmatch], [res="yes"], [res="no"])
if test "x$res" = "xno"; then
AC_CHECK_LIB(fnmatch, fnmatch, res=yes fnmatch_libs="-lfnmatch", res=no)
dnl Test for compilation with MinGW.
dnl fnmatch function is in the libiberty library
if test "x$res" = "xno"; then
AC_CHECK_LIB(iberty, fnmatch, res=yes fnmatch_libs="-liberty", res=no)
fi
if test "x$res" = "xno"; then
AC_MSG_ERROR([Cannot find fnmatch() in neither libc nor libfnmatch, nor libiberty])
fi
AC_SEARCH_LIBS([fnmatch],
[fnmatch iberty evil])
fi
AC_SUBST(fnmatch_libs)
dnl These are needed for fmemopen/open_memstream
AC_DEFINE(_GNU_SOURCE, , [Enable GNU extensions])
@ -118,30 +104,8 @@ int main (int argc, char **argv) {
)
dnl Unit Tests
AC_ARG_ENABLE(tests,
[AC_HELP_STRING([--enable-tests], [Enable tests @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_tests="yes"
else
enable_tests="no"
fi
],
[enable_tests="no"]
)
AC_MSG_CHECKING([if tests are built])
AC_MSG_RESULT([${enable_tests}])
if test "x${enable_tests}" = "xyes" ; then
PKG_CHECK_MODULES([CHECK],
[check >= 0.9.5],
[dummy="yes"],
[enable_tests="no"]
)
fi
AM_CONDITIONAL(EET_ENABLE_TESTS, test "x${enable_tests}" = "xyes")
EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
EFL_CHECK_COVERAGE([${enable_tests}], [enable_coverage="yes"], [enable_coverage="no"])
dnl Openssl support
want_openssl="auto"
@ -155,11 +119,6 @@ if test "x$want_openssl" = "xyes" -o "x$want_openssl" = "xauto"; then
[
have_openssl="yes"
AC_DEFINE(HAVE_OPENSSL, 1, [Have Openssl support])
],
[
if test "x$use_strict" = "xyes"; then
AC_MSG_ERROR([Openssl not found (strict dependencies checking)])
fi
])
fi
@ -169,69 +128,32 @@ have_cypher="no"
want_signature="yes"
have_signature="no"
AC_MSG_CHECKING(whether to activate cypher support in eet)
AC_ARG_ENABLE(cypher,
[AC_HELP_STRING([--disable-cypher], [disable cypher support for eet API])],
[ want_cypher=$enableval ]
)
if test "x$have_openssl" = "xyes" -a "x$want_cypher" = "xyes"; then
have_cypher="yes"
AC_DEFINE(HAVE_CYPHER, 1, [Have cypher support built in eet])
fi
AC_MSG_CHECKING(whether to activate cypher support in eet)
AC_MSG_RESULT($have_cypher)
AC_MSG_CHECKING(whether to activate signature support in eet)
AC_ARG_ENABLE(signature,
[AC_HELP_STRING([--disable-signature], [disable signature file support for eet])],
[ want_signature=$enableval ]
)
if test "x$have_openssl" = "xyes" -a "x$want_signature" = "xyes"; then
have_signature="yes"
AC_DEFINE(HAVE_SIGNATURE, 1, [Have signature support for eet file])
fi
AC_MSG_CHECKING(whether to activate signature support in eet)
AC_MSG_RESULT($have_signature)
dnl Coverage
AC_ARG_ENABLE(coverage,
[AC_HELP_STRING([--enable-coverage],
[compile with coverage profiling instrumentation @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
enable_coverage="yes"
else
enable_coverage="no"
fi],
[enable_coverage="no"]
)
AC_MSG_CHECKING([whether to use profiling instrumentation])
AC_MSG_RESULT($enable_coverage)
if test "x$enable_tests" = "xno" -a "x$enable_coverage" = "xyes"; then
enable_coverage="no"
fi
if test "x$enable_coverage" = "xyes"; then
AC_CHECK_PROG(have_lcov,
[lcov],
[yes],
[no]
)
if test "x$have_lcov" = "xyes" ; then
COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
COVERAGE_LIBS="-lgcov"
dnl remove any optimisation flag and force debug symbols
CFLAGS="-g -O0"
else
AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
enable_coverage="no"
fi
fi
AC_SUBST(COVERAGE_CFLAGS)
AC_SUBST(COVERAGE_LIBS)
AM_CONDITIONAL(EET_ENABLE_COVERAGE, test "x$enable_coverage" = "xyes")
dnl Disable support for old eet file format.
old_eet_file_format="yes"
AC_ARG_ENABLE(old-eet-file-format,
@ -241,7 +163,6 @@ AC_ARG_ENABLE(old-eet-file-format,
),
[ old_eet_file_format=$enableval ]
)
AM_CONDITIONAL(EET_OLD_EET_FILE_FORMAT, test "x$old_eet_file_format" = "xyes")
if test "x$old_eet_file_format" = "xyes"; then
AC_DEFINE(EET_OLD_EET_FILE_FORMAT, 1, [support old eet file format])
else
@ -257,17 +178,18 @@ AC_ARG_ENABLE(assert,
),
[ prefer_assert=$enableval ]
)
AM_CONDITIONAL(EET_ASSERT, test "x$prefer_assert" = "xyes")
if test "x$prefer_assert" = "xno"; then
cflags="$cflags -DNDEBUG"
DEBUG_CFLAGS="-DNDEBUG"
fi
AC_SUBST(DEBUG_CFLAGS)
#AM_CHECK_DOXYGEN()
EFL_CHECK_DOXYGEN([enable_doc="yes"], [enable_doc="no"])
AC_OUTPUT([
Makefile
eet.pc
eet.c
doc/Makefile
doc/eet.c
src/Makefile
src/lib/Makefile
src/bin/Makefile
@ -292,7 +214,8 @@ echo
echo " Openssl..............: ${have_openssl}"
echo " Cypher support.....: ${have_cypher}"
echo " Signature..........: ${have_signature}"
echo
echo " Documentation........: ${enable_doc}"
echo " Tests................: ${enable_tests}"
echo " Coverage.............: ${enable_coverage}"
echo

View File

@ -1,7 +1,7 @@
PROJECT_NAME = Eet
PROJECT_NUMBER =
OUTPUT_DIRECTORY = .
INPUT = ../eet.c ../src/lib
INPUT = eet.c ../src/lib
IMAGE_PATH = img
OUTPUT_LANGUAGE = English
GENERATE_HTML = YES
@ -102,7 +102,7 @@ GENERATE_MAN = YES
MAN_OUTPUT = man
MAN_EXTENSION = .3
MAN_LINKS = YES
GENERATE_XML = YES
GENERATE_XML = NO
XML_SCHEMA =
XML_DTD =
GENERATE_AUTOGEN_DEF = NO

View File

@ -1,46 +1,32 @@
if BUILD_DOCS
# install documentation
docdir = $(datadir)/$(PACKAGE)/doc
all-local: doc-build.stamp
# rule to remove all old created files
doc-prepare.stamp:
@if test -d html ; then \
rm -rf html/ latex/ man/ xml/; \
fi
# rule to build documentation and copy necessary files
doc-build.stamp: doc-prepare.stamp
@doxygen
@cp img/*.png html/
# rules to clean
clean-local:
@rm -rf html/ latex/ man/ xml/
# rule to install the documentation in $(docdir)
install-data-local:
@if ! test -d "$(DESTDIR)$(datadir)/$(PACKAGE)"; then \
$(mkinstalldirs) "$(DESTDIR)$(datadir)/$(PACKAGE)"; \
fi
@if ! test -d "$(DESTDIR)$(docdir)"; then \
$(mkinstalldirs) "$(DESTDIR)$(docdir)"; \
fi
@cp -pr html/ man/ latex/ xml/ "$(DESTDIR)$(docdir)"
# rule to uninstall the documentation
uninstall-local:
rm -rf $(DESTDIR)$(docdir)
MAINTAINERCLEANFILES = Makefile.in eet.c
DISTCLEANFILES = Makefile.in eet.c
.PHONY: doc
if EFL_BUILD_DOC
doc-clean:
rm -rf html/ latex/ man/ xml/ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar*
doc: all doc-clean
$(DOXYGEN)
cp img/*.png html/
rm -rf $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION).tar*
mkdir -p $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION)/doc
cp -R html/ latex/ man/ $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION)/doc
tar cf $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION).tar $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION)
bzip2 -9 $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION).tar
rm -rf $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION)
mv $(PACKAGE_TARNAME)-doc-$(PACKAGE_VERSION).tar.bz2 $(top_srcdir)
else
doc:
@echo "Documentation not built. Run ./configure --help"
endif
EXTRA_DIST = Doxyfile eet.css foot.html head.html img/
clean-local: doc-clean
EXTRA_DIST = Doxyfile eet.css foot.html head.html img/ eet.c.in

View File

@ -1,8 +0,0 @@
#!/bin/sh
rm -rf ./doc/html ./doc/latex ./doc/man
doxygen
cp doc/img/* doc/html/
rm -f eet_docs.tar eet_docs.tar.gz
tar -cvf eet_docs.tar doc/html doc/man doc/latex
gzip -9 eet_docs.tar
exit 0

View File

@ -0,0 +1,14 @@
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)])
if test "$ac_cv___attribute__" = "yes"; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has __attribute__])
fi
AC_MSG_RESULT($ac_cv___attribute__)
])

View File

@ -1,73 +0,0 @@
dnl Configure script for doxygen
dnl Vincent Torri 2005-22-09
dnl
dnl AM_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for the doxygen program, and define BUILD_DOCS and DOXYGEN.
dnl
AC_DEFUN([AM_CHECK_DOXYGEN],
[
DOXYGEN="doxygen"
dnl
dnl Disable the build of the documentation
dnl
AC_ARG_ENABLE(
[build_docs],
AC_HELP_STRING(
[--disable-build-docs],
[Disable the build of the documentation]),
[if test "${disable_build_docs}" = "yes" ; then
enable_build_docs="no"
else
enable_build_docs="yes"
fi],
[enable_build_docs="yes"])
dnl
dnl Get the prefix where doxygen is installed.
dnl
AC_ARG_WITH(
[doxygen],
AC_HELP_STRING(
[--with-doxygen=FILE],
[doxygen program to use (eg /usr/bin/doxygen)]),
dnl
dnl Check the given doxygen program.
dnl
[DOXYGEN=${withval}
AC_CHECK_PROG(
[BUILD_DOCS],
[${DOXYGEN}],
[yes],
[no])
if test $BUILD_DOCS = no; then
echo "WARNING:"
echo "The doxygen program you specified:"
echo "$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(
[BUILD_DOCS],
[${DOXYGEN}],
[yes],
[no])
if test ${BUILD_DOCS} = no; 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's 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])
dnl
dnl Substitution
dnl
AC_SUBST([DOXYGEN])
AM_CONDITIONAL(BUILD_DOCS, test "x$BUILD_DOCS" = "xyes")
])
dnl End of doxygen.m4

View File

@ -0,0 +1,64 @@
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 coverage support is wanted and, if yes, if
dnl lcov is available.
dnl Usage: EFL_CHECK_COVERAGE(tests [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl The parameter 'tests' is used if a dependency is needed. If set to "yes",
dnl the dependency is available.
dnl Defines EFL_COVERAGE_CFLAGS and EFL_COVERAGE_LIBS variables
dnl Defines the automake conditionnal EFL_ENABLE_COVERAGE
AC_DEFUN([EFL_CHECK_COVERAGE],
[
dnl configure option
AC_ARG_ENABLE([coverage],
[AC_HELP_STRING([--enable-coverage], [compile with coverage profiling instrumentation @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_efl_enable_coverage="yes"
else
_efl_enable_coverage="no"
fi
],
[_efl_enable_coverage="no"]
)
AC_MSG_CHECKING([whether to use profiling instrumentation])
AC_MSG_RESULT([$_efl_enable_coverage])
dnl lcov check
if test ! "x$1" = "xyes" -a "x$_efl_enable_coverage" = "xyes" ; then
AC_MSG_WARN([Coverage report requested but tests not being built, disable profiling instrumentation.])
AC_MSG_WARN([Run configure with --enable-tests])
_efl_enable_coverage="no"
fi
if test "x$_efl_enable_coverage" = "xyes" ; then
AC_CHECK_PROG(have_lcov, [lcov], [yes], [no])
if test "x$have_lcov" = "xyes" ; then
EFL_COVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
EFL_COVERAGE_LIBS="-lgcov"
# remove any optimisation flag and force debug symbols
EFL_DEBUG_CFLAGS="-g -O0 -DDEBUG"
else
AC_MSG_WARN([lcov is not found, disable profiling instrumentation])
_efl_enable_coverage="no"
fi
fi
dnl Substitution
AC_SUBST(EFL_COVERAGE_CFLAGS)
AC_SUBST(EFL_COVERAGE_LIBS)
AM_CONDITIONAL(EFL_ENABLE_COVERAGE, test "x${_efl_enable_coverage}" = "xyes")
if test "x${_efl_enable_coverage}" = "xyes" ; then
ifelse([$2], , :, [$2])
else
ifelse([$3], , :, [$3])
fi
])

View File

@ -0,0 +1,88 @@
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 DOXYGEN
dnl Defines the automake conditionnal EFL_BUILD_DOC
dnl
AC_DEFUN([EFL_CHECK_DOXYGEN],
[
DOXYGEN="doxygen"
dnl
dnl Disable the build of the documentation
dnl
AC_ARG_ENABLE([doc],
AC_HELP_STRING(
[--disable-doc],
[Disable the build of the documentation]),
[if test "${disable_doc}" = "yes" ; then
enable_doc="no"
else
enable_doc="yes"
fi],
[enable_doc="yes"]
)
dnl
dnl Specify the full file name, with path
dnl
AC_ARG_WITH([doxygen],
AC_HELP_STRING(
[--with-doxygen=FILE],
[doxygen program to use @<:@default=doxygen@:>@]),
dnl
dnl Check the given doxygen program.
dnl
[DOXYGEN=${withval}
AC_CHECK_PROG([BUILD_DOCS],
[${DOXYGEN}],
[yes],
[no])
if test "x${BUILD_DOCS}" = "xno" ; then
echo "WARNING:"
echo "The doxygen program you specified:"
echo "$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([BUILD_DOCS],
[${DOXYGEN}],
[yes],
[no])
if test "x${BUILD_DOCS}" = "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
]
)
dnl
dnl Substitution
dnl
AC_SUBST([DOXYGEN])
AM_CONDITIONAL(EFL_BUILD_DOC, test "x${BUILD_DOCS}" = "xyes")
if test "x${BUILD_DOCS}" = "xyes" ; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
])
dnl End of doxygen.m4

View File

@ -0,0 +1,44 @@
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 tests programs are wanted and if yes, if
dnl the Check library is available.
dnl Usage: EFL_CHECK_TESTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Define the automake conditionnal EFL_ENABLE_TESTS
AC_DEFUN([EFL_CHECK_TESTS],
[
dnl configure option
AC_ARG_ENABLE([tests],
[AC_HELP_STRING([--enable-tests], [enable tests @<:@default=no@:>@])],
[
if test "x${enableval}" = "xyes" ; then
_efl_enable_tests="yes"
else
_efl_enable_tests="no"
fi
],
[_efl_enable_tests="no"]
)
AC_MSG_CHECKING([whether tests are built])
AC_MSG_RESULT([${_efl_enable_tests}])
if test "x${_efl_enable_tests}" = "xyes" ; then
PKG_CHECK_MODULES([CHECK],
[check >= 0.9.5],
[dummy="yes"],
[_efl_enable_tests="no"]
)
fi
AM_CONDITIONAL(EFL_ENABLE_TESTS, test "x${_efl_enable_tests}" = "xyes")
if test "x${_efl_enable_tests}" = "xyes" ; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
])

View File

@ -4,11 +4,12 @@ MAINTAINERCLEANFILES = Makefile.in
AM_CPPFLAGS = \
-I. \
-I$(top_srcdir)/src/lib \
-I$(top_builddir)/src/lib \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EVIL_CFLAGS@ \
@COVERAGE_CFLAGS@ \
@EFL_COVERAGE_CFLAGS@ \
@OPENSSL_CFLAGS@
include_HEADERS = Eet.h
@ -24,9 +25,8 @@ eet_dictionary.c \
eet_utils.c
libeet_la_CFLAGS = @WIN32_CFLAGS@
libeet_la_LIBADD = @OPENSSL_LIBS@ @COVERAGE_LIBS@ @EVIL_LIBS@ @WIN32_LIBS@ -lz -ljpeg @fnmatch_libs@ -lm
libeet_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@ -version-info @version_info@
libeet_la_DEPENDENCIES = $(top_builddir)/config.h
libeet_la_LIBADD = @OPENSSL_LIBS@ @EFL_COVERAGE_LIBS@ @EVIL_LIBS@ @WIN32_LIBS@ -lz -ljpeg -lm
libeet_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@
EXTRA_DIST = Eet_private.h

View File

@ -5,7 +5,7 @@ AM_CPPFLAGS = \
@CHECK_CFLAGS@
if EET_ENABLE_TESTS
if EFL_ENABLE_TESTS
check_PROGRAMS = eet_suite