File: check-win32

package info (click to toggle)
zzuf 0.15-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,500 kB
  • sloc: ansic: 7,284; sh: 581; cpp: 352; makefile: 80
file content (41 lines) | stat: -rwxr-xr-x 1,037 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh
#
#  check-win32 - ensure msvc/config.h is in sync with the autotools version
#
#  Copyright © 2002—2015 Sam Hocevar <sam@hocevar.net>
#
#  This program is free software. It comes without any warranty, to
#  the extent permitted by applicable law. You can redistribute it
#  and/or modify it under the terms of the Do What the Fuck You Want
#  to Public License, Version 2, as published by the WTFPL Task Force.
#  See http://www.wtfpl.net/ for more details.
#

ret=0

#
# Check that the Win32 config.h is in sync with config.h.in
#

config_h_in=$(dirname "$0")/../config.h.in
win32_config_h=$(dirname "$0")/../msvc/config.h

nfails=0
ntokens=0
for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in");
do
  ntokens=$(($ntokens + 1))
  if ! grep '[ef] \<'"$key"'\>' "$win32_config_h" >/dev/null 2>&1; then
    echo "error: $key missing from msvc/config.h"
    nfails=$(($nfails + 1))
  fi
done

echo "$ntokens tokens, $nfails errors in Win32 config.h"

if test "$nfails" != "0"; then
  exit 1
fi

exit 0