changeset 2691:4735bd39ff61

PR2964: Set system defaults based on OS 2016-05-17 Andrew John Hughes <gnu.andrew@redhat.com> PR2964: Set system defaults based on OS * NEWS: Updated. * acinclude.m4: (IT_ENABLE_WARNINGS): Make sure all possible values of enableval are handled. (IT_LOCATE_NSS): Likewise. (IT_CHECK_FOR_LCMS): Likewise. Use a similar case statement as in IT_SET_OS_DIRS to determine default based on OS. (IT_CHECK_FOR_ZLIB): Likewise. (IT_CHECK_FOR_JPEG): Likewise. (IT_CHECK_FOR_PNG): Likewise. (IT_CHECK_FOR_GIF): Likewise. 2013-12-26 Andrew John Hughes <gnu.andrew@redhat.com> PR2964: Set system defaults based on OS * acinclude.m4: (IT_SET_ARCH_SETTINGS): Use target, not host. (IT_SET_OS_DIRS): Likewise. * configure.ac: Add AC_CANONICAL_TARGET after AC_CANONICAL_HOST and move earlier in file, before Automake initialisation.
author Andrew John Hughes <gnu_andrew@member.fsf.org>
date Mon, 18 Jul 2016 06:04:06 +0100
parents 27ceed26e16e
children 7bb7897da999
files ChangeLog NEWS acinclude.m4 configure.ac
diffstat 4 files changed, 131 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 18 05:43:30 2016 +0100
+++ b/ChangeLog	Mon Jul 18 06:04:06 2016 +0100
@@ -1,3 +1,30 @@
+2016-05-17  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	PR2964: Set system defaults based on OS
+	* NEWS: Updated.
+	* acinclude.m4:
+	(IT_ENABLE_WARNINGS): Make sure all possible
+	values of enableval are handled.
+	(IT_LOCATE_NSS): Likewise.
+	(IT_CHECK_FOR_LCMS): Likewise. Use a similar case
+	statement as in IT_SET_OS_DIRS to determine default
+	based on OS.
+	(IT_CHECK_FOR_ZLIB): Likewise.
+	(IT_CHECK_FOR_JPEG): Likewise.
+	(IT_CHECK_FOR_PNG): Likewise.
+	(IT_CHECK_FOR_GIF): Likewise.
+
+2013-12-26  Andrew John Hughes  <gnu.andrew@redhat.com>
+
+	PR2964: Set system defaults based on OS
+	* acinclude.m4:
+	(IT_SET_ARCH_SETTINGS): Use target, not host.
+	(IT_SET_OS_DIRS): Likewise.
+	* configure.ac:
+	Add AC_CANONICAL_TARGET after AC_CANONICAL_HOST
+	and move earlier in file, before Automake
+	initialisation.
+
 2016-07-17  Andrew John Hughes  <gnu.andrew@member.fsf.org>
 
 	PR2932: Support ccache in a non-automagic manner
--- a/NEWS	Mon Jul 18 05:43:30 2016 +0100
+++ b/NEWS	Mon Jul 18 06:04:06 2016 +0100
@@ -184,6 +184,7 @@
   - PR2822: Feed LIBS & CFLAGS into configure rather than make to avoid re-discovery by OpenJDK configure
   - PR2931, G478960: Provide Infinality Support via fontconfig
   - PR2932: Support ccache in a non-automagic manner
+  - PR2964: Set system defaults based on OS
   - PR2974: PKCS#10 certificate requests now use CRLF line endings rather than system line endings
   - PR3083, RH1346460: Regression in SSL debug output without an ECC provider
   - PR3089: Remove old memory limits patch
--- a/acinclude.m4	Mon Jul 18 05:43:30 2016 +0100
+++ b/acinclude.m4	Mon Jul 18 06:04:06 2016 +0100
@@ -1,6 +1,6 @@
 AC_DEFUN([IT_SET_ARCH_SETTINGS],
 [
-  case "${host_cpu}" in
+  case "${target_cpu}" in
     x86_64)
       BUILD_ARCH_DIR=amd64
       INSTALL_ARCH_DIR=amd64
@@ -109,7 +109,7 @@
 
 AC_DEFUN([IT_SET_OS_DIRS],
 [
-  case "${host_os}" in
+  case "${target_os}" in
     *linux*)
       BUILD_OS_DIR=linux
       OS_PATH=
@@ -123,7 +123,7 @@
       OS_PATH=
       ;;
     *)
-      AC_MSG_ERROR([unsupported operating system ${host_os}])
+      AC_MSG_ERROR([unsupported operating system ${target_os}])
       ;;
   esac
   AC_SUBST(BUILD_OS_DIR)
@@ -1159,7 +1159,14 @@
   AC_ARG_ENABLE([warnings],
 	      [AS_HELP_STRING(--enable-warnings,produce warnings from javac/ecj [[default=no]])],
   [
-    ENABLE_WARNINGS="${enableval}"
+    case "${enableval}" in
+      no)
+        ENABLE_WARNINGS=no
+        ;;
+      *)
+        ENABLE_WARNINGS=yes
+        ;;
+    esac
   ],
   [
     ENABLE_WARNINGS=no
@@ -1388,7 +1395,16 @@
 AC_ARG_ENABLE([nss],
 	      [AS_HELP_STRING([--enable-nss],
 	      		      [Enable inclusion of PKCS11 crypto provider using NSS])],
-	      [ENABLE_NSS="${enableval}"], [ENABLE_NSS='no'])
+  [
+    case "${enableval}" in
+      no)
+        ENABLE_NSS=no
+        ;;
+      *)
+        ENABLE_NSS=yes
+        ;;
+    esac
+  ], [ENABLE_NSS='no'])
 AM_CONDITIONAL([ENABLE_NSS], [test x$ENABLE_NSS = xyes])
 if test "x${ENABLE_NSS}" = "xyes"
 then
