compiling Proto 7 on Mac OS X 10.9.4
When I tried to compile proto 7 on Mac OsX 10.9.4 and I bumped into several problems,
so after succeeding in building it I decided to write this short post,
hoping that it will be useful to others users.
- autogen.sh may get libtool name wrong.
- The standard compiler and linker shipped with Command Line Tools in Xcode (5.1.1) seem to have problems in compiling proto source code and interpreting the -rdynamic flag to export all symbols.
1) I suggest the following patch to solve the first problem concerning autogen.sh
--- autogen.sh 2010-01-05 15:22:41.000000000 +0100
+++ autogenNew.sh 2014-09-12 18:19:57.000000000 +0200
@@ -6,7 +6,7 @@
rm -f configure
# select right libtoolize name:
-if [ `uname -s` = Darwin ]
+if hash glibtoolize 2> /dev/null
For those ones who do not know how to manage it,
copy and paste the plain code into a X.patch file and type:
patch < X.patch
2) Instead of trying to understand why clang gets stuck on compilation errors, I directly switched to gcc. I suggest having a user-compiled version of the GNU compiler, it turns to be useful in situations like this one.
Notice that in Command Line Tools ld '-rdynamic' as option for exporting all symbols is not recognized, so let's convert it in '-export-dynamic':
find . -type f -name "configure" | xargs sed -i '' 's/export_dynamic_flag_spec=-rdynamic/export_dynamic_flag_spec=-export-dynamic/g'
- Apply autogen.sh patch
- Convert '-rdynamic' flag into '-export-dynamic'
- Run configure (with parameters)
- Build (make) with gcc