Login | Register
My pages Projects Community openCollabNet

Discussions > users > configure tests

Discussion topic

Back to topic list

configure tests

Author Alexander Pyhalov <alp at rsu dot ru>
Full name Alexander Pyhalov <alp at rsu dot ru>
Date 2009-12-29 01:35:47 PST
Message Hello.
On freebsd configure script incorrectly decides that system has
fmemopen() function (defines HAVE_FMEMOPEN 1). This happens because it
has AC_COMPILE_IFELSE directive for
int main(int argc, char *args[])
{ return fmemopen(args[0], 2, args[1]) == NULL; }

It should be changed to AC_LINK_IFELSE, because compiler uses default
prototype for fmemopen() and compiles it. If we tried to link it, we
would have:
conftest.c: In function 'main':
conftest.c:9: warning: comparison between pointer and integer
/var/tmp//cclJD5PD.o​(.text+0x3c): In function `main.2298':
: undefined reference to `fmemopen'

However, using AC_LINK_IFELSE is not enough, because ac_compile includes
   "-O2" CFLAGS for gcc. It leads to incorrect behavior during linking:
(must be bug in gcc). When using -O2 switch, the program is compiled
only with warning:
conftest.c: In function 'main':
conftest.c:9: warning: comparison between pointer and integer

I'm making a freebsd port for fsvs and need advise, how to deal with
this? I would ask you to change AC_COMPILE_IFELSE to AC_LINK_IFELSE (it
seems more correct). For now in my port I will possibly use -O0 CFLAGS
to suppress this behavior, later I'll contact with (freebsd?) gcc
maintainers to report this bug.

Another bad feature of fsvs configure script is its "bashism". It uses
bash-specific (non-sh) test conditions:
[[ condition ]]should be changed to [ condition ],
&& should be changed to -a
== in shell should be changed to =.

It is not difficult, but makes program more sh-compliant.

Another point, ENODATA constant in src/est_ops.c should be changed to
APR_EOF. It makes this file portable.
Attaching patches to make fsvs more standard-compliant (they are not
enough to compile it on freebsd, but this is a minimum which will not
harm). Is there hope that this changes will be merged?

Also, on FreeBSD there is no alloca.h and fstat64, but I'll patch it in
Best regards,
Alexander Pyhalov,
system administrator of Computer Center of South Federal University

« Previous message in topic | 1 of 2 | Next message in topic »


Show all messages in topic

configure tests Alexander Pyhalov <alp at rsu dot ru> Alexander Pyhalov <alp at rsu dot ru> 2009-12-29 01:35:47 PST
     Re: configure tests pmarek P.Marek 2009-12-30 02:12:46 PST
Messages per page: