diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /build/moz.configure/libraries.configure | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/moz.configure/libraries.configure')
-rw-r--r-- | build/moz.configure/libraries.configure | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/build/moz.configure/libraries.configure b/build/moz.configure/libraries.configure new file mode 100644 index 0000000000..cac37e0ae5 --- /dev/null +++ b/build/moz.configure/libraries.configure @@ -0,0 +1,55 @@ +# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +@template +def check_clock_monotonic_support(lib=None, when=None): + check_msg = "for clock_gettime(CLOCK_MONOTONIC)" + flags = [] + + if lib is not None: + check_msg += f" in {lib}" + flags.append(f"-l{lib}") + + check_when = building_with_gnu_cc + if when is not None: + check_when &= when + + return try_link( + includes=["time.h"], + body="struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts);", + check_msg=check_msg, + flags=flags, + when=check_when, + ) + + +have_raw_clock_monotonic_support = check_clock_monotonic_support() +have_rt_clock_monotonic_support = check_clock_monotonic_support( + lib="rt", when=~have_raw_clock_monotonic_support +) + +set_define( + "HAVE_CLOCK_MONOTONIC", + have_raw_clock_monotonic_support | have_rt_clock_monotonic_support, +) +set_config( + "HAVE_CLOCK_MONOTONIC", + have_raw_clock_monotonic_support | have_rt_clock_monotonic_support, +) + +set_config("REALTIME_LIBS", ["-lrt"], when=have_rt_clock_monotonic_support) + + +have_res_ninit = try_link( + includes=["sys/types.h", "netinet/in.h", "arpa/nameser.h", "resolv.h"], + body="int foo = res_ninit(&_res);", + check_msg="for res_ninit()", + flags=depends(when=building_linux)(["-D_BSD_SOURCE=1"]), + when=building_with_gnu_cc & ~target_is_netbsd & ~target_is_openbsd, +) + +set_define("HAVE_RES_NINIT", have_res_ninit) |