hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject [48/51] [partial] incubator-hawq git commit: SGA import
Date Sat, 19 Sep 2015 00:36:31 GMT
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/general.m4
----------------------------------------------------------------------
diff --git a/config/general.m4 b/config/general.m4
new file mode 100644
index 0000000..7f18e84
--- /dev/null
+++ b/config/general.m4
@@ -0,0 +1,152 @@
+# $PostgreSQL: pgsql/config/general.m4,v 1.9 2006/11/30 22:21:23 tgl Exp $
+
+# This file defines new macros to process configure command line
+# arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE.
+# The flaw in these is particularly that they only differentiate
+# between "given" and "not given" and do not provide enough help to
+# process arguments that only accept "yes/no", that require an
+# argument (other than "yes/no"), etc.
+#
+# The point of this implementation is to reduce code size and
+# redundancy in configure.in and to improve robustness and consistency
+# in the option evaluation code.
+
+
+# Convert type and name to shell variable name (e.g., "enable_long_strings")
+m4_define([pgac_arg_to_variable],
+          [$1[]_[]patsubst($2, -, _)])
+
+
+# PGAC_ARG(TYPE, NAME, HELP-STRING,
+#          [ACTION-IF-YES], [ACTION-IF-NO], [ACTION-IF-ARG],
+#          [ACTION-IF-OMITTED])
+# ------------------------------------------------------------
+# This is the base layer. TYPE is either "with" or "enable", depending
+# on what you like. NAME is the rest of the option name, HELP-STRING
+# as usual. ACTION-IF-YES is executed if the option is given without
+# an argument (or "yes", which is the same); similar for ACTION-IF-NO.
+
+AC_DEFUN([PGAC_ARG],
+[
+pgac_args="$pgac_args pgac_arg_to_variable([$1],[$2])"
+m4_case([$1],
+
+enable, [
+AC_ARG_ENABLE([$2], [$3], [
+  case [$]enableval in
+    yes)
+      m4_default([$4], :)
+      ;;
+    no)
+      m4_default([$5], :)
+      ;;
+    *)
+      $6
+      ;;
+  esac
+],
+[$7])[]dnl AC_ARG_ENABLE
+],
+
+with, [
+AC_ARG_WITH([$2], [$3], [
+  case [$]withval in
+    yes)
+      m4_default([$4], :)
+      ;;
+    no)
+      m4_default([$5], :)
+      ;;
+    *)
+      $6
+      ;;
+  esac
+],
+[$7])[]dnl AC_ARG_WITH
+],
+
+[m4_fatal([first argument of $0 must be 'enable' or 'with', not '$1'])]
+)
+])# PGAC_ARG
+
+# PGAC_ARG_CHECK()
+# ----------------
+# Checks if the user passed any --with/without/enable/disable
+# arguments that were not defined. Just prints out a warning message,
+# so this should be called near the end, so the user will see it.
+
+AC_DEFUN([PGAC_ARG_CHECK],
+[for pgac_var in `set | sed 's/=.*//' | $EGREP 'with_|enable_'`; do
+  for pgac_arg in $pgac_args with_gnu_ld; do
+    if test "$pgac_var" = "$pgac_arg"; then
+      continue 2
+    fi
+  done
+  pgac_txt=`echo $pgac_var | sed 's/_/-/g'`
+  AC_MSG_WARN([option ignored: --$pgac_txt])
+done])# PGAC_ARG_CHECK
+
+# PGAC_ARG_BOOL(TYPE, NAME, DEFAULT, HELP-STRING, 
+#               [ACTION-IF-YES], [ACTION-IF-NO])
+# ---------------------------------------------------
+# Accept a boolean option, that is, one that only takes yes or no.
+# ("no" is equivalent to "disable" or "without"). DEFAULT is what
+# should be done if the option is omitted; it should be "yes" or "no".
+# (Consequently, one of ACTION-IF-YES and ACTION-IF-NO will always
+# execute.)
+
+AC_DEFUN([PGAC_ARG_BOOL],
+[PGAC_ARG([$1], [$2], [$4], [$5], [$6], 
+          [AC_MSG_ERROR([no argument expected for --$1-$2 option])],
+          [m4_case([$3],
+                   yes, [pgac_arg_to_variable([$1], [$2])=yes
+$5],
+                   no,  [pgac_arg_to_variable([$1], [$2])=no
+$6],
+                   [m4_fatal([third argument of $0 must be 'yes' or 'no', not '$3'])])])[]dnl
+])# PGAC_ARG_BOOL
+
+
+# PGAC_ARG_REQ(TYPE, NAME, HELP-STRING, [ACTION-IF-GIVEN], [ACTION-IF-NOT-GIVEN])
+# -------------------------------------------------------
+# This option will require an argument; "yes" or "no" will not be
+# accepted.
+
+AC_DEFUN([PGAC_ARG_REQ],
+[PGAC_ARG([$1], [$2], [$3],
+          [AC_MSG_ERROR([argument required for --$1-$2 option])],
+          [AC_MSG_ERROR([argument required for --$1-$2 option])],
+          [$4],
+          [$5])])# PGAC_ARG_REQ
+
+
+# PGAC_ARG_OPTARG(TYPE, NAME, HELP-STRING, [DEFAULT-ACTION], [ARG-ACTION]
+#                 [ACTION-ENABLED], [ACTION-DISABLED])
+# ----------------------------------------------------------
+# This will create an option that behaves as follows: If omitted, or
+# called with "no", then set the enable_variable to "no" and do
+# nothing else. If called with "yes", then execute DEFAULT-ACTION. If
+# called with argument, set enable_variable to "yes" and execute
+# ARG-ACTION. Additionally, execute ACTION-ENABLED if we ended up with
+# "yes" either way, else ACTION-DISABLED.
+#
+# The intent is to allow enabling a feature, and optionally pass an
+# additional piece of information.
+
+AC_DEFUN([PGAC_ARG_OPTARG],
+[PGAC_ARG([$1], [$2], [$3], [$4], [],
+          [pgac_arg_to_variable([$1], [$2])=yes
+$5],
+          [pgac_arg_to_variable([$1], [$2])=no])
+dnl Add this code only if there's a ACTION-ENABLED or ACTION-DISABLED.
+m4_ifval([$6[]$7],
+[
+if test "[$]pgac_arg_to_variable([$1], [$2])" = yes; then
+  m4_default([$6], :)
+m4_ifval([$7],
+[else
+  $7
+])[]dnl
+fi
+])[]dnl
+])# PGAC_ARG_OPTARG

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/install-sh
----------------------------------------------------------------------
diff --git a/config/install-sh b/config/install-sh
new file mode 100755
index 0000000..fdca633
--- /dev/null
+++ b/config/install-sh
@@ -0,0 +1,527 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+# config/install-sh
+
+scriptversion=2009-08-26.20
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+# Darwin normal strip removes symbols from shared libraries that are
+# later needed for dynamic linking, so use strip -x.
+# http://archives.postgresql.org/pgsql-hackers/2007-10/msg01470.php
+case `uname -s` in
+  Darwin) stripprog="${STRIPPROG-strip -x}";;
+esac
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  trap '(exit $?); exit' 1 2 13 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/java.m4
----------------------------------------------------------------------
diff --git a/config/java.m4 b/config/java.m4
new file mode 100644
index 0000000..3be9af2
--- /dev/null
+++ b/config/java.m4
@@ -0,0 +1,77 @@
+dnl
+dnl java.m4: Locates the JDK and its include files and libraries.
+dnl
+
+# PGAC_JAVA_HOME
+# --------------
+AC_DEFUN([PGAC_JAVA_HOME],
+[ 
+  AC_MSG_CHECKING([JAVA_HOME])
+
+  dnl Use $JAVA_HOME if specified, otherwise look for java in the likely places.
+  dnl Note that Darwin's JVM layout is pretty weird.  JDK 1.6 apears to be the
+  dnl default for Snow Leopard, but JDK 1.5 is for Leopard.
+  dnl See http://developer.apple.com/qa/qa2001/qa1170.html
+  if test -x "${JAVA_HOME}/bin/java"; then
+    JDK="${JAVA_HOME}"
+  elif test -x "/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java"; then
+    JDK="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home"
+  elif test -x "/usr/java/bin/java"; then
+    JDK="/usr/java"
+  else
+    AC_MSG_RESULT(not found)
+    AC_MSG_ERROR([JAVA_HOME not found])
+  fi
+  JAVA_HOME="$JDK"
+
+  AC_MSG_RESULT(${JAVA_HOME})
+  AC_SUBST(JAVA_HOME)
+])
+
+# PGAC_PATH_JAVA
+# --------------
+AC_DEFUN([PGAC_PATH_JAVA],
+[ 
+  JAVA=none
+  JAVAC=none
+  JAVAH=none
+  JAR=none
+  JAVADOC=none
+
+  AC_REQUIRE([PGAC_JAVA_HOME])  
+  AC_PATH_PROGS(JAVA,java,,${JAVA_HOME}/bin)
+  AC_PATH_PROGS(JAVAC,javac,,${JAVA_HOME}/bin)
+  AC_PATH_PROGS(JAVAH,javah,,${JAVA_HOME}/bin)
+  AC_PATH_PROGS(JAR,jar,,${JAVA_HOME}/bin)
+  AC_PATH_PROGS(JAVADOC,javadoc,,${JAVA_HOME}/bin)
+])
+
+
+# PGAC_CHECK_JAVA_EMBED_SETUP
+# --------------
+AC_DEFUN(PGAC_CHECK_JAVA_EMBED_SETUP,
+[
+  AC_REQUIRE([PGAC_PATH_JAVA])
+
+  # Check the current java version
+  AC_MSG_CHECKING([for Java version])
+  version=`${JAVA} -version 2>&1 | grep version`
+  AC_MSG_RESULT("$version")
+
+  # Setup compilation FLAGS to support compiling for JDK 1.6
+  AC_MSG_CHECKING([for JAVAC_FLAGS])
+  JAVAC_FLAGS="-target 1.6 -source 1.6"
+  AC_MSG_RESULT(${JAVAC_FLAGS})
+  AC_SUBST(JAVAC_FLAGS)
+
+  # Test Java FLAGS
+  AC_MSG_CHECKING([for Java JDK 1.6 support])
+  version_check=`${JAVAC} ${JAVAC_FLAGS} 2>&1 | grep invalid`
+  if test "$version_check" != ""; then
+    AC_MSG_RESULT(no)
+    AC_MSG_ERROR("$version_check")
+  else
+    AC_MSG_RESULT(yes)
+  fi
+])
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/libtool.m4
----------------------------------------------------------------------
diff --git a/config/libtool.m4 b/config/libtool.m4
new file mode 100644
index 0000000..f6e426d
--- /dev/null
+++ b/config/libtool.m4
@@ -0,0 +1,119 @@
+## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+## Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# No, PostgreSQL doesn't use libtool (yet), we just borrow stuff from it.
+# This file was taken on 2000-10-20 from the multi-language branch (since
+# that is the branch that PostgreSQL would most likely adopt anyway).
+# --petere
+
+# ... bunch of stuff removed here ...
+
+# PGAC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN([PGAC_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [[default=no]]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+dnl ###not for PostgreSQL### AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case "$ac_prog" in
+    # Accept absolute paths.
+changequote(,)dnl
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+changequote([,])dnl
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(ac_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      ac_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  ac_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$ac_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+PGAC_PROG_LD_GNU
+])
+
+AC_DEFUN([PGAC_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  ac_cv_prog_gnu_ld=yes
+else
+  ac_cv_prog_gnu_ld=no
+fi])
+with_gnu_ld=$ac_cv_prog_gnu_ld
+])
+
+# ... more stuff removed ...

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/maven.m4
----------------------------------------------------------------------
diff --git a/config/maven.m4 b/config/maven.m4
new file mode 100644
index 0000000..a9ccef7
--- /dev/null
+++ b/config/maven.m4
@@ -0,0 +1,35 @@
+# config/maven.m4
+
+# PGAC_PATH_MAVEN
+# ---------------
+# Look for maven, set the output variable MAVEN to its path if found.
+# Reject versions before 3.0.0 (they have bugs or capacity limits).
+
+AC_DEFUN([PGAC_PATH_MAVEN],
+[# Let the user override the search
+if test -z "$MAVEN"; then
+  AC_PATH_PROGS(MAVEN, mvn)
+fi
+
+if test "$MAVEN"; then
+  pgac_maven_version=`$MAVEN --version 2>/dev/null | sed q | $AWK '{print [$]1" "[$]2" "[$]3;}'`
+  AC_MSG_NOTICE([using $pgac_maven_version])
+  if echo "$pgac_maven_version" | sed ['s/[^0-9]/ /g'] | $AWK '{ if ([$]1 < 3) exit 0; else exit 1;}'
+  then
+    AC_MSG_WARN([
+*** The installed version of Maven, $MAVEN, is too old to use with HAWQ.
+*** Maven version 3.0.0 or later is required, but this is $pgac_maven_version.])
+    MAVEN=""
+  fi
+fi
+
+if test -z "$MAVEN"; then
+  AC_MSG_WARN([
+*** Without Maven you will not be able to build HAWQ with Mapreduce
+*** InputFormat/OutputFormat support.])
+fi
+# We don't need AC_SUBST(MAVEN) because AC_PATH_PROG did it.
+AC_SUBST(MAVEN)
+])# PGAC_PATH_MAVEN
+
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/missing
----------------------------------------------------------------------
diff --git a/config/missing b/config/missing
new file mode 100755
index 0000000..6df77e9
--- /dev/null
+++ b/config/missing
@@ -0,0 +1,54 @@
+#! /bin/sh
+
+# config/missing
+
+# This is *not* the GNU `missing' script, although it is similar in
+# concept. You can call it from the makefiles to get consistent
+# behavior when certain utility programs are missing.
+
+case $1 in
+    flex|bison)
+        # `missing flex|bison <input> <output>'
+        input=$2
+        output=$3
+        if test -f "$output"; then
+            echo "\
+***
+WARNING: \`$1' is missing on your system. You should only need it
+if you changed the file \`$input'; these changes will not take effect.
+You can get $1 from a GNU mirror site.
+***" >&2
+            echo "touch $output"
+            touch "$output"
+            exit 0
+        else # ! test -f $output
+            echo "\
+***
+ERROR: \`$1' is missing on your system. It is needed to create the
+file \`$output'. You can either get $1 from a GNU mirror site
+or download an official distribution of PostgreSQL, which contains
+pre-packaged $1 output.
+***" >&2
+            exit 1
+        fi
+        ;;
+
+    perl)
+        # `missing perl'
+        echo "\
+***
+ERROR: Perl is missing on your system. It is needed unless you are building
+from an unmodified official distribution of PostgreSQL.
+***" >&2
+        exit 1
+        ;;
+
+    *)
+        # `missing something-or-other'
+        echo "\
+***
+ERROR: \`$1' is missing on your system.
+***" >&2
+        exit 1
+        ;;
+esac

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/mkinstalldirs
----------------------------------------------------------------------
diff --git a/config/mkinstalldirs b/config/mkinstalldirs
new file mode 100755
index 0000000..070b418
--- /dev/null
+++ b/config/mkinstalldirs
@@ -0,0 +1,152 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+# $PostgreSQL: pgsql/config/mkinstalldirs,v 1.5 2006/03/11 04:38:28 momjian Exp $
+
+scriptversion=2005-02-02.21
+
+# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+errstatus=0
+dirmode=""
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake@gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+  shift
+
+  pathcomp=
+  for d
+  do
+    pathcomp="$pathcomp$d"
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+	errstatus=$lasterr
+      else
+	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+	  lasterr=""
+	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+	  if test ! -z "$lasterr"; then
+	    errstatus=$lasterr
+	  fi
+	fi
+      fi
+    fi
+
+    pathcomp="$pathcomp/"
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/perl.m4
----------------------------------------------------------------------
diff --git a/config/perl.m4 b/config/perl.m4
new file mode 100644
index 0000000..031c3a0
--- /dev/null
+++ b/config/perl.m4
@@ -0,0 +1,72 @@
+# config/perl.m4
+
+
+# PGAC_PATH_PERL
+# --------------
+AC_DEFUN([PGAC_PATH_PERL],
+[# Let the user override the search
+if test -z "$PERL"; then
+  AC_PATH_PROG(PERL, perl)
+fi
+
+if test "$PERL"; then
+  pgac_perl_version=`$PERL -v 2>/dev/null | sed -n ['s/This is perl.*v[a-z ]*\([0-9]\.[0-9][0-9.]*\).*$/\1/p']`
+  AC_MSG_NOTICE([using perl $pgac_perl_version])
+  if echo "$pgac_perl_version" | sed ['s/[.a-z_]/ /g'] | \
+    $AWK '{ if ([$]1 = 5 && [$]2 >= 6) exit 1; else exit 0;}'
+  then
+    AC_MSG_WARN([
+*** The installed version of Perl, $PERL, is too old to use with PostgreSQL.
+*** Perl version 5.6 or later is required, but this is $pgac_perl_version.])
+    PERL=""
+  fi
+fi
+
+if test -z "$PERL"; then
+  AC_MSG_WARN([
+*** Without Perl you will not be able to build PostgreSQL from Git.
+*** You can obtain Perl from any CPAN mirror site.
+*** (If you are using the official distribution of PostgreSQL then you do not
+*** need to worry about this, because the Perl output is pre-generated.)])
+fi
+])# PGAC_PATH_PERL
+
+
+# PGAC_CHECK_PERL_CONFIG(NAME)
+# ----------------------------
+AC_DEFUN([PGAC_CHECK_PERL_CONFIG],
+[AC_REQUIRE([PGAC_PATH_PERL])
+AC_MSG_CHECKING([for Perl $1])
+perl_$1=`$PERL -MConfig -e 'print $Config{$1}'`
+AC_SUBST(perl_$1)dnl
+AC_MSG_RESULT([$perl_$1])])
+
+
+# PGAC_CHECK_PERL_CONFIGS(NAMES)
+# ------------------------------
+AC_DEFUN([PGAC_CHECK_PERL_CONFIGS],
+[m4_foreach([pgac_item], [$1], [PGAC_CHECK_PERL_CONFIG(pgac_item)])])
+
+
+# PGAC_CHECK_PERL_EMBED_LDFLAGS
+# -----------------------------
+# We are after Embed's ldopts, but without the subset mentioned in
+# Config's ccdlflags; and also without any -arch flags, which recent
+# Apple releases put in unhelpfully.  (If you want a multiarch build
+# you'd better be specifying it in more places than plperl's final link.)
+AC_DEFUN([PGAC_CHECK_PERL_EMBED_LDFLAGS],
+[AC_REQUIRE([PGAC_PATH_PERL])
+AC_MSG_CHECKING(for flags to link embedded Perl)
+pgac_tmp1=`$PERL -MExtUtils::Embed -e ldopts`
+pgac_tmp2=`$PERL -MConfig -e 'print $Config{ccdlflags}'`
+perl_embed_ldflags=`echo X"$pgac_tmp1" | sed -e "s/^X//" -e "s%$pgac_tmp2%%" -e ["s/ -arch [-a-zA-Z0-9_]*//g"]`
+AC_SUBST(perl_embed_ldflags)dnl
+if test -z "$perl_embed_ldflags" ; then
+	AC_MSG_RESULT(no)
+	AC_MSG_ERROR([could not determine flags for linking embedded Perl.
+This probably means that ExtUtils::Embed or ExtUtils::MakeMaker is not
+installed.])
+else
+	AC_MSG_RESULT([$perl_embed_ldflags])
+fi
+])# PGAC_CHECK_PERL_EMBED_LDFLAGS

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/prep_buildtree
----------------------------------------------------------------------
diff --git a/config/prep_buildtree b/config/prep_buildtree
new file mode 100755
index 0000000..2be92f0
--- /dev/null
+++ b/config/prep_buildtree
@@ -0,0 +1,45 @@
+#! /bin/sh
+
+# This script prepares a PostgreSQL build tree.  It is intended
+# to be run by the configure script.
+
+me=`basename $0`
+
+help="\
+Usage: $me sourcetree [buildtree]"
+
+if test -z "$1"; then
+    echo "$help" 1>&2
+    exit 1
+elif test x"$1" = x"--help"; then
+    echo "$help"
+    exit 0
+fi
+
+unset CDPATH
+
+sourcetree=`cd $1 && pwd`
+
+buildtree=`cd ${2:-'.'} && pwd`
+
+# We must not auto-create the subdirectories holding built documentation.
+# If we did, it would interfere with installation of prebuilt docs from
+# the source tree, if a VPATH build is done from a distribution tarball.
+# See bug #5595.
+for item in `find "$sourcetree" -type d \( \( -name CVS -prune \) -o \( -name .git -prune \) -o -print \) | grep -v "$sourcetree/doc/src/sgml/\+"`; do
+    subdir=`expr "$item" : "$sourcetree\(.*\)"`
+    if test ! -d "$buildtree/$subdir"; then
+        mkdir -p "$buildtree/$subdir" || exit 1
+    fi
+done
+
+for item in `find "$sourcetree" -name Makefile -print -o -name GNUmakefile -print -o -name .p4ignore -print`; do
+    filename=`expr "$item" : "$sourcetree\(.*\)"`
+    if test ! -f "${item}.in"; then
+        if cmp "$item" "$buildtree/$filename" >/dev/null 2>&1; then : ; else
+            ln -fs "$item" "$buildtree/$filename" || exit 1
+        fi
+    fi
+done
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/programs.m4
----------------------------------------------------------------------
diff --git a/config/programs.m4 b/config/programs.m4
new file mode 100644
index 0000000..0ebfc65
--- /dev/null
+++ b/config/programs.m4
@@ -0,0 +1,246 @@
+# config/programs.m4
+
+
+# PGAC_PATH_BISON
+# ---------------
+# Look for Bison, set the output variable BISON to its path if found.
+# Reject versions before 1.875 (they have bugs or capacity limits).
+# Note we do not accept other implementations of yacc.
+
+AC_DEFUN([PGAC_PATH_BISON],
+[# Let the user override the search
+if test -z "$BISON"; then
+  AC_PATH_PROGS(BISON, bison)
+fi
+
+if test "$BISON"; then
+  pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
+  AC_MSG_NOTICE([using $pgac_bison_version])
+  if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
+  then
+    AC_MSG_WARN([
+*** The installed version of Bison, $BISON, is too old to use with PostgreSQL.
+*** Bison version 1.875 or later is required, but this is $pgac_bison_version.])
+    BISON=""
+  fi
+fi
+
+if test -z "$BISON"; then
+  AC_MSG_WARN([
+*** Without Bison you will not be able to build PostgreSQL from Git nor
+*** change any of the parser definition files.  You can obtain Bison from
+*** a GNU mirror site.  (If you are using the official distribution of
+*** PostgreSQL then you do not need to worry about this, because the Bison
+*** output is pre-generated.)])
+fi
+# We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
+AC_SUBST(BISONFLAGS)
+])# PGAC_PATH_BISON
+
+
+
+# PGAC_PATH_FLEX
+# --------------
+# Look for Flex, set the output variable FLEX to its path if found.
+# Reject versions before 2.5.31, as we need a reasonably non-buggy reentrant
+# scanner.  (Note: the well-publicized security problem in 2.5.31 does not
+# affect Postgres, and there are still distros shipping patched 2.5.31,
+# so allow it.)  Also find Flex if its installed under `lex', but do not
+# accept other Lex programs.
+
+AC_DEFUN([PGAC_PATH_FLEX],
+[AC_CACHE_CHECK([for flex], pgac_cv_path_flex,
+[# Let the user override the test
+if test -n "$FLEX"; then
+  pgac_cv_path_flex=$FLEX
+else
+  pgac_save_IFS=$IFS
+  IFS=$PATH_SEPARATOR
+  for pgac_dir in $PATH; do
+    IFS=$pgac_save_IFS
+    if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
+      pgac_dir=`pwd`
+    fi
+    for pgac_prog in flex lex; do
+      pgac_candidate="$pgac_dir/$pgac_prog"
+      if test -f "$pgac_candidate" \
+        && $pgac_candidate --version </dev/null >/dev/null 2>&1
+      then
+        echo '%%'  > conftest.l
+        if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
+          pgac_flex_version=`$pgac_candidate --version 2>/dev/null`
+          if echo "$pgac_flex_version" | sed ['s/[^0-9]/ /g'] | $AWK '{ if ([$]1 = 2 && [$]2 = 5 && [$]3 >= 4) exit 0; else exit 1;}'
+          then
+            pgac_cv_path_flex=$pgac_candidate
+            break 2
+          else
+            AC_MSG_WARN([
+*** The installed version of Flex, $pgac_candidate, is too old to use with Greenplum DB.
+*** Flex version 2.5.4 or later is required, but this is $pgac_flex_version.])
+          fi
+        fi
+      fi
+    done
+  done
+  rm -f conftest.l lex.yy.c
+  : ${pgac_cv_path_flex=no}
+fi
+])[]dnl AC_CACHE_CHECK
+
+if test x"$pgac_cv_path_flex" = x"no"; then
+  AC_MSG_WARN([
+*** Without Flex you will not be able to build PostgreSQL from Git nor
+*** change any of the scanner definition files.  You can obtain Flex from
+*** a GNU mirror site.  (If you are using the official distribution of
+*** PostgreSQL then you do not need to worry about this because the Flex
+*** output is pre-generated.)])
+
+  FLEX=
+else
+  FLEX=$pgac_cv_path_flex
+  pgac_flex_version=`$FLEX --version 2>/dev/null`
+  AC_MSG_NOTICE([using $pgac_flex_version])
+fi
+
+AC_SUBST(FLEX)
+AC_SUBST(FLEXFLAGS)
+])# PGAC_PATH_FLEX
+
+
+
+# PGAC_CHECK_READLINE
+# -------------------
+# Check for the readline library and dependent libraries, either
+# termcap or curses.  Also try libedit, since NetBSD's is compatible.
+# Add the required flags to LIBS, define HAVE_LIBREADLINE.
+
+AC_DEFUN([PGAC_CHECK_READLINE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+
+AC_CACHE_CHECK([for library containing readline], [pgac_cv_check_readline],
+[pgac_cv_check_readline=no
+pgac_save_LIBS=$LIBS
+if test x"$with_libedit_preferred" != x"yes"
+then	READLINE_ORDER="-lreadline -ledit"
+else	READLINE_ORDER="-ledit -lreadline"
+fi
+for pgac_rllib in $READLINE_ORDER ; do
+  for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
+    LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
+    AC_TRY_LINK_FUNC([readline], [[
+      # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
+      # recognize dependent libraries; assume curses is needed if we didn't
+      # find any dependency.
+      case $host_os in
+        netbsd* | openbsd* | irix*)
+          if test x"$pgac_lib" = x"" ; then
+            pgac_lib=" -lcurses"
+          fi ;;
+      esac
+
+      pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
+      break
+    ]])
+  done
+  if test "$pgac_cv_check_readline" != no ; then
+    break
+  fi
+done
+LIBS=$pgac_save_LIBS
+])[]dnl AC_CACHE_CHECK
+
+if test "$pgac_cv_check_readline" != no ; then
+  LIBS="$pgac_cv_check_readline $LIBS"
+  AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a function readline library])
+fi
+
+])# PGAC_CHECK_READLINE
+
+
+
+# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
+# ---------------------------------------
+# Readline versions < 2.1 don't have rl_completion_append_character
+
+AC_DEFUN([PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER],
+[AC_CACHE_CHECK([for rl_completion_append_character], pgac_cv_var_rl_completion_append_character,
+[AC_TRY_LINK([#include <stdio.h>
+#ifdef HAVE_READLINE_READLINE_H
+# include <readline/readline.h>
+#elif defined(HAVE_READLINE_H)
+# include <readline.h>
+#endif
+],
+[rl_completion_append_character = 'x';],
+[pgac_cv_var_rl_completion_append_character=yes],
+[pgac_cv_var_rl_completion_append_character=no])])
+if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then
+AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1,
+          [Define to 1 if you have the global variable 'rl_completion_append_character'.])
+fi])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER
+
+
+
+# PGAC_CHECK_GETTEXT
+# ------------------
+# We check for bind_textdomain_codeset() not just gettext().  GNU gettext
+# before 0.10.36 does not have that function, and is generally too incomplete
+# to be usable.
+
+AC_DEFUN([PGAC_CHECK_GETTEXT],
+[
+  AC_SEARCH_LIBS(bind_textdomain_codeset, intl, [],
+                 [AC_MSG_ERROR([a gettext implementation is required for NLS])])
+  AC_CHECK_HEADER([libintl.h], [],
+                  [AC_MSG_ERROR([header file <libintl.h> is required for NLS])])
+  AC_CHECK_PROGS(MSGFMT, msgfmt)
+  if test -z "$MSGFMT"; then
+    AC_MSG_ERROR([msgfmt is required for NLS])
+  fi
+  AC_CHECK_PROGS(MSGMERGE, msgmerge)
+  AC_CHECK_PROGS(XGETTEXT, xgettext)
+])# PGAC_CHECK_GETTEXT
+
+
+
+# PGAC_CHECK_STRIP
+# ----------------
+# Check for a 'strip' program, and figure out if that program can
+# strip libraries.
+
+AC_DEFUN([PGAC_CHECK_STRIP],
+[
+  AC_CHECK_TOOL(STRIP, strip, :)
+
+  AC_MSG_CHECKING([whether it is possible to strip libraries])
+  if test x"$STRIP" != x"" && "$STRIP" -V 2>&1 | grep "GNU strip" >/dev/null; then
+    STRIP_STATIC_LIB="$STRIP -x"
+    STRIP_SHARED_LIB="$STRIP --strip-unneeded"
+    AC_MSG_RESULT(yes)
+  else
+    STRIP_STATIC_LIB=:
+    STRIP_SHARED_LIB=:
+    AC_MSG_RESULT(no)
+  fi
+  AC_SUBST(STRIP_STATIC_LIB)
+  AC_SUBST(STRIP_SHARED_LIB)
+])# PGAC_CHECK_STRIP
+
+# PGAC_PATH_GPERF
+# ---------------
+# Look for gperf, set the output variable GPERF to its path if found.
+
+AC_DEFUN([PGAC_PATH_GPERF],
+[# Let the user override the search
+if test -z "$GPERF"; then
+  AC_PATH_PROGS(GPERF, gperf)
+fi
+
+if test -z "$GPERF"; then
+  AC_MSG_ERROR([
+*** Without gperf you will not be able to build HAWQ.  You can obtain gperf from
+*** a GNU mirror site.])
+fi
+# We don't need AC_SUBST(GPERF) because AC_PATH_PROG did it
+AC_SUBST(GPERFFLAGS)
+])# PGAC_PATH_GPERF

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/python.m4
----------------------------------------------------------------------
diff --git a/config/python.m4 b/config/python.m4
new file mode 100644
index 0000000..cd3acec
--- /dev/null
+++ b/config/python.m4
@@ -0,0 +1,102 @@
+#
+# Autoconf macros for configuring the build of Python extension modules
+#
+# config/python.m4
+#
+
+# PGAC_PATH_PYTHON
+# ----------------
+# Look for Python and set the output variable 'PYTHON'
+# to 'python' if found, empty otherwise.
+AC_DEFUN([PGAC_PATH_PYTHON],
+[AC_PATH_PROG(PYTHON, python)
+if test x"$PYTHON" = x""; then
+  AC_MSG_ERROR([Python not found])
+fi
+])
+
+
+# _PGAC_CHECK_PYTHON_DIRS
+# -----------------------
+# Determine the name of various directories of a given Python installation.
+AC_DEFUN([_PGAC_CHECK_PYTHON_DIRS],
+[AC_REQUIRE([PGAC_PATH_PYTHON])
+AC_MSG_CHECKING([for Python distutils module])
+if "${PYTHON}" -c 'import distutils' 2>&AS_MESSAGE_LOG_FD
+then
+    AC_MSG_RESULT(yes)
+else
+    AC_MSG_RESULT(no)
+    AC_MSG_ERROR([distutils module not found])
+fi
+AC_MSG_CHECKING([Python configuration directory])
+python_majorversion=`${PYTHON} -c "import sys; print(sys.version[[0]])"`
+python_version=`${PYTHON} -c "import sys; print(sys.version[[:3]])"`
+python_configdir=`${PYTHON} -c "from distutils.sysconfig import get_python_lib as f; import os; print(os.path.join(f(plat_specific=1,standard_lib=1),'config'))"`
+python_includespec=`${PYTHON} -c "import distutils.sysconfig; print('-I'+distutils.sysconfig.get_python_inc())"`
+
+AC_SUBST(python_majorversion)[]dnl
+AC_SUBST(python_version)[]dnl
+AC_SUBST(python_configdir)[]dnl
+AC_SUBST(python_includespec)[]dnl
+# This should be enough of a message.
+AC_MSG_RESULT([$python_configdir])
+])# _PGAC_CHECK_PYTHON_DIRS
+
+
+# PGAC_CHECK_PYTHON_EMBED_SETUP
+# -----------------------------
+#
+# Note: selecting libpython from python_configdir works in all Python
+# releases, but it generally finds a non-shared library, which means
+# that we are binding the python interpreter right into libplpython.so.
+# In Python 2.3 and up there should be a shared library available in
+# the main library location.
+AC_DEFUN([PGAC_CHECK_PYTHON_EMBED_SETUP],
+[AC_REQUIRE([_PGAC_CHECK_PYTHON_DIRS])
+AC_MSG_CHECKING([how to link an embedded Python application])
+
+python_libdir=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBDIR'))))"`
+python_ldlibrary=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LDLIBRARY'))))"`
+python_so=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('SO'))))"`
+ldlibrary=`echo "${python_ldlibrary}" | sed "s/${python_so}$//"`
+
+if test x"${python_libdir}" != x"" -a x"${python_ldlibrary}" != x"" -a x"${python_ldlibrary}" != x"${ldlibrary}"
+then
+	# New way: use the official shared library
+	ldlibrary=`echo "${ldlibrary}" | sed "s/^lib//"`
+	# special for greenplum... python was built in /opt/, but resides in the ext directory
+	if test ! -d "${python_libdir}"
+	then
+		python_libdir=`echo "${python_configdir}" | sed "s/\/python2.6\/config//"`
+	fi
+	python_libspec="-L${python_libdir} -l${ldlibrary}"
+else
+	# Old way: use libpython from python_configdir
+	python_libdir="${python_configdir}"
+	python_libspec="-L${python_libdir} -lpython${python_version}"
+fi
+
+python_additional_libs=`${PYTHON} -c "import distutils.sysconfig,string; print(' '.join(filter(None,distutils.sysconfig.get_config_vars('LIBS','LIBC','LIBM','LOCALMODLIBS','BASEMODLIBS'))))"`
+
+AC_MSG_RESULT([${python_libspec} ${python_additional_libs}])
+
+AC_SUBST(python_libdir)[]dnl
+AC_SUBST(python_libspec)[]dnl
+AC_SUBST(python_additional_libs)[]dnl
+
+# threaded python is not supported on bsd's
+AC_MSG_CHECKING(whether Python is compiled with thread support)
+pythreads=`${PYTHON} -c "import sys; print(int('thread' in sys.builtin_module_names))"`
+if test "$pythreads" = "1"; then
+  AC_MSG_RESULT(yes)
+  case $host_os in
+  openbsd*|freebsd*)
+    AC_MSG_ERROR([threaded Python not supported on this platform])
+    ;;
+  esac
+else
+  AC_MSG_RESULT(no)
+fi
+
+])# PGAC_CHECK_PYTHON_EMBED_SETUP

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8b26974c/config/tcl.m4
----------------------------------------------------------------------
diff --git a/config/tcl.m4 b/config/tcl.m4
new file mode 100644
index 0000000..e886057
--- /dev/null
+++ b/config/tcl.m4
@@ -0,0 +1,93 @@
+# config/tcl.m4
+
+# Autoconf macros to check for Tcl related things
+
+
+AC_DEFUN([PGAC_PATH_TCLSH],
+[AC_PATH_PROGS(TCLSH, [tclsh tcl tclsh8.5 tclsh85 tclsh8.4 tclsh84 tclsh8.3 tclsh83])
+if test x"$TCLSH" = x""; then
+  AC_MSG_ERROR([Tcl shell not found])
+fi
+])
+
+
+# PGAC_PATH_TCLCONFIGSH([SEARCH-PATH])
+# ------------------------------------
+AC_DEFUN([PGAC_PATH_TCLCONFIGSH],
+[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
+AC_BEFORE([$0], [PGAC_PATH_TKCONFIGSH])[]dnl
+AC_MSG_CHECKING([for tclConfig.sh])
+# Let user override test
+if test -z "$TCL_CONFIG_SH"; then
+    pgac_test_dirs="$1"
+
+    set X $pgac_test_dirs; shift
+    if test $[#] -eq 0; then
+        test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tclConfig.sh because no Tcl shell was found])
+        set X `echo 'puts $auto_path' | $TCLSH`; shift
+    fi
+
+    for pgac_dir do
+        if test -r "$pgac_dir/tclConfig.sh"; then
+            TCL_CONFIG_SH=$pgac_dir/tclConfig.sh
+            break
+        fi
+    done
+fi
+
+if test -z "$TCL_CONFIG_SH"; then
+    AC_MSG_RESULT(no)
+    AC_MSG_ERROR([file 'tclConfig.sh' is required for Tcl])
+else
+    AC_MSG_RESULT([$TCL_CONFIG_SH])
+fi
+
+AC_SUBST([TCL_CONFIG_SH])
+])# PGAC_PATH_TCLCONFIGSH
+
+
+# PGAC_PATH_TKCONFIGSH([SEARCH-PATH])
+# ------------------------------------
+AC_DEFUN([PGAC_PATH_TKCONFIGSH],
+[AC_REQUIRE([PGAC_PATH_TCLSH])[]dnl
+AC_MSG_CHECKING([for tkConfig.sh])
+# Let user override test
+if test -z "$TK_CONFIG_SH"; then
+    pgac_test_dirs="$1"
+
+    set X $pgac_test_dirs; shift
+    if test $[#] -eq 0; then
+        test -z "$TCLSH" && AC_MSG_ERROR([unable to locate tkConfig.sh because no Tcl shell was found])
+        set X `echo 'puts $auto_path' | $TCLSH`; shift
+    fi
+
+    for pgac_dir do
+        if test -r "$pgac_dir/tkConfig.sh"; then
+            TK_CONFIG_SH=$pgac_dir/tkConfig.sh
+            break
+        fi
+    done
+fi
+
+if test -z "$TK_CONFIG_SH"; then
+    AC_MSG_RESULT(no)
+    AC_MSG_ERROR([file 'tkConfig.sh' is required for Tk])
+else
+    AC_MSG_RESULT([$TK_CONFIG_SH])
+fi
+
+AC_SUBST([TK_CONFIG_SH])
+])# PGAC_PATH_TKCONFIGSH
+
+
+# PGAC_EVAL_TCLCONFIGSH(FILE, WANTED-VARS)
+# ----------------------------------------
+# Assigns variables listed in WANTED-VARS by reading FILE and
+# evaluating it according to the quoting scheme of tclConfig.sh and
+# tkConfig.sh.  Calls AC_SUBST for each variable.
+
+AC_DEFUN([PGAC_EVAL_TCLCONFIGSH],
+[. "$1"
+m4_foreach([pgac_item], [$2],
+[eval pgac_item=\"[$]pgac_item\"
+AC_SUBST(pgac_item)])])


Mime
View raw message