From 73ec0b2b11a065a2219ecf7278940ef39043b316 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Tue, 26 Jan 2010 09:48:47 +0000 Subject: [PATCH] emotion_test can be disabled with configure, now Gustavo: the theme is still built. Do you want me to disable its built when emotion_test is not built ? SVN revision: 45578 --- legacy/emotion/configure.ac | 7 ++++- legacy/emotion/m4/efl_binary.m4 | 44 ++++++++++++++++++++++++++++++ legacy/emotion/src/bin/Makefile.am | 3 +- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 legacy/emotion/m4/efl_binary.m4 diff --git a/legacy/emotion/configure.ac b/legacy/emotion/configure.ac index 9f8b29a491..f2277bfca3 100644 --- a/legacy/emotion/configure.ac +++ b/legacy/emotion/configure.ac @@ -45,6 +45,8 @@ requirement_emotion="" ### Additional options to configure +EFL_ENABLE_BIN([emotion-test]) + # edje_cc AC_ARG_WITH([edje-cc], @@ -82,7 +84,9 @@ EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"]) PKG_CHECK_MODULES(EMOTION, [eina-0 evas >= 0.9.9 ecore >= 0.9.9]) requirement_emotion="ecore evas eina-0" -PKG_CHECK_MODULES(EMOTION_BIN, [evas >= 0.9.9 ecore >= 0.9.9 ecore-evas >= 0.9.9 edje >= 0.5.0]) +if test "x${have_emotion_test}" = "xyes" ; then + PKG_CHECK_MODULES(EMOTION_BIN, [evas >= 0.9.9 ecore >= 0.9.9 ecore-evas >= 0.9.9 edje >= 0.5.0]) +fi PKG_CHECK_MODULES(ECORE_X, [ecore-x >= 0.9.9], [have_ecore_x="yes"], [have_ecore_x="no"]) @@ -194,6 +198,7 @@ echo " Gstreamer..........: ${enable_gstreamer}" echo " Gstreamer FFmpeg...: ${have_gst_ffmpeg}" echo " Gstreamer CDDA.....: ${have_gst_cdiocddasrc}" echo +echo " Build emotion_test...: $have_emotion_test" echo " edje_cc..............: ${edje_cc}" echo echo "Compilation............: make (or gmake)" diff --git a/legacy/emotion/m4/efl_binary.m4 b/legacy/emotion/m4/efl_binary.m4 new file mode 100644 index 0000000000..0fe85ab6ae --- /dev/null +++ b/legacy/emotion/m4/efl_binary.m4 @@ -0,0 +1,44 @@ +dnl Copyright (C) 2010 Vincent Torri +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 tranformed into _) +dnl Define have_binary (- is tranformed into _) +dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being tranformed 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]) + +]) diff --git a/legacy/emotion/src/bin/Makefile.am b/legacy/emotion/src/bin/Makefile.am index bc016d3ff0..157740821a 100644 --- a/legacy/emotion/src/bin/Makefile.am +++ b/legacy/emotion/src/bin/Makefile.am @@ -12,7 +12,8 @@ AM_CPPFLAGS = \ @ECORE_X_CFLAGS@ \ @ECORE_FB_CFLAGS@ -bin_PROGRAMS = emotion_test +bin_PROGRAMS = @EMOTION_TEST_PRG@ +EXTRA_PROGRAMS = emotion_test emotion_test_SOURCES = emotion_test_main.c