3 for i in fxc.exe D3DCompiler_43.dll d3dx9_43.dll d3dx10_43.dll d3dx11_43.dll; do
4 if ! test -e "$i"; then
13 echo "To compile HLSL shaders, the Microsoft HLSL compiler needs to be downloaded."
15 echo "Downloading Microsoft DirectX June 2010 SDK and extracting files..."
16 echo "Please wait, this will need to download and unpack a 600 MB file..."
18 echo "The contribution of a free HLSL compiler would be greatly appreciated!"
22 if ! which wget >/dev/null; then
23 echo "Error: wget is required to download the files"
24 echo "On Debian or Ubuntu, run the following command to install it:"
25 echo "sudo apt-get install wget"
30 if ! which cabextract >/dev/null; then
31 echo "Error: cabextract is required to unpack the files"
32 echo "On Debian or Ubuntu, run the following command to install it:"
33 echo "sudo apt-get install cabextract"
38 if test -z "$ok"; then
42 dxsdk_file="DXSDK_Jun10.exe"
43 dxsdk_url="http://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe"
46 fxc_path="DXSDK/Utilities/bin/x86/fxc.exe"
47 d3dcompiler_cab_path="DXSDK/Redist/Jun2010_D3DCompiler_43_x86.cab"
48 d3dx9_cab_path="DXSDK/Redist/Jun2010_d3dx9_43_x86.cab"
49 d3dx10_cab_path="DXSDK/Redist/Jun2010_d3dx10_43_x86.cab"
50 d3dx11_cab_path="DXSDK/Redist/Jun2010_d3dx11_43_x86.cab"
52 if test "$(stat -c '%s' "$dxsdk_file" 2>/dev/null)" != $dxsdk_size; then
53 wget --continue "$dxsdk_url"
54 if test "$(stat -c '%s' "$dxsdk_file" 2>/dev/null)" != $dxsdk_size; then
55 echo "Failed to download DirectX SDK: expected $dxsdk_file with size $dxsdk_size"
56 echo "Download manually from $dxsdk_url"
61 for i in "$fxc_path" "$d3dcompiler_cab_path" "$d3dx9_cab_path" "$d3dx10_cab_path" "$d3dx11_cab_path"; do
62 if ! test -e "$i"; then
63 echo "Please wait, this may take several minutes because a 600 MB archive may need to be fully decompressed..."
64 cabextract -F "$i" "$dxsdk_file"
68 for i in "$d3dcompiler_cab_path" "$d3dx9_cab_path" "$d3dx10_cab_path" "$d3dx11_cab_path"; do
69 cabextract -F "*.dll" "$i"
72 /bin/cp -dpf "$fxc_path" .