2017-12-19 01:15:38 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
WINE_DIR=$1
|
|
|
|
|
|
|
|
if test -z $WINE_DIR; then
|
|
|
|
echo "Usage: wine-impot.sh wine_dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
import_header() {
|
|
|
|
dstfile=$2/$1
|
|
|
|
srcfile=$WINE_DIR/include/$1
|
|
|
|
rm -f $dstfile
|
|
|
|
unicode_fix=
|
|
|
|
if test -n "$(grep WINELIB_NAME_AW\\\|DECL_WINELIB_TYPE_AW $srcfile)"; then
|
|
|
|
unicode_fix="yes"
|
|
|
|
echo '#include <_mingw_unicode.h>' >>$dstfile
|
|
|
|
fi
|
|
|
|
if test -n "$(grep -w INTERFACE $srcfile)"; then
|
|
|
|
echo '#undef INTERFACE' >>$dstfile
|
|
|
|
fi
|
|
|
|
cat $srcfile >>$dstfile
|
|
|
|
if test -n "$(grep WINELIB_NAME_AW\\\|DECL_WINELIB_TYPE_AW $srcfile)"; then
|
|
|
|
sed -i 's/\bWINELIB_NAME_AW\b/__MINGW_NAME_AW/g' $dstfile
|
|
|
|
sed -i 's/\bDECL_WINELIB_TYPE_AW\b/__MINGW_TYPEDEF_AW/g' $dstfile
|
|
|
|
fi
|
|
|
|
sed -i 's/\bBOOL /WINBOOL /g' $dstfile
|
|
|
|
sed -i 's/\bBOOL\b/WINBOOL/g' $dstfile
|
|
|
|
sed -i 's/DECLSPEC_HIDDEN//g' $dstfile
|
|
|
|
}
|
|
|
|
|
|
|
|
import_idl() {
|
|
|
|
dstfile=$2/$1
|
|
|
|
srcfile=$WINE_DIR/include/$1
|
|
|
|
cp $srcfile $dstfile
|
|
|
|
|
|
|
|
# HACK:
|
|
|
|
sed -i 's/cpp_quote\(.*\)\bBOOL\b/cpp_quote\1WINBOOL/' $dstfile
|
|
|
|
sed -i 's/cpp_quote\(.*\)\bBOOL\b/cpp_quote\1WINBOOL/' $dstfile
|
|
|
|
sed -i 's/cpp_quote\(.*\)\bBOOL\b/cpp_quote\1WINBOOL/' $dstfile
|
|
|
|
}
|
|
|
|
|
|
|
|
# headers
|
|
|
|
for f in \
|
|
|
|
amaudio.h \
|
|
|
|
audevcod.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
corerror.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3d10_1shader.h \
|
|
|
|
d3d10effect.h \
|
|
|
|
d3d10misc.h \
|
|
|
|
d3d10shader.h \
|
|
|
|
d3d11shader.h \
|
|
|
|
d3d8caps.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
d3d8.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3d8types.h \
|
|
|
|
d3d9caps.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
d3d9.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3d9types.h \
|
|
|
|
d3dcaps.h \
|
|
|
|
d3dcompiler.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
d3d.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3dhal.h \
|
|
|
|
d3drmdef.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
d3drm.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3drmobj.h \
|
|
|
|
d3dtypes.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
d3dvec.inl \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3dx9anim.h \
|
|
|
|
d3dx9core.h \
|
|
|
|
d3dx9effect.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
d3dx9.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3dx9math.h \
|
|
|
|
d3dx9math.inl \
|
|
|
|
d3dx9mesh.h \
|
|
|
|
d3dx9shader.h \
|
|
|
|
d3dx9shape.h \
|
|
|
|
d3dx9tex.h \
|
|
|
|
d3dx9xof.h \
|
|
|
|
dls1.h \
|
|
|
|
dls2.h \
|
|
|
|
dmerror.h \
|
|
|
|
dmo.h \
|
|
|
|
dmoreg.h \
|
|
|
|
dmort.h \
|
|
|
|
dmplugin.h \
|
|
|
|
dmusbuff.h \
|
|
|
|
dmusicc.h \
|
|
|
|
dmusicf.h \
|
|
|
|
dmusici.h \
|
|
|
|
dmusics.h \
|
|
|
|
dpaddr.h \
|
|
|
|
dplay8.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
dplay.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
dplobby8.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
dplobby.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
dpnathlp.h \
|
|
|
|
dshow.h \
|
|
|
|
dvdmedia.h \
|
|
|
|
dxdiag.h \
|
|
|
|
dxerr8.h \
|
|
|
|
dxerr9.h \
|
|
|
|
dxfile.h \
|
|
|
|
errors.h \
|
|
|
|
evcode.h \
|
|
|
|
mediaerr.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
mscat.h \
|
|
|
|
propkeydef.h \
|
|
|
|
propkey.h \
|
|
|
|
rpcsal.h \
|
|
|
|
t2embapi.h \
|
|
|
|
uiautomationcoreapi.h \
|
|
|
|
uiautomation.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
vfwmsgs.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
winhttp.h \
|
|
|
|
winineti.h \
|
|
|
|
xinput.h; do
|
|
|
|
import_header $f include
|
2017-12-19 01:15:38 +08:00
|
|
|
done
|
|
|
|
|
2019-12-16 22:01:48 +08:00
|
|
|
# IDLs
|
2017-12-19 01:15:38 +08:00
|
|
|
for f in \
|
|
|
|
amstream \
|
|
|
|
amvideo \
|
|
|
|
austream \
|
2019-12-16 22:01:48 +08:00
|
|
|
ctfutb \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3d10 \
|
|
|
|
d3d10_1 \
|
|
|
|
d3d10sdklayers \
|
|
|
|
d3d11 \
|
|
|
|
d3d11_1 \
|
|
|
|
d3d11_2 \
|
|
|
|
d3d11_3 \
|
|
|
|
d3d11_4 \
|
|
|
|
d3d11sdklayers \
|
|
|
|
d3dcommon \
|
|
|
|
ddstream \
|
2019-12-16 22:01:48 +08:00
|
|
|
devicetopology \
|
|
|
|
downloadmgr \
|
|
|
|
drmexternals \
|
2017-12-19 01:15:38 +08:00
|
|
|
dxgi \
|
|
|
|
dxgi1_2 \
|
|
|
|
dxgi1_3 \
|
|
|
|
dxgi1_4 \
|
|
|
|
dxgi1_5 \
|
|
|
|
dxgi1_6 \
|
|
|
|
dxgicommon \
|
2020-01-08 23:13:11 +08:00
|
|
|
dxgidebug \
|
2017-12-19 01:15:38 +08:00
|
|
|
dxgiformat \
|
|
|
|
dxgitype \
|
2020-02-07 22:34:11 +08:00
|
|
|
dxva2api \
|
2019-12-16 22:01:48 +08:00
|
|
|
endpointvolume \
|
|
|
|
fusion \
|
|
|
|
icftypes \
|
|
|
|
mediaobj \
|
|
|
|
mmdeviceapi \
|
2017-12-19 01:15:38 +08:00
|
|
|
mmstream \
|
2019-12-16 22:01:48 +08:00
|
|
|
mscoree \
|
|
|
|
msctf \
|
|
|
|
netfw \
|
|
|
|
netlistmgr \
|
|
|
|
objectarray \
|
|
|
|
optary \
|
|
|
|
qedit \
|
|
|
|
taskschd \
|
2020-01-09 17:01:46 +08:00
|
|
|
thumbcache \
|
2019-12-16 22:01:48 +08:00
|
|
|
uiautomationclient \
|
|
|
|
uiautomationcore \
|
|
|
|
urlhist \
|
|
|
|
wmdrmsdk \
|
|
|
|
wmsbuffer \
|
|
|
|
wmsdkidl \
|
|
|
|
wpcapi \
|
|
|
|
xmllite; do
|
|
|
|
import_idl $f.idl include
|
2017-12-19 01:15:38 +08:00
|
|
|
done
|
|
|
|
|
|
|
|
echo Import complete. You need to update headers generated from IDL files now:
|
2020-01-25 04:16:02 +08:00
|
|
|
echo '$ ./configure --with-widl --host=i686-w64-mingw32 && make && make distclean'
|
2017-12-19 01:15:38 +08:00
|
|
|
|