Index: configure.in
===================================================================
--- configure.in	(revision 11248)
+++ configure.ac	(working copy)
@@ -19,10 +19,11 @@
 dnl
 
 dnl We need at least autoconf 2.50...
-AC_PREREQ(2.50)
+AC_PREREQ([2.50])
 
 dnl Required file in package...
-AC_INIT(src/Fl.cxx)
+AC_INIT
+AC_CONFIG_SRCDIR([src/Fl.cxx])
 
 AC_CANONICAL_HOST
 
@@ -279,13 +280,12 @@
                 ac_cv_cxx_fvisibility, [
                     OLDCXXFLAGS="$CXXFLAGS"
                     CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
-                    AC_LANG_SAVE
-                    AC_LANG_CPLUSPLUS
-                    AC_TRY_COMPILE(,,
+                    AC_LANG_PUSH([C++])
+                    AC_COMPILE_IFELSE(,
                         ac_cv_cxx_fvisibility=yes,
                         ac_cv_cxx_fvisibility=no)
                     CXXFLAGS="$OLDCXXFLAGS"
-                    AC_LANG_RESTORE
+                    AC_LANG_POP
             ])
             if test x"$ac_cv_cxx_fvisibility" = xyes; then
                 OPTIM="$OPTIM -fvisibility=hidden"
@@ -296,13 +296,12 @@
                 ac_cv_cxx_fvisibility_inlines, [
                     OLDCXXFLAGS="$CXXFLAGS"
                     CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
-                    AC_LANG_SAVE
-                    AC_LANG_CPLUSPLUS
-                    AC_TRY_COMPILE(,,
+                    AC_LANG_PUSH([C++])
+                    AC_COMPILE_IFELSE(,
                         ac_cv_cxx_fvisibility_inlines=yes,
                         ac_cv_cxx_fvisibility_inlines=no)
                     CXXFLAGS="$OLDCXXFLAGS"
-                    AC_LANG_RESTORE
+                    AC_LANG_POP
             ])
             if test x"$ac_cv_cxx_fvisibility_inlines" = xyes; then
                 CXXFLAGS="$CXXFLAGS -fvisibility-inlines-hidden"
@@ -477,17 +476,16 @@
 dnl Does the C++ compiler support the bool type?
 AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type,
     ac_cv_cxx_bool,[
-	AC_LANG_SAVE
-	AC_LANG_CPLUSPLUS
-	AC_TRY_COMPILE([
+	AC_LANG_PUSH([C++])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 	    int f(int  x){return 1;}
 	    int f(char x){return 1;}
 	    int f(bool x){return 1;}
-	],[
+	]], [[
 	    bool b = true;
 	    return f(b);
-	], ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no)
-	AC_LANG_RESTORE
+	]])], [ac_cv_cxx_bool=yes], [ac_cv_cxx_bool=no])
+	AC_LANG_POP
     ])
 
 if test "$ac_cv_cxx_bool" != yes; then
@@ -496,22 +494,20 @@
 
 dnl Standard headers and functions...
 AC_HEADER_DIRENT
-AC_CHECK_HEADER(sys/select.h,AC_DEFINE(HAVE_SYS_SELECT_H))
-AC_CHECK_HEADER(sys/stdtypes.h,AC_DEFINE(HAVE_SYS_SELECT_H))
+AC_CHECK_HEADERS([sys/select.h sys/stdtypes.h])
 
 dnl Do we have the POSIX compatible scandir() prototype?
 AC_CACHE_CHECK([whether we have the POSIX compatible scandir() prototype],
     ac_cv_cxx_scandir_posix,[
-	AC_LANG_SAVE
-	AC_LANG_CPLUSPLUS
-	AC_TRY_COMPILE([
-	  #include <dirent.h>
+	AC_LANG_PUSH([C++])
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dirent.h>
 	  int func (const char *d, dirent ***list, void *sort) {
 	    int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);
+	    return n;
 	  }
-	],[
-	], ac_cv_cxx_scandir_posix=yes, ac_cv_cxx_scandir_posix=no)
-	AC_LANG_RESTORE
+	]], [[
+	]])], [ac_cv_cxx_scandir_posix=yes], [ac_cv_cxx_scandir_posix=no])
+	AC_LANG_POP
     ])
 
 dnl Define both HAVE_SCANDIR... macros, if the POSIX compatible function is
