If your application requires the definition of a launch variable like DYLD_LIBRARY_PATH, the most secure solution is to specify it in the application's Info.plist file.
Application developers can find information about using the Info.plist file in the Apple Developer Reference Library. You can specify a launch variable using the LSEnvironment key.
You can allow the use of global DYLD launch variables by creating a file with this Terminal command:
sudo touch /var/db/.launchd_allow_global_dyld_envvars
To revert to the more secure behavior, use this Terminal command to remove the file:
sudo rm /var/db/.launchd_allow_global_dyld_envvars