summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in443
1 files changed, 249 insertions, 194 deletions
diff --git a/configure.in b/configure.in
index 8cd0908..c18bc67 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,11 @@
dnl -*- sh -*-
dnl the "configure" script is made from this by running GNU "autoconf"
dnl
-dnl "$Id: configure.in 9707 2012-11-06 21:13:54Z matt $"
+dnl "$Id: configure.in 10418 2014-10-30 14:07:58Z AlbrechtS $"
dnl
dnl Configuration script for the Fast Light Tool Kit (FLTK).
dnl
-dnl Copyright 1998-2010 by Bill Spitzak and others.
+dnl Copyright 1998-2014 by Bill Spitzak and others.
dnl
dnl This library is free software. Distribution and use rights are outlined in
dnl the file "COPYING" which should have been included with this file. If this
@@ -24,21 +24,40 @@ AC_PREREQ(2.50)
dnl Required file in package...
AC_INIT(src/Fl.cxx)
+AC_CANONICAL_HOST
+
+dnl Do not automatically add "-g" to compiler options...
+dnl This must be _before_ "Find compiler commands..."
+ARCHFLAGS="${ARCHFLAGS:=}"
+CFLAGS="${CFLAGS:=}"
+CPPFLAGS="${CPPFLAGS:=}"
+CXXFLAGS="${CXXFLAGS:=}"
+DSOFLAGS="${DSOFLAGS:=}"
+LDFLAGS="${LDFLAGS:=}"
+OPTIM="${OPTIM:=}"
+
+dnl Find compiler commands...
+AC_PROG_CC
+AC_PROG_CXX
+
dnl So --with-archflags option is used during "checking size of long"
-if test `uname` = Darwin; then
- if test "x$with_archflags" != x ; then
- CFLAGS="$CFLAGS $with_archflags"
- fi
- USEMMFILES="Yes"
-else
- USEMMFILES="No"
-fi
+case $host_os in
+ darwin*)
+ if test "x$with_archflags" != x ; then
+ CFLAGS="$CFLAGS $with_archflags"
+ fi
+ USEMMFILES="Yes"
+ ;;
+ *)
+ USEMMFILES="No"
+ ;;
+esac
AC_SUBST(USEMMFILES)
dnl FLTK library versions...
FL_MAJOR_VERSION=1
FL_MINOR_VERSION=3
-FL_PATCH_VERSION=1
+FL_PATCH_VERSION=3
FL_API_VERSION=${FL_MAJOR_VERSION}.${FL_MINOR_VERSION}
AC_SUBST(FL_MAJOR_VERSION)
@@ -46,61 +65,21 @@ AC_SUBST(FL_MINOR_VERSION)
AC_SUBST(FL_PATCH_VERSION)
AC_SUBST(FL_API_VERSION)
-dnl Get the operating system and version number...
-uname=`uname`
-uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`
-if test "x$uname" = xIRIX64; then
- uname="IRIX"
-fi
-if test "x$uname" = x; then
- # Older MinGW doesn't provide any output when uname is run, even with "-s".
- # Current MinGW (as of Jan. 2011) however does, so this is not necessary anymore...
- uname="MINGW"
-fi
-
-dnl Do not automatically add "-g" to compiler options...
-ARCHFLAGS="${ARCHFLAGS:=}"
-CFLAGS="${CFLAGS:=}"
-CPPFLAGS="${CPPFLAGS:=}"
-CXXFLAGS="${CXXFLAGS:=}"
-DSOFLAGS="${DSOFLAGS:=}"
-LDFLAGS="${LDFLAGS:=}"
-OPTIM="${OPTIM:=}"
-
AC_SUBST(ARCHFLAGS)
AC_SUBST(OPTIM)
-dnl in case of cross-compiling mingw32 under linux we must change uname for Win32 GUI
-dnl run ./configure --host=i686-pc-ming32 try use X11 without change uname
-if test "x$cross_compiling" != xno ; then
- case $host_alias in
- *mingw*)
- uname=MINGW
- ;;
- esac
-fi
-
dnl OS-specific pre-tests...
-dnl uname_GUI equals $uname unless we target Cygwin in combination with X11.
-uname_GUI=$uname
-case $uname in
- CYGWIN*)
+dnl host_os_gui equals $host_os unless we target Cygwin in combination with X11.
+host_os_gui=$host_os
+case $host_os in
+ cygwin*)
# 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
- # different C library...
- CFLAGS="$CFLAGS -mno-cygwin"
- CPPFLAGS="$CPPFLAGS -mno-cygwin"
- CXXFLAGS="$CXXFLAGS -mno-cygwin"
- LDFLAGS="$LDFLAGS -mno-cygwin"
- DSOFLAGS="$DSOFLAGS -mno-cygwin"
- else
+ 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
# we target Cygwin in combination with X11
if test x$enable_x11 = xyes; then
- uname_GUI="X11$uname"
+ host_os_gui="X11$host_os"
fi
fi
;;
@@ -133,8 +112,8 @@ LINKFLTKCAIRO=""
FLTKCAIROOPTION=""
CAIROLIBS=""
-AC_ARG_ENABLE(cairoext,[ --enable-cairoext use fltk code instrumentation for cairo extended use (default=no)])
-AC_ARG_ENABLE(cairo,[ --enable-cairo use lib Cairo (default=no)])
+AC_ARG_ENABLE(cairoext,[ --enable-cairoext use fltk code instrumentation for cairo extended use [[default=no]]])
+AC_ARG_ENABLE(cairo, [ --enable-cairo use lib Cairo [[default=no]]])
if test x$enable_cairoext = xyes; then
AC_DEFINE(FLTK_USE_CAIRO)
@@ -190,29 +169,29 @@ AC_SUBST(IMGLIBBASENAME)
AC_SUBST(CAIROLIBBASENAME)
dnl Handle compile-time options...
-AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]])
+AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [[default=no]]])
if test x$enable_debug = xyes; then
DEBUGFLAG="-g "
else
DEBUGFLAG=""
fi
-AC_ARG_ENABLE(cp936, [ --enable-cp936 turn on CP936 [default=no]])
+AC_ARG_ENABLE(cp936, [ --enable-cp936 turn on CP936 [[default=no]]])
if test x$enable_cp936 = xyes; then
CFLAGS="$CFLAGS -DCP936"
fi
-AC_ARG_ENABLE(gl, [ --enable-gl turn on OpenGL support [default=yes]])
+AC_ARG_ENABLE(gl, [ --enable-gl turn on OpenGL support [[default=yes]]])
-AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [default=no]])
+AC_ARG_ENABLE(shared, [ --enable-shared turn on shared libraries [[default=no]]])
if test x$enable_shared = xyes; then
PICFLAG=1
SHAREDSUFFIX=""
FLUID="fluid-shared"
- case $uname in
- Darwin*)
+ case $host_os in
+ darwin*)
DSONAME="libfltk.$FL_API_VERSION.dylib"
FLDSONAME="libfltk_forms.$FL_API_VERSION.dylib"
GLDSONAME="libfltk_gl.$FL_API_VERSION.dylib"
@@ -221,7 +200,7 @@ if test x$enable_shared = xyes; then
DSOCOMMAND="\$(CXX) \$(ARCHFLAGS) \$(DSOFLAGS) -dynamiclib -lc -o"
;;
- SunOS* | UNIX_S*)
+ solaris*)
DSONAME="libfltk.so.$FL_API_VERSION"
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
@@ -232,7 +211,7 @@ if test x$enable_shared = xyes; then
DSOLINK="-R$libdir"
fi
;;
- HP-UX*)
+ hpux*)
DSONAME="libfltk.sl.$FL_API_VERSION"
FLDSONAME="libfltk_forms.sl.$FL_API_VERSION"
GLDSONAME="libfltk_gl.sl.$FL_API_VERSION"
@@ -243,7 +222,7 @@ if test x$enable_shared = xyes; then
DSOLINK="-Wl,-rpath,$libdir"
fi
;;
- IRIX*)
+ irix*)
DSONAME="libfltk.so.$FL_API_VERSION"
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
@@ -254,7 +233,7 @@ if test x$enable_shared = xyes; then
DSOLINK="-Wl,-rpath,$libdir"
fi
;;
- OSF1*)
+ osf*)
DSONAME="libfltk.so.$FL_API_VERSION"
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
@@ -265,18 +244,53 @@ if test x$enable_shared = xyes; then
DSOLINK="-Wl,-rpath,$libdir"
fi
;;
- Linux* | *BSD*)
+ linux* | *bsd*)
DSONAME="libfltk.so.$FL_API_VERSION"
FLDSONAME="libfltk_forms.so.$FL_API_VERSION"
GLDSONAME="libfltk_gl.so.$FL_API_VERSION"
IMGDSONAME="libfltk_images.so.$FL_API_VERSION"
CAIRODSONAME="libfltk_cairo.so.$FL_API_VERSION"
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-soname,\$@ -shared -fPIC $DEBUGFLAG -o"
+
+ # See if the compiler supports -fvisibility...
+ AC_CACHE_CHECK([if the compiler supports -fvisibility],
+ ac_cv_cxx_fvisibility, [
+ OLDCXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,,
+ ac_cv_cxx_fvisibility=yes,
+ ac_cv_cxx_fvisibility=no)
+ CXXFLAGS="$OLDCXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+ if test x"$ac_cv_cxx_fvisibility" = xyes; then
+ OPTIM="$OPTIM -fvisibility=hidden"
+ fi
+
+ # See if the compiler supports -fvisibility-inlines-hidden...
+ AC_CACHE_CHECK([if the compiler supports -fvisibility-inlines-hidden],
+ ac_cv_cxx_fvisibility_inlines, [
+ OLDCXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ AC_TRY_COMPILE(,,
+ ac_cv_cxx_fvisibility_inlines=yes,
+ ac_cv_cxx_fvisibility_inlines=no)
+ CXXFLAGS="$OLDCXXFLAGS"
+ AC_LANG_RESTORE
+ ])
+ if test x"$ac_cv_cxx_fvisibility_inlines" = xyes; then
+ CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
+ fi
+
# if test "x$libdir" != "x/usr/lib" -a "x$libdir" != "x/usr/lib64"; then
# DSOLINK="-Wl,-rpath,$libdir"
# fi
;;
- AIX*)
+ aix*)
DSONAME="libfltk_s.a"
FLDSONAME="libfltk_forms_s.a"
GLDSONAME="libfltk_gl_s.a"
@@ -285,7 +299,7 @@ if test x$enable_shared = xyes; then
DSOCOMMAND="\$(CXX) \$(DSOFLAGS) -Wl,-bexpall,-bM:SRE,-bnoentry -o"
SHAREDSUFFIX="_s"
;;
- CYGWIN* | MINGW*)
+ cygwin* | mingw*)
PICFLAG=0
if test x$enable_cygwin != xyes; then
DSONAME="mgwfltknox-$FL_API_VERSION.dll"
@@ -356,7 +370,7 @@ AC_SUBST(SHAREDSUFFIX)
AC_SUBST(LINKSHARED)
AC_SUBST(FLUID)
-AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support (default=yes)])
+AC_ARG_ENABLE(threads, [ --enable-threads enable multi-threading support [[default=yes]]])
AC_ARG_WITH(optim, [ --with-optim="flags" use custom optimization flags])
@@ -364,19 +378,17 @@ AC_ARG_WITH(archflags, [ --with-archflags="flags"
use custom architecture flags
(possible Mac OS X values include -arch i386, -arch x86_64, -arch ppc)],
ARCHFLAGS="$withval")
-case $uname in
- Darwin*)
+case $host_os in
+ darwin*)
# QD is not supported anymore since 1.3
AC_DEFINE(__APPLE_QUARTZ__)
;;
esac
dnl Find commands...
-AC_PROG_CC
-AC_PROG_CXX
AC_PROG_INSTALL
-case $uname in
- OSF1*)
+case $host_os in
+ osf*)
INSTALL="`pwd`/install-sh -c"
;;
esac
@@ -394,7 +406,6 @@ if test "x$NROFF" = "x:"; then
NROFF="$GROFF -T ascii"
fi
fi
-AC_PATH_PROG(HTMLDOC,htmldoc)
AC_PATH_PROG(DOXYDOC,doxygen)
dnl How do we make libraries?
@@ -418,10 +429,6 @@ dnl this will only be used to compile resources for Windows .exe files
AC_PATH_TOOL(RC,windres)
dnl Architecture checks...
-if test "$uname" != Darwin; then
- AC_C_BIGENDIAN
-fi
-
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
@@ -435,7 +442,12 @@ else
AC_DEFINE(U32,unsigned long)
fi
fi
-if test "$uname" != Darwin; then
+case $host_os in
+ darwin*)
+ ;;
+ *)
+ AC_C_BIGENDIAN
+
if test $ac_cv_sizeof_int -eq 8; then
AC_DEFINE(U64,unsigned)
else
@@ -443,7 +455,8 @@ if test "$uname" != Darwin; then
AC_DEFINE(U64,unsigned long)
fi
fi
-fi
+ ;;
+esac
dnl Does the C++ compiler support the bool type?
AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
@@ -494,57 +507,40 @@ if test "$ac_cv_cxx_scandir_posix" = yes; then
AC_DEFINE(HAVE_SCANDIR)
AC_DEFINE(HAVE_SCANDIR_POSIX)
else
- AC_CHECK_FUNC(scandir,
- if test "x$uname" = xSunOS -o "x$uname" = xQNX; then
- AC_MSG_WARN(Not using $uname scandir emulation function.)
- else
- AC_DEFINE(HAVE_SCANDIR)
- fi)
+ AC_CHECK_FUNC(scandir,[
+ case $host_os in
+ solaris* | *qnx*)
+ AC_MSG_WARN(Not using $host_os scandir emulation function.)
+ ;;
+ *)
+ AC_DEFINE(HAVE_SCANDIR)
+ ;;
+ esac])
fi
AC_CHECK_FUNC(vsnprintf,[
- case "$uname" in
- HP-UX*)
- if test "$uversion" = "1020"; then
- AC_MSG_WARN(Not using built-in vsnprintf function because you are running HP-UX 10.20.)
- else
- AC_DEFINE(HAVE_VSNPRINTF)
- fi
- ;;
-
- OSF1*)
- if test "$uversion" = "40"; then
- AC_MSG_WARN(Not using built-in vsnprintf function because you are running Tru64 4.0.)
- else
- AC_DEFINE(HAVE_VSNPRINTF)
- fi
- ;;
-
+ case $host_os in
+ hpux1020)
+ AC_MSG_WARN(Not using built-in vsnprintf function because you are running HP-UX 10.20.)
+ ;;
+ osf4)
+ AC_MSG_WARN(Not using built-in vsnprintf function because you are running Tru64 4.0.)
+ ;;
*)
AC_DEFINE(HAVE_VSNPRINTF)
- ;;
+ ;;
esac])
AC_CHECK_FUNC(snprintf,[
- case "$uname" in
- HP-UX*)
- if test "$uversion" = "1020"; then
- AC_MSG_WARN(Not using built-in snprintf function because you are running HP-UX 10.20.)
- else
- AC_DEFINE(HAVE_SNPRINTF)
- fi
- ;;
-
- OSF1*)
- if test "$uversion" = "40"; then
- AC_MSG_WARN(Not using built-in snprintf function because you are running Tru64 4.0.)
- else
- AC_DEFINE(HAVE_SNPRINTF)
- fi
- ;;
-
+ case $host_os in
+ hpux1020)
+ AC_MSG_WARN(Not using built-in snprintf function because you are running HP-UX 10.20.)
+ ;;
+ osf4)
+ AC_MSG_WARN(Not using built-in snprintf function because you are running Tru64 4.0.)
+ ;;
*)
AC_DEFINE(HAVE_SNPRINTF)
- ;;
+ ;;
esac])
AC_CHECK_HEADER(strings.h, AC_DEFINE(HAVE_STRINGS_H))
AC_CHECK_FUNCS(strcasecmp strlcat strlcpy)
@@ -587,8 +583,6 @@ if test $ac_cv_c_long_long = yes; then
AC_DEFINE(HAVE_LONG_LONG)
fi
-AC_CHECK_FUNC(strtoll, AC_DEFINE(HAVE_STRTOLL))
-
dnl Check for dlopen/dlsym...
AC_SEARCH_LIBS(dlsym, dl, AC_DEFINE(HAVE_DLSYM))
AC_CHECK_HEADER(dlfcn.h, AC_DEFINE(HAVE_DLFCN_H))
@@ -596,13 +590,13 @@ AC_CHECK_HEADER(dlfcn.h, AC_DEFINE(HAVE_DLFCN_H))
dnl Check for audio libraries...
AUDIOLIBS=""
-case $uname in
- CYGWIN* | MINGW*)
+case $host_os in
+ cygwin* | mingw*)
dnl Cygwin environment...
AUDIOLIBS="-lwinmm"
;;
- Darwin*)
+ darwin*)
AUDIOLIBS="-framework CoreAudio"
;;
@@ -626,7 +620,7 @@ AC_SUBST(STATICIMAGELIBS)
# Handle the JPEG lib linking mode (use fltk local or system lib)
# If --enable-(resp. --disable-)localjpeg parameter is not set by user
# Then we check the JPEG lib usability, with result in sysjpeglib_ok variable
-AC_ARG_ENABLE(localjpeg, [ --enable-localjpeg use local JPEG library, default=auto])
+AC_ARG_ENABLE(localjpeg, [ --enable-localjpeg use local JPEG library [[default=auto]]])
# Check for System lib use if automatic mode or --disable-localjpeg is requested
sysjpeglib_ok=no
sysjpeginc_ok=no
@@ -661,7 +655,7 @@ fi
# Handle the ZLIB lib linking mode (use fltk local or system lib)
# If --enable-(resp. --disable-)localzlib parameter is not set by user
# Then we check the ZLIB lib usability, with result in syszlib_ok variable
-AC_ARG_ENABLE(localzlib, [ --enable-localzlib use local ZLIB library, default=auto])
+AC_ARG_ENABLE(localzlib, [ --enable-localzlib use local ZLIB library [[default=auto]]])
# Check for System lib use if automatic mode or --disable-localzlib is requested
syszlib_ok=no
syszinc_ok=no
@@ -698,7 +692,7 @@ fi
# Handle the PNG lib linking mode (use fltk local or system lib)
# If --enable-(resp. --disable-)localpng parameter is not set by user
# Then we check the png lib usability with result in syspng_lib variable
-AC_ARG_ENABLE(localpng, [ --enable-localpng use local PNG library, default=auto])
+AC_ARG_ENABLE(localpng, [ --enable-localpng use local PNG library [[default=auto]]])
# Now check if system lib is usable, we check Lib AND include availability with inc variant,
# but only, if the builtin lib is not requested
@@ -762,11 +756,11 @@ dnl Test whether we want to check for pthreads. We must not do it on Windows
dnl unless we run under Cygwin with --enable-cygwin, since we always use
dnl native threads on Windows (even if libpthread is available)
check_pthread=yes
-case $uname in
- MINGW*)
+case $host_os in
+ mingw*)
check_pthread=no
;;
- CYGWIN*)
+ cygwin*)
if test "x$enable_cygwin" != xyes; then
check_pthread=no
fi
@@ -796,9 +790,11 @@ if test "x$enable_threads" != xno -a x$check_pthread = xyes; then
# Solaris requires -D_POSIX_PTHREAD_SEMANTICS to
# be POSIX-compliant... :(
- if test $uname = SunOS; then
- PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
- fi
+ case $host_os in
+ solaris*)
+ PTHREAD_FLAGS="$PTHREAD_FLAGS -D_POSIX_PTHREAD_SEMANTICS"
+ ;;
+ esac
break
fi
done
@@ -813,13 +809,13 @@ HLINKS=
OSX_ONLY=:
THREADS=
-AC_ARG_WITH(links, [ --with-links make header links for common misspellings (default=no)])
+AC_ARG_WITH(links, [ --with-links make header links for common misspellings [[default=no]]])
INSTALL_DESKTOP=""
UNINSTALL_DESKTOP=""
-case $uname_GUI in
- CYGWIN* | MINGW*)
+case $host_os_gui in
+ cygwin* | mingw*)
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
@@ -863,7 +859,7 @@ case $uname_GUI in
fi
;;
- Darwin*)
+ darwin*)
# MacOS X uses Cocoa for graphics.
LIBS="$LIBS -framework Cocoa"
@@ -962,7 +958,7 @@ case $uname_GUI in
fi
dnl Check for Xinerama support unless disabled...
- AC_ARG_ENABLE(xinerama, [ --enable-xinerama turn on Xinerama support [default=yes]])
+ AC_ARG_ENABLE(xinerama, [ --enable-xinerama turn on Xinerama support [[default=yes]]])
if test x$enable_xinerama != xno; then
AC_CHECK_LIB(Xinerama,XineramaIsActive,
@@ -971,13 +967,14 @@ case $uname_GUI in
fi
dnl Check for the Xft library unless disabled...
- AC_ARG_ENABLE(xft, [ --enable-xft turn on Xft support [default=yes]])
+ AC_ARG_ENABLE(xft, [ --enable-xft turn on Xft support [[default=yes]]])
if test x$enable_xft != xno; then
AC_PATH_PROG(FTCONFIG,freetype-config)
if test "x$FTCONFIG" != x; then
CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
+ CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
AC_CHECK_LIB(fontconfig, FcPatternCreate)
@@ -989,7 +986,7 @@ case $uname_GUI in
fi
dnl Check for the Xdbe extension unless disabled...
- AC_ARG_ENABLE(xdbe, [ --enable-xdbe turn on Xdbe support [default=yes]])
+ AC_ARG_ENABLE(xdbe, [ --enable-xdbe turn on Xdbe support [[default=yes]]])
if test x$enable_xdbe != xno; then
AC_CHECK_HEADER(X11/extensions/Xdbe.h, AC_DEFINE(HAVE_XDBE),,
@@ -998,6 +995,26 @@ case $uname_GUI in
LIBS="-lXext $LIBS")
fi
+ dnl Check for the Xfixes extension unless disabled...
+ AC_ARG_ENABLE(xfixes, [ --enable-xfixes turn on Xfixes support [[default=yes]]])
+
+ if test x$enable_xfixes != xno; then
+ AC_CHECK_HEADER(X11/extensions/Xfixes.h, AC_DEFINE(HAVE_XFIXES),,
+ [#include <X11/Xlib.h>])
+ AC_CHECK_LIB(Xfixes, XFixesQueryExtension,
+ LIBS="-lXfixes $LIBS")
+ fi
+
+ dnl Check for the Xcursor library unless disabled...
+ AC_ARG_ENABLE(xcursor, [ --enable-xcursor turn on Xcursor support [[default=yes]]])
+
+ if test x$enable_xcursor != xno; then
+ AC_CHECK_HEADER(X11/Xcursor/Xcursor.h, AC_DEFINE(HAVE_XCURSOR),,
+ [#include <X11/Xlib.h>])
+ AC_CHECK_LIB(Xcursor, XcursorImageCreate,
+ LIBS="-lXcursor $LIBS")
+ fi
+
dnl Check for overlay visuals...
AC_PATH_PROG(XPROP, xprop)
AC_CACHE_CHECK(for X overlay visuals, ac_cv_have_overlay,
@@ -1017,8 +1034,8 @@ case $uname_GUI in
# Make symlinks since UNIX/Linux is case sensitive,
# but Cygwin in general not.
- case $uname in
- CYGWIN*)
+ case $host_os in
+ cygwin*)
HLINKS="#"
;;
*)
@@ -1046,14 +1063,14 @@ AC_SUBST(INSTALL_DESKTOP)
AC_SUBST(UNINSTALL_DESKTOP)
dnl Figure out the appropriate formatted man page extension...
-case "$uname" in
- *BSD* | Darwin*)
+case "$host_os" in
+ *bsd* | darwin*)
# *BSD
CAT1EXT=0
CAT3EXT=0
CAT6EXT=0
;;
- IRIX*)
+ irix*)
# SGI IRIX
CAT1EXT=z
CAT3EXT=z
@@ -1073,12 +1090,12 @@ AC_SUBST(CAT6EXT)
dnl Fix "mandir" variable...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
- case "$uname" in
- *BSD* | Darwin* | Linux*)
+ case "$host_os" in
+ *bsd* | darwin* | linux*)
# *BSD, Darwin, and Linux
mandir="\${prefix}/share/man"
;;
- IRIX*)
+ irix*)
# SGI IRIX
mandir="\${prefix}/share/catman"
;;
@@ -1094,9 +1111,15 @@ if test "$exec_prefix" = NONE; then
exec_prefix="\${prefix}"
fi
-if test "$uname" = "IRIX" -a $uversion -ge 62 -a "$libdir" = "\${exec_prefix}/lib" -a "$exec_prefix" = "\${prefix}" -a "$prefix" = "/usr"; then
- libdir="/usr/lib32"
-fi
+case $host_os in
+ irix[1-5]*)
+ ;;
+ irix*)
+ if test "$libdir" = "\${exec_prefix}/lib" -a "$exec_prefix" = "\${prefix}" -a "$prefix" = "/usr"; then
+ libdir="/usr/lib32"
+ fi
+ ;;
+esac
dnl Define the command used to update the dependencies (this option
dnl mainly for FLTK core developers - not necessary for users)
@@ -1116,9 +1139,13 @@ if test -n "$GCC"; then
# We know that Carbon is deprecated on OS X 10.4. To avoid hundreds of warnings
# we will temporarily disable 'deprecated' warnings on OS X.
- if test "$uname" = "Darwin" -a $uversion -ge 800; then
- OPTIM="-Wno-deprecated-declarations $OPTIM"
- fi
+ case $host_os in
+ darwin[1-7])
+ ;;
+ darwin*)
+ OPTIM="-Wno-deprecated-declarations $OPTIM"
+ ;;
+ esac
# Set the default compiler optimizations...
if test -z "$DEBUGFLAG"; then
@@ -1168,6 +1195,30 @@ if test -n "$GCC"; then
AC_MSG_RESULT(no))
CFLAGS="$OLDCFLAGS"
+ # See if ld supports -Bsymbolic-functions...
+ AC_MSG_CHECKING(if ld supports -Bsymbolic-functions)
+ OLDLDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
+ AC_TRY_LINK(,,
+ [DSOFLAGS="$DSOFLAGS -Wl,-Bsymbolic-functions"]
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+ LDFLAGS="$OLDLDFLAGS"
+
+ # See if toolchain supports a sectioned build...
+ AC_MSG_CHECKING(if toolchain supports sections)
+ OLDLDFLAGS="$LDFLAGS"
+ OLDCFLAGS="$CFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,-gc-sections"
+ CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
+ AC_TRY_LINK(,,
+ [DSOFLAGS="$DSOFLAGS -Wl,-gc-sections"
+ OPTIM="$OPTIM -ffunction-sections -fdata-sections"]
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+ LDFLAGS="$OLDLDFLAGS"
+ CFLAGS="$OLDCFLAGS"
+
# See if we are running Solaris; if so, try the -fpermissive option...
# This option is required on some versions of Solaris to work around
# bugs in the X headers up through Solaris 7.
@@ -1175,20 +1226,22 @@ if test -n "$GCC"; then
# Unlike the other compiler/optimization settings, this one is placed
# in CFLAGS and CXXFLAGS so that fltk-config will provide the option
# to clients - otherwise client apps will not compile properly...
- if test "$uname" = SunOS; then
- AC_MSG_CHECKING(if GCC supports -fpermissive)
-
- OLDCFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fpermissive"
- AC_TRY_COMPILE(,,
- CXXFLAGS="$CXXFLAGS -fpermissive"
- AC_MSG_RESULT(yes),
- CFLAGS="$OLDCFLAGS"
- AC_MSG_RESULT(no))
- fi
+ case $host_os in
+ solaris*)
+ AC_MSG_CHECKING(if GCC supports -fpermissive)
+
+ OLDCFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fpermissive"
+ AC_TRY_COMPILE(,,
+ CXXFLAGS="$CXXFLAGS -fpermissive"
+ AC_MSG_RESULT(yes),
+ CFLAGS="$OLDCFLAGS"
+ AC_MSG_RESULT(no))
+ ;;
+ esac
else
- case "$uname" in
- IRIX*)
+ case "$host_os" in
+ irix*)
# Running some flavor of IRIX; see which version and
# set things up according...
if test "$uversion" -ge 62; then
@@ -1217,7 +1270,7 @@ else
fi
fi
;;
- HP-UX*)
+ hpux*)
# Running HP-UX; these options should work for the HP compilers.
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
@@ -1244,7 +1297,7 @@ else
fi
fi
;;
- SunOS*)
+ solaris*)
# Solaris
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
@@ -1258,7 +1311,7 @@ else
OPTIM="-KPIC $OPTIM"
fi
;;
- AIX*)
+ aix*)
if test -z "$DEBUGFLAG"; then
if test "x$with_optim" != x; then
OPTIM="$with_optim $OPTIM"
@@ -1281,15 +1334,17 @@ fi
OPTIM="$DEBUGFLAG $OPTIM"
dnl Take archflags away from CFLAGS (makefiles use ARCHFLAGS explicitly)
-if test `uname` = Darwin; then
- if test "x$with_archflags" != x ; then
- CFLAGS="`echo $CFLAGS | sed -e "s/$with_archflags//g"`"
- fi
-fi
+case $host_os in
+ darwin*)
+ if test "x$with_archflags" != x ; then
+ CFLAGS="`echo $CFLAGS | sed -e "s/$with_archflags//g"`"
+ fi
+ ;;
+esac
dnl Define the FLTK documentation directory...
-case $uname in
- MINGW*)
+case $host_os in
+ mingw*)
# Determine the path where MSys has /usr installed
msyspath=`mount | grep '\/usr ' | cut -d ' ' -f -1 | sed -e 's/\\\/\// g'`
# Then substitute that in the WIN32 path instead of /usr
@@ -1316,11 +1371,11 @@ echo ""
echo "Configuration Summary"
echo "-------------------------------------------------------------------------"
-case $uname_GUI in
- CYGWIN* | MINGW*)
+case $host_os_gui in
+ cygwin* | mingw*)
graphics="GDI"
;;
- Darwin*)
+ darwin*)
graphics="Quartz"
;;
*)
@@ -1345,8 +1400,8 @@ echo " exec_prefix=$exec_prefix"
echo " includedir=$includedir"
echo " libdir=$libdir"
echo " mandir=$mandir"
-case $uname in
- MINGW*)
+case $host_os in
+ mingw*)
echo " MSys docpath=$msyspath/local/share/doc/fltk"
;;
esac
@@ -1401,5 +1456,5 @@ dnl Make sure the fltk-config script is executable...
chmod +x fltk-config
dnl
-dnl End of "$Id: configure.in 9707 2012-11-06 21:13:54Z matt $".
+dnl End of "$Id: configure.in 10418 2014-10-30 14:07:58Z AlbrechtS $".
dnl