STR 2147: new configure option --enable-x11 for building on cygwin with X11

support. 


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6657 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2009-02-14 14:34:32 +00:00
parent 4ac63b788a
commit c0717aa18e
3 changed files with 85 additions and 15 deletions

View File

@ -68,10 +68,14 @@ AC_SUBST(ARCHFLAGS)
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(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 @@ case $uname in
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 @@ if test x$enable_shared = xyes; then
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 @@ AC_ARG_WITH(links, [ --with-links make header links for common missp
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 @@ case $uname in
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 @@ case $uname in
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 @@ case $uname in
*)
# 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...
@ -891,9 +909,10 @@ case $uname in
CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
AC_CHECK_LIB(fontconfig, FcPatternCreate)
AC_CHECK_HEADER(X11/Xft/Xft.h,
AC_CHECK_LIB(Xft, XftDrawCreate,
AC_DEFINE(USE_XFT)
AC_DEFINE(USE_XFT)
LIBS="-lXft $LIBS"))
fi
fi
@ -1199,7 +1218,7 @@ echo ""
echo "Configuration Summary"
echo "-------------------------------------------------------------------------"
case $uname in
case $uname_GUI in
CYGWIN* | MINGW*)
graphics="GDI"
;;

View File

@ -208,6 +208,9 @@ Enable the X double-buffer extension
\par --enable-xft
Enable the Xft library for anti-aliased fonts under X11
\par --enable-x11
When targeting cygwin, build with X11 GUI instead of windows GDI
\par --bindir=/path
Set the location for executables [default = $prefix/bin]

View File

@ -365,6 +365,10 @@ libfltk_images_s.a: $(IMGOBJECTS)
# 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 @@ cygfltknox_images-1.3.dll: $(IMGLIBNAME) cygfltknox-1.3.dll
-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 @@ uninstall:
$(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 @@ uninstall:
$(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 @@ uninstall:
$(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 @@ uninstall:
$(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;\