xref: /netbsd-src/external/bsd/jemalloc.old/dist/include/jemalloc/jemalloc_rename.sh (revision 8e33eff89e26cf71871ead62f0d5063e1313c33a)
1*8e33eff8Schristos#!/bin/sh
2*8e33eff8Schristos
3*8e33eff8Schristospublic_symbols_txt=$1
4*8e33eff8Schristos
5*8e33eff8Schristoscat <<EOF
6*8e33eff8Schristos/*
7*8e33eff8Schristos * Name mangling for public symbols is controlled by --with-mangling and
8*8e33eff8Schristos * --with-jemalloc-prefix.  With default settings the je_ prefix is stripped by
9*8e33eff8Schristos * these macro definitions.
10*8e33eff8Schristos */
11*8e33eff8Schristos#ifndef JEMALLOC_NO_RENAME
12*8e33eff8SchristosEOF
13*8e33eff8Schristos
14*8e33eff8Schristosfor nm in `cat ${public_symbols_txt}` ; do
15*8e33eff8Schristos  n=`echo ${nm} |tr ':' ' ' |awk '{print $1}'`
16*8e33eff8Schristos  m=`echo ${nm} |tr ':' ' ' |awk '{print $2}'`
17*8e33eff8Schristos  echo "#  define je_${n} ${m}"
18*8e33eff8Schristosdone
19*8e33eff8Schristos
20*8e33eff8Schristoscat <<EOF
21*8e33eff8Schristos#endif
22*8e33eff8SchristosEOF
23