Skip to content

Commit e71188f

Browse files
committed
add malloc implementation selection to configure
the intent here is to keep oldmalloc as an option, at least for the short term, in case any users are negatively impacted in some way by mallocng and need to fallback until their issues are resolved.
1 parent 503bd39 commit e71188f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

configure

+12
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Optional features:
3535
--disable-shared inhibit building shared library [enabled]
3636
--disable-static inhibit building static library [enabled]
3737
38+
Optional packages:
39+
--with-malloc=... choose malloc implementation [oldmalloc]
40+
3841
Some influential environment variables:
3942
CC C compiler command [detected]
4043
CFLAGS C compiler flags [-Os -pipe ...]
@@ -139,6 +142,7 @@ static=yes
139142
wrapper=auto
140143
gcc_wrapper=no
141144
clang_wrapper=no
145+
malloc_dir=oldmalloc
142146

143147
for arg ; do
144148
case "$arg" in
@@ -168,6 +172,7 @@ case "$arg" in
168172
--disable-wrapper|--enable-wrapper=no) wrapper=no ;;
169173
--enable-gcc-wrapper|--enable-gcc-wrapper=yes) wrapper=yes ; gcc_wrapper=yes ;;
170174
--disable-gcc-wrapper|--enable-gcc-wrapper=no) wrapper=no ;;
175+
--with-malloc=*) malloc_dir=${arg#*=} ;;
171176
--enable-*|--disable-*|--with-*|--without-*|--*dir=*) ;;
172177
--host=*|--target=*) target=${arg#*=} ;;
173178
--build=*) build=${arg#*=} ;;
@@ -214,6 +219,12 @@ done
214219
set +C
215220
trap 'rm "$tmpc"' EXIT INT QUIT TERM HUP
216221

222+
#
223+
# Check that the requested malloc implementation exists
224+
#
225+
test -d "$srcdir/src/malloc/$malloc_dir" \
226+
|| fail "$0: error: chosen malloc implementation '$malloc_dir' does not exist"
227+
217228
#
218229
# Check whether we are cross-compiling, and set a default
219230
# CROSS_COMPILE prefix if none was provided.
@@ -779,6 +790,7 @@ OPTIMIZE_GLOBS = $OPTIMIZE_GLOBS
779790
ALL_TOOLS = $tools
780791
TOOL_LIBS = $tool_libs
781792
ADD_CFI = $ADD_CFI
793+
MALLOC_DIR = $malloc_dir
782794
EOF
783795
test "x$static" = xno && echo "STATIC_LIBS ="
784796
test "x$shared" = xno && echo "SHARED_LIBS ="

0 commit comments

Comments
 (0)