New issue 84 by rockdrea...@gmail.com: Compilation steps on AIX 5.3 using
gcc+stlport
http://code.google.com/p/ctemplate/issues/detail?id=84
Just leaving a reminder in order to make it easier for the few unlucky
others who need to make this work on this unpleasant platform combination.
First one must patch template_dictionary.cc and tests/statemachine_test.c
using the attached patch file (WARNING, not fully tested yet)
then one must use the magic incantation
export STLPORT_HOME=/whatever
CC="g++" \
CXXFLAGS="-I$STLPORT_HOME/include/stlport -D_REENTRANT
-D_LINUX_SOURCE_COMPAT -D_THREAD_SAFE -D_LARGE_FILE_API" \
LDFLAGS="-L$STLPORT_HOME/lib" \
LIBS="-lstlport -lpthread -lstdc++" \
../ctemplate-2.0/configure
reasons for this:
- patch in template_dictionary.cc: this is because int64 gets defined as
long long int somewhere so I simply use long both in the headers and the
implementation
- patch in statemachine_test.c: this is because I compile everything with
g++ so the #ifdef(__cplusplus) in statemachine.h is not a good
discrimination of what is being compiled. The solution is to use the
statemachine namespace in the .c file
- -D_REENTRANT and -D_THREAD_SAFE are stlport configuration options
- -D_LINUX_SOURCE_COMPAT makes AIX headers more linux-y
- LIBS="-lstlport -lpthread -lstdc++" makes it possible to compile
configure tests and get on, without those pthread support cannot be
detected and compilation fails on arena.cc
I realise this is not a fully working solution (and yes: AIX+gcc is totally
unsupported) but for the unlucky it's a start ;)
Attachments:
ctemplate-aix.diff 1.0 KB