On Tuesday 15 December 2015 21:55:53 Kiyoshi KANAZAWA wrote: > 2. about #error "Compiler or options invalid for pre-UNIX 03 X/Open > applications" This error may depends on compilers. > Both of "solarisstudio12.4" & "gcc-4.8.5" can build wget-1.17.1 without > errors. > > But I once experienced the similar problem when trying to compile > "sam2p-0.49.2". At that time, gcc-4.4.7 passed, but gcc-4.8.* stopped with > this error and I had to set "-D_XPG6" as optional cc flags. > > ./configure of wget checks compiler to accept ISO C89, such as > "checking for gcc -O3 option to accept ISO C89... none needed". > If "-std=c89" is required for some versions of gcc, shouldn't it set in > configure ?
You could try to insert AC_PROG_CC_C89 after AC_PROG_CC. AFAIK, it will add - std=c89 but only if needed (if the compiler does not support C89 without it). autoreconf && ./configure && make clean && make to see if the problem still occurs. Setting CFLAGS directly in configure.ac is not recommended, AFAIK. Maybe just a set of compilers understands -std=c89 !? Also, setting -std=c89 might be helpful or not, depending of the compiler and version. Nobody is going to waste time working on such a list/table. Maybe we should ask the gnulib people, why flock() isn't emulated on Solaris when -std=c89 is missing !? I could simply be a bug... Also, we could replace flock() by some fcntl() code. But then, that is what gnulib should do for us. Tim
