summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-30 18:55:56 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-30 18:55:56 +0000
commit1453b3848b22bbb8cfbbca1a107b50e2f6d9b006 (patch)
tree47f2b72cf3c6e12fd9ed4197dc47912616f38462 /m4
parentec75e2048658aaef795f318ca78ecf349add4696 (diff)
efl: EFL_CHECK_LIBS() is strict, simplify it then.
as we abort (AC_MSG_ERROR) if not found, simplify the code. SVN revision: 81907
Diffstat (limited to 'm4')
-rw-r--r--m4/efl_check_libs.m494
1 files changed, 29 insertions, 65 deletions
diff --git a/m4/efl_check_libs.m4 b/m4/efl_check_libs.m4
index c43e8d0..91500db 100644
--- a/m4/efl_check_libs.m4
+++ b/m4/efl_check_libs.m4
@@ -7,43 +7,31 @@ dnl libjpeg
7dnl zlib 7dnl zlib
8 8
9dnl _EFL_CHECK_LIB_LIBJPEG is for internal use 9dnl _EFL_CHECK_LIB_LIBJPEG is for internal use
10dnl _EFL_CHECK_LIB_LIBJPEG(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) 10dnl _EFL_CHECK_LIB_LIBJPEG(EFL)
11dnl it will abort (AC_MSG_ERROR) if libjpeg is not found.
11 12
12AC_DEFUN([_EFL_CHECK_LIB_LIBJPEG], 13AC_DEFUN([_EFL_CHECK_LIB_LIBJPEG],
13[ 14[dnl
14m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl 15m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
15m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl 16m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
16 17
17AC_CHECK_HEADER([jpeglib.h], 18AC_CHECK_HEADER([jpeglib.h], [],
18 [have_dep="yes"], 19 [AC_MSG_ERROR([Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file])])
19 [
20 AC_MSG_ERROR(["Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"])
21 have_dep="no"
22 ])
23
24if test "x${have_dep}" = "xyes" ; then
25 AC_CHECK_LIB([jpeg], [jpeg_std_error],
26 [
27 have_dep="yes"
28 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ljpeg"
29 ],
30 [
31 AC_MSG_ERROR("Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file")
32 have_dep="no"
33 ])
34fi
35 20
36AS_IF([test "x${have_dep}" = "xyes"], [$2], [$3]) 21AC_CHECK_LIB([jpeg], [jpeg_std_error],
22 [requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ljpeg"],
23 [AC_MSG_ERROR([Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file])])
37 24
38m4_popdef([DOWNEFL]) 25m4_popdef([DOWNEFL])dnl
39m4_popdef([UPEFL]) 26m4_popdef([UPEFL])dnl
40]) 27])
41 28
42dnl _EFL_CHECK_LIB_ZLIB is for internal use 29dnl _EFL_CHECK_LIB_ZLIB is for internal use
43dnl _EFL_CHECK_LIB_ZLIB(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) 30dnl _EFL_CHECK_LIB_ZLIB(EFL)
31dnl it will abort (AC_MSG_ERROR) if zlib is not found.
44 32
45AC_DEFUN([_EFL_CHECK_LIB_ZLIB], 33AC_DEFUN([_EFL_CHECK_LIB_ZLIB],
46[ 34[dnl
47m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl 35m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
48m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl 36m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
49 37
@@ -53,63 +41,39 @@ if test "x${_efl_have_lib}" = "xyes" ; then
53 requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[]m4_defn([DOWNEFL])} zlib >= 1.2.3" 41 requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[]m4_defn([DOWNEFL])} zlib >= 1.2.3"
54 requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_[]m4_defn([DOWNEFL])} zlib >= 1.2.3" 42 requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_[]m4_defn([DOWNEFL])} zlib >= 1.2.3"
55else 43else
56 AC_CHECK_HEADER([zlib.h], 44 AC_CHECK_HEADER([zlib.h], [],
57 [_efl_have_lib="yes"], 45 [AC_MSG_ERROR([Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file])])
58 [
59 AC_MSG_ERROR(["Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"])
60 _efl_have_lib="no"
61 ])
62
63 if test "x${_efl_have_lib}" = "xyes" ; then
64 AC_CHECK_LIB([z], [zlibVersion],
65 [
66 _efl_have_lib="yes"
67 requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -lz"
68 ],
69 [
70 AC_MSG_ERROR(["Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file"])
71 _efl_have_lib="no"
72 ])
73 fi
74fi
75 46
76AS_IF([test "x${_efl_have_lib}" = "xyes"], [$2], [$3]) 47 AC_CHECK_LIB([z], [zlibVersion],
48 [requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -lz"],
49 [AC_MSG_ERROR([Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file])])
50fi
77 51
78m4_popdef([DOWNEFL]) 52m4_popdef([DOWNEFL])dnl
79m4_popdef([UPEFL]) 53m4_popdef([UPEFL])dnl
80]) 54])
81 55
82dnl Macro that checks for a library 56dnl Macro that checks for a library
83dnl 57dnl
84dnl EFL_CHECK_LIB(EFL, LIBRARY) 58dnl EFL_CHECK_LIB(EFL, LIBRARY)
85dnl AC_DEFINE : EFL_HAVE_LIBRARY (LIBRARY being replaced by its value) 59dnl it will abort if library is not found
86 60
87AC_DEFUN([EFL_CHECK_LIB], 61AC_DEFUN([EFL_CHECK_LIB],
88[ 62[dnl
89m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl 63m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl
90m4_pushdef([DOWN], m4_translit([$2], [-A-Z], [_a-z]))dnl
91
92m4_default([_EFL_CHECK_LIB_]m4_defn([UP]))($1, [have_lib="yes"], [have_lib="no"])
93 64
94AC_MSG_CHECKING([for ]m4_defn([DOWN])) 65AC_MSG_CHECKING([for $2])
95AC_MSG_RESULT([${have_lib}]) 66m4_default([_EFL_CHECK_LIB_]m4_defn([UP]))($1)
67AC_MSG_RESULT([yes])
96 68
97if test "x${have_lib}" = "xyes" ; then 69m4_popdef([UP])dnl
98 AC_DEFINE([HAVE_]m4_defn([UP]), [1], [Define to 1 if the `]m4_defn([DOWN])[' library is installed.])
99fi
100
101efl_lib_[]m4_defn([DOWN])="${have_lib}"
102
103m4_popdef([DOWN])
104m4_popdef([UP])
105]) 70])
106 71
107dnl Macro that iterates over a sequence of white separated libraries 72dnl Macro that iterates over a sequence of white separated libraries
108dnl and that calls EFL_CHECK_LIB() for each of these libraries 73dnl and that calls EFL_CHECK_LIB() for each of these libraries
109dnl 74dnl
110dnl EFL_CHECK_LIBS(EFL, LIBRARIES) 75dnl EFL_CHECK_LIBS(EFL, LIBRARIES)
76dnl it will abort if libraries are not found
111 77
112AC_DEFUN([EFL_CHECK_LIBS], 78AC_DEFUN([EFL_CHECK_LIBS],
113[ 79[m4_foreach_w([lib], [$2], [EFL_CHECK_LIB($1, m4_defn([lib]))])])
114m4_foreach_w([lib], [$2], [EFL_CHECK_LIB($1, m4_defn([lib]))])
115])