On 06/01/16 03:18, Rama wrote:
> Hi,
>
> I have to build for PPC as there seems no binary package.
>
> ran configure with some options as below (most of the options are to
> cater for our build environment) :
>
> bash ./configure --with-pam=no --with-openssl=$INTERFACE_DIR
> --with-lmdb=${INTERFACE_DIR} LDFLAGS="-Bstatic -s -UHAVE_SNPRINTF
> -DHAVE_STDLIB_H -L$ADD_LIB_DIR" CFLAGS="-DHAVE_STDLIB_H -UHAVE_SNPRINTF
> -I$ADD_INC_DIR -I$ADD_INC_DIR/${PLATFORM}" CXXFLAGS="-DHAVE_STDLIB_H
> -UHAVE_SNPRINTF -I$ADD_INC_DIR -I$ADD_INC_DIR -L$ADD_LIB_DIR"
> --build=i386 --host=${HOST} CXX=${CROSS_COMPILE}g++
> CC=${CROSS_COMPILE}gcc AR=${CROSS_COMPILE}ar LD=${CROSS_COMPILE}ld
> RANLIB=${CROSS_COMPILE}ranlib --with-masterdir=/var/cfengine/masterfiles
> --with-inputdir=/var/cfengine/inputs --with-workdir=/var/cfengine
> --libdir=/var/cfengine/lib
>
> Linker fails to resolve the "rpl_" symbols which are actually defined in
> snprintf.c enclosed deep inside conditional compiles. I tried adding a
> few different defines and undefined to CFLAGS, CXXFLAGS and LDFLAGS,
> without much luck so far.
The same define is used both to conditionally compile rpl_fprintf and to
replace occurrences of fprintf with rpl_fprintf, and configure is
supposed to figure this out, so no additional defines should be
necessary. Can you verify that configure outputs:
checking whether snprintf is C99 compliant... no
That being said, it looks like you're not compiling on a native host,
but cross compiling. While this should work in theory, it has been
tested very little (we only cross compile for Windows), so I wouldn't be
surprised if some of the configure tests are not prepared to handle
that. You might have more luck compiling it natively.
Another thing you can try is making the "#include <config.h>" inside
snprintf.c unconditional (remove the #if and #endif).
These are just off the top of my head.
--
Kristian