cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1677491 ] compilation outside distribution directory failed.

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 15 Mar 2007 08:28:25 -0700

Bugs item #1677491, was opened at 2007-03-09 19:00
Message generated for change (Comment added) made by benjihan
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1677491&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: compile or build problem
Group: portability problem
Status: Open
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: benjamin gerard (benjihan)
Assigned to: Daniel Stenberg (bagder)
Summary: compilation outside distribution directory failed.

Initial Comment:
cURL package version 7.15.5

Problem: I was trying to compile curl package for mingw32 platform on a linux system. configure command I used is something like:
>../curl-7.15.5/configure --host=i386-pc-mingw32
>make
>

In file included from ../../../../curl68/lib/setup.h:375,
                 from ../../../../curl68/lib/strtoofft.h:31,
                 from ../../../../curl68/lib/curlx.h:41,
                 from ../../../../curl68/src/main.c:105:
../../../../curl68/lib/setup_once.h:82: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Missing_definition_of_macro_sread’

The same probleme occurs when not using cross compilation. After investigation I have figured what the error is: the wrong config.h is include. It is included by the setup.h in either lib/ or src/ directory depending what is being compiled. When compiling in the distrib directory lib/setup.h(#include "config.h") will always include lib/config.h (resp. src). In my case as config.h files are configured their locations is not in the same directory that setup.h but ${topdir}/src/config.h and ${topdir}/lib/config.h. In this configuration the config.h file actually include by setup.h is the one from the first -I ... As a simple workaround you should change the name of the configuration in both directory. Notice that I am not an expert of autoconf but I guess your way of using the config.h is not totally recommended.

----------------------------------------------------------------------

>Comment By: benjamin gerard (benjihan)
Date: 2007-03-15 16:28

Message:
Logged In: YES
user_id=613648
Originator: YES

To be as short as possible: The config.h file included by setup.h is not
the same file if you compile either inside or outside distrib directory.
This difference of behavior is most probably not done on purpose, that why
I call it a BUG. This bug currently do not produce error (at least not with
lastest curl within the configuration I had tried), which makes it, I agree
not prioritary, but it does exist anyway. It's not because a bug do not
actually crash or whatever that it is not there (most bugs exist long
before being dicovered). So may be this one may become annoying in the
future. Anyway even if it is not a very important bug, I have proposed a
very simple fix which takes you less time than this discussion to apply and
test :) If the fix produces some an expected side effects (I don't think it
will) it would be very easy to rollback. If you really want I can upload a
patch but again it's just to a lot of noise for nothing.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2007-03-15 15:46

Message:
Logged In: YES
user_id=1110
Originator: NO

Then please clarify to me. What exactly is the error and problem? What is
this "the bug" you refer to?

I can build 7.16.1 fine outside of the source directory, cross-compiler
(for any platform, including with mingw for windows) and native compiler.

----------------------------------------------------------------------

Comment By: benjamin gerard (benjihan)
Date: 2007-03-15 15:42

Message:
Logged In: YES
user_id=613648
Originator: YES

