Path: blob/aarch64-shenandoah-jdk8u272-b10/common/autoconf/autogen.sh
32278 views
#!/bin/bash1#2# Copyright (c) 2011, 2012, 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 it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.22#2324generate_configure_script() {25# First create a header26cat > $1 << EOT27#!/bin/bash28#29# ##########################################################30# ### THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. ###31# ##########################################################32#33EOT34# Then replace "magic" variables in configure.ac and append the output35# from autoconf. $2 is either cat (just a no-op) or a filter.36cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \37eval $2 | ${AUTOCONF} -W all -I$script_dir - >> $138rm -rf autom4te.cache39}4041script_dir=`dirname $0`4243# Create a timestamp as seconds since epoch44if test "x`uname -s`" = "xSunOS"; then45TIMESTAMP=`date +%s`46if test "x$TIMESTAMP" = "x%s"; then47# date +%s not available on this Solaris, use workaround from nawk(1):48TIMESTAMP=`nawk 'BEGIN{print srand()}'`49fi50else51TIMESTAMP=`date +%s`52fi5354if test "x$CUSTOM_CONFIG_DIR" = "x"; then55topdir=`cd $script_dir/../.. >/dev/null && pwd`56custom_script_dir="$topdir/jdk/make/closed/autoconf"57else58custom_script_dir=$CUSTOM_CONFIG_DIR59fi6061custom_hook=$custom_script_dir/custom-hook.m46263AUTOCONF="`which autoconf 2> /dev/null | grep -v '^no autoconf in'`"6465if test "x${AUTOCONF}" = x; then66echo "You need autoconf installed to be able to regenerate the configure script"67echo "Error: Cannot find autoconf" 1>&268exit 169fi7071autoconf_version=`$AUTOCONF --version | head -1`72echo "Using autoconf at ${AUTOCONF} [$autoconf_version]"7374echo "Generating generated-configure.sh"75generate_configure_script "$script_dir/generated-configure.sh" 'cat'7677if test -e $custom_hook; then78# We have custom sources available; also generate configure script79# with custom hooks compiled in.80echo "Generating custom generated-configure.sh"81generate_configure_script "$custom_script_dir/generated-configure.sh" 'sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|"'82else83echo "(No custom hook found at $custom_hook)"84fi858687