Skip to content

Commit d93a1d9

Browse files
committed
Adjusted logic for OS X brew and --with options to configure
When a user specifies --with-something=/path/to/something in ./configure we don't want that to be overridden. In other words, we only want to do the automatic brew --prefix checking if the with_something variable is yes or check. Changelog: None Ticket: CFE-4385 Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
1 parent 725bde1 commit d93a1d9

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

configure.ac

Lines changed: 33 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,10 @@ 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-
623+
AS_IF(
624+
[(test "x$with_libcurl" = xyes || test "x$with_libcurl" = xcheck) \
625+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix libcurl)/],
626+
[with_libcurl=$(brew --prefix libcurl)])
608627
CF3_WITH_LIBRARY(libcurl, [
609628
AC_CHECK_LIB(curl, curl_global_init,
610629
[],
@@ -630,7 +649,10 @@ AC_ARG_WITH([libyaml],
630649

631650
if test "x$with_libyaml" != xno
632651
then
633-
AS_IF([test "x$have_brew" = "xyes" && test -d $(brew --prefix libyaml)/], [with_libyaml=$(brew --prefix libyaml)])
652+
AS_IF(
653+
[(test "x$with_libyaml" = xyes || test "x$with_libyaml" = xcheck) \
654+
&& test "x$have_brew" = "xyes" && test -d $(brew --prefix libyaml)/],
655+
[with_libyaml=$(brew --prefix libyaml)])
634656

635657
CF3_WITH_LIBRARY(libyaml, [
636658
AC_CHECK_LIB(yaml, yaml_parser_initialize,
@@ -709,7 +731,7 @@ if test "x$with_libxml2" != "xno"; then
709731
AC_MSG_ERROR(Cannot find libxml2); fi]
710732
)]
711733
)
712-
734+
713735
fi
714736

715737
AM_CONDITIONAL([HAVE_LIBXML2],

libntech

0 commit comments

Comments
 (0)