jdk

Форк
0
/
help.m4 
398 строк · 13.9 Кб
1
#
2
# Copyright (c) 2011, 2022, 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
  UTIL_LOOKUP_PROGS(PKGHANDLER, zypper apt-get yum brew port pkgutil pkgadd pacman apk)
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: cups, alsa etc
35
  MISSING_DEPENDENCY=$1
36

37
  if test "x$MISSING_DEPENDENCY" = "xopenjdk"; then
38
    HELP_MSG="OpenJDK distributions are available at http://jdk.java.net/."
39
  elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then
40
    cygwin_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
      *brew)
50
        brew_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
      *zypper)
58
        zypper_help  $MISSING_DEPENDENCY ;;
59
      *pacman)
60
        pacman_help  $MISSING_DEPENDENCY ;;
61
      *apk)
62
        apk_help     $MISSING_DEPENDENCY ;;
63
    esac
64

65
    if test "x$PKGHANDLER_COMMAND" != x; then
66
      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
67
    fi
68
  fi
69
])
70

71
cygwin_help() {
72
  case $1 in
73
    unzip)
74
      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P unzip )"
75
      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
76
      ;;
77
    zip)
78
      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P zip )"
79
      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
80
      ;;
81
    make)
82
      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P make )"
83
      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
84
      ;;
85
    i686-w64-mingw32-gcc)
86
      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P gcc-core i686-w64-mingw32-gcc-core mingw64-i686-glib2.0 )"
87
      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
88
      ;;
89
    x86_64-w64-mingw32-gcc)
90
      PKGHANDLER_COMMAND="( cd <location of cygwin setup.exe> && cmd /c setup -q -P gcc-core x86_64-w64-mingw32-gcc-core mingw64-x86_64-glib2.0 )"
91
      HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'."
92
      ;;
93
  esac
94
}
95

96
apt_help() {
97
  case $1 in
98
    reduced)
99
      PKGHANDLER_COMMAND="sudo apt-get install gcc-multilib g++-multilib" ;;
100
    devkit)
101
      PKGHANDLER_COMMAND="sudo apt-get install build-essential" ;;
102
    alsa)
103
      PKGHANDLER_COMMAND="sudo apt-get install libasound2-dev" ;;
104
    cups)
105
      PKGHANDLER_COMMAND="sudo apt-get install libcups2-dev" ;;
106
    fontconfig)
107
      PKGHANDLER_COMMAND="sudo apt-get install libfontconfig1-dev" ;;
108
    freetype)
109
      PKGHANDLER_COMMAND="sudo apt-get install libfreetype6-dev" ;;
110
    harfbuzz)
111
      PKGHANDLER_COMMAND="sudo apt-get install libharfbuzz-dev" ;;
112
    ffi)
113
      PKGHANDLER_COMMAND="sudo apt-get install libffi-dev" ;;
114
    x11)
115
      PKGHANDLER_COMMAND="sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev" ;;
116
    ccache)
117
      PKGHANDLER_COMMAND="sudo apt-get install ccache" ;;
118
    dtrace)
119
      PKGHANDLER_COMMAND="sudo apt-get install systemtap-sdt-dev" ;;
120
    capstone)
121
      PKGHANDLER_COMMAND="sudo apt-get install libcapstone-dev" ;;
122
  esac
123
}
124

125
zypper_help() {
126
  case $1 in
127
    devkit)
128
      PKGHANDLER_COMMAND="sudo zypper install gcc gcc-c++" ;;
129
    alsa)
130
      PKGHANDLER_COMMAND="sudo zypper install alsa-devel" ;;
131
    cups)
132
      PKGHANDLER_COMMAND="sudo zypper install cups-devel" ;;
133
    fontconfig)
134
      PKGHANDLER_COMMAND="sudo zypper install fontconfig-devel" ;;
135
    freetype)
136
      PKGHANDLER_COMMAND="sudo zypper install freetype-devel" ;;
137
    harfbuzz)
138
      PKGHANDLER_COMMAND="sudo zypper install harfbuzz-devel" ;;
139
    x11)
140
      PKGHANDLER_COMMAND="sudo zypper install libX11-devel libXext-devel libXrender-devel libXrandr-devel libXtst-devel libXt-devel libXi-devel" ;;
