#!/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