1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20 21 22PRJ=. 23 24PRJNAME=so_jemalloc 25TARGET=so_jemalloc 26 27# --- Settings ----------------------------------------------------- 28 29.INCLUDE : settings.mk 30 31.IF "$(ENABLE_JEMALLOC)" != "YES" 32all: 33 @echo "jemalloc is not enabled; configure with --enable-jemalloc to build it." 34.ENDIF 35 36# --- Files -------------------------------------------------------- 37 38TARFILE_NAME=jemalloc-5.4.0 39TARFILE_MD5=e9abfa20270beb35e54043240ba37369 40 41CONFIGURE_DIR=.$/ 42CONFIGURE_ACTION=.$/configure 43CONFIGURE_FLAGS=--disable-static --disable-cxx --disable-doc 44CONFIGURE_FLAGS+=CC="$(CC) $(ARCH_FLAGS)" 45 46.IF "$(OS)"=="LINUX" 47# libjemalloc is loaded together with libraries that dlopen() it late, which 48# the initial-exec TLS model does not allow. 49CONFIGURE_FLAGS+=--disable-initial-exec-tls 50.IF "$(CPUNAME)"=="AARCH64" 51# Linux/arm64 kernels come with 4K, 16K or 64K pages; 64K covers all of them. 52CONFIGURE_FLAGS+=--with-lg-page=16 53.ENDIF 54.ENDIF 55 56BUILD_DIR=$(CONFIGURE_DIR) 57BUILD_ACTION=$(GNUMAKE) build_lib_shared 58BUILD_FLAGS+= -j$(EXTMAXPROCESS) 59 60.IF "$(OS)"=="MACOSX" 61OUT2LIB=lib$/libjemalloc.2.dylib 62.ELSE 63OUT2LIB=lib$/libjemalloc.so.2 64.ENDIF 65 66# --- Targets ------------------------------------------------------ 67 68.INCLUDE : set_ext.mk 69.INCLUDE : target.mk 70.INCLUDE : tg_ext.mk 71