Add config option to use dlmalloc instead of mheap
[vpp.git] / src / vppinfra.am
index cb8748c..7641c71 100644 (file)
 
 lib_LTLIBRARIES += libvppinfra.la
 
+BUILT_SOURCES += vppinfra/config.h
+
+vppinfra/config.h:
+       @echo "/** Autogenerated by Autotools **/" > $@
+       @echo "#ifndef included_clib_config_h" >> $@
+       @echo "#define included_clib_config_h" >> $@
+       @echo "#ifndef CLIB_LOG2_CACHE_LINE_BYTES " >> $@
+       @echo "#define CLIB_LOG2_CACHE_LINE_BYTES " @LOG2_CACHE_LINE_BYTES@ >> $@
+       @echo "#endif " >> $@
+       @echo "#endif " >> $@
+
 TESTS = 
 
 if ENABLE_TESTS
@@ -24,6 +35,7 @@ TESTS  +=  test_bihash_template \
           test_elf \
           test_elog \
           test_fifo \
+          test_flowhash_template \
           test_format \
           test_fpool \
           test_hash \
@@ -31,7 +43,6 @@ TESTS  +=  test_bihash_template \
           test_longjmp \
           test_macros \
           test_maplog \
-          test_md5 \
           test_mheap \
           test_pool_iterate \
           test_ptclosure \
@@ -41,8 +52,10 @@ TESTS  +=  test_bihash_template \
           test_slist \
           test_socket \
           test_time \
+          test_time_range \
           test_timing_wheel \
           test_tw_timer \
+          test_valloc \
           test_vec \
           test_zvec
 endif
@@ -58,6 +71,7 @@ test_dlist_SOURCES = vppinfra/test_dlist.c
 test_elf_SOURCES = vppinfra/test_elf.c
 test_elog_SOURCES = vppinfra/test_elog.c
 test_fifo_SOURCES = vppinfra/test_fifo.c
+test_flowhash_template_SOURCES = vppinfra/test_flowhash_template.c
 test_format_SOURCES = vppinfra/test_format.c
 test_fpool_SOURCES = vppinfra/test_fpool.c
 test_hash_SOURCES = vppinfra/test_hash.c
@@ -65,7 +79,6 @@ test_heap_SOURCES = vppinfra/test_heap.c
 test_longjmp_SOURCES = vppinfra/test_longjmp.c
 test_macros_SOURCES = vppinfra/test_macros.c
 test_maplog_SOURCES = vppinfra/test_maplog.c
-test_md5_SOURCES = vppinfra/test_md5.c
 test_mheap_SOURCES = vppinfra/test_mheap.c
 test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
 test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
@@ -75,8 +88,10 @@ test_serialize_SOURCES = vppinfra/test_serialize.c
 test_slist_SOURCES = vppinfra/test_slist.c
 test_socket_SOURCES = vppinfra/test_socket.c
 test_time_SOURCES = vppinfra/test_time.c
+test_time_range_SOURCES = vppinfra/test_time_range.c
 test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
 test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
+test_valloc_SOURCES = vppinfra/test_valloc.c
 test_vec_SOURCES = vppinfra/test_vec.c
 test_zvec_SOURCES = vppinfra/test_zvec.c
 
@@ -90,6 +105,7 @@ test_dlist_CPPFLAGS =        $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_elf_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_elog_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_fifo_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
+test_flowhash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_format_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_fpool_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_hash_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
@@ -97,7 +113,6 @@ test_heap_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_longjmp_CPPFLAGS =        $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_macros_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_maplog_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
-test_md5_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_mheap_CPPFLAGS =  $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_pool_iterate_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_ptclosure_CPPFLAGS =      $(AM_CPPFLAGS) -DCLIB_DEBUG
@@ -109,6 +124,7 @@ test_socket_CPPFLAGS =      $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_time_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_tw_timer_CPPFLAGS =       $(AM_CPPFLAGS) -DCLIB_DEBUG
+test_valloc_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_vec_CPPFLAGS =    $(AM_CPPFLAGS) -DCLIB_DEBUG
 test_zvec_CPPFLAGS =   $(AM_CPPFLAGS) -DCLIB_DEBUG
 
