Tue, 10 Apr 2012 08:18:28 -0700
7074397: Build infrastructure changes (makefile re-write)
Summary: New makefiles transition, old and new living side by side for now.
Reviewed-by: ohair, jjg, dholmes, ohrstrom, erikj, ihse, tgranat, ykantser
Contributed-by: ohrstrom <fredrik.ohrstrom@oracle.com>, erikj <erik.joelsson@oracle.com>, ihse <magnus.ihse.bursie@oracle.com>, tgranat <torbjorn.granat@oracle.com>, ykantser <yekaterina.kantserova@oracle.com>
ohair@425 | 1 | # |
ohair@425 | 2 | # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
ohair@425 | 3 | # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
ohair@425 | 4 | # |
ohair@425 | 5 | # This code is free software; you can redistribute it and/or modify it |
ohair@425 | 6 | # under the terms of the GNU General Public License version 2 only, as |
ohair@425 | 7 | # published by the Free Software Foundation. Oracle designates this |
ohair@425 | 8 | # particular file as subject to the "Classpath" exception as provided |
ohair@425 | 9 | # by Oracle in the LICENSE file that accompanied this code. |
ohair@425 | 10 | # |
ohair@425 | 11 | # This code is distributed in the hope that it will be useful, but WITHOUT |
ohair@425 | 12 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
ohair@425 | 13 | # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
ohair@425 | 14 | # version 2 for more details (a copy is included in the LICENSE file that |
ohair@425 | 15 | # accompanied this code). |
ohair@425 | 16 | # |
ohair@425 | 17 | # You should have received a copy of the GNU General Public License version |
ohair@425 | 18 | # 2 along with this work; if not, write to the Free Software Foundation, |
ohair@425 | 19 | # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
ohair@425 | 20 | # |
ohair@425 | 21 | # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@425 | 22 | # or visit www.oracle.com if you need additional information or have any |
ohair@425 | 23 | # questions. |
ohair@425 | 24 | # |
ohair@425 | 25 | |
ohair@425 | 26 | function help_on_build_dependency { |
ohair@425 | 27 | # Print a helpful message on how to acquire the necessary build dependency. |
ohair@425 | 28 | # $1 is the help tag: freetyp2, cups, pulse, alsa etc |
ohair@425 | 29 | MISSING_DEPENDENCY=$1 |
ohair@425 | 30 | PKGHANDLER_COMMAND= |
ohair@425 | 31 | |
ohair@425 | 32 | AC_CHECK_PROGS(PKGHANDLER, apt-get yum port pkgutil pkgadd) |
ohair@425 | 33 | |
ohair@425 | 34 | case $PKGHANDLER in |
ohair@425 | 35 | apt-get) |
ohair@425 | 36 | apt_help $MISSING_DEPENDENCY ;; |
ohair@425 | 37 | yum) |
ohair@425 | 38 | yum_help $MISSING_DEPENDENCY ;; |
ohair@425 | 39 | port) |
ohair@425 | 40 | port_help $MISSING_DEPENDENCY ;; |
ohair@425 | 41 | pkgutil) |
ohair@425 | 42 | pkgutil_help $MISSING_DEPENDENCY ;; |
ohair@425 | 43 | pkgadd) |
ohair@425 | 44 | pkgadd_help $MISSING_DEPENDENCY ;; |
ohair@425 | 45 | * ) |
ohair@425 | 46 | break ;; |
ohair@425 | 47 | esac |
ohair@425 | 48 | |
ohair@425 | 49 | if test "x$PKGHANDLER_COMMAND" != x; then |
ohair@425 | 50 | HELP_MSG="Try running '$PKGHANDLER_COMMAND'." |
ohair@425 | 51 | fi |
ohair@425 | 52 | } |
ohair@425 | 53 | |
ohair@425 | 54 | function apt_help { |
ohair@425 | 55 | case $1 in |
ohair@425 | 56 | devkit) |
ohair@425 | 57 | PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;; |
ohair@425 | 58 | openjdk) |
ohair@425 | 59 | PKGHANDLER_COMMAND="sudo apt-get install openjdk-7-jdk" ;; |
ohair@425 | 60 | alsa) |
ohair@425 | 61 | PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;; |
ohair@425 | 62 | cups) |
ohair@425 | 63 | PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;; |
ohair@425 | 64 | freetype2) |
ohair@425 | 65 | PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;; |
ohair@425 | 66 | pulse) |
ohair@425 | 67 | PKGHANDLER_COMMAND="sudo apt-get install libpulse-dev" ;; |
ohair@425 | 68 | x11) |
ohair@425 | 69 | PKGHANDLER_COMMAND="sudo apt-get install libX11-dev libxext-dev libxrender-dev libxtst-dev" ;; |
ohair@425 | 70 | ccache) |
ohair@425 | 71 | PKGHANDLER_COMMAND="sudo apt-get install ccache" ;; |
ohair@425 | 72 | * ) |
ohair@425 | 73 | break ;; |
ohair@425 | 74 | esac |
ohair@425 | 75 | } |
ohair@425 | 76 | |
ohair@425 | 77 | function yum_help { |
ohair@425 | 78 | case $1 in |
ohair@425 | 79 | devkit) |
ohair@425 | 80 | PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;; |
ohair@425 | 81 | openjdk) |
ohair@425 | 82 | PKGHANDLER_COMMAND="sudo yum install java-1.7.0-openjdk" ;; |
ohair@425 | 83 | alsa) |
ohair@425 | 84 | PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;; |
ohair@425 | 85 | cups) |
ohair@425 | 86 | PKGHANDLER_COMMAND="sudo yum install cups-devel" ;; |
ohair@425 | 87 | freetype2) |
ohair@425 | 88 | PKGHANDLER_COMMAND="sudo yum install freetype2-devel" ;; |
ohair@425 | 89 | pulse) |
ohair@425 | 90 | PKGHANDLER_COMMAND="sudo yum install pulseaudio-libs-devel" ;; |
ohair@425 | 91 | x11) |
ohair@425 | 92 | PKGHANDLER_COMMAND="sudo yum install libXtst-devel" ;; |
ohair@425 | 93 | ccache) |
ohair@425 | 94 | PKGHANDLER_COMMAND="sudo yum install ccache" ;; |
ohair@425 | 95 | * ) |
ohair@425 | 96 | break ;; |
ohair@425 | 97 | esac |
ohair@425 | 98 | } |
ohair@425 | 99 | |
ohair@425 | 100 | function port_help { |
ohair@425 | 101 | PKGHANDLER_COMMAND="" |
ohair@425 | 102 | } |
ohair@425 | 103 | |
ohair@425 | 104 | function pkgutil_help { |
ohair@425 | 105 | PKGHANDLER_COMMAND="" |
ohair@425 | 106 | } |
ohair@425 | 107 | |
ohair@425 | 108 | function pkgadd_help { |
ohair@425 | 109 | PKGHANDLER_COMMAND="" |
ohair@425 | 110 | } |