common/autoconf/autogen.sh
changeset 13697 5262b00bc10c
parent 13132 bd88bb8dd3af
child 14111 2a82ecb35fc7
equal deleted inserted replaced
13694:ffe6bce5a521 13697:5262b00bc10c
    21 # or visit www.oracle.com if you need additional information or have any
    21 # or visit www.oracle.com if you need additional information or have any
    22 # questions.
    22 # questions.
    23 #
    23 #
    24 
    24 
    25 script_dir=`dirname $0`
    25 script_dir=`dirname $0`
    26 closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
       
    27 
    26 
    28 # Create a timestamp as seconds since epoch
    27 # Create a timestamp as seconds since epoch
    29 TIMESTAMP=`date +%s`
    28 if test "x`uname -s`" = "xSunOS"; then
       
    29   # date +%s is not available on Solaris, use this workaround
       
    30   # from http://solarisjedi.blogspot.co.uk/2006/06/solaris-date-command-and-epoch-time.html
       
    31   TIMESTAMP=`/usr/bin/truss /usr/bin/date 2>&1 |  nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}'`
       
    32   # On Solaris /bin/sh doesn't support test -e but /usr/bin/test does.
       
    33   TEST=`which test`
       
    34 else
       
    35   TIMESTAMP=`date +%s`
       
    36   TEST="test"
       
    37 fi
    30 
    38 
       
    39 if $TEST "$CUSTOM_CONFIG_DIR" = ""; then
       
    40   custom_script_dir="$script_dir/../../jdk/make/closed/autoconf"
       
    41 else
       
    42   custom_script_dir=$CUSTOM_CONFIG_DIR
       
    43 fi
       
    44 
       
    45 custom_hook=$custom_script_dir/custom-hook.m4
       
    46 
       
    47 echo Generating generated-configure.sh
    31 cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
    48 cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
    32 rm -rf autom4te.cache
    49 rm -rf autom4te.cache
    33 
    50 
    34 if test -e $closed_script_dir/closed-hook.m4; then
    51 if $TEST -e $custom_hook; then
    35   # We have closed sources available; also generate configure script
    52   echo Generating custom generated-configure.sh
    36   # with closed hooks compiled in.
    53   # We have custom sources available; also generate configure script
       
    54   # with custom hooks compiled in.
    37   cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
    55   cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
    38     sed -e "s|AC_DEFUN_ONCE(\[CLOSED_HOOK\])|m4_include([$closed_script_dir/closed-hook.m4])|" | autoconf -W all -I$script_dir - > $closed_script_dir/generated-configure.sh
    56     sed -e "s|AC_DEFUN_ONCE(\[CUSTOM_HOOK\])|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
    39   rm -rf autom4te.cache
    57   rm -rf autom4te.cache
       
    58 else
       
    59   echo No custom hook found:  $custom_hook
    40 fi
    60 fi