1 # ===========================================================================
3 # ===========================================================================
14 # Copyright (c) 2011 Boris Manojlovic <boris@steki.net>
16 # This program is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by the
18 # Free Software Foundation; either version 2 of the License, or (at your
19 # option) any later version.
21 # This program is distributed in the hope that it will be useful, but
22 # WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
24 # Public License for more details.
26 # You should have received a copy of the GNU General Public License along
27 # with this program. If not, see <http://www.gnu.org/licenses/>.
29 # As a special exception, the respective Autoconf Macro's copyright owner
30 # gives unlimited permission to copy, distribute and modify the configure
31 # scripts that are the output of Autoconf when processing the Macro. You
32 # need not follow the terms of the GNU General Public License when using
33 # or distributing such scripts, even though portions of the text of the
34 # Macro appear in them. The GNU General Public License (GPL) does govern
35 # all other use of the material that constitutes the Autoconf Macro.
37 # This special exception to the GPL applies to versions of the Autoconf
38 # Macro released by the Autoconf Archive. When you make and distribute a
39 # modified version of the Autoconf Macro, you may extend this special
40 # exception to the GPL to apply to your modified version as well.
44 AU_ALIAS([CHECK_YAJL], [AX_CHECK_YAJL])
45 AC_DEFUN([AX_CHECK_YAJL],
51 --with-yajl=DIR root directory path of yajl installation [defaults to
52 /usr/local or /usr if not found in /usr/local]
53 --without-yajl to disable yajl usage completely],
55 if test "$withval" != "no"; then
56 if test -d "$withval" ; then
58 yajl_places="$withval"
60 AC_MSG_WARN([Sorry, $withval does not exist])
64 dnl just provide default places where it most probably could be found
65 yajl_places="/usr/local /usr /opt/local /sw"
72 if test -n "$yajl_places" ; then
73 # check the user supplied or any other more or less 'standard' place:
74 for YAJL_HOME in ${yajl_places} ; do
75 if test -f "${YAJL_HOME}/include/yajl/yajl_parse.h"; then break; fi
79 # if yajl.h was nowhere to be found, give a notice and bail out
80 if test ! -n "${YAJL_HOME}"; then
81 AC_MSG_ERROR(No yajl.h in any include directory of ${yajl_places}: either specify a valid yajl installation with --with-yajl=DIR or disable yajl usage with --without-yajl)
86 AC_CHECK_LIB(yajl, yajl_parse, [yajl_cv_libyajl=yes], [yajl_cv_libyajl=no])
87 AC_CHECK_HEADER(yajl/yajl_parse.h, [yajl_cv_yajl_parse_h=yes], [yajl_cv_yajl_parse_h=no])
90 YAJL_CFLAGS="-I${YAJL_HOME}/include"
91 if test "$yajl_cv_libyajl" != "yes" -a "$yajl_cv_yajl_parse_h" != "yes"
93 # If either header or library was not found, revert and bomb
94 AC_MSG_ERROR(either specify a valid yajl installation with --with-yajl=DIR or disable yajl usage with --without-yajl)
99 AC_SUBST(YAJL_LDFLAGS) dnl no really use for this library