summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xextras/scripts/build_static_vppctl.sh7
-rw-r--r--src/vppinfra/clib.h3
-rw-r--r--src/vppinfra/vec.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/extras/scripts/build_static_vppctl.sh b/extras/scripts/build_static_vppctl.sh
index 1c09055492c..7ed2be24e82 100755
--- a/extras/scripts/build_static_vppctl.sh
+++ b/extras/scripts/build_static_vppctl.sh
@@ -1,16 +1,12 @@
#/bin/env bash
src=$(realpath $(dirname $0)/../..)/src
-tmp=$(mktemp -d)
-mkdir ${tmp}/vppinfra
-touch ${tmp}/vppinfra/config.h
${CC:-cc} \
-O2 \
-flto \
-static \
-I ${src} \
- -I ${tmp} \
${src}/vppinfra/backtrace.c \
${src}/vppinfra/dlmalloc.c \
${src}/vppinfra/elf.c \
@@ -29,6 +25,3 @@ ${CC:-cc} \
${src}/vppinfra/linux/mem.c \
${src}/vpp/app/vppctl.c \
-o vppctl
-
-rm ${tmp}/vppinfra/config.h
-rmdir ${tmp}/vppinfra ${tmp}
diff --git a/src/vppinfra/clib.h b/src/vppinfra/clib.h
index 7cdf4a41aaa..ade7e5fa4bb 100644
--- a/src/vppinfra/clib.h
+++ b/src/vppinfra/clib.h
@@ -39,7 +39,10 @@
#define included_clib_h
#include <stddef.h>
+
+#if __has_include(<vppinfra/config.h>)
#include <vppinfra/config.h>
+#endif
#ifdef __x86_64__
#include <x86intrin.h>
diff --git a/src/vppinfra/vec.c b/src/vppinfra/vec.c
index e98b5825156..970f7f7bfa8 100644
--- a/src/vppinfra/vec.c
+++ b/src/vppinfra/vec.c
@@ -38,6 +38,10 @@
#include <vppinfra/vec.h>
#include <vppinfra/mem.h>
+#ifndef CLIB_VECTOR_GROW_BY_ONE
+#define CLIB_VECTOR_GROW_BY_ONE 0
+#endif
+
/* Vector resize operator. Called as needed by various macros such as
vec_add1() when we need to allocate memory. */
__clib_export void *