Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/macos_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ jobs:
with:
submodules: recursive
- name: Install dependencies
run: brew install lmdb automake openssl pcre autoconf libtool
run: brew install lmdb automake openssl pcre autoconf libtool libyaml
- name: Check tools
run: command -v libtool && command -v automake && command -v autoconf
- name: Check tools versions
run: libtool -V && automake --version && autoconf --version
- name: Run autotools / configure
run: >
LDFLAGS="-L`brew --prefix lmdb`/lib -L`brew --prefix openssl`/lib -L`brew --prefix pcre`/lib"
CPPFLAGS="-I`brew --prefix lmdb`/include -I`brew --prefix openssl`/include -I`brew --prefix pcre`/include"
PATH="/opt/homebrew/opt/libtool/libexec/gnubin:$PATH"
./autogen.sh --enable-debug
- name: Compile and link
run: make -j8 CFLAGS="-Werror -Wall"
run: MACOSX_DEPLOYMENT_TARGET=15.4 make -j8 CFLAGS="-Werror -Wall"
- name: Run unit tests
run: make -C tests/unit check
42 changes: 34 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ AC_PROG_CC
AC_PROG_MKDIR_P
AC_EXEEXT

AS_CASE([${target_os}],
[darwin*], [
AC_CHECK_PROG([BREW], [brew], [brew])
AC_MSG_CHECKING([for OS X Homebrew])
AS_IF([test "x$BREW" = "xbrew"], [
have_brew=yes
AC_MSG_RESULT([OS X Homebrew detected])
],
[have_brew=])
])

dnl GCC specific flags
m4_include([m4/cf3_gcc_flags.m4])

Expand Down Expand Up @@ -369,6 +380,8 @@ then
fi
fi

AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix mysql)/], [with_mysql=$(brew --prefix mysql)])

CF3_WITH_LIBRARY(mysql,
[AC_CHECK_LIB(mysqlclient, mysql_real_connect,
[],
Expand Down Expand Up @@ -432,6 +445,8 @@ AC_ARG_WITH([lmdb],
AS_IF([test $WITH_TOKYO -eq 0 && test $WITH_QDBM -eq 0 && (! test -n "$with_lmdb" || test "x$with_lmdb" != "xno")], [WITH_LMDB=1], [WITH_LMDB=0])

if test $WITH_LMDB = 1; then
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix lmdb)/], [with_lmdb=$(brew --prefix lmdb)])

CF3_WITH_LIBRARY(lmdb, [
AC_CHECK_LIB(lmdb, mdb_dbi_open, [], [AC_MSG_ERROR(Cannot find Lightning MDB)])
AC_CHECK_HEADERS(lmdb.h, [], [AC_MSG_ERROR(Cannot find Lightning MDB)])
Expand All @@ -455,13 +470,7 @@ if test x"$with_openssl" = xno ; then
AC_MSG_ERROR([This release of CFEngine requires OpenSSL >= 0.9.7])
fi

if test -d /usr/local/Cellar/ && \
test -d /usr/local/opt/openssl/ && \
test "x$with_openssl" = "xyes" ; then
with_openssl=$(brew --prefix openssl)
echo "OS X Homebrew detected"
echo "Defaulting to: --with-openssl=$with_openssl"
fi
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix openssl)/], [with_openssl=$(brew --prefix openssl)])

CF3_WITH_LIBRARY(openssl, [
AC_CHECK_LIB(crypto, RSA_generate_key_ex, [], [])
Expand Down Expand Up @@ -507,6 +516,11 @@ if test "x$with_pcre" = "xno"; then
AC_MSG_ERROR([PCRE is required])
fi

AS_IF(
[(test "x$with_pcre" = xyes || test "x$with_pcre" = xcheck) \
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix pcre)/],
[with_pcre=$(brew --prefix pcre)])

CF3_WITH_LIBRARY(pcre, [
AC_CHECK_LIB(pcre, pcre_exec, [], [AC_MSG_ERROR(Cannot find PCRE)])
AC_CHECK_HEADERS([pcre.h], [],
Expand All @@ -523,6 +537,8 @@ AC_ARG_WITH([libvirt],

if test "x$with_libvirt" != xno
then
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix libvirt)/], [with_libvirt=$(brew --prefix libvirt)])

CF3_WITH_LIBRARY(libvirt, [
AC_CHECK_LIB(virt, virConnectOpen, [], [if test "x$with_libvirt" != xcheck; then AC_MSG_ERROR(Cannot find libvirt library); fi])
AC_CHECK_HEADERS(libvirt/libvirt.h, [], [if test "x$with_libvirt" != xcheck; then AC_MSG_ERROR(Cannot find libvirt library headers); fi])
Expand Down Expand Up @@ -562,6 +578,8 @@ AC_ARG_WITH([libcurl],

if test "x$with_libcurl" != xno
then
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix curl)/], [with_libcurl=$(brew --prefix curl)])

CF3_WITH_LIBRARY(libcurl, [
AC_CHECK_LIB(curl, curl_global_init,
[],
Expand All @@ -587,6 +605,8 @@ AC_ARG_WITH([libyaml],

if test "x$with_libyaml" != xno
then
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix libyaml)/], [with_libyaml=$(brew --prefix libyaml)])

CF3_WITH_LIBRARY(libyaml, [
AC_CHECK_LIB(yaml, yaml_parser_initialize,
[],
Expand All @@ -609,7 +629,13 @@ AC_ARG_WITH([libxml2],
have_libxml2="no"

if test "x$with_libxml2" != "xno"; then
if test -n "$PKG_CONFIG"; then
if test "x$have_brew" = "xyes" && \
test -d $(brew --prefix libxml2)/; then
with_libxml2=$(brew --prefix libxml2)
echo "OS X Homebrew detected"
echo "Defaulting to: --with-libxml2=$with_libxml2"
have_libxml2="yes"
elif test -n "$PKG_CONFIG"; then
AC_MSG_CHECKING([for libxml2 via pkg-config])
if `$PKG_CONFIG --exists libxml-2.0`; then
LIBXML2_CFLAGS=`$PKG_CONFIG --cflags libxml-2.0`
Expand Down
2 changes: 1 addition & 1 deletion libntech
4 changes: 2 additions & 2 deletions libpromises/evalfunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2704,9 +2704,9 @@ static FnCallResult FnCallUrlGet(ARG_UNUSED EvalContext *ctx,
Buffer *content = BufferNew();
Buffer *headers = BufferNew();
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); // do not use signals
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1L); // do not use signals
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 3L); // set default timeout
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
curl_easy_setopt(curl,
CURLOPT_PROTOCOLS,

Expand Down
Loading