@@ -120,6 +136,7 @@ test_dlist_LDADD =  libvppinfra.la
 test_elf_LDADD =       libvppinfra.la
 test_elog_LDADD =      libvppinfra.la
 test_fifo_LDADD =      libvppinfra.la
+test_flowhash_template_LDADD =  libvppinfra.la
 test_format_LDADD =    libvppinfra.la
 test_fpool_LDADD =     libvppinfra.la
 test_hash_LDADD =      libvppinfra.la
@@ -127,7 +144,6 @@ test_heap_LDADD =   libvppinfra.la
 test_longjmp_LDADD =   libvppinfra.la
 test_macros_LDADD =    libvppinfra.la
 test_maplog_LDADD =    libvppinfra.la
-test_md5_LDADD =       libvppinfra.la
 test_mheap_LDADD =     libvppinfra.la
 test_pool_iterate_LDADD =      libvppinfra.la
 test_ptclosure_LDADD = libvppinfra.la
@@ -137,8 +153,10 @@ test_serialize_LDADD =     libvppinfra.la
 test_slist_LDADD =     libvppinfra.la
 test_socket_LDADD =    libvppinfra.la
 test_time_LDADD =      libvppinfra.la -lm
+test_time_range_LDADD =        libvppinfra.la -lm
 test_timing_wheel_LDADD =      libvppinfra.la -lm
 test_tw_timer_LDADD =  libvppinfra.la
+test_valloc_LDADD =    libvppinfra.la
 test_vec_LDADD =       libvppinfra.la
 test_zvec_LDADD =      libvppinfra.la
 
@@ -150,6 +168,7 @@ test_dlist_LDFLAGS = -static
 test_elf_LDFLAGS = -static
 test_elog_LDFLAGS = -static
 test_fifo_LDFLAGS = -static
+test_flowhash_template_LDFLAGS = -static
 test_format_LDFLAGS = -static
 test_fpool_LDFLAGS = -static
 test_hash_LDFLAGS = -static
@@ -157,7 +176,6 @@ test_heap_LDFLAGS = -static
 test_longjmp_LDFLAGS = -static
 test_macros_LDFLAGS = -static
 test_maplog_LDFLAGS = -static
-test_md5_LDFLAGS = -static
 test_mheap_LDFLAGS = -static
 test_pool_iterate_LDFLAGS = -static
 test_ptclosure_LDFLAGS = -static
@@ -167,8 +185,10 @@ test_serialize_LDFLAGS = -static
 test_slist_LDFLAGS = -static
 test_socket_LDFLAGS = -static
 test_time_LDFLAGS = -static
+test_time_range_LDFLAGS = -static
 test_timing_wheel_LDFLAGS = -static
 test_tw_timer_LDFLAGS = -static
+test_valloc_LDFLAGS = -static
 test_vec_LDFLAGS = -static
 test_zvec_LDFLAGS = -static
 
@@ -185,6 +205,7 @@ nobase_include_HEADERS = \
   vppinfra/bihash_vec8_8.h \
   vppinfra/bihash_16_8.h \
   vppinfra/bihash_24_8.h \
+  vppinfra/bihash_40_8.h \
   vppinfra/bihash_48_8.h \
   vppinfra/bihash_template.h \
   vppinfra/bihash_template.c \
@@ -192,10 +213,12 @@ nobase_include_HEADERS = \
   vppinfra/bitops.h \
   vppinfra/byte_order.h \
   vppinfra/cache.h \
+  vppinfra/config.h \
   vppinfra/clib.h \
   vppinfra/clib_error.h \
   vppinfra/cpu.h \
   vppinfra/crc32.h \
+  vppinfra/lb_hash_hash.h \
   vppinfra/dlist.h \
   vppinfra/elf.h \
   vppinfra/elf_clib.h \
@@ -205,6 +228,9 @@ nobase_include_HEADERS = \
   vppinfra/error_bootstrap.h \
   vppinfra/fifo.h \
   vppinfra/file.h \
+  vppinfra/flowhash_template.h \
+  vppinfra/flowhash_8_8.h \
+  vppinfra/flowhash_24_16.h \
   vppinfra/format.h \
   vppinfra/graph.h \
   vppinfra/hash.h \
