Fix gettext dynamic linkage breaking binary builds due to missing dylib #1076
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, all the external libraries MacVim links against are dynamically linked, but so far they are all system libraries or bundled in /usr/lib, so all users have them installed. When gettext dependency was added to the Travis build to add localization support, it relied on an installed libintl.dylib library, usually in /usr/local/lib. This means users who don't have it installed and open the distributed binary will see MacVim immediately crash due to a missing dylib.
Instead, statically link against libintl.a instead. This is tricky because clang stubbornly prefers dynamic libs over static ones if both exist and you use the "-l" argument. Instead, you have to pass full path to the static lib for it to link against it. Modify configure.ac to do so, but because of the full path requirement, it's hard to get AC_TRY_LINK to work with it, so just manually check for the library's existence and use that. Hacky but works.
Also, add a check to Travis CI build to make sure we didn't accidentally introduce third-party dynacmic linkage to the build.
Fix #1073