From 697dff2dab72b4b5ce4e7ea8c8e6c19a524ea1af Mon Sep 17 00:00:00 2001 From: caro Date: Sun, 26 Oct 2008 11:55:57 +0000 Subject: [PATCH] autotools cleanups * configure.ac re-organisation * don't compile edje binaries on windows ce * add doc rule to build documentation (hence gendo is removed, Doxyfile is moved to doc/ and edje.c.in is renamed doc/edje.dox.in) Next commit will fix completely the documentation * fix edje.pc.in git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/edje@37137 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- Makefile.am | 25 ++++- autogen.sh | 2 +- configure.ac | 258 ++++++++++++++++++++++++++++--------------- Doxyfile => doc/Doxyfile | 0 doc/Makefile.am | 33 ++++++ edje.c.in => doc/edje.dox.in | 0 edje.pc.in | 6 +- m4/ac_attribute.m4 | 44 ++++++++ src/bin/Makefile.am | 11 +- src/lib/Makefile.am | 17 +-- src/lib/edje_edit.c | 2 + src/lib/edje_private.h | 4 +- 12 files changed, 282 insertions(+), 120 deletions(-) rename Doxyfile => doc/Doxyfile (100%) create mode 100644 doc/Makefile.am rename edje.c.in => doc/edje.dox.in (100%) create mode 100644 m4/ac_attribute.m4 diff --git a/Makefile.am b/Makefile.am index 5127fb4..3d69b61 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,6 @@ -SUBDIRS = data src utils +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = data src utils doc MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \ config.h.in config.sub configure install-sh \ @@ -16,9 +18,24 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \ bin_SCRIPTS = -EXTRA_DIST = README AUTHORS COPYING COPYING-PLAIN autogen.sh edje.spec \ - edje.spec.in edje.pc.in edje.c.in Doxyfile \ - doc gendoc +EXTRA_DIST = \ +AUTHORS \ +COPYING \ +COPYING-PLAIN \ +autogen.sh \ +edje.pc.in \ +edje.spec \ +edje.spec.in \ +README.in \ +README pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = edje.pc + +.PHONY: doc + +# Documentation + +doc: + @echo "entering doc/" + make -C doc doc diff --git a/autogen.sh b/autogen.sh index 0846992..995ff2f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -5,7 +5,7 @@ rm -f aclocal.m4 ltmain.sh touch README -echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1 +echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1 echo "Running autoheader..." ; autoheader || exit 1 echo "Running autoconf..." ; autoconf || exit 1 echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 diff --git a/configure.ac b/configure.ac index 3623367..1a9ccd6 100644 --- a/configure.ac +++ b/configure.ac @@ -3,9 +3,10 @@ dnl Process this file with autoconf to produce a configure script. # get rid of that stupid cache mechanism rm -f config.cache -AC_INIT(edje, 0.9.9.050, enlightenment-devel@lists.sourceforge.net) +AC_INIT([edje], [0.9.9.050], [enlightenment-devel@lists.sourceforge.net]) AC_PREREQ(2.52) -AC_CONFIG_SRCDIR(configure.ac) +AC_CONFIG_SRCDIR([configure.ac]) +AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_ISC_POSIX @@ -13,15 +14,6 @@ AC_ISC_POSIX AM_INIT_AUTOMAKE(1.6 dist-bzip2) AM_CONFIG_HEADER(config.h) -AC_PROG_CC -AM_PROG_CC_STDC -AM_PROG_CC_C_O -AC_HEADER_STDC -AC_C_CONST - -AM_PATH_PYTHON([2.5], , [:]) -AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != : ]) - AC_LIBTOOL_WIN32_DLL define([AC_LIBTOOL_LANG_CXX_CONFIG], [:])dnl define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl @@ -34,88 +26,78 @@ SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'` version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN" AC_SUBST(version_info) -PKG_PROG_PKG_CONFIG - -AC_FUNC_ALLOCA -PKG_CHECK_MODULES([EINA], [eina-0]) +### Default options with respect to host -WIN32_CFLAGS="" -lt_no_undefined="" -lt_enable_auto_import="" case "$host_os" in - mingw*|cegcc) - PKG_CHECK_MODULES([EVIL], [evil]) - AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if evil package is installed]) - AC_DEFINE(HAVE_REALPATH, 1, [Define to 1 if you have the `realpath' function.]) - dnl needed for correct definition of EAPI - AC_DEFINE(EFL_EDJE_BUILD, 1, [Define to mention that embryo is built]) - if test "x$host_os" = "xcegcc" ; then - WIN32_CFLAGS="-mwin32" - lt_enable_auto_import="-Wl,--enable-auto-import" - fi - lt_no_undefined="-no-undefined" - ;; - *) - AC_CHECK_FUNCS(realpath) - ;; + mingw32ce* | cegcc*) + install_vim="no" + have_edje_cc="no" + ;; + *) + install_vim="yes" + have_edje_cc="yes" + ;; esac -AC_SUBST(WIN32_CFLAGS) -AC_SUBST(lt_no_undefined) -AC_SUBST(lt_enable_auto_import) -AC_MSG_CHECKING(whether to build edje_cc) -have_edje_cc="yes" -AC_ARG_ENABLE(edje-cc, [ --disable-edje-cc disable building of edje_cc ], [ - if test x"$enableval" = x"yes" ; then - AC_MSG_RESULT(yes) +want_edje_program_cache="no" + +requirement_edje="" + + +### Additional options to configure + +AC_ARG_ENABLE([edje-cc], + [AC_HELP_STRING([--disable-edje-cc], [disable building of edje_cc])], + [ + if test x"$enableval" = x"yes" ; then have_edje_cc="yes" - else - AC_MSG_RESULT(no) + else have_edje_cc="no" - fi - ], [ - AC_MSG_RESULT($have_edje_cc) + fi ] ) +AC_MSG_CHECKING(whether to build edje_cc) +AC_MSG_RESULT([${have_edje_cc}]) -PKG_CHECK_MODULES(EDJE, [ - evas >= 0.9.9 - ecore >= 0.9.9 - ecore-job >= 0.9.9 - eet >= 1.0.1 - embryo >= 0.9.1 -]) - -PKG_CHECK_MODULES(ECORE_FILE, [ - ecore-file >= 0.9.9 -]) +AM_CONDITIONAL(BUILD_EDJE_CC, test "x${have_edje_cc}" = "xyes") +AM_CONDITIONAL(BUILD_EDJE_DECC, test "x${have_edje_cc}" = "xyes") -PKG_CHECK_MODULES(ECORE_EVAS, [ - ecore-evas >= 0.9.9 -]) +EDJE_CC_PRG="" +EDJE_DECC_PRG="" +EDJE_RECC_PRG="" +if test "x${have_edje_cc}" = "xyes"; then + EDJE_CC_PRG="edje_cc" + EDJE_DECC_PRG="edje_decc" + EDJE_RECC_PRG="edje_recc" +fi +AC_SUBST(EDJE_CC_PRG) +AC_SUBST(EDJE_DECC_PRG) +AC_SUBST(EDJE_RECC_PRG) -dnl Optional EDJE_PROGRAM_CACHE (use much more ram, but increase speed in some case) -want_edje_program_cache="no" -AC_ARG_ENABLE(edje-program-cache, - AC_HELP_STRING( - [--enable-edje-program-cache], - [enable EDJE_PROGRAM_CACHE support. [[default=disabled]]] - ), - [ want_edje_program_cache=$enableval ] +# Optional EDJE_PROGRAM_CACHE (use much more ram, but increase speed in some cases) +AC_ARG_ENABLE([edje-program-cache], + [AC_HELP_STRING( + [--enable-edje-program-cache], + [enable EDJE_PROGRAM_CACHE support. [[default=disabled]]] + )], + [want_edje_program_cache=$enableval] ) -AM_CONDITIONAL(EDJE_PROGRAM_CACHE, test "x$want_edje_program_cache" = "xyes") -if test "x$want_edje_program_cache" = "xyes"; then - AC_DEFINE(EDJE_PROGRAM_CACHE, 1, [Cache result of program glob matches - this uses up extra ram with the gain of faster program matching]) +AM_CONDITIONAL(EDJE_PROGRAM_CACHE, test "x${want_edje_program_cache}" = "xyes") + +if test "x${want_edje_program_cache}" = "xyes" ; then + AC_DEFINE(EDJE_PROGRAM_CACHE, 1, [Cache result of program glob matches - this uses up extra ram with the gain of faster program matching]) fi -AC_MSG_CHECKING([for location of Vim data files]) -install_vim="yes"; -AC_ARG_WITH(vim, - [ --with-vim=DIR Location of Vim data files [[autodetect]]], - [if test -d "${withval}"; then - vimdir="${withval}" - fi]) +install_vim="yes" +AC_ARG_WITH([vim], + [AC_HELP_STRING([--with-vim=DIR], [Location of Vim data files [[autodetect]]])], + [ + if test -d "${withval}"; then + vimdir="${withval}" + fi + ] +) if test "x${vimdir}" = "x" ; then if test -d "${prefix}/share/vim"; then @@ -131,6 +113,8 @@ if test "x${vimdir}" = "x" ; then fi fi +AC_MSG_CHECKING([for location of Vim data files]) + if test "${install_vim}" = "yes"; then AC_MSG_RESULT([$vimdir]) else @@ -139,22 +123,108 @@ fi AC_SUBST(vimdir) -EDJE_CC_PRG="" -EDJE_DECC_PRG="" -EDJE_RECC_PRG="" + +### Checks for libraries + +PKG_PROG_PKG_CONFIG + +# Evil library for compilation on Windows + +EFL_EDJE_BUILD="" +case "$host_os" in + mingw* | cegcc*) + PKG_CHECK_MODULES([EVIL], [evil]) + AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed]) + requirement_edje="evil ${requirement_edje}" + EFL_EDJE_BUILD="-DEFL_EDJE_BUILD" + ;; +esac +AC_SUBST(EFL_EDJE_BUILD) + +# Dependencies for the library + +PKG_CHECK_MODULES([EDJE], + [ + eina-0 + eet >= 1.0.1 + evas >= 0.9.9 + ecore >= 0.9.9 + ecore-job >= 0.9.9 + embryo >= 0.9.1 + ] +) + +requirement_edje="embryo ecore-job ecore evas eet eina-0 ${requirement_edje}" + +# Dependencies for the binaries + if test "x$have_edje_cc" = "xyes"; then - AM_CONDITIONAL(BUILD_EDJE_CC, true) - AM_CONDITIONAL(BUILD_EDJE_DECC, true) - EDJE_CC_PRG="edje_cc" - EDJE_DECC_PRG="edje_decc" - EDJE_RECC_PRG="edje_recc" -else - AM_CONDITIONAL(BUILD_EDJE_CC, false) - AM_CONDITIONAL(BUILD_EDJE_DECC, false) + PKG_CHECK_MODULES([ECORE_FILE], [ecore-file >= 0.9.9]) + PKG_CHECK_MODULES([ECORE_EVAS], [ecore-evas >= 0.9.9]) fi -AC_SUBST(EDJE_CC_PRG) -AC_SUBST(EDJE_DECC_PRG) -AC_SUBST(EDJE_RECC_PRG) + + +### Checks for header files +AC_CHECK_HEADERS([locale.h]) + +### Checks for programs +AC_PROG_CC + +# doxygen program for documentation building + +EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"]) + +# python + +AM_PATH_PYTHON([2.5], , [:]) +AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != : ]) + + +### Checks for types + + +### Checks for structures + + +### Checks for compiler characteristics +AM_PROG_CC_C_O +AC_C_CONST +AC_PROG_CC_STDC +AC_HEADER_STDC +AC_C___ATTRIBUTE__ + +case "$host_os" in + mingw32ce*) + EDJE_CFLAGS="${EDJE_CFLAGS} -D_WIN32_WCE=0x0420" + ;; + cegcc*) + EDJE_CFLAGS="${EDJE_CFLAGS} -mwin32 -D_WIN32_WCE=0x0420" + ;; +esac + +lt_enable_auto_import="" +case "$host_os" in + mingw* | cegcc*) + lt_enable_auto_import="-Wl,--enable-auto-import" + ;; +esac +AC_SUBST(lt_enable_auto_import) + + +### Checks for library functions +AC_FUNC_ALLOCA + +case "$host_os" in + mingw* | cegcc*) + AC_DEFINE(HAVE_REALPATH, 1, [Define to 1 if you have the `realpath' function.]) + ;; + *) + AC_CHECK_FUNCS([realpath]) + ;; +esac + + +AC_SUBST(requirement_edje) AC_OUTPUT([ edje.pc @@ -162,6 +232,8 @@ edje.spec Makefile data/Makefile data/include/Makefile +doc/Makefile +doc/edje.dox src/Makefile src/lib/Makefile src/bin/Makefile @@ -185,6 +257,8 @@ echo " EDJE_PROGRAM_CACHE...: $want_edje_program_cache" echo echo " Build binaries.......: $have_edje_cc" echo +echo " Documentation........: ${enable_doc}" +echo echo " Compilation..........: make" echo echo " Installation.........: make install" diff --git a/Doxyfile b/doc/Doxyfile similarity index 100% rename from Doxyfile rename to doc/Doxyfile diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..b516c22 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,33 @@ + +MAINTAINERCLEANFILES = Makefile.in edje.dox + +.PHONY: doc + +PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc + +if EFL_BUILD_DOC + +doc-clean: + rm -rf html/ latex/ man/ xml/ $(PACKAGE_DOCNAME).tar* + +doc: all doc-clean + $(DOXYGEN) + cp img/* html/ + rm -rf $(PACKAGE_DOCNAME).tar* + mkdir -p $(PACKAGE_DOCNAME)/doc + cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc + tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/ + bzip2 -9 $(PACKAGE_DOCNAME).tar + rm -rf $(PACKAGE_DOCNAME)/ + mv $(PACKAGE_DOCNAME).tar.bz2 $(top_srcdir) + +clean-local: doc-clean + +else + +doc: + @echo "Documentation not built. Run ./configure --help" + +endif + +EXTRA_DIST = Doxyfile e.css foot.html head.html img/ edje.dox.in diff --git a/edje.c.in b/doc/edje.dox.in similarity index 100% rename from edje.c.in rename to doc/edje.dox.in diff --git a/edje.pc.in b/edje.pc.in index f4a3650..d589e9a 100644 --- a/edje.pc.in +++ b/edje.pc.in @@ -6,9 +6,9 @@ datarootdir=@datarootdir@ datadir=@datadir@/edje Name: edje -Description: Enlightened graphical design and layout engine. -Requires: evas +Description: Enlightened graphical design and layout engine. +Requires: @requirement_edje@ Version: @VERSION@ Libs: -L${libdir} -ledje -Libs.private: @EDJE_LIBS@ +Libs.private: @EDJE_LIBS@ @EVIL_LIBS@ Cflags: -I${includedir} diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 new file mode 100644 index 0000000..e0df55d --- /dev/null +++ b/m4/ac_attribute.m4 @@ -0,0 +1,44 @@ +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. + +dnl Macro that check if the compiler supports __atribute__ + +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 + ], + [ +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))], [Define to __attribute__((unused)) if your compiler has __attribute__]) + else + AC_DEFINE([__UNUSED__], [], [Define to nothing if your compiler does not support __attribute__]) +fi + +]) diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 0b83982..6a229a0 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -11,8 +11,7 @@ AM_CPPFLAGS = \ @EDJE_CFLAGS@ \ @ECORE_EVAS_CFLAGS@ \ @ECORE_FILE_CFLAGS@ \ -@EVIL_CFLAGS@ \ -@EINA_CFLAGS@ +@EVIL_CFLAGS@ if BUILD_EDJE_CC EDJE_CC = edje_cc @@ -50,10 +49,8 @@ edje_prefix.c \ edje_prefix.h \ edje_main.h -edje_cc_CFLAGS = @WIN32_CFLAGS@ -edje_cc_LDADD = $(top_builddir)/src/lib/libedje.la $(EDJE_LIBS) $(ECORE_EVAS_LIBS) $(EVIL_LIBS) $(EINA_LIBS) +edje_cc_LDADD = $(top_builddir)/src/lib/libedje.la $(ECORE_EVAS_LIBS) $(EVIL_LIBS) edje_cc_LDFLAGS = @lt_enable_auto_import@ -edje_cc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la edje_decc_SOURCES = \ @@ -62,7 +59,5 @@ edje_decc.h \ edje_cc_mem.c \ edje_cc_sources.c -edje_decc_CFLAGS = @WIN32_CFLAGS@ -edje_decc_LDADD = $(top_builddir)/src/lib/libedje.la $(EDJE_LIBS) $(ECORE_EVAS_LIBS) $(ECORE_FILE_LIBS) $(EVIL_LIBS) $(EINA_LIBS) +edje_decc_LDADD = $(top_builddir)/src/lib/libedje.la $(ECORE_EVAS_LIBS) $(ECORE_FILE_LIBS) edje_decc_LDFLAGS = @lt_enable_auto_import@ -edje_decc_DEPENDENCIES = $(top_builddir)/src/lib/libedje.la diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 19db9f3..59f6036 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -9,16 +9,13 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@EDJE_CFLAGS@ \ @EVIL_CFLAGS@ \ -@EINA_CFLAGS@ +@EDJE_CFLAGS@ \ +@EFL_EDJE_BUILD@ -lib_LTLIBRARIES = \ -libedje.la +lib_LTLIBRARIES = libedje.la -include_HEADERS = \ -Edje.h \ -Edje_Edit.h +include_HEADERS = Edje.h Edje_Edit.h libedje_la_SOURCES = \ edje_calc.c \ @@ -44,7 +41,5 @@ edje_edit.c \ edje_script_only.c \ edje_entry.c -libedje_la_CFLAGS = @WIN32_CFLAGS@ -libedje_la_LIBADD = @EDJE_LIBS@ @EINA_LIBS@ -lm -libedje_la_DEPENDENCIES = $(top_builddir)/config.h -libedje_la_LDFLAGS = @lt_no_undefined@ @lt_enable_auto_import@ -version-info @version_info@ +libedje_la_LIBADD = @EDJE_LIBS@ -lm +libedje_la_LDFLAGS = no-undefined @lt_enable_auto_import@ -version-info @version_info@ diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 2d6d556..d8a31de 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -1854,7 +1854,9 @@ edje_edit_part_states_list_get(Evas_Object *obj, const char *part) GET_RP_OR_RETURN(NULL); //Is there a better place to put this? maybe edje_edit_init() ? +#ifdef HAVE_LOCALE_H setlocale(LC_NUMERIC, "C"); +#endif states = NULL; diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h index 00baa2f..50f505b 100644 --- a/src/lib/edje_private.h +++ b/src/lib/edje_private.h @@ -16,7 +16,9 @@ #include #include #include -#include +#ifdef HAVE_LOCALE_H +# include +#endif #include #ifdef HAVE_STDINT_H -- 2.7.4