diff options
author | Paweł Krupa <pawel@krupa.net.pl> | 2018-09-26 12:46:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 12:46:28 +0200 |
commit | c1b02322653f8474c6dc077f33f016d68f54406b (patch) | |
tree | d79203405b885b533db58455a77a344c6de98a65 /build/m4/jemalloc.m4 | |
parent | 465d375c5096421254c6e331394bf6d69ab36db9 (diff) |
reproducible build system (#4294)
- Move `m4` dir to `build/m4` to clean TLD
- create `build/build.sh` script which builds netdata in docker container
- create `build/Dockerfile` which creates reproducible build environment
- exclude `.lgtm.yml` from final package
- use `.tar.gz` package in `netdata.spec.in` as `*.xz` and `*.bz2` will be removed due to #3913
What it does is simple, you don't need any libraries installed on host to build netdata as they are provided inside a container.
Diffstat (limited to 'build/m4/jemalloc.m4')
-rw-r--r-- | build/m4/jemalloc.m4 | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/build/m4/jemalloc.m4 b/build/m4/jemalloc.m4 new file mode 100644 index 0000000000..c2008a8eac --- /dev/null +++ b/build/m4/jemalloc.m4 @@ -0,0 +1,75 @@ +dnl -------------------------------------------------------- -*- autoconf -*- +dnl SPDX-License-Identifier: Apache-2.0 + +dnl +dnl jemalloc.m4: Trafficserver's jemalloc autoconf macros +dnl modified to skip other TS_ helpers +dnl + +AC_DEFUN([TS_CHECK_JEMALLOC], [ +AC_ARG_WITH([jemalloc-prefix], + [AS_HELP_STRING([--with-jemalloc-prefix=PREFIX],[Specify the jemalloc prefix [default=""]])], + [ + jemalloc_prefix="$withval" + ],[ + if test "`uname -s`" = "Darwin"; then + jemalloc_prefix="je_" + else + jemalloc_prefix="" + fi + ] +) +AC_DEFINE_UNQUOTED([prefix_jemalloc], [${jemalloc_prefix}], [jemalloc prefix]) + +enable_jemalloc=no +AC_ARG_WITH([jemalloc], [AS_HELP_STRING([--with-jemalloc=DIR], [use a specific jemalloc library])], +[ + if test "$withval" != "no"; then + if test "x${enable_tcmalloc}" = "xyes"; then + AC_MSG_ERROR([Cannot compile with both jemalloc and tcmalloc]) + fi + enable_jemalloc=yes + jemalloc_base_dir="$withval" + case "$withval" in + yes) + jemalloc_base_dir="/usr" + AC_MSG_CHECKING(checking for jemalloc includes standard directories) + ;; + *":"*) + jemalloc_include="`echo $withval |sed -e 's/:.*$//'`" + jemalloc_ldflags="`echo $withval |sed -e 's/^.*://'`" + AC_MSG_CHECKING(checking for jemalloc includes in $jemalloc_include libs in $jemalloc_ldflags) + ;; + *) + jemalloc_include="$withval/include" + jemalloc_ldflags="$withval/lib" + AC_MSG_CHECKING(checking for jemalloc includes in $withval) + ;; + esac + fi +]) + +has_jemalloc=0 +if test "$enable_jemalloc" != "no"; then + jemalloc_have_headers=0 + jemalloc_have_libs=0 + if test "$jemalloc_base_dir" != "/usr"; then + CFLAGS="${CFLAGS} -I${jemalloc_include}" + LDFLAGS="${LDFLAGS} -L${jemalloc_ldflags}" + LIBTOOL_LINK_FLAGS="${LIBTOOL_LINK_FLAGS} -R${jemalloc_ldflags}" + fi + func="${jemalloc_prefix}malloc_stats_print" + AC_CHECK_LIB(jemalloc, ${func}, [jemalloc_have_libs=1]) + if test "$jemalloc_have_libs" != "0"; then + AC_CHECK_HEADERS([jemalloc/jemalloc.h], [jemalloc_have_headers=1]) + fi + if test "$jemalloc_have_headers" != "0"; then + has_jemalloc=1 + LIBS="${LIBS} -ljemalloc" + AC_DEFINE(has_jemalloc, [1], [Link/compile against jemalloc]) + else + AC_MSG_ERROR([Couldn't find a jemalloc installation]) + fi +fi +AC_SUBST(has_jemalloc) +]) |