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: Wed, 14 Mar 2007 17:01:02 -0700

Bugs item #1677491, was opened at 2007-03-09 19:00
Message generated for change (Comment added) made by bagder
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: 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