annotate common/autoconf/autogen.sh @ 890:13ddc5c3ebfc

Merge
author jlaskey
date Sat, 02 Mar 2013 10:28:16 -0400
parents e64f2cb57d05
children 15c1642967c9
rev   line source
ohair@492 1 #!/bin/bash
ohair@423 2 #
ohair@423 3 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
ohair@423 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@423 5 #
ohair@423 6 # This code is free software; you can redistribute it and/or modify it
ohair@423 7 # under the terms of the GNU General Public License version 2 only, as
ohair@423 8 # published by the Free Software Foundation.
ohair@423 9 #
ohair@423 10 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@423 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@423 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@423 13 # version 2 for more details (a copy is included in the LICENSE file that
ohair@423 14 # accompanied this code).
ohair@423 15 #
ohair@423 16 # You should have received a copy of the GNU General Public License version
ohair@423 17 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@423 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@423 19 #
ohair@423 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@423 21 # or visit www.oracle.com if you need additional information or have any
ohair@423 22 # questions.
ohair@423 23 #
ohair@423 24
erikj@456 25 script_dir=`dirname $0`
erikj@456 26
erikj@456 27 # Create a timestamp as seconds since epoch
ohair@476 28 if test "x`uname -s`" = "xSunOS"; then
tbell@569 29 TIMESTAMP=`date +%s`
tbell@569 30 if test "x$TIMESTAMP" = "x%s"; then
tbell@569 31 # date +%s not available on this Solaris, use workaround from nawk(1):
tbell@569 32 TIMESTAMP=`nawk 'BEGIN{print srand()}'`
tbell@569 33 fi
ohair@476 34 else
ohair@476 35 TIMESTAMP=`date +%s`
ohair@476 36 fi
erikj@456 37
ohair@492 38 if test "x$CUSTOM_CONFIG_DIR" = "x"; then
ohair@476 39 custom_script_dir="$script_dir/../../jdk/make/closed/autoconf"
ohair@476 40 else
ohair@476 41 custom_script_dir=$CUSTOM_CONFIG_DIR
ohair@476 42 fi
ohair@476 43
ohair@476 44 custom_hook=$custom_script_dir/custom-hook.m4
ohair@476 45
ohair@492 46 if test "x`which autoconf 2> /dev/null`" = x; then
ohair@492 47 echo You need autoconf installed to be able to regenerate the configure script
ohair@492 48 echo Error: Cannot find autoconf 1>&2
ohair@492 49 exit 1
ohair@492 50 fi
ohair@492 51
ohair@476 52 echo Generating generated-configure.sh
erikj@456 53 cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
erikj@456 54 rm -rf autom4te.cache
erikj@456 55
ohair@492 56 if test -e $custom_hook; then
ohair@476 57 echo Generating custom generated-configure.sh
ohair@476 58 # We have custom sources available; also generate configure script
ohair@476 59 # with custom hooks compiled in.
erikj@456 60 cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
ohair@492 61 sed -e "s|#CUSTOM_AUTOCONF_INCLUDE|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
erikj@456 62 rm -rf autom4te.cache
ohair@476 63 else
ohair@476 64 echo No custom hook found: $custom_hook
erikj@456 65 fi