@@ -558,10 +554,10 @@
             AC_DEFINE(HAVE_SNPRINTF)
             ;;
     esac])
-AC_CHECK_HEADER(strings.h, AC_DEFINE(HAVE_STRINGS_H))
-AC_CHECK_FUNCS(strcasecmp strlcat strlcpy)
+AC_CHECK_HEADERS(strings.h)
+AC_CHECK_FUNCS(_stricmp strcasecmp strlcat strlcpy)
 
-AC_CHECK_HEADER(locale.h, AC_DEFINE(HAVE_LOCALE_H))
+AC_CHECK_HEADERS(locale.h)
 AC_CHECK_FUNCS(localeconv)
 
 dnl FLTK library uses math library functions...
@@ -590,9 +586,10 @@
 	[if test "$GCC" = yes; then
 		ac_cv_c_long_long=yes
 	else
-		AC_TRY_COMPILE(,[long long int i;],
-			ac_cv_c_long_long=yes,
-			ac_cv_c_long_long=no)
+		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
+			[[long long int i;]])],
+			[ac_cv_c_long_long=yes],
+			[ac_cv_c_long_long=no])
 	fi])
 
 if test $ac_cv_c_long_long = yes; then
@@ -786,7 +783,7 @@
 esac
 
 if test "x$enable_threads" != xno -a x$check_pthread = xyes; then
-    AC_CHECK_HEADER(pthread.h, AC_DEFINE(HAVE_PTHREAD_H))
+    AC_CHECK_HEADERS(pthread.h)
 
     if test x$ac_cv_header_pthread_h = xyes; then
 	dnl Check various threading options for the platforms we support
@@ -794,10 +791,10 @@
             AC_MSG_CHECKING([for pthread_create using $flag])
 	    SAVELIBS="$LIBS"
 	    LIBS="$flag $LIBS"
-            AC_TRY_LINK([#include <pthread.h>],
-		[pthread_create(0, 0, 0, 0);],
-        	have_pthread=yes,
-		LIBS="$SAVELIBS")
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
+		[[pthread_create(0, 0, 0, 0);]])],
+		[have_pthread=yes],
+		[LIBS="$SAVELIBS"])
             AC_MSG_RESULT([$have_pthread])
 
 	    if test $have_pthread = yes; then
@@ -929,7 +926,7 @@
 	fi
 
 	if test "x$X_PRE_LIBS" != x; then
-	    AC_MSG_WARN(Ignoring libraries \"$X_PRE_LIBS\" requested by configure.)
+	    AC_MSG_WARN([Ignoring libraries "$X_PRE_LIBS" requested by configure.])
 	fi
 
 	LIBS="$LIBS -lX11 $X_EXTRA_LIBS"
@@ -994,7 +991,6 @@
             AC_PATH_PROG(FTCONFIG,freetype-config)
 
 	    if test "x$FTCONFIG" != x; then
-	        CPPFLAGS="`$FTCONFIG --cflags` $CPPFLAGS"
 	        CFLAGS="`$FTCONFIG --cflags` $CFLAGS"
 	        CXXFLAGS="`$FTCONFIG --cflags` $CXXFLAGS"
 
@@ -1010,10 +1006,12 @@
         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),,