141
    ccache)
142
      PKGHANDLER_COMMAND="sudo zypper install ccache" ;;
143
  esac
144
}
145

146
yum_help() {
147
  case $1 in
148
    devkit)
149
      PKGHANDLER_COMMAND="sudo yum groupinstall \"Development Tools\"" ;;
150
    alsa)
151
      PKGHANDLER_COMMAND="sudo yum install alsa-lib-devel" ;;
152
    cups)
153
      PKGHANDLER_COMMAND="sudo yum install cups-devel" ;;
154
    fontconfig)
155
      PKGHANDLER_COMMAND="sudo yum install fontconfig-devel" ;;
156
    freetype)
157
      PKGHANDLER_COMMAND="sudo yum install freetype-devel" ;;
158
    harfbuzz)
159
      PKGHANDLER_COMMAND="sudo yum install harfbuzz-devel" ;;
160
    x11)
161
      PKGHANDLER_COMMAND="sudo yum install libXtst-devel libXt-devel libXrender-devel libXrandr-devel libXi-devel" ;;
162
    ccache)
163
      PKGHANDLER_COMMAND="sudo yum install ccache" ;;
164
  esac
165
}
166

167
brew_help() {
168
  case $1 in
169
    freetype)
170
      PKGHANDLER_COMMAND="brew install freetype" ;;
171
    ccache)
172
      PKGHANDLER_COMMAND="brew install ccache" ;;
173
    capstone)
174
      PKGHANDLER_COMMAND="brew install capstone" ;;
175
  esac
176
}
177

178
pacman_help() {
179
  case $1 in
180
    unzip)
181
      PKGHANDLER_COMMAND="sudo pacman -S unzip" ;;
182
    zip)
183
      PKGHANDLER_COMMAND="sudo pacman -S zip" ;;
184
    make)
185
      PKGHANDLER_COMMAND="sudo pacman -S make" ;;
186
  esac
187
}
188

189
port_help() {
190
  PKGHANDLER_COMMAND=""
191
}
192

193
pkgutil_help() {
194
  PKGHANDLER_COMMAND=""
195
}
196

197
pkgadd_help() {
198
  PKGHANDLER_COMMAND=""
199
}
200

201
apk_help() {
202
  case $1 in
203
    devkit)
204
      PKGHANDLER_COMMAND="sudo apk add alpine-sdk linux-headers" ;;
205
    alsa)
206
      PKGHANDLER_COMMAND="sudo apk add alsa-lib-dev" ;;
207
    cups)
208
      PKGHANDLER_COMMAND="sudo apk add cups-dev" ;;
209
    fontconfig)
210
      PKGHANDLER_COMMAND="sudo apk add fontconfig-dev" ;;
211
    freetype)
212
      PKGHANDLER_COMMAND="sudo apk add freetype-dev" ;;
213
    harfbuzz)
214
      PKGHANDLER_COMMAND="sudo apk add harfbuzz-dev" ;;
215
    x11)
216
      PKGHANDLER_COMMAND="sudo apk add libxtst-dev libxt-dev libxrender-dev libxrandr-dev" ;;
217
    ccache)
218
      PKGHANDLER_COMMAND="sudo apk add ccache" ;;
219
  esac
220
}
221

222
# This function will check if we're called from the "configure" wrapper while
223
# printing --help. If so, we will print out additional information that can
224
# only be extracted within the autoconf script, and then exit. This must be
225
# called at the very beginning in configure.ac.
226
AC_DEFUN_ONCE([HELP_PRINT_ADDITIONAL_HELP_AND_EXIT],
227
[
228
  if test "x$CONFIGURE_PRINT_ADDITIONAL_HELP" != x; then
229

230
    # Print available toolchains
231
    $PRINTF "The following toolchains are valid as arguments to --with-toolchain-type.\n"
232
    $PRINTF "Which are available to use depends on the build platform.\n"
233
    for toolchain in $VALID_TOOLCHAINS_all; do
234
      # Use indirect variable referencing
235
      toolchain_var_name=TOOLCHAIN_DESCRIPTION_$toolchain
236
      TOOLCHAIN_DESCRIPTION=${!toolchain_var_name}
237
      $PRINTF "  %-22s  %s\n" $toolchain "$TOOLCHAIN_DESCRIPTION"
238
    done
239
    $PRINTF "\n"
240

241
    # Print available JVM features
242
    $PRINTF "The following JVM features are valid as arguments to --with-jvm-features.\n"
243
    $PRINTF "Which are available to use depends on the environment and JVM variant.\n"
244
    m4_foreach(FEATURE, m4_split(jvm_features_valid), [
245
      # Create an m4 variable containing the description for FEATURE.
246
      m4_define(FEATURE_DESCRIPTION, [jvm_feature_desc_]m4_translit(FEATURE, -, _))
247
      $PRINTF "  %-22s  %s\n" FEATURE "FEATURE_DESCRIPTION"
248
      m4_undefine([FEATURE_DESCRIPTION])
249
    ])
250

251
    # And now exit directly
252
    exit 0
253
  fi
254
])
255