No. The bug is the very same. My mistake was to think it was related to
mingw (because that's the case in I have noticed the bug). In the first
time I was using curl 7.15.5 did a compile error so I had notice the bug.
In a 2nd time you tell me to use 7.16,1 what I have done and it has
compiled... So you think the bug is gone ? But as I was curious I had tried
to understand how it was fixed and that's how I had noticed it was not
really fixed : the wrong file still be included. That was the very origin
of the problem. So off course I could find some time to register an another
mailing-list to explain that problem again and again, or may be people in
charge like you can communicate with his teammate and do the job. I am just
trying to help here.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2007-03-15 13:43

Message:
Logged In: YES
user_id=1110
Originator: NO

Okay, so the error you reported has now converted into a thread about what
files that are included from what directory and how you think it should be
done instead?

Since this is no longer the bug report you filed, I suggest you instead
post your design questions and suggestíons to the libcurl mailing list and
we can discuss their pros and cons there.

----------------------------------------------------------------------

Comment By: benjamin gerard (benjihan)
Date: 2007-03-15 02:05

Message:
Logged In: YES
user_id=613648
Originator: YES

Of course there is no warning I've added #warning directive in order to
trace more easily which file included by what. Have a closer look to the
traces in my previous message, you'll see that in one case (when compiling
inside package directory) setup.h include the config.h in the same
directory (either lib or src) (no error in this cass). In the other case
(compiling outside) both setup.h always includes lib/config.h. As I had
written before it produce no error with the new version because (in my case
at least) both config.h are the same (I mean diff lib/config.h src/config.h
==> 0) ... But even if it produces no error it is an error (from my point
of view) because different files may have different content... Either these
files always have the same content then you should put it in the top folder
so that there is only one instance of it and avoid any confusion. Or the
content may be different and there is an error (the wrong file may be
include). The fix I propose is very simple, you just have to edit both
setup.h and put ../lib/ and ../src/ in the #include config.h lines. I guess
it should not introduce any side effect... I hope I make myself clear.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2007-03-15 01:01

Message:
Logged In: YES
user_id=1110
Originator: NO

I just tried 7.16.1 now too, and I don't get those problems. I used this
command line:

env LDFLAGS=-L/home/dast/src/win32 CFLAGS="-I/home/dast/src/win32/include
-isystem /home/dast/src/win32/include -Os" ../curl-7.16.1/configure
--host=i586-mingw32msvc --target=i586-mingw32msvc --disable-shared
--with-random=notused --with-zlib

No errors, no warnings...

Using i586-mingw32msvc-gcc (GCC) 3.4.5 (mingw special) on Debian
unstable.

----------------------------------------------------------------------

Comment By: benjamin gerard (benjihan)
Date: 2007-03-10 12:23

Message:
Logged In: YES
user_id=613648
Originator: YES

I've just tried with curl-7.16.1 (sorry I thought I had the latest
version):
At first sight, It did compile. So I've quickly tried to understand how
you fix the problem but I did not see anything :) The wrong file seems to
be include in fact it is just that it does not make any error so it goes
unnotice. Look at those trace:

Compiling *IN* distrib directory:

In file included from main.c:24:
setup.h:26:2: warning: #warning ">>>src/setup.h"
In file included from setup.h:46,
                 from main.c:24:
config.h:4:2: warning: #warning ">>>src/config.h"

Compiling *OUTSIDE* distrib directory:

In file included from ../../../../curl68/src/main.c:24:
../../../../curl68/src/setup.h:26:2: warning: #warning ">>>src/setup.h"
In file included from ../../../../curl68/src/setup.h:46,
                 from ../../../../curl68/src/main.c:24:
../lib/config.h:7:2: warning: #warning ">>>> lib/config.h"

It seems lib/config.h still be included by src/setup.h. That is not the
normal/expected behavior, is it ? I had noticed both config.h are the same
(at least in my configuration) this might be how you fix the problem but it
feel it more workaround than just changing the name of both config.h (let's
try config_libcurl.h and config_srccurl.h or whatever). If you intend to
have exactly the same config.h in all cases may be should you just have one
copy of this file in the top most directory ?

I have just tried another way to fix it which seems to work pretty well:
I have change #include "config.h" to #include "../lib/config.h" (resp.
src) the result of my test looks good:

In file included from ../../../../curl68/src/main.c:24:
../../../../curl68/src/setup.h:26:2: warning: #warning ">>>src/setup.h"
In file included from ../../../../curl68/src/setup.h:46,
                 from ../../../../curl68/src/main.c:24:
../lib/../src/config.h:1:2: warning: #warning ">>>src/config.h"

Just one more thing outside this subject (i'm just too lazy to start a new
bug):
`make distclean' deletes the src/hugehelp.c file and the package can no
longer compile.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2007-03-09 22:22

Message:
Logged In: YES
user_id=1110
Originator: NO

But this works fine in later versions, right?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1677491&group_id=976
Received on 2007-03-15

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET