Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

Re: [PATCH v3] autoconf: Test FREAD_READS_DIRECTORIES

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:20

Hi,

On Tue, 4 Mar 2008, Michal Rokos wrote:
On Tuesday 04 March 2008 15:59:02 Johannes Schindelin wrote:
quoted
On Tue, 4 Mar 2008, Michal Rokos wrote:
quoted
+AC_RUN_IFELSE(
+	[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+		[[char c;
+		FILE *f = fopen(".", "r");
+		if (! f) return 0;
+		if (f && fread(&c, 1, 1, f) > 0) return 1]])],
+	[ac_cv_fread_reads_directories=no],
+	[ac_cv_fread_reads_directories=yes])
I do not see the issue addressed that I saw on msysGit.
ahh, sorry I've included some old one. Now it's
+AC_RUN_IFELSE(
+	[AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+		[[char c;
+		FILE *f = fopen(".", "r");
+		return f && fread(&c, 1, 1, f)]])],
+	[ac_cv_fread_reads_directories=no],
+	[ac_cv_fread_reads_directories=yes])

I've tried to reproduce, but I failed to do so. When I put "return 0;" it 
detect that "no"; when I return something else, "yes" is detected - as it 
should.
I finally figured out what is going wrong.

But first let me say what a PITA it is to debug configure.  It is utterly, 
completely painful!  When you insert random "exit"s, like you usually do 
with scripts that are too garbled and complex and ugly to understand (the 
worst Perl code I ever saw was not as ugly), it does not exit _at all_!

Turns out that the compilation fails:

	...\ld.exe: cannot find -lsocket 1 exit status

Nice.

FWIW it tries to link with

	cc -o conftest.exe -g -O2   conftest.c  -liconv -lsocket >&5

Hth,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help