Disable bundled getopt implementation and GNU extensions shim when
building in GNU environment.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Tested-by: William Tu <u9012063@gmail.com>
Tested-by: Pallavi Kadam <pallavi.kadam@intel.com>
Acked-by: Pallavi Kadam <pallavi.kadam@intel.com>
if cc.has_function('getentropy', prefix : '#include <unistd.h>')
cflags += '-DRTE_LIBEAL_USE_GETENTROPY'
endif
+if cc.has_header('getopt.h')
+ cflags += ['-DHAVE_GETOPT_H', '-DHAVE_GETOPT', '-DHAVE_GETOPT_LONG']
+endif
sources = common_sources + env_sources
objs = common_objs + env_objs
headers = common_headers + env_headers
* Copyright(c) 2019 Intel Corporation
*/
-#include <sys/stat.h>
-#include <io.h>
#include <fcntl.h>
+#include <io.h>
+#include <share.h>
+#include <sys/stat.h>
+
#include <rte_debug.h>
#include <rte_eal.h>
#include <eal_memcfg.h>
#ifndef NEED_USUAL_GETOPT
/* Use system getopt */
+#ifdef RTE_TOOLCHAIN_GCC
+#include_next <getopt.h>
+#else
#include <getopt.h>
+#endif
#else /* NEED_USUAL_GETOPT */
*/
void eal_create_cpu_map(void);
+#ifndef RTE_TOOLCHAIN_GCC
static inline int
asprintf(char **buffer, const char *format, ...)
{
}
return ret;
}
+#endif /* RTE_TOOLCHAIN_GCC */
/* cpu_set macros implementation */
#define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)