From: Thomas Monjalon Date: Thu, 14 Nov 2013 21:26:30 +0000 (+0100) Subject: app/test: fix build without librte_cmdline X-Git-Tag: spdx-start~10925 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=21a7f4e264;p=dpdk.git app/test: fix build without librte_cmdline Some features are not available if LIBRTE_CMDLINE is disabled: - interactive commands - cmdline tests Remove also cmdline_parse includes which are not needed. Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz --- diff --git a/app/test/Makefile b/app/test/Makefile index 55c391bbe9..28f1f62ed7 100644 --- a/app/test/Makefile +++ b/app/test/Makefile @@ -39,7 +39,7 @@ APP = test # # all sources are stored in SRCS-y # -SRCS-$(CONFIG_RTE_APP_TEST) := commands.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) := commands.c SRCS-$(CONFIG_RTE_APP_TEST) += test.c SRCS-$(CONFIG_RTE_APP_TEST) += test_pci.c SRCS-$(CONFIG_RTE_APP_TEST) += test_prefetch.c @@ -78,13 +78,13 @@ SRCS-$(CONFIG_RTE_APP_TEST) += test_version.c SRCS-$(CONFIG_RTE_APP_TEST) += test_eal_fs.c SRCS-$(CONFIG_RTE_APP_TEST) += test_func_reentrancy.c SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_num.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_etheraddr.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_portlist.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_ipaddr.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_cirbuf.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_string.c -SRCS-$(CONFIG_RTE_APP_TEST) += test_cmdline_lib.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_num.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_etheraddr.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_portlist.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_ipaddr.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_cirbuf.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_string.c +SRCS-$(CONFIG_RTE_LIBRTE_CMDLINE) += test_cmdline_lib.c SRCS-$(CONFIG_RTE_APP_TEST) += test_red.c SRCS-$(CONFIG_RTE_APP_TEST) += test_sched.c SRCS-$(CONFIG_RTE_APP_TEST) += test_meter.c diff --git a/app/test/test.c b/app/test/test.c index 59fcc9d245..079d5c1d80 100644 --- a/app/test/test.c +++ b/app/test/test.c @@ -41,10 +41,13 @@ #include #include +#ifdef RTE_LIBRTE_CMDLINE #include #include #include #include +extern cmdline_parse_ctx_t main_ctx[]; +#endif #include #include @@ -109,7 +112,9 @@ do_recursive_call(void) int main(int argc, char **argv) { +#ifdef RTE_LIBRTE_CMDLINE struct cmdline *cl; +#endif int ret; ret = rte_eal_init(argc, argv); @@ -136,13 +141,14 @@ main(int argc, char **argv) "HPET is not enabled, using TSC as default timer\n"); - +#ifdef RTE_LIBRTE_CMDLINE cl = cmdline_stdin_new(main_ctx, "RTE>>"); if (cl == NULL) { return -1; } cmdline_interact(cl); cmdline_stdin_exit(cl); +#endif return 0; } diff --git a/app/test/test.h b/app/test/test.h index 0e029009b1..bc001b9d7a 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -43,10 +43,6 @@ extern const char *prgname; -#include - -extern cmdline_parse_ctx_t main_ctx[]; - int main(int argc, char **argv); int test_pci(void); diff --git a/app/test/test_acl.c b/app/test/test_acl.c index 2c84329f36..790cdf3da8 100644 --- a/app/test/test_acl.c +++ b/app/test/test_acl.c @@ -34,8 +34,6 @@ #include #include -#include - #include "test.h" #ifdef RTE_LIBRTE_ACL diff --git a/app/test/test_alarm.c b/app/test/test_alarm.c index 06c68f4001..a2462ae5dd 100644 --- a/app/test/test_alarm.c +++ b/app/test/test_alarm.c @@ -34,8 +34,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c index 2d93a5f0f2..896a28b6ff 100644 --- a/app/test/test_atomic.c +++ b/app/test/test_atomic.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_byteorder.c b/app/test/test_byteorder.c index e5d1cd407d..598c5c2c3b 100644 --- a/app/test/test_byteorder.c +++ b/app/test/test_byteorder.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include "test.h" diff --git a/app/test/test_cmdline.c b/app/test/test_cmdline.c index 30366b5322..3df2d29582 100644 --- a/app/test/test_cmdline.c +++ b/app/test/test_cmdline.c @@ -33,14 +33,13 @@ #include -#include - #include "test.h" #include "test_cmdline.h" int test_cmdline(void) { +#ifdef CONFIG_RTE_LIBRTE_CMDLINE printf("Testind parsing ethernet addresses...\n"); if (test_parse_etheraddr_valid() < 0) return -1; @@ -88,6 +87,9 @@ test_cmdline(void) printf("Testing library functions...\n"); if (test_cmdline_lib() < 0) return -1; +#else + printf("The cmdline library is not included in this build\n"); +#endif return 0; } diff --git a/app/test/test_common.c b/app/test/test_common.c index 12be1f4732..3c9408d242 100644 --- a/app/test/test_common.c +++ b/app/test/test_common.c @@ -36,8 +36,6 @@ #include #include -#include - #include "test.h" #define MAX_NUM 1 << 20 diff --git a/app/test/test_cpuflags.c b/app/test/test_cpuflags.c index bf5e0f5bff..9cfbec6c22 100644 --- a/app/test/test_cpuflags.c +++ b/app/test/test_cpuflags.c @@ -33,7 +33,6 @@ #include -#include #include #include #include diff --git a/app/test/test_cycles.c b/app/test/test_cycles.c index e06aa064d5..db8e58de74 100644 --- a/app/test/test_cycles.c +++ b/app/test/test_cycles.c @@ -34,8 +34,6 @@ #include #include -#include - #include #include diff --git a/app/test/test_debug.c b/app/test/test_debug.c index 6fc3535f3f..ae7be52535 100644 --- a/app/test/test_debug.c +++ b/app/test/test_debug.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 0f373ef4b1..964a3a9bc4 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -32,8 +32,6 @@ */ #include -#include - #include "test.h" #ifndef RTE_EXEC_ENV_BAREMETAL diff --git a/app/test/test_eal_fs.c b/app/test/test_eal_fs.c index 93d8a7fcfd..0a7524df51 100644 --- a/app/test/test_eal_fs.c +++ b/app/test/test_eal_fs.c @@ -31,8 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include - #include "test.h" #ifndef RTE_EXEC_ENV_BAREMETAL #include diff --git a/app/test/test_errno.c b/app/test/test_errno.c index 24065e5b0d..5ebc8aba9d 100644 --- a/app/test/test_errno.c +++ b/app/test/test_errno.c @@ -40,8 +40,6 @@ #include #include -#include - #include "test.h" int diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c index c12167bf53..367050ab71 100644 --- a/app/test/test_func_reentrancy.c +++ b/app/test/test_func_reentrancy.c @@ -70,8 +70,6 @@ #include -#include - #include "test.h" typedef int (*case_func_t)(void* arg); diff --git a/app/test/test_hash.c b/app/test/test_hash.c index 07fe60225a..df0afba491 100644 --- a/app/test/test_hash.c +++ b/app/test/test_hash.c @@ -49,7 +49,6 @@ #include #include #include -#include #include "test.h" diff --git a/app/test/test_hash_perf.c b/app/test/test_hash_perf.c index f4f291bd9b..a4f144b103 100644 --- a/app/test/test_hash_perf.c +++ b/app/test/test_hash_perf.c @@ -50,7 +50,6 @@ #include #include #include -#include #include "test.h" diff --git a/app/test/test_interrupts.c b/app/test/test_interrupts.c index 322c218d68..4563e2b0e5 100644 --- a/app/test/test_interrupts.c +++ b/app/test/test_interrupts.c @@ -35,8 +35,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_kni.c b/app/test/test_kni.c index cd87c3c069..e0fe44ef35 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -37,8 +37,6 @@ #include #include -#include - #include "test.h" #ifdef RTE_LIBRTE_KNI diff --git a/app/test/test_logs.c b/app/test/test_logs.c index 3d8105328c..057cdc6352 100644 --- a/app/test/test_logs.c +++ b/app/test/test_logs.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_lpm.c b/app/test/test_lpm.c index a274a11dde..ffed766401 100644 --- a/app/test/test_lpm.c +++ b/app/test/test_lpm.c @@ -36,7 +36,6 @@ #include #include #include -#include #include #include diff --git a/app/test/test_lpm6.c b/app/test/test_lpm6.c index 13ca59483f..151840d1ee 100644 --- a/app/test/test_lpm6.c +++ b/app/test/test_lpm6.c @@ -36,7 +36,6 @@ #include #include #include -#include #include diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c index e8d26e3bcd..887774e079 100644 --- a/app/test/test_malloc.c +++ b/app/test/test_malloc.c @@ -39,8 +39,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c index 25202a4f63..f4437340ea 100644 --- a/app/test/test_mbuf.c +++ b/app/test/test_mbuf.c @@ -60,8 +60,6 @@ #include #include -#include - #include "test.h" #define MBUF_SIZE 2048 diff --git a/app/test/test_memcpy.c b/app/test/test_memcpy.c index 75cd09ccd1..50b947890f 100644 --- a/app/test/test_memcpy.c +++ b/app/test/test_memcpy.c @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/app/test/test_memcpy_perf.c b/app/test/test_memcpy_perf.c index 9ebaa69292..f665387720 100644 --- a/app/test/test_memcpy_perf.c +++ b/app/test/test_memcpy_perf.c @@ -37,7 +37,6 @@ #include #include -#include #include #include #include diff --git a/app/test/test_memory.c b/app/test/test_memory.c index 164c58b2f3..a179fd6af8 100644 --- a/app/test/test_memory.c +++ b/app/test/test_memory.c @@ -34,8 +34,6 @@ #include #include -#include - #include #include diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index b948e30493..5f546de945 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -58,8 +58,6 @@ #include #include -#include - #include "test.h" /* diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c index 533f433461..86cba8ae7f 100644 --- a/app/test/test_mempool_perf.c +++ b/app/test/test_mempool_perf.c @@ -58,8 +58,6 @@ #include #include -#include - #include "test.h" /* diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c index cebe375d17..d87fcc01f2 100644 --- a/app/test/test_memzone.c +++ b/app/test/test_memzone.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_meter.c b/app/test/test_meter.c index bcc3c0f058..d52faa38de 100644 --- a/app/test/test_meter.c +++ b/app/test/test_meter.c @@ -37,8 +37,6 @@ #include #include -#include - #include "test.h" #ifdef RTE_LIBRTE_METER diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c index aceb56773e..2c916f633f 100644 --- a/app/test/test_mp_secondary.c +++ b/app/test/test_mp_secondary.c @@ -33,8 +33,6 @@ #include -#include - #include "test.h" #ifndef RTE_EXEC_ENV_BAREMETAL diff --git a/app/test/test_pci.c b/app/test/test_pci.c index 8fa041e05f..64b13c1120 100644 --- a/app/test/test_pci.c +++ b/app/test/test_pci.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include diff --git a/app/test/test_per_lcore.c b/app/test/test_per_lcore.c index 04b556739a..bd7b526cbf 100644 --- a/app/test/test_per_lcore.c +++ b/app/test/test_per_lcore.c @@ -35,8 +35,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_power.c b/app/test/test_power.c index 5bc90c821b..0b08fcead8 100644 --- a/app/test/test_power.c +++ b/app/test/test_power.c @@ -37,8 +37,6 @@ #include #include -#include - #include "test.h" #ifdef RTE_LIBRTE_POWER diff --git a/app/test/test_prefetch.c b/app/test/test_prefetch.c index 368853398b..f130f6e6fc 100644 --- a/app/test/test_prefetch.c +++ b/app/test/test_prefetch.c @@ -34,8 +34,6 @@ #include #include -#include - #include #include "test.h" diff --git a/app/test/test_red.c b/app/test/test_red.c index f394425f4f..bee490ed94 100644 --- a/app/test/test_red.c +++ b/app/test/test_red.c @@ -40,7 +40,6 @@ #include #include #include -#include #include "test.h" diff --git a/app/test/test_ring.c b/app/test/test_ring.c index 7112d2aa9e..be7eefc3fc 100644 --- a/app/test/test_ring.c +++ b/app/test/test_ring.c @@ -59,8 +59,6 @@ #include #include -#include - #include "test.h" /* diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c index 9bb0aebace..0e238c13e4 100644 --- a/app/test/test_ring_perf.c +++ b/app/test/test_ring_perf.c @@ -38,8 +38,6 @@ #include #include -#include - #include "test.h" /* diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c index 8d40f68a8c..a76ae5611c 100644 --- a/app/test/test_rwlock.c +++ b/app/test/test_rwlock.c @@ -36,8 +36,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_sched.c b/app/test/test_sched.c index 3b7cd5ebda..0de5b1c6a6 100644 --- a/app/test/test_sched.c +++ b/app/test/test_sched.c @@ -37,8 +37,6 @@ #include #include -#include - #include "test.h" #if defined(RTE_LIBRTE_SCHED) && defined(RTE_ARCH_X86_64) diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c index fb148cb86e..ffeebf7fc2 100644 --- a/app/test/test_spinlock.c +++ b/app/test/test_spinlock.c @@ -38,8 +38,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_string_fns.c b/app/test/test_string_fns.c index 42a23d19fb..1a7b024010 100644 --- a/app/test/test_string_fns.c +++ b/app/test/test_string_fns.c @@ -39,8 +39,6 @@ #include -#include - #include "test.h" #define LOG(...) do {\ diff --git a/app/test/test_tailq.c b/app/test/test_tailq.c index ee380fd06e..663d9fbcf4 100644 --- a/app/test/test_tailq.c +++ b/app/test/test_tailq.c @@ -37,8 +37,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_timer.c b/app/test/test_timer.c index 3945ed8ebf..38c1218a40 100644 --- a/app/test/test_timer.c +++ b/app/test/test_timer.c @@ -124,8 +124,6 @@ #include #include -#include - #include #include #include diff --git a/app/test/test_version.c b/app/test/test_version.c index 1973b3c6e6..83474ec142 100644 --- a/app/test/test_version.c +++ b/app/test/test_version.c @@ -35,8 +35,6 @@ #include #include -#include - #include #include