Skip to content

Commit

Permalink
One more fix
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov committed Jan 12, 2024
1 parent 54c10ab commit 1a79925
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
40 changes: 22 additions & 18 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ if test -n "$ac_init_help"; then
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-jsonc=<path> Location where json-c/json_object.h is installed
--with-jsonc=<path> Location where json_object.h is installed
--with-libcurl=<path> Location where curl/curl.h is installed
--with-libintl=<path> Location where libintl.h is installed
Expand Down Expand Up @@ -2433,6 +2433,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
# lib = The name of the library file without the 'lib' prefix and without the extension.
# package = The name of the package that holds the library
# testfn = One function included in the library that can be used for a test compilation.
# headerdir = directory that contains required header
# header = header file to check for
# if there's a problem during the test compilation.

Expand Down Expand Up @@ -3510,7 +3511,7 @@ then :

case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/json-c/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include"
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/json-c"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -ljson-c" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/json-c"
tde_LDFLAGS="$tde_LDFLAGS -ljson-c" ;;
Expand All @@ -3526,18 +3527,19 @@ fi
LDFLAGS="$LDFLAGS $tde_LDFLAGS"
CPPFLAGS="$CPPFLAGS $tde_CPPFLAGS"

ac_fn_c_check_header_compile "$LINENO" "json-c/json_object.h" "ac_cv_header_json_c_json_object_h" "$ac_includes_default"
if test "x$ac_cv_header_json_c_json_object_h" = xyes
ac_fn_c_check_header_compile "$LINENO" "json_object.h" "ac_cv_header_json_object_h" "$ac_includes_default"
if test "x$ac_cv_header_json_object_h" = xyes
then :

else case e in #(
e)
as_fn_error $? "header file <json-c/json_object.h> is required, try specifying --with-jsonc" "$LINENO" 5
as_fn_error $? "header file <json_object.h> is required, try specifying --with-jsonc" "$LINENO" 5
;;
esac
fi



{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for json_object_get in -ljson-c" >&5
printf %s "checking for json_object_get in -ljson-c... " >&6; }
if test ${ac_cv_lib_json_c_json_object_get+y}
Expand Down Expand Up @@ -3611,7 +3613,7 @@ then :

case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/curl/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include"
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/curl"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -lcurl" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/curl"
tde_LDFLAGS="$tde_LDFLAGS -lcurl" ;;
Expand Down Expand Up @@ -3639,6 +3641,7 @@ esac
fi



{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for curl_easy_setopt in -lcurl" >&5
printf %s "checking for curl_easy_setopt in -lcurl... " >&6; }
if test ${ac_cv_lib_curl_curl_easy_setopt+y}
Expand Down Expand Up @@ -3715,9 +3718,9 @@ then :

case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/gettext/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include"
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -lintl" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/intl"
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/"
tde_LDFLAGS="$tde_LDFLAGS -lintl" ;;
esac

Expand All @@ -3743,9 +3746,10 @@ esac
fi


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettext in -lintl" >&5
printf %s "checking for gettext in -lintl... " >&6; }
if test ${ac_cv_lib_intl_gettext+y}

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ngettext in -lintl" >&5
printf %s "checking for ngettext in -lintl... " >&6; }
if test ${ac_cv_lib_intl_ngettext+y}
then :
printf %s "(cached) " >&6
else case e in #(
Expand All @@ -3763,30 +3767,30 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
char gettext (void);
char ngettext (void);
int
main (void)
{
return gettext ();
return ngettext ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_intl_gettext=yes
ac_cv_lib_intl_ngettext=yes
else case e in #(
e) ac_cv_lib_intl_gettext=no ;;
e) ac_cv_lib_intl_ngettext=no ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS ;;
esac
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_gettext" >&5
printf "%s\n" "$ac_cv_lib_intl_gettext" >&6; }
if test "x$ac_cv_lib_intl_gettext" = xyes
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_ngettext" >&5
printf "%s\n" "$ac_cv_lib_intl_ngettext" >&6; }
if test "x$ac_cv_lib_intl_ngettext" = xyes
then :
printf "%s\n" "#define HAVE_LIBINTL 1" >>confdefs.h

Expand Down
18 changes: 10 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ AC_CANONICAL_HOST
# lib = The name of the library file without the 'lib' prefix and without the extension.
# package = The name of the package that holds the library
# testfn = One function included in the library that can be used for a test compilation.
# headerdir = directory that contains required header
# header = header file to check for
# if there's a problem during the test compilation.
AC_DEFUN([REQUIRE_LIB], [ {
AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=<path>],[Location where $5 is installed]),[],[with_$1=default])
AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=<path>],[Location where $6 is installed]),[],[with_$1=default])
AS_IF([test "x$with_$1" == xdefault],
[
case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/$3/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include"
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/$5"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -l$2" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/$2"
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/$5"
tde_LDFLAGS="$tde_LDFLAGS -l$2" ;;
esac
], [ #AS_ELSE
Expand All @@ -30,11 +31,12 @@ AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=<path>],[Location where $5 is instal
LDFLAGS="$LDFLAGS $tde_LDFLAGS"
CPPFLAGS="$CPPFLAGS $tde_CPPFLAGS"
AC_CHECK_HEADER($5, [],
AC_CHECK_HEADER($6, [],
[
AC_MSG_ERROR([header file <$5> is required, try specifying --with-$1])
AC_MSG_ERROR([header file <$6> is required, try specifying --with-$1])
])
AC_CHECK_LIB($2, $4, [],
[
AC_MSG_ERROR([$1 was not found, try specifying --with-$1])
Expand All @@ -43,12 +45,12 @@ AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=<path>],[Location where $5 is instal

#=======================================

REQUIRE_LIB(jsonc, json-c, json-c, json_object_get, json-c/json_object.h)
REQUIRE_LIB(libcurl, curl, curl, curl_easy_setopt, curl/curl.h)
REQUIRE_LIB(jsonc, json-c, json-c, json_object_get, json-c, json_object.h)
REQUIRE_LIB(libcurl, curl, curl, curl_easy_setopt, curl, curl/curl.h)

case $host_os in
# on other systems libintl is a part of glibc
darwin*) REQUIRE_LIB(libintl, intl, gettext, gettext, libintl.h)
darwin*) REQUIRE_LIB(libintl, intl, gettext, ngettext, [], libintl.h)
esac


Expand Down

0 comments on commit 1a79925

Please sign in to comment.