There are many similar articles on the web about how swig is installed and configured on Mac OS X, which is generally:
- Download Pcre,configure & make & make Install
- Download Swig,configure & make & make Install
But in fact, when I follow this step for the first time, I will find that in the Configure Swig, the newspaper Pcre can not find the problem. Then use –with-pcre-prefix= to force the path of the specified pcre, configure no problem. And then when make, can't find pcre.h, and then began to toss this problem ...
In fact, not so troublesome, Swig has done for us a very simple sh, is in the Swig compressed package in the Tools folder pcre-build.sh. This script helps us to extract, configure and install Pcre with one click, which is very convenient and quick. Here's how:
- Download tar from the PCRE website (i downloaded pcre-8.40.tar.bz2)
- Unzip the pcre-8.40.tar.bz2 to get Pcre-8.40.tar, copy to Swig (I'm using version 3.0.12) under the root directory
- Under the Swig root directory, execute:./tools/pcre-build.sh enter and wait.
If the final output: The SWIG configure script can now is run, whereupon PCRE'll automatically be detected and used from ... The expression was successful. Next, perform the execution directly under the Swig root directory:./configure & Make & makes install.
Note the points:
1. Do not run CD to tools under Pcre-build.sh
2. The pcre file suffix must be tar
Swig installation on Mac OS X