Fix build system problems.

Split library build rules up so that parallel building works.

Fix autoconf-related dependencies.

Remove obsolete JEMALLOC_VERSION definition.
This commit is contained in:
Jason Evans 2010-04-07 23:37:35 -07:00
parent af366593a4
commit 0656ec0eb4
6 changed files with 21 additions and 32 deletions

3
.gitignore vendored
View File

@ -1,6 +1,5 @@
/jemalloc/autom4te.cache/ /jemalloc/autom4te.cache/
/jemalloc/cfghdrs.stamp /jemalloc/config.stamp
/jemalloc/cfgoutputs.stamp
/jemalloc/config.log /jemalloc/config.log
/jemalloc/config.status /jemalloc/config.status
/jemalloc/configure /jemalloc/configure

View File

@ -63,11 +63,17 @@ all: $(DSOS)
$(CC) $(CFLAGS) -c $(CPPFLAGS) -o $@ $< $(CC) $(CFLAGS) -c $(CPPFLAGS) -o $@ $<
@$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)" @$(SHELL) -ec "$(CC) -MM $(CPPFLAGS) $< | sed \"s/\($(subst /,\/,$(notdir $(basename $@)))\)\.o\([ :]*\)/$(subst /,\/,$(strip $(dir $@)))\1.o \2/g\" > $(@:%.o=%.d)"
$(DSOS): $(CSRCS:@srcroot@%.c=@objroot@%.o) %.so : %.so.$(REV)
@mkdir -p $(@D) @mkdir -p $(@D)
$(CC) -shared -Wl,-soname,libjemalloc@install_suffix@.so.$(REV) -o $@ $+ $(LDFLAGS) $(LIBS) ln -sf $(<F) $@
ln -sf libjemalloc@install_suffix@.so.$(REV) lib/libjemalloc@install_suffix@.so
ar crus @objroot@lib/libjemalloc@install_suffix@_pic.a $+ @objroot@lib/libjemalloc@install_suffix@.so.$(REV) : $(CSRCS:@srcroot@%.c=@objroot@%.o)
@mkdir -p $(@D)
$(CC) -shared -Wl,-soname,$(@F) -o $@ $+ $(LDFLAGS) $(LIBS)
@objroot@lib/libjemalloc@install_suffix@_pic.a : $(CSRCS:@srcroot@%.c=@objroot@%.o)
@mkdir -p $(@D)
ar crus $@ $+
install_bin: install_bin:
install -d $(BINDIR) install -d $(BINDIR)
@ -128,26 +134,15 @@ ifeq (@enable_autogen@, 1)
@objroot@config.status : @srcroot@configure @objroot@config.status : @srcroot@configure
./@objroot@config.status --recheck ./@objroot@config.status --recheck
# cfghdrs rules. @srcroot@config.stamp.in : @srcroot@configure.ac
@srcroot@cfghdrs.stamp.in : @srcroot@configure.ac echo stamp > @srcroot@config.stamp.in
echo stamp > @srcroot@cfghdrs.stamp.in
@objroot@cfghdrs.stamp : @cfghdrs_in@ @srcroot@configure @objroot@config.stamp : @cfgoutputs_in@ @cfghdrs_in@ @srcroot@configure
./@objroot@config.status
@touch $@
@cfghdrs@ : @objroot@cfghdrs.stamp
# cfgoutputs rules.
@srcroot@cfgoutputs.stamp.in : @srcroot@configure.ac
echo stamp > @srcroot@cfgoutputs.stamp.in
@objroot@cfgoutputs.stamp : @cfgoutputs_in@ @srcroot@configure
./@objroot@config.status ./@objroot@config.status
@touch $@ @touch $@
# There must be some action in order for make to re-read Makefile when it is # There must be some action in order for make to re-read Makefile when it is
# out of date. # out of date.
@cfgoutputs@ : @objroot@cfgoutputs.stamp @cfgoutputs_out@ @cfghdrs_out@ : @objroot@config.stamp
@true @true
endif endif

View File

@ -263,9 +263,9 @@ AC_ARG_WITH([install_suffix],
install_suffix="$INSTALL_SUFFIX" install_suffix="$INSTALL_SUFFIX"
AC_SUBST([install_suffix]) AC_SUBST([install_suffix])
cfgoutputs_in="Makefile doc/jemalloc.3.in" cfgoutputs_in="${srcroot}Makefile.in ${srcroot}doc/jemalloc.3.in"
cfgoutputs_in="${cfgoutputs_in} include/jemalloc/jemalloc.h.in" cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/jemalloc.h.in"
cfgoutputs_in="${cfgoutputs_in} include/jemalloc/internal/jemalloc_internal.h.in" cfgoutputs_in="${cfgoutputs_in} ${srcroot}include/jemalloc/internal/jemalloc_internal.h.in"
cfgoutputs_out="Makefile doc/jemalloc${install_suffix}.3" cfgoutputs_out="Makefile doc/jemalloc${install_suffix}.3"
cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h" cfgoutputs_out="${cfgoutputs_out} include/jemalloc/jemalloc${install_suffix}.h"
@ -275,7 +275,7 @@ cfgoutputs_tup="Makefile doc/jemalloc${install_suffix}.3:doc/jemalloc.3.in"
cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in" cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/jemalloc${install_suffix}.h:include/jemalloc/jemalloc.h.in"
cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h" cfgoutputs_tup="${cfgoutputs_tup} include/jemalloc/internal/jemalloc_internal.h"
cfghdrs_in="include/jemalloc/jemalloc_defs.h.in" cfghdrs_in="${srcroot}include/jemalloc/jemalloc_defs.h.in"
cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h" cfghdrs_out="include/jemalloc/jemalloc_defs${install_suffix}.h"
@ -720,11 +720,11 @@ AC_HEADER_STDBOOL
dnl Process .in files. dnl Process .in files.
AC_SUBST([cfghdrs_in]) AC_SUBST([cfghdrs_in])
AC_SUBST([cfghdrs_out]) AC_SUBST([cfghdrs_out])
AC_CONFIG_HEADERS([$cfghdrs_tup cfghdrs.stamp]) AC_CONFIG_HEADERS([$cfghdrs_tup])
dnl ============================================================================ dnl ============================================================================
dnl Generate outputs. dnl Generate outputs.
AC_CONFIG_FILES([$cfgoutputs_tup cfgoutputs.stamp]) AC_CONFIG_FILES([$cfgoutputs_tup config.stamp])
AC_SUBST([cfgoutputs_in]) AC_SUBST([cfgoutputs_in])
AC_SUBST([cfgoutputs_out]) AC_SUBST([cfgoutputs_out])
AC_OUTPUT AC_OUTPUT

View File

@ -1,11 +1,6 @@
#ifndef JEMALLOC_DEFS_H_ #ifndef JEMALLOC_DEFS_H_
#define JEMALLOC_DEFS_H_ #define JEMALLOC_DEFS_H_
/*
* jemalloc version string.
*/
#undef JEMALLOC_VERSION
/* /*
* If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed. * If JEMALLOC_PREFIX is defined, it will cause all public APIs to be prefixed.
* This makes it possible, with some care, to use multiple allocators * This makes it possible, with some care, to use multiple allocators