@@ -216,14 +242,12 @@ nobase_include_HEADERS = \
   vppinfra/macros.h \
   vppinfra/maplog.h \
   vppinfra/math.h \
-  vppinfra/md5.h \
   vppinfra/mem.h \
   vppinfra/memcpy_sse3.h \
   vppinfra/memcpy_avx2.h \
   vppinfra/memcpy_avx512.h \
   vppinfra/mhash.h \
   vppinfra/mheap.h \
-  vppinfra/mheap_bootstrap.h \
   vppinfra/os.h \
   vppinfra/pipeline.h \
   vppinfra/pool.h \
@@ -238,6 +262,7 @@ nobase_include_HEADERS = \
   vppinfra/sparse_vec.h \
   vppinfra/string.h \
   vppinfra/time.h \
+  vppinfra/time_range.h \
   vppinfra/timing_wheel.h \
   vppinfra/timer.h \
   vppinfra/tw_timer_2t_1w_2048sl.h \
@@ -249,19 +274,29 @@ nobase_include_HEADERS = \
   vppinfra/tw_timer_template.c \
   vppinfra/types.h \
   vppinfra/unix.h \
+  vppinfra/valloc.h \
   vppinfra/vec.h \
   vppinfra/vec_bootstrap.h \
   vppinfra/vector.h \
   vppinfra/vector_altivec.h \
+  vppinfra/vector_avx2.h \
+  vppinfra/vector_avx512.h \
   vppinfra/vector_funcs.h \
-  vppinfra/vector_iwmmxt.h \
   vppinfra/vector_neon.h \
-  vppinfra/vector_sse2.h \
+  vppinfra/vector_sse42.h \
   vppinfra/valgrind.h \
   vppinfra/xxhash.h \
   vppinfra/xy.h \
   vppinfra/zvec.h
 
+if ENABLE_DLMALLOC
+  nobase_include_HEADERS += \
+  vppinfra/dlmalloc.h
+else
+  nobase_include_HEADERS +=  \
+  vppinfra/mheap_bootstrap.h 
+endif
+
 CLIB_CORE = \
   vppinfra/asm_x86.c \
   vppinfra/backtrace.c \
@@ -275,6 +310,9 @@ CLIB_CORE = \
   vppinfra/error.c \
   vppinfra/fifo.c \
   vppinfra/fheap.c \
+  vppinfra/flowhash_8_8.h \
+  vppinfra/flowhash_24_16.h \
+  vppinfra/flowhash_template.h \
   vppinfra/format.c \
   vppinfra/pool.c \
   vppinfra/graph.c \
@@ -283,9 +321,6 @@ CLIB_CORE = \
   vppinfra/longjmp.S \
   vppinfra/macros.c \
   vppinfra/mhash.c \
-  vppinfra/mheap.c \
-  vppinfra/md5.c \
-  vppinfra/mem_mheap.c \
   vppinfra/ptclosure.c \
   vppinfra/random.c \
   vppinfra/random_buffer.c \
@@ -295,6 +330,7 @@ CLIB_CORE = \
   vppinfra/std-formats.c \
   vppinfra/string.c \
   vppinfra/time.c \
+  vppinfra/time_range.c \
   vppinfra/timing_wheel.c \
   vppinfra/tw_timer_template.h \
   vppinfra/tw_timer_2t_1w_2048sl.h \
@@ -308,10 +344,22 @@ CLIB_CORE = \
   vppinfra/tw_timer_1t_3w_1024sl_ov.h \
   vppinfra/tw_timer_1t_3w_1024sl_ov.c \
   vppinfra/unformat.c \
+  vppinfra/valloc.c \
   vppinfra/vec.c \
   vppinfra/vector.c \
   vppinfra/zvec.c
 
+if ENABLE_DLMALLOC
+  CLIB_CORE += \
+  vppinfra/mem_dlmalloc.c \
+  vppinfra/dlmalloc.c \
+  vppinfra/dlmalloc.h
+else
+  CLIB_CORE += \
+  vppinfra/mheap.c \
+  vppinfra/mem_mheap.c 
+endif
+
 # Core plus Unix additions
 libvppinfra_la_SOURCES =                       \
   $(CLIB_CORE)                                 \