1# SPDX-License-Identifier: FSFAP 2# 3# =========================================================================== 4# https://gitlab.isc.org/isc-projects/autoconf-archive/ax_jemalloc.html 5# =========================================================================== 6# 7# SYNOPSIS 8# 9# AX_CHECK_JEMALLOC([, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) 10# 11# DESCRIPTION 12# 13# Test for the jemalloc library in a path 14# 15# LICENSE 16# 17# Copyright (c) 2021 Internet Systems Consortium 18# 19# Copying and distribution of this file, with or without modification, are 20# permitted in any medium without royalty provided the copyright notice 21# and this notice are preserved. This file is offered as-is, without any 22# warranty. 23 24#serial 1 25 26# 27AC_DEFUN([AX_CHECK_JEMALLOC], [ 28 found=false 29 PKG_CHECK_MODULES( 30 [JEMALLOC], [jemalloc], 31 [ 32 PKG_CHECK_VERSION([JEMALLOC_VERSION], [jemalloc]) 33 found=true 34 ], [ 35 AC_CHECK_HEADERS([malloc_np.h jemalloc/jemalloc.h], 36 [ 37 save_LIBS="$LIBS" 38 save_LDFLAGS="$LDFLAGS" 39 save_CPPFLAGS="$CPPFLAGS" 40 AC_SEARCH_LIBS([sdallocx], [jemalloc], 41 [ 42 found=true 43 JEMALLOC_VERSION=system 44 AS_IF([test "$ac_cv_search_mallocx" != "none required"], 45 [JEMALLOC_LIBS="$ac_cv_search_mallocx"]) 46 ]) 47 CPPFLAGS="$save_CPPFLAGS" 48 LDFLAGS="$save_LDFLAGS" 49 LIBS="$save_LIBS" 50 ]) 51 ]) 52 53 AS_IF([$found], [$1], [$2]) 54 55 AC_SUBST([JEMALLOC_CFLAGS]) 56 AC_SUBST([JEMALLOC_LIBS]) 57]) 58