emotion_test can be disabled with configure, now
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 26 Jan 2010 09:48:47 +0000 (09:48 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 26 Jan 2010 09:48:47 +0000 (09:48 +0000)
Gustavo: the theme is still built. Do you want me to
disable its built when emotion_test is not built ?

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/emotion@45578 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
m4/efl_binary.m4 [new file with mode: 0644]
src/bin/Makefile.am

index 9f8b29a..f2277bf 100644 (file)
@@ -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/m4/efl_binary.m4 b/m4/efl_binary.m4
new file mode 100644 (file)
index 0000000..0fe85ab
--- /dev/null
@@ -0,0 +1,44 @@
+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 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])
+
+])
index bc016d3..1577408 100644 (file)
@@ -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