summaryrefslogtreecommitdiff
path: root/legacy/eeze/m4/efl_binary.m4
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-12-11 17:04:34 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-12-11 17:04:34 +0000
commitd8765063db07cf941f3361a64958af5d70e54968 (patch)
treefc4701d531cf8d5b1b513d748d15a1b07661fe54 /legacy/eeze/m4/efl_binary.m4
parentee1d0dbc23ca8e408400969cf3e85a51f81c9bdf (diff)
* fix DSO problem
* simplify a bit the autotools * add the possibility to disable the test SVN revision: 55499
Diffstat (limited to '')
-rw-r--r--legacy/eeze/m4/efl_binary.m478
1 files changed, 78 insertions, 0 deletions
diff --git a/legacy/eeze/m4/efl_binary.m4 b/legacy/eeze/m4/efl_binary.m4
new file mode 100644
index 0000000000..0ad38ce1c2
--- /dev/null
+++ b/legacy/eeze/m4/efl_binary.m4
@@ -0,0 +1,78 @@
1dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
2dnl That code is public domain and can be freely used or copied.
3
4dnl Macro that checks if a binary is built or not
5
6dnl Usage: EFL_ENABLE_BIN(binary, dep[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
8dnl Define have_binary (- is transformed into _)
9dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
10
11AC_DEFUN([EFL_ENABLE_BIN],
12[
13
14m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
16
17dnl configure option
18
19AC_ARG_ENABLE([$1],
20 [AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
21 [
22 if test "x${enableval}" = "xyes" ; then
23 have_[]m4_defn([DOWN])="yes"
24 else
25 have_[]m4_defn([DOWN])="no"
26 fi
27 ],
28 [have_[]m4_defn([DOWN])=$2])
29
30AC_MSG_CHECKING([whether to build ]DOWN[ binary])
31AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
32
33if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
34 UP[]_PRG=DOWN[${EXEEXT}]
35fi
36
37AC_SUBST(UP[]_PRG)
38
39AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
40
41AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$3], [$4])
42
43])
44
45dnl Macro that specifies the binary to be used
46
47dnl Usage: EFL_WITH_BIN(binary, package, msg)
48dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
49dnl Define with_binary (- is transformed into _)
50dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
51
52AC_DEFUN([EFL_WITH_BIN],
53[
54
55m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
56m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
57
58AC_REQUIRE([PKG_PROG_PKG_CONFIG])
59AC_MSG_NOTICE([$PKG_CONFIG])
60
61with_[]m4_defn([DOWN])=m4_esyscmd($PKG_CONFIG --variable=prefix $2)/bin/m4_defn([DOWN])
62
63dnl configure option
64
65AC_ARG_WITH([$1],
66 [AC_HELP_STRING([--with-$1-bin=PATH], [specify a specific path to ]DOWN)],
67 [
68 with_[]m4_defn([DOWN])=$withval
69 _efl_msg="( explicitely set)"
70 ])
71
72AC_MSG_NOTICE([$msg: ]m4_defn([DOWN])[$_efl_msg])
73
74AC_SUBST(with_[]m4_defn([DOWN]))
75
76AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$4], [$5])
77
78])