Freitag, 5. November 2010

Building Slony-I on OSX

Just stumpled across this today while trying to build a fresh git clone of Slony-I on my MacBook; To build Slony-I on a OSX box (in my case 10.6.4), you might do the following on your box:


% ./configure --prefix=$PGSQL_HOME --with-pgconfigdir=$PGSQL_HOME/bin
...
configure: error: Headers for libpqserver are not found in the includeserverdir.
This is the path to postgres.h. Please specify the includeserverdir with
--with-pgincludeserverdir=<dir>


Now, of course you are following this gentle hint and try again with a proper include path:


% ./configure --prefix=$PGSQL_HOME --with-pgconfigdir=$PGSQL_HOME/bin --with-pgincludeserverdir=$PGSQL_HOME/include/server
...
configure: error: Headers for libpqserver are not found in the includeserverdir.
This is the path to postgres.h. Please specify the includeserverdir with
--with-pgincludeserverdir=<dir>


Uhm, doesn't work either. A good way to find out what's really going on now is to have a look into the config.log (located in the Slony-I source directory) and check what exactly is causing this error. Open the file and simply search for postgres.h. You'll find the following line there (ignore my path names here, they surely differ from yours):


In file included from /Users/bernd/pgsql-dev/install/REL9_0_STABLE/include/server/postgres.h:47,
from conftest.c:80:
/Users/bernd/pgsql-dev/install/REL9_0_STABLE/include/server/c.h:99:21: error: libintl.h: No such file or directory


Ah okay, it is indeed failing compiling the conftest.c file while including the PostgreSQL headers. Now that i saw this i remembered that i had my local development PostgreSQL-builds configured with --enable-nls, which need to include gettext/libintl. Since OSX doesn't ship with the latter, they were installed from MacPorts, which is located in /opt/local/include. So the solution is to just include those header path as well. PostgreSQL has an extra configure switch --with-includes, unfortunately the configure script in Slony-I is missing this, so i decided to go with this:


% CFLAGS='-I /opt/local/include' ./configure --prefix=$PGSQL_HOME --with-pgconfigdir=$PGSQL_HOME/bin


That worked and i was finally able to sucessfully build Slony-I on my MacBook. Hope this helps anybody facing the same issue.

Keine Kommentare: