make/common/shared/Defs-utils.gmk

Sat, 01 Dec 2007 00:00:00 +0000

author
duke
date
Sat, 01 Dec 2007 00:00:00 +0000
changeset 1
55540e827aef
child 27
0d92f2ecc8ff
permissions
-rw-r--r--

Initial load

     1 #
     2 # Copyright 2005-2007 Sun Microsystems, Inc.  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.  Sun designates this
     8 # particular file as subject to the "Classpath" exception as provided
     9 # by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
    23 # have any questions.
    24 #
    26 #
    27 # Shared variables for standard unix utilties on all platforms.
    28 #
    29 # Assumes Platform.gmk has been included before this file.
    30 #
    31 # These input UTILS_* variables can be defined at anytime, ideally once.
    32 #         Unix Commands: Normally /bin/, /usr/bin/. or C:/mksnt/mksnt/
    33 #            UTILS_COMMAND_PATH
    34 #         /usr/bin/ 
    35 #            UTILS_USR_BIN_PATH
    36 #         /usr/ccs/bin/ (sccs, m4, lex, yacc, as, ar, strip, mcs)
    37 #            UTILS_CCS_BIN_PATH
    38 #         Dev Tools: zip, unzip, etc that we may have special versions of
    39 #            UTILS_DEVTOOL_PATH
    40 #
    41 # WARNING:  This file cannot assume that any of these utilties are available
    42 #           to be run via their variable names defined here.
    43 #           The paths inside the UTILS_* variables may not be defined yet.
    44 #
    45 # Note: There is no guarantee that all these exist on all platforms.
    46 #       Some only make sense for one platform, but are harmless.
    47 #
    49 ifeq ($(PLATFORM),linux)
    50   UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
    51   UTILS_USR_BIN_PATH=$(USRBIN_PATH)
    52   UTILS_CCS_BIN_PATH=$(USRBIN_PATH)
    53   UTILS_DEVTOOL_PATH=$(USRBIN_PATH)
    54 endif
    56 ifeq ($(PLATFORM),solaris)
    57   UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
    58   UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH)
    59   UTILS_CCS_BIN_PATH=$(UNIXCCS_PATH)
    60   UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
    61 endif
    63 ifeq ($(PLATFORM),windows)
    64   UTILS_COMMAND_PATH=$(UNIXCOMMAND_PATH)
    65   UTILS_USR_BIN_PATH=$(UNIXCOMMAND_PATH)
    66   UTILS_CCS_BIN_PATH=$(UNIXCOMMAND_PATH)
    67   UTILS_DEVTOOL_PATH=$(DEVTOOLS_PATH)
    68 endif
    70 # Utilities ant and findbugs
    71 ifndef ANT_HOME
    72   ANT_HOME = $(JDK_DEVTOOLS_DIR)/share/ant/latest
    73 endif
    74 ANT = $(ANT_HOME)/bin/ant
    75 ifndef FINDBUGS_HOME
    76   FINDBUGS_HOME = $(JDK_DEVTOOLS_DIR)/share/findbugs/latest
    77 endif
    78 FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs
    80 # Utilities
    81 ADB            = $(UTILS_COMMAND_PATH)adb
    82 AR             = $(UTILS_CCS_BIN_PATH)ar
    83 AS             = $(UTILS_CCS_BIN_PATH)as
    84 BASENAME       = $(UTILS_COMMAND_PATH)basename
    85 CAT            = $(UTILS_COMMAND_PATH)cat
    86 CHMOD          = $(UTILS_COMMAND_PATH)chmod
    87 CMP            = $(UTILS_USR_BIN_PATH)cmp
    88 COMM           = $(UTILS_USR_BIN_PATH)comm
    89 COMPRESS       = $(UTILS_USR_BIN_PATH)compress
    90 CP             = $(UTILS_COMMAND_PATH)cp
    91 CPIO           = $(UTILS_COMMAND_PATH)cpio
    92 CUT            = $(UTILS_USR_BIN_PATH)cut
    93 DATE           = $(UTILS_COMMAND_PATH)date
    94 DF             = $(UTILS_COMMAND_PATH)df
    95 DIFF           = $(UTILS_USR_BIN_PATH)diff
    96 DIRNAME        = $(UTILS_USR_BIN_PATH)dirname
    97 ECHO           = $(UTILS_COMMAND_PATH)echo
    98 EGREP          = $(UTILS_COMMAND_PATH)egrep
    99 EXPR           = $(UTILS_USR_BIN_PATH)expr
   100 FILE           = $(UTILS_USR_BIN_PATH)file
   101 FIND           = $(UTILS_USR_BIN_PATH)find
   102 FMT            = $(UTILS_COMMAND_PATH)fmt
   103 GDB            = $(UTILS_USR_BIN_PATH)gdb
   104 GREP           = $(UTILS_COMMAND_PATH)grep
   105 GUNZIP         = $(UTILS_COMMAND_PATH)gunzip
   106 HEAD           = $(UTILS_USR_BIN_PATH)head
   107 ID             = $(UTILS_COMMAND_PATH)id
   108 ISAINFO        = $(UTILS_COMMAND_PATH)isainfo
   109 KSH            = $(UTILS_COMMAND_PATH)ksh
   110 LD             = $(UTILS_CCS_BIN_PATH)ld
   111 LEX            = $(UTILS_CCS_BIN_PATH)lex
   112 LN             = $(UTILS_COMMAND_PATH)ln
   113 LS             = $(UTILS_COMMAND_PATH)ls
   114 MCS            = $(UTILS_CCS_BIN_PATH)mcs
   115 M4             = $(UTILS_CCS_BIN_PATH)m4
   116 MKDIR          = $(UTILS_COMMAND_PATH)mkdir
   117 MKSINFO        = $(UTILS_COMMAND_PATH)mksinfo
   118 MSGFMT         = $(UTILS_USR_BIN_PATH)msgfmt
   119 MV             = $(UTILS_COMMAND_PATH)mv
   120 NAWK           = $(UTILS_USR_BIN_PATH)nawk
   121 NM             = $(UTILS_CCS_BIN_PATH)nm
   122 PKGMK          = $(UTILS_COMMAND_PATH)pkgmk
   123 PRINTF         = $(UTILS_USR_BIN_PATH)printf
   124 PWD            = $(UTILS_COMMAND_PATH)pwd
   125 RC             = $(UTILS_COMMAND_PATH)rc
   126 RMDIR          = $(UTILS_COMMAND_PATH)rmdir
   127 RPM            = $(UTILS_COMMAND_PATH)rpm
   128 RPMBUILD       = $(UTILS_COMMAND_PATH)rpmbuild
   129 SCCS           = $(UTILS_CCS_BIN_PATH)sccs
   130 SED            = $(UTILS_COMMAND_PATH)sed
   131 SH             = $(UTILS_COMMAND_PATH)sh
   132 SHOWREV        = $(UTILS_USR_BIN_PATH)showrev
   133 SORT           = $(UTILS_COMMAND_PATH)sort
   134 STRIP          = $(UTILS_CCS_BIN_PATH)strip
   135 TAIL           = $(UTILS_USR_BIN_PATH)tail
   136 TAR            = $(UTILS_COMMAND_PATH)tar
   137 TEST           = $(UTILS_USR_BIN_PATH)test
   138 TOUCH          = $(UTILS_COMMAND_PATH)touch
   139 TR             = $(UTILS_USR_BIN_PATH)tr
   140 TRUE           = $(UTILS_COMMAND_PATH)true
   141 UNAME          = $(UTILS_COMMAND_PATH)uname
   142 UNIQ           = $(UTILS_USR_BIN_PATH)uniq
   143 UNZIP          = $(UTILS_USR_BIN_PATH)unzip
   144 UNZIPSFX       = $(UTILS_DEVTOOL_PATH)unzipsfx
   145 WC             = $(UTILS_USR_BIN_PATH)wc
   146 WHICH          = $(UTILS_USR_BIN_PATH)which
   147 YACC           = $(UTILS_CCS_BIN_PATH)yacc
   148 ZIPEXE         = $(UTILS_DEVTOOL_PATH)zip
   150 # Special cases
   151 #RM   is defined by GNU Make as 'rm -f'
   152 CD             = cd # intrinsic unix command
   154 # Windows specific
   155 ifeq ($(PLATFORM),windows)
   156   ifdef USING_CYGWIN
   157     # Intrinsic unix command, with backslash-escaped character interpretation
   158     ECHO = $(UNIXCOMMAND_PATH)echo -e
   159     ZIPEXE = $(UNIXCOMMAND_PATH)zip
   160     UNZIP  = $(UNIXCOMMAND_PATH)unzip
   161   else
   162     ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
   163     UNZIP  = $(UTILS_DEVTOOL_PATH)unzip
   164   endif
   165   # Re-define some utilities
   166   LEX            =# override GNU Make intrinsic: no lex on windows
   167   NAWK           = $(UNIXCOMMAND_PATH)awk
   168 endif
   170 # Linux specific
   171 ifeq ($(PLATFORM),linux)
   172   # A few redefines
   173   # Allows for builds on Debian GNU Linux, basename is in a different place
   174   BASENAME=$(firstword $(wildcard $(UTILS_COMMAND_PATH)basename) \
   175                        $(wildcard $(UTILS_USR_BIN_PATH)basename))
   176   # RPM 4 has replaced "rpm -b" with an entirely new utility "rpmbuild".
   177   # Also, some distribution (Ubuntu, Debian, others?) place the rpm command
   178   # itself in /usr/bin rather than it's traditional home in /bin.
   179   RPM=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpm) \
   180 		  $(wildcard $(UTILS_USR_BIN_PATH)rpm))
   181   RPMBUILD=$(firstword $(wildcard $(UTILS_COMMAND_PATH)rpmbuild) \
   182 		       $(wildcard $(UTILS_USR_BIN_PATH)rpmbuild) \
   183 		       $(wildcard $(UTILS_COMMAND_PATH)rpm) \
   184 		       $(wildcard $(UTILS_USR_BIN_PATH)rpm))
   185   # Most Linux distros have "sort" in /bin.  Ubuntu, Debian and perhaps
   186   # others have it in /usr/bin.
   187   SORT=$(firstword $(wildcard $(UTILS_COMMAND_PATH)sort) \
   188 		   $(wildcard $(UTILS_USR_BIN_PATH)sort))
   189   NAWK           = $(USRBIN_PATH)gawk
   190   # Intrinsic unix command, with backslash-escaped character interpretation
   191   ECHO           = /bin/echo -e
   192   # These are really in UTILS_USR_BIN_PATH on Linux (only sccs is not)
   193   AR             = $(UTILS_USR_BIN_PATH)ar
   194   AS             = $(UTILS_USR_BIN_PATH)as
   195   LD             = $(UTILS_USR_BIN_PATH)ld
   196   LEX            = $(UTILS_USR_BIN_PATH)lex
   197   MCS            = $(UTILS_USR_BIN_PATH)mcs
   198   M4             = $(UTILS_USR_BIN_PATH)m4
   199   NM             = $(UTILS_USR_BIN_PATH)nm
   200   STRIP          = $(UTILS_USR_BIN_PATH)strip
   201   YACC           = $(UTILS_USR_BIN_PATH)yacc
   202 endif
   204 # Solaris specific
   205 ifeq ($(PLATFORM),solaris)
   206   # Intrinsic unix command, with backslash-escaped character interpretation
   207   #   (not using -e  will cause build failure when using /bin/bash)
   208   #   (using -e breaks something else)
   209   ECHO           = /usr/bin/echo
   210 endif

mercurial