Refactor SO and REV make variables.

Refactor the SO and REV such that they are set via autoconf variables,
@so@ and @rev@.  These variables are both needed by the jemalloc.sh
script, so this unifies their definitions.
This commit is contained in:
Jason Evans 2011-11-01 22:27:41 -07:00
parent 2bd3cbc5c6
commit f576c63f1e
3 changed files with 12 additions and 8 deletions

View File

@ -27,14 +27,13 @@ endif
LDFLAGS := @LDFLAGS@ LDFLAGS := @LDFLAGS@
LIBS := @LIBS@ LIBS := @LIBS@
RPATH_EXTRA := @RPATH_EXTRA@ RPATH_EXTRA := @RPATH_EXTRA@
SO := @so@
ifeq (macho, @abi@) ifeq (macho, @abi@)
SO := dylib
WL_SONAME := dylib_install_name WL_SONAME := dylib_install_name
else else
SO := so
WL_SONAME := soname WL_SONAME := soname
endif endif
REV := 1 REV := @rev@
ifeq (macho, @abi@) ifeq (macho, @abi@)
TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH=@objroot@lib TEST_LIBRARY_PATH := DYLD_FALLBACK_LIBRARY_PATH=@objroot@lib
else else

View File

@ -4,6 +4,6 @@ prefix=@prefix@
exec_prefix=@exec_prefix@ exec_prefix=@exec_prefix@
libdir=@libdir@ libdir=@libdir@
@LD_PRELOAD_VAR@=${libdir}/libjemalloc.@SHLIB_SUFFIX_NAME@.1 @LD_PRELOAD_VAR@=${libdir}/libjemalloc.@so@.@rev@
export @LD_PRELOAD_VAR@ export @LD_PRELOAD_VAR@
exec "$@" exec "$@"

View File

@ -40,6 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM(
dnl ============================================================================ dnl ============================================================================
dnl Library revision.
rev=1
AC_SUBST([rev])
srcroot=$srcdir srcroot=$srcdir
if test "x${srcroot}" = "x." ; then if test "x${srcroot}" = "x." ; then
srcroot="" srcroot=""
@ -168,7 +172,7 @@ esac
AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT]) AC_DEFINE_UNQUOTED([CPU_SPINWAIT], [$CPU_SPINWAIT])
LD_PRELOAD_VAR="LD_PRELOAD" LD_PRELOAD_VAR="LD_PRELOAD"
SHLIB_SUFFIX_NAME="so" so="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
@ -184,7 +188,7 @@ case "${host}" in
AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE]) AC_DEFINE([JEMALLOC_PURGE_MADVISE_FREE])
RPATH="" RPATH=""
LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES" LD_PRELOAD_VAR="DYLD_INSERT_LIBRARIES"
SHLIB_SUFFIX_NAME="dylib" so="dylib"
;; ;;
*-*-freebsd*) *-*-freebsd*)
CFLAGS="$CFLAGS" CFLAGS="$CFLAGS"
@ -242,7 +246,7 @@ esac
AC_SUBST([abi]) AC_SUBST([abi])
AC_SUBST([RPATH]) AC_SUBST([RPATH])
AC_SUBST([LD_PRELOAD_VAR]) AC_SUBST([LD_PRELOAD_VAR])
AC_SUBST([SHLIB_SUFFIX_NAME]) AC_SUBST([so])
JE_COMPILABLE([__attribute__ syntax], JE_COMPILABLE([__attribute__ syntax],
[static __attribute__((unused)) void foo(void){}], [static __attribute__((unused)) void foo(void){}],
@ -907,7 +911,8 @@ AC_OUTPUT
dnl ============================================================================ dnl ============================================================================
dnl Print out the results of configuration. dnl Print out the results of configuration.
AC_MSG_RESULT([===============================================================================]) AC_MSG_RESULT([===============================================================================])
AC_MSG_RESULT([jemalloc version : $jemalloc_version]) AC_MSG_RESULT([jemalloc version : ${jemalloc_version}])
AC_MSG_RESULT([library revision : ${rev}])
AC_MSG_RESULT([]) AC_MSG_RESULT([])
AC_MSG_RESULT([CC : ${CC}]) AC_MSG_RESULT([CC : ${CC}])
AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}]) AC_MSG_RESULT([CPPFLAGS : ${CPPFLAGS}])