mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-02 15:45:25 +00:00
[master] check for -ljson-c as well as -ljson
3512. [port] Check whether to use -ljson or -ljson-c. [RT #34115]
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
3512. [port] Check whether to use -ljson or -ljson-c. [RT #34115]
|
||||||
|
|
||||||
3611. [bug] Improved resistance to a theoretical authentication
|
3611. [bug] Improved resistance to a theoretical authentication
|
||||||
attack based on differential timing. [RT #33939]
|
attack based on differential timing. [RT #33939]
|
||||||
|
|
||||||
|
90
configure
vendored
90
configure
vendored
@@ -16023,6 +16023,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
have_libjson=
|
||||||
case "$use_libjson" in
|
case "$use_libjson" in
|
||||||
no)
|
no)
|
||||||
libjson_libs=""
|
libjson_libs=""
|
||||||
@@ -16030,37 +16031,108 @@ case "$use_libjson" in
|
|||||||
auto|yes)
|
auto|yes)
|
||||||
if test -f "/usr/include/json/json.h"
|
if test -f "/usr/include/json/json.h"
|
||||||
then
|
then
|
||||||
libjson_libs="-ljson"
|
|
||||||
libjson_cflags="-I /usr/include/json"
|
libjson_cflags="-I /usr/include/json"
|
||||||
else
|
have_libjson="yes"
|
||||||
libjson_libs=""
|
elif test -f "/usr/include/json-c/json.h"
|
||||||
|
then
|
||||||
|
libjson_cflags="-I /usr/include/json-c"
|
||||||
|
have_libjson="yes"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if test -f "${use_libjson}/include/json/json.h"
|
if test -f "${use_libjson}/include/json/json.h"
|
||||||
then
|
then
|
||||||
libjson_libs="-L${use_libjson}/lib -ljson"
|
|
||||||
libjson_cflags="-I${use_libjson}/include/json"
|
libjson_cflags="-I${use_libjson}/include/json"
|
||||||
|
LIBS="$LIBS -L${use_libjson}/lib"
|
||||||
|
have_libjson="yes"
|
||||||
|
elif test -f "${use_libjson}/include/json-c/json.h"
|
||||||
|
then
|
||||||
|
libjson_cflags="-I${use_libjson}/include/json-c"
|
||||||
|
LIBS="$LIBS -L${use_libjson}/lib"
|
||||||
|
have_libjson="yes"
|
||||||
else
|
else
|
||||||
as_fn_error $? "$use_libjson/include/json.h not found." "$LINENO" 5
|
as_fn_error $? "$use_libjson/include/json{,-c}/json.h not found." "$LINENO" 5
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test "X${libjson_libs}" != "X"
|
if test "%${have_libjson}" != "X"
|
||||||
then
|
then
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||||
$as_echo "yes" >&6; }
|
$as_echo "yes" >&6; }
|
||||||
CFLAGS="$CFLAGS $libjson_cflags"
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing json_object_new_int" >&5
|
||||||
LIBS="$LIBS $libjson_libs"
|
$as_echo_n "checking for library containing json_object_new_int... " >&6; }
|
||||||
|
if ${ac_cv_search_json_object_new_int+:} false; then :
|
||||||
|
$as_echo_n "(cached) " >&6
|
||||||
|
else
|
||||||
|
ac_func_search_save_LIBS=$LIBS
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
$as_echo "#define HAVE_JSON 1" >>confdefs.h
|
/* Override any GCC internal prototype to avoid an error.
|
||||||
|
Use char because int might match the return type of a GCC
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
char json_object_new_int ();
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return json_object_new_int ();
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
for ac_lib in '' json json-c; do
|
||||||
|
if test -z "$ac_lib"; then
|
||||||
|
ac_res="none required"
|
||||||
|
else
|
||||||
|
ac_res=-l$ac_lib
|
||||||
|
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||||
|
fi
|
||||||
|
if ac_fn_c_try_link "$LINENO"; then :
|
||||||
|
ac_cv_search_json_object_new_int=$ac_res
|
||||||
|
fi
|
||||||
|
rm -f core conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext
|
||||||
|
if ${ac_cv_search_json_object_new_int+:} false; then :
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if ${ac_cv_search_json_object_new_int+:} false; then :
|
||||||
|
|
||||||
|
else
|
||||||
|
ac_cv_search_json_object_new_int=no
|
||||||
|
fi
|
||||||
|
rm conftest.$ac_ext
|
||||||
|
LIBS=$ac_func_search_save_LIBS
|
||||||
|
fi
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_json_object_new_int" >&5
|
||||||
|
$as_echo "$ac_cv_search_json_object_new_int" >&6; }
|
||||||
|
ac_res=$ac_cv_search_json_object_new_int
|
||||||
|
if test "$ac_res" != no; then :
|
||||||
|
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||||
|
|
||||||
|
else
|
||||||
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: found libjson include but not library." >&5
|
||||||
|
$as_echo "$as_me: WARNING: found libjson include but not library." >&2;}
|
||||||
|
have_libjson=""
|
||||||
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||||
$as_echo "no" >&6; }
|
$as_echo "no" >&6; }
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "X${have_libjson}" != "X"
|
||||||
|
then
|
||||||
|
CFLAGS="$CFLAGS $libjson_cflags"
|
||||||
|
|
||||||
|
$as_echo "#define HAVE_JSON 1" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# In solaris 10, SMF can manage named service
|
# In solaris 10, SMF can manage named service
|
||||||
#
|
#
|
||||||
|
33
configure.in
33
configure.in
@@ -1501,6 +1501,7 @@ AC_ARG_WITH(libjson,
|
|||||||
[ --with-libjson[=PATH] Build with libjson0 library [yes|no|path]],
|
[ --with-libjson[=PATH] Build with libjson0 library [yes|no|path]],
|
||||||
use_libjson="$withval", use_libjson="auto")
|
use_libjson="$withval", use_libjson="auto")
|
||||||
|
|
||||||
|
have_libjson=
|
||||||
case "$use_libjson" in
|
case "$use_libjson" in
|
||||||
no)
|
no)
|
||||||
libjson_libs=""
|
libjson_libs=""
|
||||||
@@ -1508,33 +1509,47 @@ case "$use_libjson" in
|
|||||||
auto|yes)
|
auto|yes)
|
||||||
if test -f "/usr/include/json/json.h"
|
if test -f "/usr/include/json/json.h"
|
||||||
then
|
then
|
||||||
libjson_libs="-ljson"
|
|
||||||
libjson_cflags="-I /usr/include/json"
|
libjson_cflags="-I /usr/include/json"
|
||||||
else
|
have_libjson="yes"
|
||||||
libjson_libs=""
|
elif test -f "/usr/include/json-c/json.h"
|
||||||
|
then
|
||||||
|
libjson_cflags="-I /usr/include/json-c"
|
||||||
|
have_libjson="yes"
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if test -f "${use_libjson}/include/json/json.h"
|
if test -f "${use_libjson}/include/json/json.h"
|
||||||
then
|
then
|
||||||
libjson_libs="-L${use_libjson}/lib -ljson"
|
|
||||||
libjson_cflags="-I${use_libjson}/include/json"
|
libjson_cflags="-I${use_libjson}/include/json"
|
||||||
|
LIBS="$LIBS -L${use_libjson}/lib"
|
||||||
|
have_libjson="yes"
|
||||||
|
elif test -f "${use_libjson}/include/json-c/json.h"
|
||||||
|
then
|
||||||
|
libjson_cflags="-I${use_libjson}/include/json-c"
|
||||||
|
LIBS="$LIBS -L${use_libjson}/lib"
|
||||||
|
have_libjson="yes"
|
||||||
else
|
else
|
||||||
AC_MSG_ERROR([$use_libjson/include/json.h not found.])
|
AC_MSG_ERROR([$use_libjson/include/json{,-c}/json.h not found.])
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test "X${libjson_libs}" != "X"
|
if test "%${have_libjson}" != "X"
|
||||||
then
|
then
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT(yes)
|
||||||
CFLAGS="$CFLAGS $libjson_cflags"
|
AC_SEARCH_LIBS([json_object_new_int], [json json-c], [],
|
||||||
LIBS="$LIBS $libjson_libs"
|
[AC_MSG_WARN([found libjson include but not library.])
|
||||||
AC_DEFINE(HAVE_JSON, 1, [Define if libjson was found])
|
have_libjson=""])
|
||||||
else
|
else
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "X${have_libjson}" != "X"
|
||||||
|
then
|
||||||
|
CFLAGS="$CFLAGS $libjson_cflags"
|
||||||
|
AC_DEFINE(HAVE_JSON, 1, [Define if libjson was found])
|
||||||
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# In solaris 10, SMF can manage named service
|
# In solaris 10, SMF can manage named service
|
||||||
#
|
#
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_JSON
|
#ifdef HAVE_JSON
|
||||||
#include <json/json.h>
|
#include <json.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ISC_JSON_RENDERCONFIG 0x00000001 /* render config data */
|
#define ISC_JSON_RENDERCONFIG 0x00000001 /* render config data */
|
||||||
|
Reference in New Issue
Block a user