summaryrefslogtreecommitdiff
path: root/dist/s_win
blob: cdfc71a8a1e94aa1513e278e97402413f423f3bd (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh

t=__wt.$$
trap 'rm -f $t' 0 1 2 3 13 15

# Insulate against locale-specific sort order
LC_ALL=C
export LC_ALL

win_config()
{
	f='../build_win/wiredtiger_config.h'
	egrep '#define|#undef' \
	    ../build_posix/config.hin $f |
	    sed 's/^.*#//' |
	    awk '{print $2}' |
	    egrep -v '^(LT_OBJDIR|PACKAGE|VERSION)' |
	    sort | uniq -u > $t

	test -s $t && {
		echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
		echo "Windows #defines missing from $f"
		echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="
		cat $t
		exit 1
	}
}

win_export()
{
	# Build the Windows list of exported symbols.
	f='../build_win/wiredtiger.def'
	(echo 'LIBRARY WIREDTIGER'
	 echo 'EXPORTS'
	 sed -e '/^$/d' \
	     -e '/^#/d' \
	     -e 's/^/    /') < s_export.list > $t
	 cmp $t $f > /dev/null 2>&1 ||
	     (echo "Building $f" && rm -f $f && cp $t $f)
}

win_filelist()
{
	f='../build_win/filelist.win'

	# Process the files for which there's a Windows-specific version, then
	# append Windows-only files. (There aren't yet any POSIX-only files.)
	(sed \
	    -e 's;os_posix/os_dir.c;os_win/os_dir.c;' \
	    -e 's;os_posix/os_dlopen.c;os_win/os_dlopen.c;' \
	    -e 's;os_posix/os_dlopen.c;os_win/os_dlopen.c;' \
	    -e 's;os_posix/os_dlopen.c;os_win/os_dlopen.c;' \
	    -e 's;os_posix/os_errno.c;os_win/os_errno.c;' \
	    -e 's;os_posix/os_exist.c;os_win/os_exist.c;' \
	    -e 's;os_posix/os_fallocate.c;os_win/os_fallocate.c;' \
	    -e 's;os_posix/os_filesize.c;os_win/os_filesize.c;' \
	    -e 's;os_posix/os_flock.c;os_win/os_flock.c;' \
	    -e 's;os_posix/os_fsync.c;os_win/os_fsync.c;' \
	    -e 's;os_posix/os_ftruncate.c;os_win/os_ftruncate.c;' \
	    -e 's;os_posix/os_getenv.c;os_win/os_getenv.c;' \
	    -e 's;os_posix/os_map.c;os_win/os_map.c;' \
	    -e 's;os_posix/os_mtx_cond.c;os_win/os_mtx_cond.c;' \
	    -e 's;os_posix/os_once.c;os_win/os_once.c;' \
	    -e 's;os_posix/os_open.c;os_win/os_open.c;' \
	    -e 's;os_posix/os_path.c;os_win/os_path.c;' \
	    -e 's;os_posix/os_priv.c;os_win/os_priv.c;' \
	    -e 's;os_posix/os_remove.c;os_win/os_remove.c;' \
	    -e 's;os_posix/os_rename.c;os_win/os_rename.c;' \
	    -e 's;os_posix/os_rw.c;os_win/os_rw.c;' \
	    -e 's;os_posix/os_sleep.c;os_win/os_sleep.c;' \
	    -e 's;os_posix/os_thread.c;os_win/os_thread.c;' \
	    -e 's;os_posix/os_time.c;os_win/os_time.c;' \
	    -e 's;os_posix/os_yield.c;os_win/os_yield.c;'
	 echo 'src/os_win/os_snprintf.c'
	 echo 'src/os_win/os_vsnprintf.c') < filelist | sort > $t
	 cmp $t $f > /dev/null 2>&1 ||
	     (echo "Building $f" && rm -f $f && cp $t $f)
}

win_config
win_export
win_filelist

exit 0