Skip to content
Mark Lesswing edited this page Mar 7, 2017 · 1 revision

Building libRETS on OS X libRETS can be built under the shell as it is on all other platforms. But, on OS X, one may also build libRETS under XCode. Both methods are described below.

Snow Leopard Warning

If using Macports for your dependencies, you should completely uninstall and then reinstall Macports for OS/X 10.6 in order to avoid problems.

Prerequisites

There are certain prerequisites that need to be installed before one can build libRETS. These include the libraries for:

Antlr Boost Expat cURL Additional libraries may be needed, depending on whether the intent is to just build libRETS, or to build and use some of the other targets within the XCode project. These libraries include:

wxWidgets cppUnit Disclosable View framework SWIG Most of these libraries and frameworks are in the svn hierarchy under the "vendorsrc" directory. An alternate way is to use MacPorts to install and maintain the required libraries. The rest of this discussion will assume MacPorts is being used.

Once MacPorts is installed, use it to install the following ports:

Antlr Boost cURL Expat SWIG If you want to run the tests to be sure things are correct (you should do this):

cppUnit If you want to track current development:

subversion You can do this with (and it should be in this order):

sudo port selfupdate sudo port install antlr +universal sudo port install expat +universal sudo port install openssl +universal sudo port install zlib +universal sudo port install boost +universal sudo port install curl +ssl +universal sudo port install cppunit sudo port install subversion sudo port install swig +csharp +java +perl +php5 +python +ruby You may drop the "+universal" if you don't care about building for all architectures.

This will also install some additional ports that are requisites of these ports. Boost (and perhaps others in the future) will be installed into /opt/local/ with version numbers as part of the directory structure.

SWIG Note

As of the October, 2009 release of MacPorts, the mechanism to build swig has changed. For this and later releases, you'll need to manually install each swig variant you need:

sudo port install swig-csharp swig-java swig-perl swig-php5 swig-python swig-ruby Building under the shell

Extract the libRETS archive or download the hierarchy using subversion:

tar --gzip -xf librets-1.3.1.tar.gz or

svn co https://code.crt.realtors.org/svn/librets/librets/tags/1.3.1 librets cd into the directory just created and type (or modify the file librets-build.sh for your own use and invoke it):

./autogen.sh ./configure --with-expat-prefix=/opt/local --with-boost-prefix=/opt/local --with-java-prefix=javaconfig Headers As of libRETS 1.3.2 you will no longer need to specify the expat, boost and java prefixes. Note that java is optional, though required if you want to build the libRETS java bindings.

Building with XCode

Once that is done, start XCode, select the project at "project/build/librets.xcodeproj" and proceed to the "Preferences" page and select "Source Trees". There, the following settings should be added (assuming that MacPorts installs everything in the default location):

Setting Name Display Name Path ANTLR_DIR Antlr /opt/local WXWIDGETS wxWidgets /opt/local BOOST Boost /opt/local CPPUNIT cppunit /opt/local EXPAT Expat /opt/local CURL Curl /opt/local Make sure that your build locations are set such that the "Place Build Products in Project Directory" option is set. You should then be able to select the target "librets" and then build it. If you have installed cppUnit, you can select the target "test", build and execute it. If all goes well, it should exit without any errors. You may need to check your run log to be sure.