Steve Underwood wrote:

> The cygwin folk have made the rather odd choice to move their fltk package to 
> use X11 instead of native Windows GDI. Therefore, I have had to build fltk 
> myself. I found two issues which seem worth reporting.

Thanks for the report. As Ian wrote I'm using Cygwin, and the stock FLTK
sources build pretty well.

And yes, the Cygwin folks are making some odd decisions. This X11 one
is surely one of them, but there ought to be a choice:

$ cygcheck -p fltk | grep 10
fltk/fltk-1.1.10-1      Fast Light Toolkit (sources)
fltk/fltk-1.1.10-1-src  Fast Light Toolkit (sources)
fltk-devel/fltk-devel-1.1.10-1  Obsolete package
fltk-doc/fltk-doc-1.1.10-1      Obsolete package
fltk_gdi/fltk_gdi-1.1.10-1-src  Fast Light Toolkit - GDI version (sources)
libfltk-devel/libfltk-devel-1.1.10-1    Fast Light Toolkit (development, 
for X11)
libfltk-doc/libfltk-doc-1.1.10-1        Fast Light Toolkit (HTML 
documentation, for X11 and GDI)
libfltk1.1/libfltk1.1-1.1.10-1  Fast Light Toolkit (runtime for X11)
libfltk1.1-gdi/libfltk1.1-gdi-1.1.10-1  Fast Light Toolkit - GDI version 
(runtime, for GDI)

You should be able to use the GDI version, but I can't help with
this.

It's strange that I didn't see an announcement of this new version
in the cygwin.announce, and I can't find it in the archives either.
They must have forgotten it, but it has been uploaded on June 30, 2010:

"Users with 'fltk' currently installed will get libfltk1.1-gdi in order
to not break their existing (self-built) programs; those with
'fltk-devel' will now get libfltk-devel which will pull in the X11
libfltk1.1."

http://cygwin.com/ml/cygwin-apps/2010-06/msg00220.html

I prefer to use the unpatched FLTK version(s), and they work OOTB
(but see below for configure options).

> The first is a cygwin packaging issue. They have two uuid libraries. One 
> relates to X11, and the other is the Windows library. If you have the files 
> /usr/lib/libuuid.a, /usr/lib/libuuid.dll.a, and /usr/lib/libuuid.la they are 
> from the X11 package, and will prevent the Windows UUID library being picked 
> up from /usr/lib/W32api at link time. I just renamed the offending files to 
> get the out of the way for now.

I don't see that problem here, and I have a rather recent (but not
completely up-to-date) Cygwin 1.7.4 version with X11 installed.
Maybe this is because you installed the fltk package, and this pulled
in its (X11) dependencies. I never installed Cygwin's FLTK package.

You should report this to the Cygwin mailing list as well...

> The second is a patch which is needed to FLTK's configure.in  I had to add 
> definitions for USE_OPENGL32, as follows:
>
> dnl OS-specific pre-tests...
> case $uname in
>      CYGWIN* | MINGW*)
>          # Handle Cygwin option *first*, before all other tests.
>       AC_ARG_ENABLE(cygwin, [  --enable-cygwin         use the CygWin 
> libraries [default=no]])
>       if test x$enable_cygwin != xyes; then
>           # NOTE: We can't use ARCHFLAGS for this, since it does not work
>           #       with some of the function tests - Cygwin uses a
>           #       different C library...
>           CFLAGS="$CFLAGS -mno-cygwin -DUSE_OPENGL32"
>           CPPFLAGS="$CPPFLAGS -mno-cygwin -DUSE_OPENGL32"
>           CXXFLAGS="$CXXFLAGS -mno-cygwin -DUSE_OPENGL32"
>           LDFLAGS="$LDFLAGS -mno-cygwin"
>           DSOFLAGS="$DSOFLAGS -mno-cygwin"
>       else
>           CFLAGS="$CFLAGS -DUSE_OPENGL32"
>           CPPFLAGS="$CPPFLAGS -DUSE_OPENGL32"
>           CXXFLAGS="$CXXFLAGS -DUSE_OPENGL32"
>       fi

Well, fltk 1.1 is not maintained anymore, and I don't think that this
patch would be okay. I remember that we did something similar for
FLTK 1.3 (Cygwin's FLTK maintainer proposed this, and I was the one
to accept it) but I'm not sure that this is correct, since FLTK
should build w/o OpenGL as well. We'll have to reconsider this, maybe
there's something else wrong with configure...

Again, I never had problems with opengl (test) apps in FLTK.

> With these changes, and --enable-cygwin on the command line for configure I 
> have been able to build and use FLTK 1.1.10 quite happily on the current 
> cygwin platform.

As Ian wrote, --enable-cygwin is used to enable the Cygwin DLL which
makes your program depend on it (see the Cygwin *licensing*). If you
want to build distributable native Windows apps, you shouldn't use it.

However, there's another Cygwin decision that makes it difficult
to build FLTK on recent (1.7) Cygwin installs: they decided to
remove the -mno-cygwin option from gcc 4.x (and failed to replace
it with another "cross compiling" option to work with the native
Windows (aka MinGW) compiler, AFAIK). Thus, you need to use gcc-3
for now, either by making it the default compiler, or by using it
explicitly like this:

CC=gcc-3 CXX=g++-3 \
   ./configure

You might want to add:
   --prefix=/usr/local/fltk-1.3-or-whatever

and
   --enable-localjpeg --enable-localpng --enable-localzlib

if you have any of these libs installed in your Cygwin environment,
as these might otherwise be used and make your program depend on
the Cygwin dll (at least if you have the dev packages installed).

Albrecht
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to