cDetect | Feature Detection for C/C++ Projects |
cDetect is a tool to help you port software to different platforms.
cDetect detects the existence of features and tools at built-time.
cDetect only needs an ANSI C compiler to run.
All your customized detection code is written in ANSI C.
The following code
#include "cdetect.c" int main(int argc, char *argv[]) { config_begin(); if (config_options(argc, argv)) { config_check_compiler(); config_check_kernel(); config_check_cpu(); config_check_type("long long"); if (config_check_header("stdio.h")) { config_check_function("snprintf"); config_check_function("vsnprintf"); config_check_function("asprintf"); config_check_function("vasprintf"); } } config_end(); return 0; }
produces the following output
/* Autogenerated by cDetect 0.1.9 -- http://cdetect.sourceforge.net/ */ #ifndef CDETECT_H_INCLUDE_GUARD #define CDETECT_H_INCLUDE_GUARD #define CDETECT_COMPILER_GCC 0x3020002 #define CDETECT_KERNEL_LINUX 0x2040014 #define CDETECT_CPU_X86 0x3000000 #define CDETECT_HEADER_STDIO_H 1 #define CDETECT_TYPE_LONG_LONG 1 #define CDETECT_FUNC_SNPRINTF 1 #define CDETECT_FUNC_VSNPRINTF 1 #define CDETECT_FUNC_ASPRINTF 1 #define CDETECT_FUNC_VASPRINTF 1 #endif /* CDETECT_H_INCLUDE_GUARD */
or, if running in GNU Autoconf emulation mode
/* Autogenerated by cDetect 0.1.9 -- http://cdetect.sourceforge.net/ */ #define CDETECT_COMPILER_GCC 0x3020002 #define CDETECT_KERNEL_LINUX 0x2040014 #define CDETECT_CPU_X86 0x3000000 #define HAVE_STDIO_H 1 #define HAVE_LONG_LONG 1 #define HAVE_SNPRINTF 1 #define HAVE_VSNPRINTF 1 #define HAVE_ASPRINTF 1 #define HAVE_VASPRINTF 1
Copyright © 2006 Bjørn Reese