@@ -1605,10 +1621,24 @@
   AC_ARG_ENABLE([system-lcms],
 	      [AS_HELP_STRING(--enable-system-lcms,use the system LCMS [[default=yes]])],
   [
-    ENABLE_SYSTEM_LCMS="${enableval}"
+    case "${enableval}" in
+      no)
+        ENABLE_SYSTEM_LCMS=no
+        ;;
+      *)
+        ENABLE_SYSTEM_LCMS=yes
+        ;;
+    esac
   ],
   [
-    ENABLE_SYSTEM_LCMS="yes"
+    case "${target_os}" in
+     *linux*)
+       ENABLE_SYSTEM_LCMS="yes"
+       ;;
+     *)
+       ENABLE_SYSTEM_LCMS="no" ;
+       ;;
+    esac
   ])
   AC_MSG_RESULT(${ENABLE_SYSTEM_LCMS})
   if test x"${ENABLE_SYSTEM_LCMS}" = "xyes"; then
@@ -1631,10 +1661,24 @@
   AC_ARG_ENABLE([system-zlib],
 	      [AS_HELP_STRING(--enable-system-zlib,use the system ZLIB [[default=yes]])],
   [
-    ENABLE_SYSTEM_ZLIB="${enableval}"
+    case "${enableval}" in
+      no)
+        ENABLE_SYSTEM_ZLIB=no
+        ;;
+      *)
+        ENABLE_SYSTEM_ZLIB=yes
+        ;;
+    esac
   ],
   [
-    ENABLE_SYSTEM_ZLIB="yes"
+    case "${target_os}" in
+      *linux*)
+        ENABLE_SYSTEM_ZLIB="yes"
+	;;
+      *)
+        ENABLE_SYSTEM_ZLIB="no" ;
+	;;
+    esac
   ])
   AC_MSG_RESULT(${ENABLE_SYSTEM_ZLIB})
   if test x"${ENABLE_SYSTEM_ZLIB}" = "xyes"; then
@@ -1657,10 +1701,24 @@
   AC_ARG_ENABLE([system-jpeg],
 	      [AS_HELP_STRING(--enable-system-jpeg,use the system libjpeg [[default=yes]])],
   [
-    ENABLE_SYSTEM_JPEG="${enableval}"
+    case "${enableval}" in
+      no)
+        ENABLE_SYSTEM_JPEG=no
+        ;;
+      *)
+        ENABLE_SYSTEM_JPEG=yes
+        ;;
+    esac
   ],
   [
-    ENABLE_SYSTEM_JPEG="yes"
+    case "${target_os}" in
+      *linux*)
+        ENABLE_SYSTEM_JPEG="yes"
+	;;
+      *)
+        ENABLE_SYSTEM_JPEG="no" ;
+	;;
+    esac
   ])
   AC_MSG_RESULT(${ENABLE_SYSTEM_JPEG})
   if test x"${ENABLE_SYSTEM_JPEG}" = "xyes"; then
@@ -1682,10 +1740,24 @@
   AC_ARG_ENABLE([system-png],
 	      [AS_HELP_STRING(--enable-system-png,use the system PNG [[default=yes]])],
   [
-    ENABLE_SYSTEM_PNG="${enableval}"
+    case "${enableval}" in
+      no)
+        ENABLE_SYSTEM_PNG=no
+        ;;
+      *)
+        ENABLE_SYSTEM_PNG=yes
+        ;;
+    esac
   ],
   [
-    ENABLE_SYSTEM_PNG="yes"
+    case "${target_os}" in
+      *linux*)
+        ENABLE_SYSTEM_PNG="yes"
+	;;
+      *)
+        ENABLE_SYSTEM_PNG="no" ;
+	;;
+    esac
   ])
   AC_MSG_RESULT(${ENABLE_SYSTEM_PNG})
   if test x"${ENABLE_SYSTEM_PNG}" = "xyes"; then
@@ -1708,10 +1780,24 @@
   AC_ARG_ENABLE([system-gif],
 	      [AS_HELP_STRING(--enable-system-gif,use the system giflib [[default=yes]])],
   [
-    ENABLE_SYSTEM_GIF="${enableval}"
+    case "${enableval}" in
+      no)
+        ENABLE_SYSTEM_GIF=no
+        ;;
+      *)
+        ENABLE_SYSTEM_GIF=yes
+        ;;
+    esac
   ],
   [
-    ENABLE_SYSTEM_GIF="yes"
+    case "${target_os}" in
+      *linux*)
+        ENABLE_SYSTEM_GIF="yes"
+	;;
+      *)
+        ENABLE_SYSTEM_GIF="no" ;
+	;;
+    esac
   ])
   AC_MSG_RESULT(${ENABLE_SYSTEM_GIF})
   if test x"${ENABLE_SYSTEM_GIF}" = "xyes"; then
--- a/configure.ac	Mon Jul 18 05:43:30 2016 +0100
+++ b/configure.ac	Mon Jul 18 06:04:06 2016 +0100
@@ -1,4 +1,6 @@
 AC_INIT([icedtea], [3.1.0pre03], [distro-pkg-dev@openjdk.java.net])
+AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE([1.9 tar-pax foreign])
 AM_MAINTAINER_MODE([enable])
 AC_CONFIG_FILES([Makefile])
@@ -17,8 +19,6 @@
 AC_CONFIG_FILES([jconsole.desktop])
 AC_CONFIG_FILES([policytool.desktop])
 
-AC_CANONICAL_HOST
-
 AC_PROG_CC
 AC_PROG_CXX