Skip to content

Commit

Permalink
Fix build on older versions of mac
Browse files Browse the repository at this point in the history
    Building on Homebrew it builds on multiple older versions of mac.
    Some older versions don't support to_char() for double.
  • Loading branch information
Loki-Astari committed Sep 13, 2024
1 parent b321b51 commit 7072186
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build
3 changes: 3 additions & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
/* We have found package ZLIB */
#undef HAVE_ZLIB

/* Check for older build tools and use simpler code with old tools */
#undef HOMEBREW_OLD_VERSION_OF_MAC

/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR

Expand Down
28 changes: 28 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,7 @@ with_aix_soname
with_gnu_ld
with_sysroot
enable_libtool_lock
with_homebrewCLT
enable_dependency_tracking
enable_silent_rules
'
Expand Down Expand Up @@ -1552,6 +1553,9 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
--with-homebrewCLT=<CLT Version>
Define what version of the CLT is being used


Some influential environment variables:
CXX C++ compiler command
Expand Down Expand Up @@ -18239,6 +18243,30 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu




# Check whether --with-homebrewCLT was given.
if test ${with_homebrewCLT+y}
then :
withval=$with_homebrewCLT;
fi

if test "x${with_homebrewCLT}" != "x"
then :

if test ${with_homebrewCLT} -lt 153
then :


printf "%s\n" "#define HOMEBREW_OLD_VERSION_OF_MAC 1" >>confdefs.h

subconfigure="${subconfigure} --with-homebrewCLT=${with_homebrewCLT}"


fi


fi

subconfigure="${subconfigure} --with-thorserialize-root=$(pwd)/build "


Expand Down
19 changes: 19 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ int main() {

LT_INIT

AC_ARG_WITH(
[homebrewCLT],
AS_HELP_STRING([--with-homebrewCLT=<CLT Version>], [Define what version of the CLT is being used])
)
AS_IF(
[test "x${with_homebrewCLT}" != "x"],
[
AC_MSG_NOTICE([Have with_homebrewCLT in Mongo => ${with_homebrewCLT}])
AS_IF(
[test ${with_homebrewCLT} -lt 153],
[
AC_MSG_NOTICE([Setting HOMEBREW_OLD_VERSION_OF_MAC])
AC_DEFINE([HOMEBREW_OLD_VERSION_OF_MAC], [1], [Check for older build tools and use simpler code with old tools])
subconfigure="${subconfigure} --with-homebrewCLT=${with_homebrewCLT}"
]
)
]
)

subconfigure="${subconfigure} --with-thorserialize-root=$(pwd)/build "

AX_THOR_FEATURE_HEADER_ONLY_VARIANT([THORS_SERIALIZER])
Expand Down
2 changes: 1 addition & 1 deletion third/ThorsSerializer

0 comments on commit 7072186

Please sign in to comment.