c - Compiling ANTLR 3C for AIX -


i'm not familiar compiling c, if don't give enough information, let me know need me post!

here's summary: need run antlr in target language of c on old ibm aix computer. gave on compiling ibm cc/make utils , got version of gcc (4.2) , gnu make on machine. issue is, while configure script detect correct architecture, not seem respond appropriately.

the specific version of antlr using version 3.2, c target. actual detected target powerpc-ibm-aix-5.3.0.0

here's i've done. first glaring error see added "-m32" flag options. okay, can remove makefile simple enough, in case gcc should default -maix32.

second issue: error giving me path stdio.h , saying "error: duplicate 'unsigned'". okay, configure made "define" statement in auto-generated antlr3config.h file... can comment out, , error goes away.

third issue... i'm stuck.

/opt/freeware/bin/make  all-am make[1]: entering directory `/scrubber/libantlr3c-3.2' if /bin/sh ./libtool --tag=cc --mode=compile gcc -dhave_config_h -i. -i. -i. -iinclude    -o2  -wall -mt antlr3baserecognizer.lo -md -mp -mf ".deps/antlr3baserecognizer.tpo" -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo './'`src/antlr3baserecognizer.c; \ mv -f ".deps/antlr3baserecognizer.tpo" ".deps/antlr3baserecognizer.plo"; else rm -f ".deps/antlr3baserecognizer.tpo"; exit 1; fi gcc -dhave_config_h -i. -i. -i. -iinclude -o2 -wall -mt antlr3baserecognizer.lo -md -mp -mf .deps/antlr3baserecognizer.tpo -c src/antlr3baserecognizer.c -o antlr3baserecognizer.o in file included include/antlr3baserecognizer.h:39,              src/antlr3baserecognizer.c:9: include/antlr3defs.h:343: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'antlr3_salent' make[1]: *** [antlr3baserecognizer.lo] error 1 make[1]: leaving directory `/scrubber/libantlr3c-3.2' make: *** [all] error 2 

here link specific antlr3defs.c file included in antlr library: https://docs.google.com/file/d/0b9xs1f8yfyb4cfjrztdwm1pmwws/edit?usp=sharing

oh , i'm able compile on other platforms, ubuntu or cygwin (i cannot use them task though). i'm not familiar aix though , have limited experience compiling c programs. perhaps need set things configure script?

thanks!

edit: made progress, updating post keep info together.

i able resolve above error adding --disable-abiflags option when running configure script... option removes -m32 , -m64 gcc flags. allowed configure script work correctly, left assembler little confused when running make. give guidance, added -wa,-a32 flag cflafs in makefile, letting assembler know wanted 32 bit.

there 1 issue remaining.

ar cru .libs/libantlr3c.a  antlr3baserecognizer.o antlr3basetree.o antlr3basetreeadaptor.o antlr3bitset.o antlr3collections.o antlr3commontoken.o antlr3commontree.o antlr3commontreeadaptor.o antlr3commontreenodestream.o antlr3convertutf.o antlr3cyclicdfa.o antlr3debughandlers.o antlr3encodings.o antlr3exception.o antlr3filestream.o antlr3inputstream.o antlr3intstream.o antlr3lexer.o antlr3parser.o antlr3rewritestreams.o antlr3string.o antlr3stringstream.o antlr3tokenstream.o antlr3treeparser.o antlr3ucs2inputstream.o ar: 0707-128 object_mode environment variable has invalid setting.     object_mode must 32, 64, 32_64, d64 or any. make[1]: *** [libantlr3c.la] error 1 

the problem is, doesn't matter set to. have tried running make not set, , used export set it:

export object_mode=32 

i can type echo $object_mode , indeed print out 32... seems not detect when run make.

i able work around editing "libtool" script add "-x 32" ar options override whatever reading. long-term solution ltmain.sh , re-run configure.

this line in question:

typedef socklen_t antlr3_salent; 

because socklen_t not defined can't typedef it, including socket.h should fix it

#include <sys/socket.h> 

edit: after taking second @ file, socket.h should included if run configure script

#ifdef have_socket_h # include   <socket.h> #else # if have_sys_socket_h #  include  <sys/socket.h> # endif #endif 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -