Skip to content

Commit ca38f30

Browse files
authored
Merge pull request #5745 from olehermanse/macos
Adjusted logic for OS X brew and --with options to configure
2 parents 725bde1 + c19864c commit ca38f30

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

configure.ac

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,10 @@ then
385385
fi
386386
fi
387387

388-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix mysql)/], [with_mysql=$(brew --prefix mysql)])
388+
AS_IF(
389+
[(test "x$with_mysql" = xyes || test "x$with_mysql" = xcheck) \
390+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix mysql)/],
391+
[with_mysql=$(brew --prefix mysql)])
389392

390393
CF3_WITH_LIBRARY(mysql,
391394
[AC_CHECK_LIB(mysqlclient, mysql_real_connect,
@@ -450,7 +453,10 @@ AC_ARG_WITH([lmdb],
450453
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])
451454

452455
if test $WITH_LMDB = 1; then
453-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix lmdb)/], [with_lmdb=$(brew --prefix lmdb)])
456+
AS_IF(
457+
[(test "x$with_lmdb" = xyes || test "x$with_lmdb" = xcheck || test "x$with_lmdb" = x) \
458+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix lmdb)/],
459+
[with_lmdb=$(brew --prefix lmdb)])
454460

455461
CF3_WITH_LIBRARY(lmdb, [
456462
AC_CHECK_LIB(lmdb, mdb_dbi_open, [], [AC_MSG_ERROR(Cannot find Lightning MDB)])
@@ -475,7 +481,10 @@ if test x"$with_openssl" = xno ; then
475481
AC_MSG_ERROR([This release of CFEngine requires OpenSSL >= 0.9.7])
476482
fi
477483

478-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix openssl)/], [with_openssl=$(brew --prefix openssl)])
484+
AS_IF(
485+
[(test "x$with_openssl" = xyes || test "x$with_openssl" = xcheck) \
486+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix openssl)/],
487+
[with_openssl=$(brew --prefix openssl)])
479488

480489
CF3_WITH_LIBRARY(openssl, [
481490
AC_CHECK_LIB(crypto, RSA_generate_key_ex, [], [])
@@ -521,7 +530,10 @@ if test "x$with_pcre2" = "xno"; then
521530
AC_MSG_ERROR([PCRE2 is required])
522531
fi
523532

524-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix pcre2)/], [with_pcre2=$(brew --prefix pcre2)])
533+
AS_IF(
534+
[(test "x$with_pcre2" = xyes || test "x$with_pcre2" = xcheck) \
535+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix pcre2)/],
536+
[with_pcre2=$(brew --prefix pcre2)])
525537

526538
CF3_WITH_LIBRARY(pcre2, [
527539
AC_CHECK_LIB(pcre2-8, pcre2_compile_8, [], [AC_MSG_ERROR(Cannot find PCRE2)])
@@ -541,7 +553,10 @@ if test "x$with_librsync" = "xno"; then
541553
AC_MSG_ERROR([librsync is required])
542554
fi
543555

544-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix librsync)/], [with_librsync=$(brew --prefix librsync)])
556+
AS_IF(
557+
[(test "x$with_librsync" = xyes || test "x$with_librsync" = xcheck) \
558+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix librsync)/],
559+
[with_librsync=$(brew --prefix librsync)])
545560

546561
CF3_WITH_LIBRARY(librsync, [
547562
AC_CHECK_HEADERS([librsync.h], [], AC_MSG_ERROR(Cannot find librsync))
@@ -562,8 +577,10 @@ AC_ARG_WITH([libvirt],
562577

563578
if test "x$with_libvirt" != xno
564579
then
565-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix libvirt)/], [with_libvirt=$(brew --prefix libvirt)])
566-
580+
AS_IF(
581+
[(test "x$with_libvirt" = xyes || test "x$with_libvirt" = xcheck) \
582+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix libvirt)/],
583+
[with_libvirt=$(brew --prefix libvirt)])
567584
CF3_WITH_LIBRARY(libvirt, [
568585
AC_CHECK_LIB(virt, virConnectOpen, [], [if test "x$with_libvirt" != xcheck; then AC_MSG_ERROR(Cannot find libvirt library); fi])
569586
AC_CHECK_HEADERS(libvirt/libvirt.h, [], [if test "x$with_libvirt" != xcheck; then AC_MSG_ERROR(Cannot find libvirt library headers); fi])
@@ -603,8 +620,6 @@ AC_ARG_WITH([libcurl],
603620

604621
if test "x$with_libcurl" != xno
605622
then
606-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix curl)/], [with_libcurl=$(brew --prefix curl)])
607-
608623
CF3_WITH_LIBRARY(libcurl, [
609624
AC_CHECK_LIB(curl, curl_global_init,
610625
[],
@@ -630,7 +645,10 @@ AC_ARG_WITH([libyaml],
630645

631646
if test "x$with_libyaml" != xno
632647
then
633-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix libyaml)/], [with_libyaml=$(brew --prefix libyaml)])
648+
AS_IF(
649+
[(test "x$with_libyaml" = xyes || test "x$with_libyaml" = xcheck) \
650+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix libyaml)/],
651+
[with_libyaml=$(brew --prefix libyaml)])
634652

635653
CF3_WITH_LIBRARY(libyaml, [
636654
AC_CHECK_LIB(yaml, yaml_parser_initialize,
@@ -709,7 +727,7 @@ if test "x$with_libxml2" != "xno"; then
709727
AC_MSG_ERROR(Cannot find libxml2); fi]
710728
)]
711729
)
712-
730+
713731
fi
714732

715733
AM_CONDITIONAL([HAVE_LIBXML2],

libntech

0 commit comments

Comments
 (0)