add autogenerated jemalloc.sh wrapper script

This commit is contained in:
Antony Dovgal 2011-10-13 09:33:33 +04:00 committed by Jason Evans
parent da9dde0854
commit 2bd3cbc5c6
4 changed files with 30 additions and 2 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@
!test/*.c !test/*.c
!test/*.exp !test/*.exp
/VERSION /VERSION
/bin/jemalloc.sh

View File

@ -42,7 +42,7 @@ TEST_LIBRARY_PATH :=
endif endif
# Lists of files. # Lists of files.
BINS := @srcroot@bin/pprof BINS := @srcroot@bin/pprof @objroot@bin/jemalloc.sh
CHDRS := @objroot@include/jemalloc/jemalloc@install_suffix@.h \ CHDRS := @objroot@include/jemalloc/jemalloc@install_suffix@.h \
@objroot@include/jemalloc/jemalloc_defs@install_suffix@.h @objroot@include/jemalloc/jemalloc_defs@install_suffix@.h
CSRCS := @srcroot@src/jemalloc.c @srcroot@src/arena.c @srcroot@src/atomic.c \ CSRCS := @srcroot@src/jemalloc.c @srcroot@src/arena.c @srcroot@src/atomic.c \

9
bin/jemalloc.sh.in Normal file
View File

@ -0,0 +1,9 @@
#!/bin/sh
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
@LD_PRELOAD_VAR@=${libdir}/libjemalloc.@SHLIB_SUFFIX_NAME@.1
export @LD_PRELOAD_VAR@
exec "$@"

View File

@ -167,6 +167,9 @@ case "${host_cpu}" in
esac esac
AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT]) AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
LD_PRELOAD_VAR="LD_PRELOAD"
SHLIB_SUFFIX_NAME="so"
dnl Platform-specific settings. abi and RPATH can probably be determined dnl Platform-specific settings. abi and RPATH can probably be determined
dnl programmatically, but doing so is error-prone, which makes it generally dnl programmatically, but doing so is error-prone, which makes it generally
dnl not worth the trouble. dnl not worth the trouble.
@ -180,6 +183,8 @@ case "${host}" in
abi="macho" abi="macho"
AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE]) AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE])
RPATH="" RPATH=""
LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
SHLIB_SUFFIX_NAME="dylib"
;; ;;
*-*-freebsd*) *-*-freebsd*)
CFLAGS="$CFLAGS" CFLAGS="$CFLAGS"
@ -217,6 +222,17 @@ case "${host}" in
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS"
LIBS="$LIBS -lposix4 -lsocket -lnsl" LIBS="$LIBS -lposix4 -lsocket -lnsl"
;; ;;
*-ibm-aix*)
if "$LG_SIZEOF_PTR" = "8"; then
dnl 64bit AIX
LD_PRELOAD_VAR="LDR_PRELOAD64"
else
dnl 32bit AIX
LD_PRELOAD_VAR="LDR_PRELOAD"
fi
abi="xcoff"
RPATH="-Wl,-rpath,"
;;
*) *)
AC_MSG_RESULT([Unsupported operating system: ${host}]) AC_MSG_RESULT([Unsupported operating system: ${host}])
abi="elf" abi="elf"
@ -225,6 +241,8 @@ case "${host}" in
esac esac
AC_SUBST([abi]) AC_SUBST([abi])
AC_SUBST([RPATH]) AC_SUBST([RPATH])
AC_SUBST([LD_PRELOAD_VAR])
AC_SUBST([SHLIB_SUFFIX_NAME])
JE_COMPILABLE([__attribute__ syntax], JE_COMPILABLE([__attribute__ syntax],
[static __attribute__((unused)) void foo(void){}], [static __attribute__((unused)) void foo(void){}],
@ -881,7 +899,7 @@ AC_CONFIG_HEADERS([$cfghdrs_tup])
dnl ============================================================================ dnl ============================================================================
dnl Generate outputs. dnl Generate outputs.
AC_CONFIG_FILES([$cfgoutputs_tup config.stamp]) AC_CONFIG_FILES([$cfgoutputs_tup config.stamp bin/jemalloc.sh])
AC_SUBST([cfgoutputs_in]) AC_SUBST([cfgoutputs_in])
AC_SUBST([cfgoutputs_out]) AC_SUBST([cfgoutputs_out])
AC_OUTPUT AC_OUTPUT