2017-12-19 01:15:38 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
WINE_DIR=$1
|
|
|
|
|
|
|
|
if test -z $WINE_DIR; then
|
2021-05-05 22:18:21 +08:00
|
|
|
echo "Usage: wine-import.sh wine_dir"
|
2017-12-19 01:15:38 +08:00
|
|
|
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 \
|
2020-06-05 14:28:38 +08:00
|
|
|
d2dbasetypes.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 \
|
2020-08-02 03:26:10 +08:00
|
|
|
devpkey.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
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 \
|
2020-04-29 23:13:38 +08:00
|
|
|
dsconf.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
dshow.h \
|
|
|
|
dvdmedia.h \
|
|
|
|
dxdiag.h \
|
|
|
|
dxerr8.h \
|
|
|
|
dxerr9.h \
|
|
|
|
dxfile.h \
|
2020-03-20 21:00:42 +08:00
|
|
|
dxva.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
errors.h \
|
|
|
|
evcode.h \
|
2020-04-14 22:14:32 +08:00
|
|
|
exdispid.h \
|
2021-11-23 00:29:44 +08:00
|
|
|
fontsub.h \
|
2017-12-19 01:15:38 +08:00
|
|
|
mediaerr.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
mscat.h \
|
2022-12-28 21:10:38 +08:00
|
|
|
msxml2did.h \
|
|
|
|
msxml6did.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
propkeydef.h \
|
|
|
|
propkey.h \
|
2021-07-13 23:33:36 +08:00
|
|
|
propvarutil.h \
|
2019-12-16 22:01:48 +08:00
|
|
|
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 \
|
2021-03-13 16:41:09 +08:00
|
|
|
wmpids.h \
|
2020-08-02 03:26:10 +08:00
|
|
|
xapofx.h \
|
|
|
|
xinput.h; do
|
2019-12-16 22:01:48 +08:00
|
|
|
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 \
|
2021-03-20 20:45:16 +08:00
|
|
|
asyncinfo \
|
2017-12-19 01:15:38 +08:00
|
|
|
austream \
|
2021-11-07 01:21:26 +08:00
|
|
|
bits \
|
|
|
|
bits1_5 \
|
|
|
|
bits2_0 \
|
|
|
|
bits2_5 \
|
|
|
|
bits3_0 \
|
|
|
|
bits5_0 \
|
2019-12-16 22:01:48 +08:00
|
|
|
ctfutb \
|
2022-10-15 12:46:55 +08:00
|
|
|
ctxtcall \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3d10 \
|
|
|
|
d3d10_1 \
|
|
|
|
d3d10sdklayers \
|
|
|
|
d3d11 \
|
2020-09-23 23:18:21 +08:00
|
|
|
d3d11on12 \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3d11_1 \
|
|
|
|
d3d11_2 \
|
|
|
|
d3d11_3 \
|
|
|
|
d3d11_4 \
|
|
|
|
d3d11sdklayers \
|
2020-09-07 20:11:51 +08:00
|
|
|
d3d12 \
|
2020-10-03 13:31:43 +08:00
|
|
|
d3d12sdklayers \
|
2020-08-15 22:26:11 +08:00
|
|
|
d3d12shader \
|
2017-12-19 01:15:38 +08:00
|
|
|
d3dcommon \
|
2020-06-05 14:28:38 +08:00
|
|
|
dcommon \
|
2017-12-19 01:15:38 +08:00
|
|
|
ddstream \
|
2019-12-16 22:01:48 +08:00
|
|
|
devicetopology \
|
2020-11-13 20:26:57 +08:00
|
|
|
directmanipulation \
|
2019-12-16 22:01:48 +08:00
|
|
|
downloadmgr \
|
|
|
|
drmexternals \
|
2020-05-04 12:00:00 +08:00
|
|
|
dvdif \
|
2020-06-05 14:28:38 +08:00
|
|
|
dwrite \
|
|
|
|
dwrite_1 \
|
|
|
|
dwrite_2 \
|
|
|
|
dwrite_3 \
|
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 \
|
2021-03-20 20:45:16 +08:00
|
|
|
eventtoken \
|
2021-10-28 15:18:07 +08:00
|
|
|
evr9 \
|
2020-06-05 14:28:38 +08:00
|
|
|
exdisp \
|
2019-12-16 22:01:48 +08:00
|
|
|
fusion \
|
|
|
|
icftypes \
|
|
|
|
mediaobj \
|
2020-12-19 04:34:33 +08:00
|
|
|
mfreadwrite \
|
2019-12-16 22:01:48 +08:00
|
|
|
mmdeviceapi \
|
2017-12-19 01:15:38 +08:00
|
|
|
mmstream \
|
2019-12-16 22:01:48 +08:00
|
|
|
mscoree \
|
|
|
|
msctf \
|
2022-12-28 21:10:38 +08:00
|
|
|
msxml \
|
|
|
|
msxml2 \
|
|
|
|
msxml6 \
|
2021-03-17 14:30:56 +08:00
|
|
|
mulres \
|
2019-12-16 22:01:48 +08:00
|
|
|
netfw \
|
|
|
|
netlistmgr \
|
|
|
|
objectarray \
|
|
|
|
optary \
|
2021-06-30 03:32:34 +08:00
|
|
|
proofofpossessioncookieinfo \
|
2019-12-16 22:01:48 +08:00
|
|
|
qedit \
|
2021-03-17 14:30:56 +08:00
|
|
|
relogger \
|
|
|
|
rtworkq \
|
2020-06-05 14:28:38 +08:00
|
|
|
spatialaudioclient \
|
2019-12-16 22:01:48 +08:00
|
|
|
taskschd \
|
2020-01-09 17:01:46 +08:00
|
|
|
thumbcache \
|
2019-12-16 22:01:48 +08:00
|
|
|
uiautomationclient \
|
|
|
|
uiautomationcore \
|
|
|
|
urlhist \
|
2020-03-05 02:28:53 +08:00
|
|
|
vmr9 \
|
2020-04-26 04:44:57 +08:00
|
|
|
wincodec \
|
2020-05-04 12:00:00 +08:00
|
|
|
wincodecsdk \
|
2021-02-28 17:20:09 +08:00
|
|
|
windowscontracts \
|
2022-04-29 22:23:20 +08:00
|
|
|
windows.devices.enumeration \
|
|
|
|
windows.devices.haptics \
|
|
|
|
windows.devices.power \
|
2021-03-20 20:45:16 +08:00
|
|
|
windows.foundation \
|
2021-02-28 17:20:09 +08:00
|
|
|
windows.foundation.collections \
|
2022-04-29 22:23:20 +08:00
|
|
|
windows.foundation.metadata \
|
|
|
|
windows.foundation.numerics \
|
|
|
|
windows.gaming.input \
|
|
|
|
windows.gaming.input.custom \
|
|
|
|
windows.gaming.input.forcefeedback \
|
|
|
|
windows.globalization \
|
2022-01-24 20:07:39 +08:00
|
|
|
windows.media \
|
2022-04-29 22:23:20 +08:00
|
|
|
windows.media.closedcaptioning \
|
|
|
|
windows.media.speechrecognition \
|
2021-03-17 14:30:56 +08:00
|
|
|
windows.media.speechsynthesis \
|
2022-04-29 22:23:20 +08:00
|
|
|
windows.storage.streams \
|
2022-04-21 13:01:34 +08:00
|
|
|
windows.system \
|
2022-04-22 17:18:18 +08:00
|
|
|
windows.system.power \
|
2022-04-29 22:23:20 +08:00
|
|
|
windows.ui \
|
2019-12-16 22:01:48 +08:00
|
|
|
wmdrmsdk \
|
2021-01-30 23:45:33 +08:00
|
|
|
wmp \
|
2021-03-13 16:41:09 +08:00
|
|
|
wmprealestate \
|
|
|
|
wmpservices \
|
2019-12-16 22:01:48 +08:00
|
|
|
wmsbuffer \
|
|
|
|
wmsdkidl \
|
2021-10-21 23:34:54 +08:00
|
|
|
wmsecure \
|
2019-12-16 22:01:48 +08:00
|
|
|
wpcapi \
|
2021-05-05 13:07:11 +08:00
|
|
|
wuapi \
|
2020-08-02 03:26:10 +08:00
|
|
|
xapo \
|
|
|
|
xaudio2 \
|
|
|
|
xaudio2fx \
|
2022-12-28 21:10:38 +08:00
|
|
|
xmldom \
|
|
|
|
xmldso \
|
2019-12-16 22:01:48 +08:00
|
|
|
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
|
|
|
|