Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
| 5 | WINE_DIR=$1 |
| 6 | |
| 7 | if test -z $WINE_DIR; then |
Liu Hao | a7d43b7 | 2021-05-05 22:18:21 +0800 | [diff] [blame] | 8 | echo "Usage: wine-import.sh wine_dir" |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | import_header() { |
| 13 | dstfile=$2/$1 |
| 14 | srcfile=$WINE_DIR/include/$1 |
| 15 | rm -f $dstfile |
| 16 | unicode_fix= |
| 17 | if test -n "$(grep WINELIB_NAME_AW\\\|DECL_WINELIB_TYPE_AW $srcfile)"; then |
| 18 | unicode_fix="yes" |
| 19 | echo '#include <_mingw_unicode.h>' >>$dstfile |
| 20 | fi |
| 21 | if test -n "$(grep -w INTERFACE $srcfile)"; then |
| 22 | echo '#undef INTERFACE' >>$dstfile |
| 23 | fi |
| 24 | cat $srcfile >>$dstfile |
| 25 | if test -n "$(grep WINELIB_NAME_AW\\\|DECL_WINELIB_TYPE_AW $srcfile)"; then |
| 26 | sed -i 's/\bWINELIB_NAME_AW\b/__MINGW_NAME_AW/g' $dstfile |
| 27 | sed -i 's/\bDECL_WINELIB_TYPE_AW\b/__MINGW_TYPEDEF_AW/g' $dstfile |
| 28 | fi |
| 29 | sed -i 's/\bBOOL /WINBOOL /g' $dstfile |
| 30 | sed -i 's/\bBOOL\b/WINBOOL/g' $dstfile |
| 31 | sed -i 's/DECLSPEC_HIDDEN//g' $dstfile |
Jacek Caban | c9ee24b | 2023-08-22 10:42:30 +0200 | [diff] [blame] | 32 | sed -i 's/\b__WINE_ALLOC_SIZE([0-9]) //g' $dstfile |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 33 | } |
| 34 | |
| 35 | import_idl() { |
| 36 | dstfile=$2/$1 |
| 37 | srcfile=$WINE_DIR/include/$1 |
| 38 | cp $srcfile $dstfile |
| 39 | |
| 40 | # HACK: |
| 41 | sed -i 's/cpp_quote\(.*\)\bBOOL\b/cpp_quote\1WINBOOL/' $dstfile |
| 42 | sed -i 's/cpp_quote\(.*\)\bBOOL\b/cpp_quote\1WINBOOL/' $dstfile |
| 43 | sed -i 's/cpp_quote\(.*\)\bBOOL\b/cpp_quote\1WINBOOL/' $dstfile |
| 44 | } |
| 45 | |
| 46 | # headers |
Biswapriyo Nath | abb6e6a | 2023-07-13 01:46:35 +0530 | [diff] [blame] | 47 | # Reverted: propkeydef.h, rpcsal.h |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 48 | for f in \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 49 | amaudio.h \ |
| 50 | audevcod.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 51 | corerror.h \ |
Biswapriyo Nath | 716676b | 2020-06-05 11:58:38 +0530 | [diff] [blame] | 52 | d2dbasetypes.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 53 | d3d10_1shader.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 54 | d3d10misc.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 55 | d3d11shader.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 56 | d3d8caps.h \ |
Jacek Caban | 5ccc975 | 2024-08-06 18:16:17 +0200 | [diff] [blame] | 57 | d3d8.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 58 | d3d8types.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 59 | d3d9caps.h \ |
Jacek Caban | 5ccc975 | 2024-08-06 18:16:17 +0200 | [diff] [blame] | 60 | d3d9.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 61 | d3d9types.h \ |
| 62 | d3dcaps.h \ |
| 63 | d3dcompiler.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 64 | d3d.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 65 | d3dhal.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 66 | d3drmdef.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 67 | d3drm.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 68 | d3drmobj.h \ |
| 69 | d3dtypes.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 70 | d3dvec.inl \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 71 | d3dx9anim.h \ |
| 72 | d3dx9core.h \ |
| 73 | d3dx9effect.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 74 | d3dx9.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 75 | d3dx9math.h \ |
| 76 | d3dx9math.inl \ |
| 77 | d3dx9mesh.h \ |
| 78 | d3dx9shader.h \ |
| 79 | d3dx9shape.h \ |
| 80 | d3dx9tex.h \ |
| 81 | d3dx9xof.h \ |
Biswapriyo Nath | 5c137a7 | 2020-08-02 00:56:10 +0530 | [diff] [blame] | 82 | devpkey.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 83 | dls1.h \ |
| 84 | dls2.h \ |
| 85 | dmerror.h \ |
| 86 | dmo.h \ |
| 87 | dmoreg.h \ |
| 88 | dmort.h \ |
| 89 | dmplugin.h \ |
| 90 | dmusbuff.h \ |
| 91 | dmusicc.h \ |
| 92 | dmusicf.h \ |
| 93 | dmusici.h \ |
| 94 | dmusics.h \ |
| 95 | dpaddr.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 96 | dplay8.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 97 | dplay.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 98 | dplobby8.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 99 | dplobby.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 100 | dpnathlp.h \ |
Jacek Caban | 3b79616 | 2020-04-29 17:13:38 +0200 | [diff] [blame] | 101 | dsconf.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 102 | dshow.h \ |
| 103 | dvdmedia.h \ |
| 104 | dxdiag.h \ |
| 105 | dxerr8.h \ |
| 106 | dxerr9.h \ |
| 107 | dxfile.h \ |
Biswapriyo Nath | c8e562e | 2020-03-20 14:00:42 +0100 | [diff] [blame] | 108 | dxva.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 109 | errors.h \ |
| 110 | evcode.h \ |
Biswapriyo Nath | 3c737ed | 2020-04-14 16:14:32 +0200 | [diff] [blame] | 111 | exdispid.h \ |
Biswapriyo Nath | 3cf799a | 2021-11-22 21:59:44 +0530 | [diff] [blame] | 112 | fontsub.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 113 | mediaerr.h \ |
Biswapriyo Nath | 39076f4 | 2025-03-11 05:19:50 +0000 | [diff] [blame] | 114 | mpeg2bits.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 115 | mscat.h \ |
Biswapriyo Nath | 9470b42 | 2022-12-28 18:40:38 +0530 | [diff] [blame] | 116 | msxml2did.h \ |
| 117 | msxml6did.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 118 | propkey.h \ |
Biswapriyo Nath | 016d674 | 2021-07-13 21:03:36 +0530 | [diff] [blame] | 119 | propvarutil.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 120 | t2embapi.h \ |
| 121 | uiautomationcoreapi.h \ |
| 122 | uiautomation.h \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 123 | vfwmsgs.h \ |
Jacek Caban | b4eadf3 | 2024-09-04 15:02:05 +0200 | [diff] [blame] | 124 | webservices.h \ |
Biswapriyo Nath | 5b5f0a1 | 2025-02-14 06:03:49 +0000 | [diff] [blame] | 125 | wia.h \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 126 | winhttp.h \ |
| 127 | winineti.h \ |
Biswapriyo Nath | 2d5eaa2 | 2021-03-13 14:11:09 +0530 | [diff] [blame] | 128 | wmpids.h \ |
Biswapriyo Nath | a885fe9 | 2024-07-05 05:39:55 +0000 | [diff] [blame] | 129 | x3daudio.h \ |
Biswapriyo Nath | 5c137a7 | 2020-08-02 00:56:10 +0530 | [diff] [blame] | 130 | xapofx.h \ |
| 131 | xinput.h; do |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 132 | import_header $f include |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 133 | done |
| 134 | |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 135 | # IDLs |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 136 | for f in \ |
| 137 | amstream \ |
| 138 | amvideo \ |
Jacek Caban | 79951ed | 2021-03-20 13:45:16 +0100 | [diff] [blame] | 139 | asyncinfo \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 140 | austream \ |
Biswapriyo Nath | f5bd1f3 | 2021-11-06 22:51:26 +0530 | [diff] [blame] | 141 | bits \ |
| 142 | bits1_5 \ |
| 143 | bits2_0 \ |
| 144 | bits2_5 \ |
| 145 | bits3_0 \ |
| 146 | bits5_0 \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 147 | ctfutb \ |
Biswapriyo Nath | 7b494c1 | 2022-10-15 10:16:55 +0530 | [diff] [blame] | 148 | ctxtcall \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 149 | d3d10 \ |
| 150 | d3d10_1 \ |
Jacek Caban | 90a60d5 | 2023-11-09 11:46:09 +0100 | [diff] [blame] | 151 | d3d10effect \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 152 | d3d10sdklayers \ |
Jacek Caban | 90a60d5 | 2023-11-09 11:46:09 +0100 | [diff] [blame] | 153 | d3d10shader \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 154 | d3d11 \ |
Jacek Caban | 50bcd81 | 2020-09-23 17:18:21 +0200 | [diff] [blame] | 155 | d3d11on12 \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 156 | d3d11_1 \ |
| 157 | d3d11_2 \ |
| 158 | d3d11_3 \ |
| 159 | d3d11_4 \ |
| 160 | d3d11sdklayers \ |
Martin Storsjö | d34d36b | 2023-09-19 23:50:02 +0300 | [diff] [blame] | 161 | d3d12 \ |
Biswapriyo Nath | ea52e5e | 2020-10-03 11:01:43 +0530 | [diff] [blame] | 162 | d3d12sdklayers \ |
Biswapriyo Nath | d9a9ccd | 2020-08-15 19:56:11 +0530 | [diff] [blame] | 163 | d3d12shader \ |
Jacek Caban | c15e4df | 2023-09-27 12:50:04 +0200 | [diff] [blame] | 164 | d3d12video \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 165 | d3dcommon \ |
Biswapriyo Nath | 716676b | 2020-06-05 11:58:38 +0530 | [diff] [blame] | 166 | dcommon \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 167 | ddstream \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 168 | devicetopology \ |
Biswapriyo Nath | dc9f65c | 2020-11-13 17:56:57 +0530 | [diff] [blame] | 169 | directmanipulation \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 170 | downloadmgr \ |
| 171 | drmexternals \ |
Biswapriyo Nath | b1fb31f | 2020-05-04 09:30:00 +0530 | [diff] [blame] | 172 | dvdif \ |
Biswapriyo Nath | 716676b | 2020-06-05 11:58:38 +0530 | [diff] [blame] | 173 | dwrite \ |
| 174 | dwrite_1 \ |
| 175 | dwrite_2 \ |
| 176 | dwrite_3 \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 177 | dxgi \ |
| 178 | dxgi1_2 \ |
| 179 | dxgi1_3 \ |
| 180 | dxgi1_4 \ |
| 181 | dxgi1_5 \ |
| 182 | dxgi1_6 \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 183 | dxgicommon \ |
Biswapriyo Nath | 22333ac | 2020-01-08 16:13:11 +0100 | [diff] [blame] | 184 | dxgidebug \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 185 | dxgiformat \ |
| 186 | dxgitype \ |
Biswapriyo Nath | 3a99d7c | 2020-02-07 20:04:11 +0530 | [diff] [blame] | 187 | dxva2api \ |
Biswapriyo Nath | 9004580 | 2024-03-18 05:55:18 +0000 | [diff] [blame] | 188 | dyngraph \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 189 | endpointvolume \ |
Jacek Caban | 79951ed | 2021-03-20 13:45:16 +0100 | [diff] [blame] | 190 | eventtoken \ |
Biswapriyo Nath | 572d27c | 2021-10-28 12:48:07 +0530 | [diff] [blame] | 191 | evr9 \ |
Biswapriyo Nath | 716676b | 2020-06-05 11:58:38 +0530 | [diff] [blame] | 192 | exdisp \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 193 | fusion \ |
| 194 | icftypes \ |
LIU Hao | 6a3e25c | 2023-02-03 11:37:01 +0800 | [diff] [blame] | 195 | ivectorchangedeventargs \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 196 | mediaobj \ |
Nikolay Sivov | be9aa46 | 2023-11-29 18:11:41 +0100 | [diff] [blame] | 197 | mfmediaengine \ |
Biswapriyo Nath | 807fb5f | 2020-12-19 02:04:33 +0530 | [diff] [blame] | 198 | mfreadwrite \ |
Biswapriyo Nath | 92d5628 | 2023-03-18 10:34:00 +0530 | [diff] [blame] | 199 | mftransform \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 200 | mmdeviceapi \ |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 201 | mmstream \ |
Biswapriyo Nath | 39076f4 | 2025-03-11 05:19:50 +0000 | [diff] [blame] | 202 | mpeg2data \ |
| 203 | mpeg2structs \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 204 | mscoree \ |
| 205 | msctf \ |
Biswapriyo Nath | 9470b42 | 2022-12-28 18:40:38 +0530 | [diff] [blame] | 206 | msxml \ |
| 207 | msxml2 \ |
| 208 | msxml6 \ |
Biswapriyo Nath | eb87e56 | 2021-03-17 12:00:56 +0530 | [diff] [blame] | 209 | mulres \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 210 | netfw \ |
| 211 | netlistmgr \ |
| 212 | objectarray \ |
| 213 | optary \ |
Jacek Caban | cdb052f | 2021-06-29 21:32:34 +0200 | [diff] [blame] | 214 | proofofpossessioncookieinfo \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 215 | qedit \ |
Biswapriyo Nath | eb87e56 | 2021-03-17 12:00:56 +0530 | [diff] [blame] | 216 | relogger \ |
| 217 | rtworkq \ |
Biswapriyo Nath | 716676b | 2020-06-05 11:58:38 +0530 | [diff] [blame] | 218 | spatialaudioclient \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 219 | taskschd \ |
Biswapriyo Nath | fcb46db | 2023-04-10 18:05:28 +0530 | [diff] [blame] | 220 | textstor \ |
Biswapriyo Nath | 06bc955 | 2020-01-09 14:31:46 +0530 | [diff] [blame] | 221 | thumbcache \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 222 | uiautomationclient \ |
| 223 | uiautomationcore \ |
| 224 | urlhist \ |
Jacek Caban | 7542dd9 | 2020-03-04 19:28:53 +0100 | [diff] [blame] | 225 | vmr9 \ |
Jacek Caban | b4eadf3 | 2024-09-04 15:02:05 +0200 | [diff] [blame] | 226 | weakreference \ |
Biswapriyo Nath | 5b5f0a1 | 2025-02-14 06:03:49 +0000 | [diff] [blame] | 227 | wia_lh \ |
| 228 | wia_xp \ |
Biswapriyo Nath | e7f3f74 | 2020-04-26 02:14:57 +0530 | [diff] [blame] | 229 | wincodec \ |
Biswapriyo Nath | 9468ebc | 2020-05-04 09:30:00 +0530 | [diff] [blame] | 230 | wincodecsdk \ |
Biswapriyo Nath | c0fa4d7 | 2021-02-28 14:50:09 +0530 | [diff] [blame] | 231 | windowscontracts \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 232 | wmdrmsdk \ |
Biswapriyo Nath | f3855e2 | 2021-01-30 21:15:33 +0530 | [diff] [blame] | 233 | wmp \ |
Biswapriyo Nath | 2d5eaa2 | 2021-03-13 14:11:09 +0530 | [diff] [blame] | 234 | wmprealestate \ |
| 235 | wmpservices \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 236 | wmsbuffer \ |
| 237 | wmsdkidl \ |
Biswapriyo Nath | ff066df | 2021-10-21 21:04:54 +0530 | [diff] [blame] | 238 | wmsecure \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 239 | wpcapi \ |
Biswapriyo Nath | 9087f9a | 2021-05-05 10:37:11 +0530 | [diff] [blame] | 240 | wuapi \ |
Jacek Caban | e89de84 | 2023-08-15 23:06:07 +0200 | [diff] [blame] | 241 | xamlom \ |
Biswapriyo Nath | 5c137a7 | 2020-08-02 00:56:10 +0530 | [diff] [blame] | 242 | xapo \ |
| 243 | xaudio2 \ |
| 244 | xaudio2fx \ |
Biswapriyo Nath | 9470b42 | 2022-12-28 18:40:38 +0530 | [diff] [blame] | 245 | xmldom \ |
| 246 | xmldso \ |
Jacek Caban | d0de753 | 2019-12-16 15:01:48 +0100 | [diff] [blame] | 247 | xmllite; do |
| 248 | import_idl $f.idl include |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 249 | done |
| 250 | |
LIU Hao | c814857 | 2023-07-23 19:01:16 +0800 | [diff] [blame] | 251 | # Import all winrt IDLs |
| 252 | for f in $WINE_DIR/include/windows.*.idl; do |
Jacek Caban | 9817f79 | 2023-06-03 19:25:03 +0200 | [diff] [blame] | 253 | import_idl $(basename $f) include |
| 254 | done |
| 255 | |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 256 | echo Import complete. You need to update headers generated from IDL files now: |
Jacek Caban | 53fab17 | 2020-01-24 21:16:02 +0100 | [diff] [blame] | 257 | echo '$ ./configure --with-widl --host=i686-w64-mingw32 && make && make distclean' |
Jacek Caban | 2979a23 | 2017-12-18 18:15:38 +0100 | [diff] [blame] | 258 | |