DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2147
Version: 1.3-feature


Currently when targeting cygwin the windows GDI is used.
The X11 interface does work as well, but is not supported
by the configure script. This patch does not contain any
source changes, but allows to configure for the X11 GUI
when targeting cygwin.

- add a --enable-X11 to the configure script.
- introduce a now variable uname_GUI in the configure script to
  aid in selection of either X11 or GDI when targeting cygwin.
- In src/Makefile there are rules for cygfltknox-*.dll. Add
  rules for cygfltk-*.dll (X11 dlls)
- add -DUSE_OPENGL32 to CFLAGS and CXXFLAGS when targeting GDI. This
  allows to make the right choice at compile team between
  /usr/include/gl/gl.h (for X11) and /usr/include/w32api/gl/gl.h
  (for GDI/opengl)
- Throughout the configure script set THREADS="threads$EXEEXT"
  to make sure we always set the right extension.


Link: http://www.fltk.org/str.php?L2147
Version: 1.3-feature
Index: src/Makefile
===================================================================
--- src/Makefile        (revision 6655)
+++ src/Makefile        (working copy)
@@ -365,6 +365,10 @@
 #   against the import libraries in the src dir.
 #-----------------------------------------------------------------
 
+#-----------------------------------------------------------------
+# cygwin GDI shared libraries
+#-----------------------------------------------------------------
+
 cygfltknox-1.3.dll: $(LIBNAME)
        echo $(DSOCOMMAND) $(LIBNAME) ...
        $(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
@@ -389,6 +393,34 @@
                -L. -lfltk -Wl,--exclude-libs -Wl,libfltk_png.a \
                        $(IMAGELIBS) $(LDLIBS)
 
+#-----------------------------------------------------------------
+# cygwin X11 shared libraries
+#-----------------------------------------------------------------
+
+cygfltk-1.3.dll: $(LIBNAME)
+       echo $(DSOCOMMAND) $(LIBNAME) ...
+       $(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
+               -Wl,--out-implib=libfltk.dll.a $(LDLIBS)
+
+cygfltk_forms-1.3.dll: $(FLLIBNAME) cygfltk-1.3.dll
+       echo $(DSOCOMMAND) $(FLLIBNAME) ...
+       $(DSOCOMMAND) $(FLLIBNAME) -Wl,--no-whole-archive \
+               -Wl,--out-implib=libfltk_forms.dll.a \
+               -L. -lfltk $(LDLIBS)
+
+cygfltk_gl-1.3.dll: $(GLLIBNAME) cygfltk-1.3.dll
+       echo $(DSOCOMMAND) $(GLLIBNAME) ...
+       $(DSOCOMMAND) $(GLLIBNAME) -Wl,--no-whole-archive \
+               -Wl,--out-implib=libfltk_gl.dll.a \
+               -L. -lfltk $(GLDLIBS)
+
+cygfltk_images-1.3.dll: $(IMGLIBNAME) cygfltk-1.3.dll
+       echo $(DSOCOMMAND) $(IMGLIBNAME) ...
+       $(DSOCOMMAND) $(IMGLIBNAME) -Wl,--no-whole-archive \
+               -Wl,--out-implib=libfltk_images.dll.a \
+               -L. -lfltk -Wl,--exclude-libs -Wl,libfltk_png.a \
+                       $(IMAGELIBS) $(LDLIBS)
+
 mgwfltknox-1.3.dll: $(LIBNAME)
        echo $(DSOCOMMAND) $(LIBNAME) ...
        $(DSOCOMMAND) $(LIBNAME) -Wl,--no-whole-archive \
@@ -660,6 +692,10 @@
                $(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
        fi
+       if test x$(DSONAME) = xcygfltk-1.3.dll; then\
+               $(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
+               $(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
+       fi
        if test x$(DSONAME) = xmgwfltknox-1.3.dll; then\
                $(RM) $(DESTDIR)$(bindir)/$(DSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk.dll.a;\
@@ -681,6 +717,10 @@
                $(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
        fi
+       if test x$(FLDSONAME) = xcygfltk_forms-1.3.dll; then\
+               $(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
+               $(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
+       fi
        if test x$(FLDSONAME) = xmgwfltknox_forms-1.3.dll; then\
                $(RM) $(DESTDIR)$(bindir)/$(FLDSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk_forms.dll.a;\
@@ -704,6 +744,10 @@
                $(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
        fi
+       if test x$(GLDSONAME) = xcygfltk_gl-1.3.dll; then\
+               $(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
+               $(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
+       fi
        if test x$(GLDSONAME) = xmgwfltknox_gl-1.3.dll; then\
                $(RM) $(DESTDIR)$(bindir)/$(GLDSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk_gl.dll.a;\
@@ -727,6 +771,10 @@
                $(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
        fi
+       if test x$(IMGDSONAME) = xcygfltk_images-1.3.dll; then\
+               $(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
+               $(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
+       fi
        if test x$(IMGDSONAME) = xmgwfltknox_images-1.3.dll; then\
                $(RM) $(DESTDIR)$(bindir)/$(IMGDSONAME); \
                $(RM) $(DESTDIR)$(libdir)/libfltk_images.dll.a;\
Index: configure.in
===================================================================
--- configure.in        (revision 6655)
+++ configure.in        (working copy)
@@ -68,10 +68,14 @@
 AC_SUBST(OPTIM)
 
 dnl OS-specific pre-tests...
+dnl uname_GUI equals $uname unless we target cygwin
+dnl in combination with X11.
+uname_GUI=$uname
 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]])
+       AC_ARG_ENABLE(X11, [  --enable-X11         use CygWin with X11 
[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
@@ -81,6 +85,11 @@
            CXXFLAGS="$CXXFLAGS -mno-cygwin"
            LDFLAGS="$LDFLAGS -mno-cygwin"
            DSOFLAGS="$DSOFLAGS -mno-cygwin"
+       else
+           # we target cygwin in combination with X11
+           if test x$enable_X11 == xyes; then
+               uname_GUI="X11$uname"
+           fi
        fi
        ;;
 esac
@@ -267,11 +276,19 @@
                IMGDSONAME="mgwfltknox_images-$FL_API_VERSION.dll"
                CAIRODSONAME="mgwfltknox_cairo-$FL_API_VERSION.dll"
            else
-               DSONAME="cygfltknox-$FL_API_VERSION.dll"
-               FLDSONAME="cygfltknox_forms-$FL_API_VERSION.dll"
-               GLDSONAME="cygfltknox_gl-$FL_API_VERSION.dll"
-               IMGDSONAME="cygfltknox_images-$FL_API_VERSION.dll"
-               CAIRODSONAME="cygfltknox_cairo-$FL_API_VERSION.dll"
+               if test x$enable_X11 == xyes; then
+                   DSONAME="cygfltk-$FL_API_VERSION.dll"
+                   FLDSONAME="cygfltk_forms-$FL_API_VERSION.dll"
+                   GLDSONAME="cygfltk_gl-$FL_API_VERSION.dll"
+                   IMGDSONAME="cygfltk_images-$FL_API_VERSION.dll"
+                   CAIRODSONAME="cygfltk_cairo-$FL_API_VERSION.dll"
+               else
+                   DSONAME="cygfltknox-$FL_API_VERSION.dll"
+                   FLDSONAME="cygfltknox_forms-$FL_API_VERSION.dll"
+                   GLDSONAME="cygfltknox_gl-$FL_API_VERSION.dll"
+                   IMGDSONAME="cygfltknox_images-$FL_API_VERSION.dll"
+                   CAIRODSONAME="cygfltknox_cairo-$FL_API_VERSION.dll"
+               fi
            fi
            #-----------------------------------------------------------
            # -Wl,--enable-runtime-pseudo-reloc: See str 1585
@@ -730,15 +747,15 @@
 INSTALL_DESKTOP=""
 UNINSTALL_DESKTOP=""
 
-case $uname in
+case $uname_GUI in
     CYGWIN* | MINGW*)
-       dnl Cygwin environment...
+       dnl Cygwin environment, using windows GDI ...
        # Recent versions of Cygwin are seriously broken and the size
        # checks don't work because the shell puts out \r\n instead of
        # \n.  Here we just force U32 to be defined to "unsigned"...
         AC_DEFINE(U32,unsigned)
-       CFLAGS="-mwindows -DWIN32 $CFLAGS"
-       CXXFLAGS="-mwindows -DWIN32 $CXXFLAGS"
+       CFLAGS="-mwindows -DWIN32 -DUSE_OPENGL32 $CFLAGS"
+       CXXFLAGS="-mwindows -DWIN32 -DUSE_OPENGL32 $CXXFLAGS"
        LDFLAGS="-mwindows $LDFLAGS"
        DSOFLAGS="-mwindows $DSOFLAGS"
        LIBS="$LIBS -lole32 -luuid -lcomctl32"
@@ -766,7 +783,7 @@
                AC_DEFINE(HAVE_PTHREAD)
            fi
 
-           THREADS="threads.exe"
+           THREADS="threads$EXEEXT"
         fi
 
        # Don't make symlinks since Windows is not case sensitive.
@@ -781,7 +798,7 @@
 
        if test x$have_pthread = xyes; then
            AC_DEFINE(HAVE_PTHREAD)
-           THREADS="threads"
+           THREADS="threads$EXEEXT"
        fi
 
        if test x$enable_gl != xno; then
@@ -810,9 +827,10 @@
 
     *)
        # All others are UNIX/X11...
+       # This includes cygwin target combined with X11
        if test x$have_pthread = xyes; then
            AC_DEFINE(HAVE_PTHREAD)
-           THREADS="threads"
+           THREADS="threads$EXEEXT"
        fi
 
        dnl Check for X11...
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to