common/autoconf/autogen.sh

changeset 478
2ba6f4da4bf3
parent 458
c8d320b48626
child 494
e64f2cb57d05
     1.1 --- a/common/autoconf/autogen.sh	Thu Sep 06 17:27:20 2012 -0700
     1.2 +++ b/common/autoconf/autogen.sh	Tue Sep 18 11:29:16 2012 -0700
     1.3 @@ -23,18 +23,38 @@
     1.4  #
     1.5  
     1.6  script_dir=`dirname $0`
     1.7 -closed_script_dir="$script_dir/../../jdk/make/closed/autoconf"
     1.8  
     1.9  # Create a timestamp as seconds since epoch
    1.10 -TIMESTAMP=`date +%s`
    1.11 +if test "x`uname -s`" = "xSunOS"; then
    1.12 +  # date +%s is not available on Solaris, use this workaround
    1.13 +  # from http://solarisjedi.blogspot.co.uk/2006/06/solaris-date-command-and-epoch-time.html
    1.14 +  TIMESTAMP=`/usr/bin/truss /usr/bin/date 2>&1 |  nawk -F= '/^time\(\)/ {gsub(/ /,"",$2);print $2}'`
    1.15 +  # On Solaris /bin/sh doesn't support test -e but /usr/bin/test does.
    1.16 +  TEST=`which test`
    1.17 +else
    1.18 +  TIMESTAMP=`date +%s`
    1.19 +  TEST="test"
    1.20 +fi
    1.21  
    1.22 +if $TEST "$CUSTOM_CONFIG_DIR" = ""; then
    1.23 +  custom_script_dir="$script_dir/../../jdk/make/closed/autoconf"
    1.24 +else
    1.25 +  custom_script_dir=$CUSTOM_CONFIG_DIR
    1.26 +fi
    1.27 +
    1.28 +custom_hook=$custom_script_dir/custom-hook.m4
    1.29 +
    1.30 +echo Generating generated-configure.sh
    1.31  cat $script_dir/configure.ac  | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | autoconf -W all -I$script_dir - > $script_dir/generated-configure.sh
    1.32  rm -rf autom4te.cache
    1.33  
    1.34 -if test -e $closed_script_dir/closed-hook.m4; then
    1.35 -  # We have closed sources available; also generate configure script
    1.36 -  # with closed hooks compiled in.
    1.37 +if $TEST -e $custom_hook; then
    1.38 +  echo Generating custom generated-configure.sh
    1.39 +  # We have custom sources available; also generate configure script
    1.40 +  # with custom hooks compiled in.
    1.41    cat $script_dir/configure.ac | sed -e "s|@DATE_WHEN_GENERATED@|$TIMESTAMP|" | \
    1.42 -    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
    1.43 +    sed -e "s|AC_DEFUN_ONCE(\[CUSTOM_HOOK\])|m4_include([$custom_hook])|" | autoconf -W all -I$script_dir - > $custom_script_dir/generated-configure.sh
    1.44    rm -rf autom4te.cache
    1.45 +else
    1.46 +  echo No custom hook found:  $custom_hook
    1.47  fi

mercurial