[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.linuxtools] Re: Autotools with CygWin

> The Autotools plugin hasn't been tested with CygWin but we don't restrict
> it from being used there.

Hi Jeff,

Thanks for the response, it encouraged me to spend another day seeing how I 
could get this to work. I have had better luck, but I still have some 
problems, which I am fairly sure are down to some problems with path 
construction and executable search paths (PATH env variable).

I've made some notes below on what I did, which may help others in future, 
but for now I am going to go back to using command line autotools to 
configure and I'll just use Eclipse to edit, make and debug.

To try and get VLC bulding:
I have checked out a copy of the project into a new folder (called vlc) in 
my Eclipse workspace using git and then created a new GNU C Autotools 
Project from File->New->Project..., specifying the vlc folder.

The project has a configure script in the workspace/vlc folder, and the 
script works fine when I run it from the CygWin shell (bash). I have a short 
shell script that I run that sets up the environment first, shown below in 
case it is relevant:

PATH=/usr/win32/bin:$PATH \
PKG_CONFIG_LIBDIR=/usr/win32/lib/pkgconfig \
CPPFLAGS="-I/usr/win32/include -I/usr/win32/include/ebml" \
LDFLAGS=-L/usr/win32/lib \
CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin" \
./configure \
     --host=i686-pc-mingw32 \
     --There follows a load of project specific settings ...

I have added the environment variables in the script above to the 
Environment property page under Project Properties->C/C++ Build. Oddly, the 
script above works fine with bash, but using Eclipse gives errors to do 
with:

1. Double quotes are not required in the Eclipse environment vars and  if "" 
is added it is just passed through. So I removed the "s fro my CC, CXX, 
CCFLAGS & CPPFLAGS vars.

2. The configuration script fails to get the version of gcc as my CC 
variable includes a switch and the version call gest translated into 
gcc -mno_cygwin -V which fails as -V must be the first switch. So I 
moved -mno_cygwin to CPPFLAGS.

I then added the switches for the configuration script to the C/C++ 
Build->Settings->Tool Settings property page under configure->Features and 
packages and enabled maintainer mode.

Delete build from Build Directory - the project doesn't use a build folder.

Now, when Eclipse is behaving and the console is able to find and launch the 
autotools binaries, it looks as if my configure works OK. Or at least it is 
mostly OK. When the makefile is executed the build is mostly OK but I think 
that some strangeness has occurred when configuring. At one point one of the 
defines in config.h was output on two lines:

#define VLC_COMPILE_HOST "Paul
"

I'm not sure that I changed anything to fix this, but a distclean and 
rebuild then produced the correct output. I have tried a few small changes 
to the environment vars and now my build is failing again with Eclispe 
unable to find sh. At this point I lost my presence of mind and gave up!

Cheers,

Paul.