1 # 2 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 5 # This code is free software; you can redistribute it and/or modify it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. Oracle designates this 8 # particular file as subject to the "Classpath" exception as provided 9 # by Oracle in the LICENSE file that accompanied this code. 10 # 11 # This code is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # version 2 for more details (a copy is included in the LICENSE file that 15 # accompanied this code). 16 # 17 # You should have received a copy of the GNU General Public License version 18 # 2 along with this work; if not, write to the Free Software Foundation, 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 # 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 # or visit www.oracle.com if you need additional information or have any 23 # questions. 24 # 25 26 AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], 27 [ 28 AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) 29 ]) 30 31 AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], 32 [ 33 # Print a helpful message on how to acquire the necessary build dependency. 34 # $1 is the help tag: freetype, cups, alsa etc 35 MISSING_DEPENDENCY=$1 36 37 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 38 cygwin_help $MISSING_DEPENDENCY 39 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 40 msys_help $MISSING_DEPENDENCY 41 else 42 PKGHANDLER_COMMAND= 43 44 case $PKGHANDLER in 45 apt-get) 46 apt_help $MISSING_DEPENDENCY ;; 47 yum) 48 yum_help $MISSING_DEPENDENCY ;; 49 port) 50 port_help $MISSING_DEPENDENCY ;; 51 pkgutil) 52 pkgutil_help $MISSING_DEPENDENCY ;; 53 pkgadd) 54 pkgadd_help $MISSING_DEPENDENCY ;; 55 esac 56 57 if test "x$PKGHANDLER_COMMAND" != x; then 58 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 59 fi 60 fi 61 ]) 62 63 cygwin_help() { 64 case $1 in 65 unzip) 66 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )" 67 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 68 ;; 121 PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; 122 esac 123 } 124 125 yum_help() { 126 case $1 in 127 devkit) 128 PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; 129 openjdk) 130 PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; 131 alsa) 132 PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; 133 cups) 134 PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; 135 freetype) 136 PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; 137 x11) 138 PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;; 139 ccache) 140 PKGHANDLER_COMMAND="sudo yum install ccache" ;; 141 esac 142 } 143 144 port_help() { 145 PKGHANDLER_COMMAND="" 146 } 147 148 pkgutil_help() { 149 PKGHANDLER_COMMAND="" 150 } 151 152 pkgadd_help() { 153 PKGHANDLER_COMMAND="" 154 } 155 156 # This function will check if we're called from the "configure" wrapper while 157 # printing --help. If so, we will print out additional information that can 158 # only be extracted within the autoconf script, and then exit. This must be 159 # called at the very beginning in configure.ac. 160 AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], | 1 # 2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 5 # This code is free software; you can redistribute it and/or modify it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. Oracle designates this 8 # particular file as subject to the "Classpath" exception as provided 9 # by Oracle in the LICENSE file that accompanied this code. 10 # 11 # This code is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # version 2 for more details (a copy is included in the LICENSE file that 15 # accompanied this code). 16 # 17 # You should have received a copy of the GNU General Public License version 18 # 2 along with this work; if not, write to the Free Software Foundation, 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 # 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 # or visit www.oracle.com if you need additional information or have any 23 # questions. 24 # 25 26 AC_DEFUN_ONCE([HELP_SETUP_DEPENDENCY_HELP], 27 [ 28 AC_CHECK_PROGS(PKGHANDLER, apt-get yum pkg port pkgutil pkgadd) 29 ]) 30 31 AC_DEFUN([HELP_MSG_MISSING_DEPENDENCY], 32 [ 33 # Print a helpful message on how to acquire the necessary build dependency. 34 # $1 is the help tag: freetype, cups, alsa etc 35 MISSING_DEPENDENCY=$1 36 37 if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then 38 cygwin_help $MISSING_DEPENDENCY 39 elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then 40 msys_help $MISSING_DEPENDENCY 41 else 42 PKGHANDLER_COMMAND= 43 44 case $PKGHANDLER in 45 apt-get) 46 apt_help $MISSING_DEPENDENCY ;; 47 yum) 48 yum_help $MISSING_DEPENDENCY ;; 49 pkg) 50 pkg_help $MISSING_DEPENDENCY ;; 51 port) 52 port_help $MISSING_DEPENDENCY ;; 53 pkgutil) 54 pkgutil_help $MISSING_DEPENDENCY ;; 55 pkgadd) 56 pkgadd_help $MISSING_DEPENDENCY ;; 57 esac 58 59 if test "x$PKGHANDLER_COMMAND" != x; then 60 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 61 fi 62 fi 63 ]) 64 65 cygwin_help() { 66 case $1 in 67 unzip) 68 PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )" 69 HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." 70 ;; 123 PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; 124 esac 125 } 126 127 yum_help() { 128 case $1 in 129 devkit) 130 PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; 131 openjdk) 132 PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; 133 alsa) 134 PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; 135 cups) 136 PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; 137 freetype) 138 PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;; 139 x11) 140 PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXi-devel" ;; 141 ccache) 142 PKGHANDLER_COMMAND="sudo yum install ccache" ;; 143 esac 144 } 145 146 pkg_help() { 147 case $1 in 148 openjdk) 149 PKGHANDLER_COMMAND="sudo pkg install openjdk8" ;; 150 cups) 151 PKGHANDLER_COMMAND="sudo pkg install cups-client" ;; 152 freetype) 153 PKGHANDLER_COMMAND="sudo pkg install freetype2" ;; 154 ffi) 155 PKGHANDLER_COMMAND="sudo pkg install libffi" ;; 156 x11) 157 PKGHANDLER_COMMAND="sudo pkg install libX11 libXrender libXext libXtst libXt" ;; 158 ccache) 159 PKGHANDLER_COMMAND="sudo pkg install ccache" ;; 160 unzip) 161 PKGHANDLER_COMMAND="sudo pkg install unzip" ;; 162 zip) 163 PKGHANDLER_COMMAND="sudo pkg install zip" ;; 164 make) 165 PKGHANDLER_COMMAND="sudo pkg install gmake" ;; 166 esac 167 } 168 169 port_help() { 170 PKGHANDLER_COMMAND="" 171 } 172 173 pkgutil_help() { 174 PKGHANDLER_COMMAND="" 175 } 176 177 pkgadd_help() { 178 PKGHANDLER_COMMAND="" 179 } 180 181 # This function will check if we're called from the "configure" wrapper while 182 # printing --help. If so, we will print out additional information that can 183 # only be extracted within the autoconf script, and then exit. This must be 184 # called at the very beginning in configure.ac. 185 AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT], |