summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2016-04-17 16:54:05 -0700
committerMichael Forney <mforney@mforney.org>2016-04-17 16:54:05 -0700
commita8b545ba2b29b7ad7f53c6d88655ac442bde6732 (patch)
treeaf8af49e52b1d0be5b5e1e223482ee31df245c28
parent952273f03475fe277c00bd2ea6efbc541e5bcfef (diff)
file: Add config.h rather than using flags
-rw-r--r--core/file/config.h32
-rw-r--r--core/file/gen.rc64
2 files changed, 35 insertions, 61 deletions
diff --git a/core/file/config.h b/core/file/config.h
new file mode 100644
index 00000000..eaaeb8ac
--- /dev/null
+++ b/core/file/config.h
@@ -0,0 +1,32 @@
+#include <config-posix.h>
+
+/* features */
+#define BUILTIN_ELF 1
+#define ELFCORE 1
+#define HAVE_ZLIB_H 1
+
+/* headers */
+#define HAVE_ERR_H 1
+#define HAVE_GETOPT_H 1
+/* #undef HAVE_NBTOOL_CONFIG_H */
+/* #undef HAVE_XLOCALE_H */
+
+/* types */
+#define HAVE_SIG_T 1
+#define HAVE_STRUCT_OPTION 1
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+#define HAVE_STRUCT_TM_TM_ZONE 1
+
+/* functions */
+#define HAVE_ASPRINTF 1
+#define HAVE_GETOPT_LONG 1
+#define HAVE_STRCASESTR 1
+#define HAVE_STRLCAT 1
+#define HAVE_STRLCPY 1
+#define HAVE_VASPRINTF 1
+/* #undef HAVE_FMTCHECK */
+
+/* misc */
+#define HAVE_VISIBILITY 1
+#define MAJOR_IN_SYSMACROS 1
+/* #undef HAVE_DECL_OPTRESET */
diff --git a/core/file/gen.rc b/core/file/gen.rc
index d6205cd9..bd1368d8 100644
--- a/core/file/gen.rc
+++ b/core/file/gen.rc
@@ -1,73 +1,15 @@
version=5.25
cflags\
- -DHAVE_ASCTIME_R'='1\
- -DHAVE_CTIME_R'='1\
- -DHAVE_FORK'='1\
- -DHAVE_FREELOCALE'='1\
- -DHAVE_GETLINE'='1\
- -DHAVE_GETOPT_H'='1\
- -DHAVE_GMTIME_R'='1\
- -DHAVE_INTTYPES_H'='1\
- -DHAVE_LIMITS_H'='1\
- -DHAVE_LOCALE_H'='1\
- -DHAVE_LOCALTIME_R'='1\
- -DHAVE_MBRTOWC'='1\
- -DHAVE_MBSTATE_T'='1\
- -DHAVE_MKOSTEMP'='1\
- -DHAVE_MKSTEMP'='1\
- -DHAVE_MMAP'='1\
- -DHAVE_NEWLOCALE'='1\
- -DHAVE_PREAD'='1\
- -DHAVE_SIGNAL_H'='1\
- -DHAVE_STDDEF_H'='1\
- -DHAVE_STDINT_H'='1\
- -DHAVE_STDLIB_H'='1\
- -DHAVE_STRERROR'='1\
- -DHAVE_STRINGS_H'='1\
- -DHAVE_STRING_H'='1\
- -DHAVE_STRNDUP'='1\
- -DHAVE_STRTOF'='1\
- -DHAVE_STRTOUL'='1\
- -DHAVE_STRUCT_OPTION'='1\
- -DHAVE_STRUCT_STAT_ST_RDEV'='1\
- -DHAVE_STRUCT_TM_TM_GMTOFF'='1\
- -DHAVE_STRUCT_TM_TM_ZONE'='1\
- -DHAVE_SYS_MMAN_H'='1\
- -DHAVE_SYS_TIME_H'='1\
- -DHAVE_SYS_WAIT_H'='1\
- -DHAVE_UNISTD_H'='1\
- -DHAVE_USELOCALE'='1\
- -DHAVE_UTIME'='1\
- -DHAVE_UTIMES'='1\
- -DHAVE_UTIME_H'='1\
- -DHAVE_WCHAR_H'='1\
- -DHAVE_WCTYPE_H'='1\
- -DHAVE_WCWIDTH'='1\
- -DHAVE_ZLIB_H'='1\
- \
- -DHAVE_ASPRINTF'='1\
- -DHAVE_GETOPT_LONG'='1\
- -DHAVE_MEMORY_H'='1\
- -DHAVE_SIG_T'='1\
- -DHAVE_STRCASESTR'='1\
- -DHAVE_STRLCAT'='1\
- -DHAVE_STRLCPY'='1\
- -DHAVE_VASPRINTF'='1\
- -DHAVE_VISIBILITY'='1\
- \
- -DBUILTIN_ELF'='1\
- -DELFCORE'='1\
+ -DHAVE_CONFIG_H\
-DVERSION'='\"$version\"\
-DMAGIC'='\"/share/file/magic\"\
-D_GNU_SOURCE\
-Wall\
+ -I include\
-I core/zlib/include\
+ -I '$dir' \
-I '$outdir'/include
-# TODO: check for visibility, xlocale.h, memory.h, vasprintf, asprintf,
-# strlcpy, strlcat, strcasestr, fmtcheck, getopt_long, sig_t, tm_zone,
-# tm_gmtoff
-
cd magic
magic_outs=magic/^(Header Localstuff)
for(src in Header Localstuff) build '$outdir'/magic/$src copy '$srcdir'/magic/$src