From 1a799251ceb7daa8115304c579e28df968fb6b56 Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Fri, 12 Jan 2024 17:27:05 +0200 Subject: [PATCH] One more fix --- configure | 40 ++++++++++++++++++++++------------------ configure.ac | 18 ++++++++++-------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/configure b/configure index d55cb806..f29d16e9 100755 --- a/configure +++ b/configure @@ -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= Location where json-c/json_object.h is installed + --with-jsonc= Location where json_object.h is installed --with-libcurl= Location where curl/curl.h is installed --with-libintl= Location where libintl.h is installed @@ -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. @@ -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" ;; @@ -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 is required, try specifying --with-jsonc" "$LINENO" 5 + as_fn_error $? "header file 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} @@ -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" ;; @@ -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} @@ -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 @@ -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 #( @@ -3763,20 +3767,20 @@ 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 \ @@ -3784,9 +3788,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ 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 diff --git a/configure.ac b/configure.ac index edc1ae37..b674c815 100644 --- a/configure.ac +++ b/configure.ac @@ -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=],[Location where $5 is installed]),[],[with_$1=default]) + AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=],[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 @@ -30,11 +31,12 @@ AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=],[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]) @@ -43,12 +45,12 @@ AC_ARG_WITH([$1], AS_HELP_STRING([--with-$1=],[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