forked from enlightenment/efl
efl: EFL_CHECK_LIBS() is strict, simplify it then.
as we abort (AC_MSG_ERROR) if not found, simplify the code. SVN revision: 81907
This commit is contained in:
parent
ec75e20486
commit
1453b3848b
|
@ -863,15 +863,8 @@ if test "$build_crypto" != "none" ; then
|
||||||
AC_DEFINE([HAVE_SIGNATURE], [1], [Have signature support for eet file])
|
AC_DEFINE([HAVE_SIGNATURE], [1], [Have signature support for eet file])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# libjpeg and zlib
|
|
||||||
|
|
||||||
EFL_CHECK_LIBS([EET], [libjpeg zlib])
|
EFL_CHECK_LIBS([EET], [libjpeg zlib])
|
||||||
|
|
||||||
# TODO: better way to force those instead of is secondary check
|
|
||||||
if test "x${efl_lib_zlib}" != "xyes" || test "x${efl_lib_libjpeg}" != "xyes" ; then
|
|
||||||
AC_MSG_ERROR([Required EET libraries were not found.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
EFL_INTERNAL_DEPEND_PKG([EET], [eina])
|
EFL_INTERNAL_DEPEND_PKG([EET], [eina])
|
||||||
|
|
||||||
EFL_EVAL_PKGS([EET])
|
EFL_EVAL_PKGS([EET])
|
||||||
|
|
|
@ -7,43 +7,31 @@ dnl libjpeg
|
||||||
dnl zlib
|
dnl zlib
|
||||||
|
|
||||||
dnl _EFL_CHECK_LIB_LIBJPEG is for internal use
|
dnl _EFL_CHECK_LIB_LIBJPEG is for internal use
|
||||||
dnl _EFL_CHECK_LIB_LIBJPEG(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
|
dnl _EFL_CHECK_LIB_LIBJPEG(EFL)
|
||||||
|
dnl it will abort (AC_MSG_ERROR) if libjpeg is not found.
|
||||||
|
|
||||||
AC_DEFUN([_EFL_CHECK_LIB_LIBJPEG],
|
AC_DEFUN([_EFL_CHECK_LIB_LIBJPEG],
|
||||||
[
|
[dnl
|
||||||
m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
|
m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
|
||||||
m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
|
m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
|
||||||
|
|
||||||
AC_CHECK_HEADER([jpeglib.h],
|
AC_CHECK_HEADER([jpeglib.h], [],
|
||||||
[have_dep="yes"],
|
[AC_MSG_ERROR([Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file])])
|
||||||
[
|
|
||||||
AC_MSG_ERROR(["Cannot find jpeglib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"])
|
|
||||||
have_dep="no"
|
|
||||||
])
|
|
||||||
|
|
||||||
if test "x${have_dep}" = "xyes" ; then
|
|
||||||
AC_CHECK_LIB([jpeg], [jpeg_std_error],
|
AC_CHECK_LIB([jpeg], [jpeg_std_error],
|
||||||
[
|
[requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ljpeg"],
|
||||||
have_dep="yes"
|
[AC_MSG_ERROR([Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file])])
|
||||||
requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -ljpeg"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
AC_MSG_ERROR("Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file")
|
|
||||||
have_dep="no"
|
|
||||||
])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AS_IF([test "x${have_dep}" = "xyes"], [$2], [$3])
|
m4_popdef([DOWNEFL])dnl
|
||||||
|
m4_popdef([UPEFL])dnl
|
||||||
m4_popdef([DOWNEFL])
|
|
||||||
m4_popdef([UPEFL])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl _EFL_CHECK_LIB_ZLIB is for internal use
|
dnl _EFL_CHECK_LIB_ZLIB is for internal use
|
||||||
dnl _EFL_CHECK_LIB_ZLIB(EFL, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND)
|
dnl _EFL_CHECK_LIB_ZLIB(EFL)
|
||||||
|
dnl it will abort (AC_MSG_ERROR) if zlib is not found.
|
||||||
|
|
||||||
AC_DEFUN([_EFL_CHECK_LIB_ZLIB],
|
AC_DEFUN([_EFL_CHECK_LIB_ZLIB],
|
||||||
[
|
[dnl
|
||||||
m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
|
m4_pushdef([UPEFL], m4_translit([$1], [-a-z], [_A-Z]))dnl
|
||||||
m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
|
m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
|
||||||
|
|
||||||
|
@ -53,63 +41,39 @@ if test "x${_efl_have_lib}" = "xyes" ; then
|
||||||
requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[]m4_defn([DOWNEFL])} zlib >= 1.2.3"
|
requirements_pc_[]m4_defn([DOWNEFL])="${requirements_pc_[]m4_defn([DOWNEFL])} zlib >= 1.2.3"
|
||||||
requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_[]m4_defn([DOWNEFL])} zlib >= 1.2.3"
|
requirements_pc_deps_[]m4_defn([DOWNEFL])="${requirements_pc_deps_[]m4_defn([DOWNEFL])} zlib >= 1.2.3"
|
||||||
else
|
else
|
||||||
AC_CHECK_HEADER([zlib.h],
|
AC_CHECK_HEADER([zlib.h], [],
|
||||||
[_efl_have_lib="yes"],
|
[AC_MSG_ERROR([Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file])])
|
||||||
[
|
|
||||||
AC_MSG_ERROR(["Cannot find zlib.h. Make sure your CFLAGS environment variable contains include lines for the location of this file"])
|
|
||||||
_efl_have_lib="no"
|
|
||||||
])
|
|
||||||
|
|
||||||
if test "x${_efl_have_lib}" = "xyes" ; then
|
|
||||||
AC_CHECK_LIB([z], [zlibVersion],
|
AC_CHECK_LIB([z], [zlibVersion],
|
||||||
[
|
[requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -lz"],
|
||||||
_efl_have_lib="yes"
|
[AC_MSG_ERROR([Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file])])
|
||||||
requirements_libs_[]m4_defn([DOWNEFL])="${requirements_libs_[]m4_defn([DOWNEFL])} -lz"
|
|
||||||
],
|
|
||||||
[
|
|
||||||
AC_MSG_ERROR(["Cannot find libjpeg library. Make sure your LDFLAGS environment variable contains include lines for the location of this file"])
|
|
||||||
_efl_have_lib="no"
|
|
||||||
])
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AS_IF([test "x${_efl_have_lib}" = "xyes"], [$2], [$3])
|
m4_popdef([DOWNEFL])dnl
|
||||||
|
m4_popdef([UPEFL])dnl
|
||||||
m4_popdef([DOWNEFL])
|
|
||||||
m4_popdef([UPEFL])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl Macro that checks for a library
|
dnl Macro that checks for a library
|
||||||
dnl
|
dnl
|
||||||
dnl EFL_CHECK_LIB(EFL, LIBRARY)
|
dnl EFL_CHECK_LIB(EFL, LIBRARY)
|
||||||
dnl AC_DEFINE : EFL_HAVE_LIBRARY (LIBRARY being replaced by its value)
|
dnl it will abort if library is not found
|
||||||
|
|
||||||
AC_DEFUN([EFL_CHECK_LIB],
|
AC_DEFUN([EFL_CHECK_LIB],
|
||||||
[
|
[dnl
|
||||||
m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl
|
m4_pushdef([UP], m4_translit([$2], [-a-z], [_A-Z]))dnl
|
||||||
m4_pushdef([DOWN], m4_translit([$2], [-A-Z], [_a-z]))dnl
|
|
||||||
|
|
||||||
m4_default([_EFL_CHECK_LIB_]m4_defn([UP]))($1, [have_lib="yes"], [have_lib="no"])
|
AC_MSG_CHECKING([for $2])
|
||||||
|
m4_default([_EFL_CHECK_LIB_]m4_defn([UP]))($1)
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
|
||||||
AC_MSG_CHECKING([for ]m4_defn([DOWN]))
|
m4_popdef([UP])dnl
|
||||||
AC_MSG_RESULT([${have_lib}])
|
|
||||||
|
|
||||||
if test "x${have_lib}" = "xyes" ; then
|
|
||||||
AC_DEFINE([HAVE_]m4_defn([UP]), [1], [Define to 1 if the `]m4_defn([DOWN])[' library is installed.])
|
|
||||||
fi
|
|
||||||
|
|
||||||
efl_lib_[]m4_defn([DOWN])="${have_lib}"
|
|
||||||
|
|
||||||
m4_popdef([DOWN])
|
|
||||||
m4_popdef([UP])
|
|
||||||
])
|
])
|
||||||
|
|
||||||
dnl Macro that iterates over a sequence of white separated libraries
|
dnl Macro that iterates over a sequence of white separated libraries
|
||||||
dnl and that calls EFL_CHECK_LIB() for each of these libraries
|
dnl and that calls EFL_CHECK_LIB() for each of these libraries
|
||||||
dnl
|
dnl
|
||||||
dnl EFL_CHECK_LIBS(EFL, LIBRARIES)
|
dnl EFL_CHECK_LIBS(EFL, LIBRARIES)
|
||||||
|
dnl it will abort if libraries are not found
|
||||||
|
|
||||||
AC_DEFUN([EFL_CHECK_LIBS],
|
AC_DEFUN([EFL_CHECK_LIBS],
|
||||||
[
|
[m4_foreach_w([lib], [$2], [EFL_CHECK_LIB($1, m4_defn([lib]))])])
|
||||||
m4_foreach_w([lib], [$2], [EFL_CHECK_LIB($1, m4_defn([lib]))])
|
|
||||||
])
|
|
||||||
|
|
Loading…
Reference in New Issue