Building on macosx

Jefferson González edited this page May 31, 2015 · 3 revisions

The process of building on mac is the same as on linux the only differences are the way we configure wxWidgets build, as the applications needed. We have tested with the php version available on mac ports.

Automatic building

Since v3.0.0.1 of wxPHP the configure script can automatically download wxWidgets, compile and link to it. So if you already have the required build environment the following steps would do:

cd wxphp.git
phpize
./configure 
make
sudo make install

If you want to link an existing build of wxWidgets on your system or need to know the build dependencies as some more details, please check the steps below.


Requirements

  1. Xcode (for a working compiling environment)

  2. Mac Ports (for PHP development environment and binaries)

Install PHP from Mac Ports

This process could take a long time since mac ports application downloads php sources and dependency sources and compiles.

sudo port install php5

Get wxWidgets sources and build

svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_9_4 wxWidgets
cd wxWidgets
mkdir mybuild
cd mybuild
../configure -with-osx_cocoa --disable-compat24 --with-macosx-version-min=10.6 --with-macosx-sdk=/Developer/SDKs/MacOSX10.6.sdk --prefix=/opt/wxWidgets CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" CPPFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" OBJCFLAGS="-arch x86_64" OBJCXXFLAGS="-arch x86_64"

Note: if non 64 bit architecture just remove the x86_64 flags from the configure command

make
sudo make install

Compile wxPHP as usual

cd wxphp
phpize
./configure --with-wxwidgets=/opt/wxWidgets
make
sudo make install
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.