chiark / gitweb /
Fix C%d[%d] messages
[inn-innduct.git] / support / mksystem
1 #! /bin/sh
2
3 ##  $Id: mksystem 6397 2003-07-12 19:14:58Z rra $
4 ##
5 ##  Create include/inn/system.h from include/config.h.
6 ##
7 ##  include/config.h is generated by autoconf and contains all of the test
8 ##  results for a platform.  Most of these are only used when building INN,
9 ##  but some of them are needed for various definitions in the header files
10 ##  for INN's libraries.  We want to be able to install those header files
11 ##  and their prerequisites, but we don't want to define the normal symbols
12 ##  defined by autoconf since they're too likely to conflict with other
13 ##  packages.
14 ##
15 ##  This script takes the path to awk as its first argument and the path to
16 ##  include/config.h as its second argument and generates a file suitable
17 ##  for being included as <inn/system.h>.  It contains only the autoconf
18 ##  results needed for INN's API, and the symbols that might conflict with
19 ##  autoconf results in other packages have INN_ prepended.
20
21 cat <<EOF
22 /* Automatically generated by mksystem from config.h; do not edit. */
23
24 /* This header contains information obtained by INN at configure time that
25    is needed by INN headers.  Autoconf results that may conflict with the
26    autoconf results of another package have INN_ prepended to the
27    preprocessor symbols. */
28
29 #ifndef INN_SYSTEM_H
30 #define INN_SYSTEM_H 1
31
32 EOF
33
34 $1 '
35
36 /^#define HAVE_C99_VAMACROS/    { print save $1 " INN_" $2 " " $3 "\n" }
37 /^#define HAVE_GNU_VAMACROS/    { print save $1 " INN_" $2 " " $3 "\n" }
38 /^#define HAVE_INTTYPES_H/      { print save $1 " INN_" $2 " " $3 "\n" }
39 /^#define HAVE_MSYNC_3_ARG/     { print save $1 " INN_" $2 " " $3 "\n" }
40 /^#define HAVE_STDBOOL_H/       { print save $1 " INN_" $2 " " $3 "\n" }
41 /^#define HAVE_SYS_BITTYPES_H/  { print save $1 " INN_" $2 " " $3 "\n" }
42
43 { save = $0 "\n" }' $2
44
45 cat <<EOF
46 #endif /* INN_SYSTEM_H */
47 EOF