-	        [#include <X11/Xlib.h>])
-	    AC_CHECK_LIB(Xext, XdbeQueryExtension,
-		LIBS="-lXext $LIBS")
+	    AC_CHECK_HEADER(X11/extensions/Xdbe.h,
+		[AC_CHECK_LIB(Xext, XdbeQueryExtension,
+		    [AC_DEFINE(HAVE_XDBE)
+		     LIBS="-lXext $LIBS"])],
+		[],
+		[#include <X11/Xlib.h>])
 	fi
 
 	dnl Check for the Xfixes extension unless disabled...
@@ -1020,10 +1018,12 @@
         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")
+	    AC_CHECK_HEADER(X11/extensions/Xfixes.h,
+		[AC_CHECK_LIB(Xfixes, XFixesQueryExtension,
+		    [AC_DEFINE(HAVE_XFIXES)
+		     LIBS="-lXfixes $LIBS"])],
+		[],
+		[#include <X11/Xlib.h>])
 	fi
 
 	dnl Check for the Xcursor library unless disabled...
@@ -1216,10 +1216,10 @@
     AC_MSG_CHECKING(if GCC supports -fno-exceptions)
     OLDCFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -fno-exceptions"
-    AC_TRY_COMPILE(,,
-	OPTIM="$OPTIM -fno-exceptions"
-	AC_MSG_RESULT(yes),
-	AC_MSG_RESULT(no))
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
+	[OPTIM="$OPTIM -fno-exceptions"
+	 AC_MSG_RESULT(yes)],
+	[AC_MSG_RESULT(no)])
     CFLAGS="$OLDCFLAGS"
 
     # See if GCC supports -fno-strict-aliasing...
@@ -1226,10 +1226,10 @@
     AC_MSG_CHECKING(if GCC supports -fno-strict-aliasing)
     OLDCFLAGS="$CFLAGS"
     CFLAGS="$CFLAGS -fno-strict-aliasing"
-    AC_TRY_COMPILE(,,
-	OPTIM="$OPTIM -fno-strict-aliasing"
-	AC_MSG_RESULT(yes),
-	AC_MSG_RESULT(no))
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
+	[OPTIM="$OPTIM -fno-strict-aliasing"
+	 AC_MSG_RESULT(yes)],
+	[AC_MSG_RESULT(no)])
     CFLAGS="$OLDCFLAGS"
 
 dnl Experimental (as of 17 Feb 2015):
@@ -1238,7 +1238,7 @@
     AC_MSG_CHECKING(if ld supports -no-undefined)
     OLDLDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS -Wl,-no-undefined"
-    AC_TRY_LINK(,,
+    AC_LINK_IFELSE(,
         [DSOFLAGS="$DSOFLAGS -Wl,-no-undefined"]
         AC_MSG_RESULT(yes),
         AC_MSG_RESULT(no))
@@ -1248,7 +1248,7 @@
     AC_MSG_CHECKING(if ld supports -Bsymbolic-functions)
     OLDLDFLAGS="$LDFLAGS"
     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
-    AC_TRY_LINK(,,
+    AC_LINK_IFELSE(,
         [DSOFLAGS="$DSOFLAGS -Wl,-Bsymbolic-functions"]
         AC_MSG_RESULT(yes),
         AC_MSG_RESULT(no))
@@ -1260,7 +1260,7 @@
     OLDCFLAGS="$CFLAGS"
     LDFLAGS="$LDFLAGS -Wl,-gc-sections"
     CFLAGS="$CFLAGS -ffunction-sections -fdata-sections"
-    AC_TRY_LINK(,,
+    AC_LINK_IFELSE(,
         [DSOFLAGS="$DSOFLAGS -Wl,-gc-sections"
         OPTIM="$OPTIM -ffunction-sections -fdata-sections"]
         AC_MSG_RESULT(yes),
@@ -1281,11 +1281,11 @@
 
 	    OLDCFLAGS="$CFLAGS"
 	    CFLAGS="$CFLAGS -fpermissive"
-	    AC_TRY_COMPILE(,,
-	        CXXFLAGS="$CXXFLAGS -fpermissive"
-	        AC_MSG_RESULT(yes),
-	        CFLAGS="$OLDCFLAGS"
-	        AC_MSG_RESULT(no))
+	    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])],
+	        [CXXFLAGS="$CXXFLAGS -fpermissive"
+	         AC_MSG_RESULT(yes)],
+	        [CFLAGS="$OLDCFLAGS"
+	         AC_MSG_RESULT(no)])
 	    ;;
     esac
 else
@@ -1303,7 +1303,7 @@
 		#     MAKEDEPEND="CC -M"
 
 		if test "x`grep abi=n32 /etc/compiler.defaults`" = x; then
-			AC_MSG_WARN(FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI \"-n32 -mips3\")
+			AC_MSG_WARN([FOR BEST RESULTS BEFORE COMPILING: setenv SGI_ABI "-n32 -mips3"])
 		fi
 
         	OPTIM="-fullwarn $OPTIM"
@@ -1504,7 +1504,8 @@
 dnl Write all of the files...
 AC_CONFIG_HEADER(config.h:configh.in)
 AC_CONFIG_HEADER(FL/abi-version.h:abi-version.in)
-AC_OUTPUT(makeinclude fltk.list fltk-config fltk.spec FL/Makefile)
+AC_CONFIG_FILES([makeinclude fltk.list fltk-config fltk.spec FL/Makefile])
+AC_OUTPUT
 
 dnl Make sure the fltk-config script is executable...
 chmod +x fltk-config
