summaryrefslogtreecommitdiffstats
path: root/src/spdk/dpdk/buildtools/gen-pmdinfo-cfile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/spdk/dpdk/buildtools/gen-pmdinfo-cfile.sh')
-rwxr-xr-xsrc/spdk/dpdk/buildtools/gen-pmdinfo-cfile.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/spdk/dpdk/buildtools/gen-pmdinfo-cfile.sh b/src/spdk/dpdk/buildtools/gen-pmdinfo-cfile.sh
new file mode 100755
index 000000000..43059cf36
--- /dev/null
+++ b/src/spdk/dpdk/buildtools/gen-pmdinfo-cfile.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright(c) 2017 Intel Corporation
+
+arfile=$1
+output=$2
+pmdinfogen=$3
+
+# The generated file must not be empty if compiled in pedantic mode
+echo 'static __attribute__((unused)) const char *generator = "'$0'";' > $output
+for ofile in `ar t $arfile` ; do
+ ar p $arfile $ofile | $pmdinfogen - - >> $output 2> /dev/null
+done
+exit 0