~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/dist/s_win32

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -
 
2
#       $Id: s_win32,v 1.14 2001/05/27 14:08:20 bostic Exp $
 
3
#
 
4
# Build Windows/32 include files.
 
5
 
 
6
msgc="/* DO NOT EDIT: automatically built by dist/s_win32. */"
 
7
 
 
8
. RELEASE
 
9
 
 
10
s=/tmp/__db_a$$
 
11
t=/tmp/__db_b$$
 
12
rm -f $s $t
 
13
 
 
14
trap 'rm -f $s $t ; exit 1' 1 2 3 13 15
 
15
 
 
16
f=../build_win32/db.h
 
17
cat <<ENDOFSEDTEXT > $s
 
18
s/@u_int8_decl@/typedef unsigned char u_int8_t;/
 
19
s/@int16_decl@/typedef short int16_t;/
 
20
s/@u_int16_decl@/typedef unsigned short u_int16_t;/
 
21
s/@int32_decl@/typedef int int32_t;/
 
22
s/@u_int32_decl@/typedef unsigned int u_int32_t;/
 
23
/@u_char_decl@/{
 
24
        i\\
 
25
        #if !defined(_WINSOCKAPI_)
 
26
        s/@u_char_decl@/typedef unsigned char u_char;/
 
27
}
 
28
s/@u_short_decl@/typedef unsigned short u_short;/
 
29
s/@u_int_decl@/typedef unsigned int u_int;/
 
30
/@u_long_decl@/{
 
31
        s/@u_long_decl@/typedef unsigned long u_long;/
 
32
        a\\
 
33
        #endif
 
34
}
 
35
/@ssize_t_decl@/{
 
36
        i\\
 
37
        #if defined(_WIN64) || defined(_M_ALPHA)\\
 
38
        typedef __int64 ssize_t;\\
 
39
        #else\\
 
40
        typedef int ssize_t;\\
 
41
        #endif
 
42
        d
 
43
}
 
44
s/@DB_VERSION_MAJOR@/$DB_VERSION_MAJOR/
 
45
s/@DB_VERSION_MINOR@/$DB_VERSION_MINOR/
 
46
s/@DB_VERSION_PATCH@/$DB_VERSION_PATCH/
 
47
s/@DB_VERSION_STRING@/"$DB_VERSION_STRING"/
 
48
ENDOFSEDTEXT
 
49
(echo "$msgc" &&
 
50
    sed -f $s ../include/db.in && 
 
51
    cat ../include_auto/rpc_defs.in &&
 
52
    cat ../include_auto/global_ext.in) > $t
 
53
cmp $t $f > /dev/null 2>&1 || 
 
54
    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
55
 
 
56
f=../build_win32/db_int.h
 
57
cat <<ENDOFSEDTEXT > $s
 
58
s/\(PATH_SEPARATOR[^"]*"\)\/"/\1\\\\\\\\\\/:\"/
 
59
s/@db_align_t_decl@/typedef unsigned long db_align_t;/
 
60
s/@db_alignp_t_decl@/typedef unsigned long db_alignp_t;/
 
61
ENDOFSEDTEXT
 
62
(echo "$msgc" && sed -f $s ../include/db_int.in) > $t
 
63
cmp $t $f > /dev/null 2>&1 || 
 
64
    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
65
 
 
66
f=../build_win32/libdb.rc
 
67
cat <<ENDOFSEDTEXT > $s
 
68
s/%MAJOR%/$DB_VERSION_MAJOR/
 
69
s/%MINOR%/$DB_VERSION_MINOR/
 
70
s/%PATCH%/$DB_VERSION_PATCH/
 
71
ENDOFSEDTEXT
 
72
sed -f $s ../build_win32/libdbrc.src > $t
 
73
cmp $t $f > /dev/null 2>&1 || 
 
74
    (echo "Building $f" && rm -f $f && cp $t $f && chmod 444 $f)
 
75
 
 
76
rm -f $s $t