Fixed missing 'GNOME_VFS_OPEN_RANDOM' for the HTTP cabinets reading.
[captive.git] / src / w32-mod / ext2fsd.so-build.sh
1 #! /bin/sh
2 # $Id$
3 # Compile Ext2fsd by GCC in UNIX system as symbol-featured debuggable .so
4 # Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; exactly version 2 of June 1991 is required
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
20 (
21         # Microsoft Windows XP DDK include files directory:
22         INC=$HOME/.w32-inc/
23         TARGET=./ext2fsd.so
24
25         set -ex
26         rm -f _all.c
27         c=`echo *.c`
28         # Force <ntifs.h> to by considered system header file:
29         echo '#include <ntifs.h>' >>_all.c
30         echo '#define InterlockedDecrement(Addend) (InterlockedExchangeAdd((Addend),-1)-1)' >>_all.c
31         echo '#define InterlockedExchangeAdd(Addend,Incr) ({ LONG _IEA_r=*(Addend); *(Addend)+=(Incr); _IEA_r; })' >>_all.c
32         for i in $c;do
33                 echo '#include "'"$i"'"' >>_all.c
34                 done
35         touch pshpack1.h poppack.h pshpack4.h
36         gcc -shared -o"$TARGET" -ggdb3 -Wall -fshort-wchar \
37                         -DDBG -D_MSC_VER=1300 -D_MSC_FULL_VER=13009038 -D_WIN32 -D_NTSYSTEM_ \
38                         -D__cdecl="" -D__stdcall="" -D__fastcall="" -D_fastcall="" \
39                         -D__int64="long long" -D_W64="" -D_M_IX86 -D_X86_ \
40                         -D'__declspec(x)'="" -D__forceinline="" -D__noop="" \
41                         -D__try="" -D"__finally"="label_finally:" \
42                         -D'__except(x)'="if (0)" -D"__leave"="goto label_finally" \
43                         -D_INTEGRAL_MAX_BITS=64 -D_WIN32_WINNT=0x0501 \
44                         -D__int8="char" -D__int16="short" -D__int32="int" \
45                         `for i in . $INC/{crt,ddk/wxp,wxp};do echo -isystem $i;done` \
46                         _all.c
47         #rm -f _all.c
48         echo ok
49         ) 2>&1 |grep -v ' warning: \| In function \|At top level:' #|less