256
AC_DEFUN_ONCE([HELP_PRINT_SUMMARY_AND_WARNINGS],
257
[
258
  # Finally output some useful information to the user
259

260
  printf "\n"
261
  printf "====================================================\n"
262
  if test "x$no_create" != "xyes"; then
263
    if test "x$IS_RECONFIGURE" != "xyes"; then
264
      printf "A new configuration has been successfully created in\n%s\n" "$OUTPUTDIR"
265
    else
266
      printf "The existing configuration has been successfully updated in\n%s\n" "$OUTPUTDIR"
267
    fi
268
  else
269
    if test "x$IS_RECONFIGURE" != "xyes"; then
270
      printf "A configuration has been successfully checked but not created\n"
271
    else
272
      printf "The existing configuration has been successfully checked in\n%s\n" "$OUTPUTDIR"
273
    fi
274
  fi
275
  if test "x$CONFIGURE_COMMAND_LINE" != x; then
276
    printf "using configure arguments '$CONFIGURE_COMMAND_LINE'.\n"
277
  else
278
    printf "using default settings.\n"
279
  fi
280

281
  if test "x$REAL_CONFIGURE_COMMAND_EXEC_FULL" != x; then
282
    printf "\n"
283
    printf "The original configure invocation was '$REAL_CONFIGURE_COMMAND_EXEC_SHORT $REAL_CONFIGURE_COMMAND_LINE'.\n"
284
  fi
285

286
  printf "\n"
287
  printf "Configuration summary:\n"
288
  printf "* Name:           $CONF_NAME\n"
289
  printf "* Debug level:    $DEBUG_LEVEL\n"
290
  printf "* HS debug level: $HOTSPOT_DEBUG_LEVEL\n"
291
  printf "* JVM variants:   $JVM_VARIANTS\n"
292
  printf "* JVM features:   "
293

294
  for variant in $JVM_VARIANTS; do
295
    features_var_name=JVM_FEATURES_$variant
296
    JVM_FEATURES_FOR_VARIANT=${!features_var_name}
297
    printf "$variant: \'$JVM_FEATURES_FOR_VARIANT\' "
298
  done
299
  printf "\n"
300

301
  printf "* OpenJDK target: OS: $OPENJDK_TARGET_OS, CPU architecture: $OPENJDK_TARGET_CPU_ARCH, address length: $OPENJDK_TARGET_CPU_BITS\n"
302
  printf "* Version string: $VERSION_STRING ($VERSION_SHORT)\n"
303

304
  if test "x$SOURCE_DATE" != xupdated; then
305
    source_date_info="$SOURCE_DATE ($SOURCE_DATE_ISO_8601)"
306
  else
307
    source_date_info="Determined at build time"
308
  fi
309
  printf "* Source date:    $source_date_info\n"
310

311
  printf "\n"
312
  printf "Tools summary:\n"
313
  if test "x$OPENJDK_BUILD_OS" = "xwindows"; then
314
    printf "* Environment:    %s version %s; windows version %s; prefix \"%s\"; root \"%s\"\n" \
315
        "$WINENV_VENDOR" "$WINENV_VERSION" "$WINDOWS_VERSION" "$WINENV_PREFIX" "$WINENV_ROOT"
316
  fi
317
  printf "* Boot JDK:       $BOOT_JDK_VERSION (at $BOOT_JDK)\n"
318
  printf "* Toolchain:      $TOOLCHAIN_TYPE ($TOOLCHAIN_DESCRIPTION)\n"
319
  if test "x$DEVKIT_NAME" != x; then
320
    printf "* Devkit:         $DEVKIT_NAME ($DEVKIT_ROOT)\n"
321
  elif test "x$DEVKIT_ROOT" != x; then
322
    printf "* Devkit:         $DEVKIT_ROOT\n"
323
  elif test "x$SYSROOT" != x; then
324
    printf "* Sysroot:        $SYSROOT\n"
325
  fi
326
  printf "* C Compiler:     Version $CC_VERSION_NUMBER (at ${CC#"$FIXPATH "})\n"
327
  printf "* C++ Compiler:   Version $CXX_VERSION_NUMBER (at ${CXX#"$FIXPATH "})\n"
328

329
  printf "\n"
330
  printf "Build performance summary:\n"
331
  printf "* Build jobs:     $JOBS\n"
332
  printf "* Memory limit:   $MEMORY_SIZE MB\n"
333
  if test "x$CCACHE_STATUS" != "x"; then
334
    printf "* ccache status:  $CCACHE_STATUS\n"
335
  fi
336
  printf "\n"
337

338
  if test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = "xtrue"; then
339
    printf "NOTE: You have requested to build more than one version of the JVM, which\n"
340
    printf "will result in longer build times.\n"
341
    printf "\n"
342
  fi
343

344
  if test "x$FOUND_ALT_VARIABLES" != "x"; then
345
    printf "WARNING: You have old-style ALT_ environment variables set.\n"
346
    printf "These are not respected, and will be ignored. It is recommended\n"
347
    printf "that you clean your environment. The following variables are set:\n"
348
    printf "$FOUND_ALT_VARIABLES\n"
349
    printf "\n"
350
  fi
351

352
  if test "x$OUTPUT_DIR_IS_LOCAL" != "xyes"; then
353
    printf "WARNING: Your build output directory is not on a local disk.\n"
354
    printf "This will severely degrade build performance!\n"
355
    printf "It is recommended that you create an output directory on a local disk,\n"
356
    printf "and run the configure script again from that directory.\n"
357
    printf "\n"
358
  fi
359

360
  if test "x$IS_RECONFIGURE" = "xyes" && test "x$no_create" != "xyes"; then
361
    printf "WARNING: The result of this configuration has overridden an older\n"
362
    printf "configuration. You *should* run 'make clean' to make sure you get a\n"
363
    printf "proper build. Failure to do so might result in strange build problems.\n"
364
    printf "\n"
365
  fi
366

367
  if test "x$IS_RECONFIGURE" != "xyes" && test "x$no_create" = "xyes"; then
368
    printf "WARNING: The result of this configuration was not saved.\n"
369
    printf "You should run without '--no-create | -n' to create the configuration.\n"
370
    printf "\n"
371
  fi
372

373
  if test "x$UNSUPPORTED_TOOLCHAIN_VERSION" = "xyes"; then
374
    printf "WARNING: The toolchain version used is known to have issues. Please\n"
375
    printf "consider using a supported version unless you know what you are doing.\n"
376
    printf "\n"
377
  fi
378
])
379

380
AC_DEFUN_ONCE([HELP_REPEAT_WARNINGS],
381
[
382
  # Locate config.log.
383
  if test -e "$CONFIGURESUPPORT_OUTPUTDIR/config.log"; then
384
    CONFIG_LOG_PATH="$CONFIGURESUPPORT_OUTPUTDIR"
385
  elif test -e "./config.log"; then
386
    CONFIG_LOG_PATH="."
387
  fi
388

389
  if test -e "$CONFIG_LOG_PATH/config.log"; then
390
    $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" > /dev/null 2>&1
391
    if test $? -eq 0; then
392
      printf "The following warnings were produced. Repeated here for convenience:\n"
393
      # We must quote sed expression (using []) to stop m4 from eating the [].
394
      $GREP '^configure:.*: WARNING:' "$CONFIG_LOG_PATH/config.log" | $SED -e [ 's/^configure:[0-9]*: //' ]
395
      printf "\n"
396
    fi
397
  fi
398
])
399

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.