Since version 9.0c it is legal to distribute the D3DX9_xx Dlls, however you should use the latest DirectX9 installer from the Microsoft website for distributing it with your game. This is the proper way. The d3dx9_30.dll only helps users who have DX9 already installed, and should normally not be distributed with the final product.