qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kp...@apache.org
Subject svn commit: r488343 - in /incubator/qpid/trunk/qpid/cpp: README-dev qpid-autotools-install
Date Mon, 18 Dec 2006 17:07:28 GMT
Author: kpvdr
Date: Mon Dec 18 09:07:27 2006
New Revision: 488343

URL: http://svn.apache.org/viewvc?view=rev&rev=488343
Log:
[For Jim Meyering] Added new utility to download and build required tools to build the C++
version

Added:
    incubator/qpid/trunk/qpid/cpp/qpid-autotools-install   (with props)
Modified:
    incubator/qpid/trunk/qpid/cpp/README-dev

Modified: incubator/qpid/trunk/qpid/cpp/README-dev
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/README-dev?view=diff&rev=488343&r1=488342&r2=488343
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/README-dev (original)
+++ incubator/qpid/trunk/qpid/cpp/README-dev Mon Dec 18 09:07:27 2006
@@ -35,13 +35,36 @@
 # yum install apr apr-devel boost boost-devel cppunit cppunit-devel
 # yum install pkgconfig doxygen graphviz help2man
 
-Download the latest source distribution of autoconf, automake, libtool
-from URLs above and install each with something like:
-# ./configure && make && sudo make-install
+To get the latest versions of autoconf, automake, libtools and other
+dependencies, run the script qpid-autotools-install:
 
-DO NOT install pkg-config from source! If installed in /usr/local, pkg-config
-cannot find packages installed in /usr. Installing in /usr will mess up
-RPM's notion of what's installed. 
+1. Decide where you would like to install the tools. It should be in a
+   local directory so that you do not need root privileges. (Suggest
+   $HOME/qpid-tools.) Create an empty directory.
+2. Modify your environment variable PATH to ensure that the bin directory
+   within this directory comes first in the PATH string:
+   PATH=$HOME/qpid-tools/bin:$PATH
+3. Set PKG_CONFIG_PATH=$HOME/qpid-tools/lib/pkgconfig:/usr/lib/pkgconfig
+   (or if it already exists, make sure that the above path to your
+   qpid-tools directory is first).
+4. Run the install utility from the cpp directory:
+   ./qpid-autotools-install --prefix=$HOME/qpid-tools --skip-check
+   (Note that --prefix will only accept an absolute path, so don't use
+   ~/qpid-tools.) The utility will download, compile and install the
+   required tools into the qpid-tools directory (this may take a little
+   time). Watch for any notices about paths at the end of the install -
+   this means that your environment is not correct - see steps 2 and 3
+   above.
+   NOTE: If you omit the --skip-check option, the check of the build
+   can add up to an hour to what is normally a few minutes of install
+   time.
+5. Perform a check: from the command-line run "which automake" and
+   ensure that it finds the automake in your qpid-tools directory. If not,
+   check that the build completed normally and your environment.
+6. (Optional) If having the build artifacts lying around bothers you, delete
+   the (hidden) build directory cpp/.build-auto-tools.
+
+To see help, run ./qpid-autotools-install --help.
 
 == Recent changes ==
 

Added: incubator/qpid/trunk/qpid/cpp/qpid-autotools-install
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/qpid-autotools-install?view=auto&rev=488343
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/qpid-autotools-install (added)
+++ incubator/qpid/trunk/qpid/cpp/qpid-autotools-install Mon Dec 18 09:07:27 2006
@@ -0,0 +1,205 @@
+#!/bin/sh
+# Written by Jim Meyering
+
+VERSION='2006-12-18 16:16' # UTC
+
+prog_name=`basename $0`
+die () { echo "$prog_name: $*" >&2; exit 1; }
+
+tarballs='
+  http://pkgconfig.freedesktop.org/releases/pkg-config-0.21.tar.gz
+  ftp://ftp.gnu.org/gnu/m4/m4-1.4.8.tar.gz
+  ftp://ftp.gnu.org/gnu/automake/automake-1.10.tar.gz
+  ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.61.tar.gz
+  ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.22.tar.gz
+'
+
+usage() {
+  echo >&2 "\
+Usage: $0 [OPTION]...
+Download, build, and install some tools.
+
+Options:
+ --prefix=PREFIX    install tools under specified directory
+ --skip-check       do not run "make check" (this can save 50+ min)
+ --help             display this help and exit
+
+For example, to install programs into $HOME/qpid-tools/bin, run this command:
+
+  $prog_name --prefix=\$HOME/qpid-tools
+
+If you've already verified that your system/environment can build working
+versions of these tools, you can make this script complete in just a
+minute or two (rather than about an hour if you let all "make check"
+tests run) by invoking it like this:
+
+  $prog_name --prefix=\$HOME/qpid-tools --skip-check
+
+"
+}
+
+# Get the listed tarballs into the current directory.
+get_sources()
+{
+  case `wget --help` in
+    *'--no-cache'*)
+      WGET_COMMAND='wget -nv --no-cache';;
+    *'--cache=on/off'*)
+      WGET_COMMAND='wget -nv --cache=off';;
+    *'--non-verbose'*)
+      WGET_COMMAND='wget -nv';;
+    *)
+      die 'no wget program found; please install it and try again';;
+  esac
+
+  # Download the each tar-ball along with its signature, if there is one.
+  pkgs=
+  for t in $(echo $tarballs); do
+    base=$(basename $t)
+    pkgs="$pkgs $base"
+    test -f $base     || $WGET_COMMAND $t
+
+    # pkg-config has no .sig file.
+    case $base in pkg-config*) continue;; esac
+
+    test -f $base.sig || $WGET_COMMAND $t.sig
+    # Verify each signature.
+    gpg --quiet --verify --trust-model=always   \
+        --trusted-key=32419B785D0CDCFC          \
+        --trusted-key=3859C03B2E236E47          \
+        --trusted-key=B93F60C6B5C4CE13          \
+        --trusted-key=F382AE19F4850180          \
+        $base.sig > /dev/null 2>&1              \
+      || echo "info: not verifying GPG signature for $base" 1>&2
+  done
+
+  printf 'verifying package SHA1 checksums...' 1>&2
+  sha1sum -c --warn --status <<EOF || die "checksum mismatch"
+69f37c509a4757d747b6f4c091d209ab3984d62f  autoconf-2.61.tar.gz
+69dc02b083b9a609b28fc4db129fef6a83ed2339  automake-1.10.tar.gz
+17353e66aeaac80ae188ea0a3a90609550ce3254  libtool-1.5.22.tar.gz
+32b5bb526de9315d1a319c2ca8eb881d9b835506  m4-1.4.8.tar.gz
+b2508ba8404cad46ec42f6f58cbca43ae59d715f  pkg-config-0.21.tar.gz
+EOF
+  printf 'ok\n' 1>&2
+  echo $pkgs
+}
+
+#################################################################
+set -e
+
+# Parse options.
+
+make_check=yes
+prefix=
+
+for option
+do
+  case $option in
+    --help) usage; exit;;
+    --skip-check) make_check=no;;
+    --prefix=*) prefix=`expr "$option" : '--prefix=\(.*\)'`;;
+    *) die "$option: unknown option";;
+  esac
+done
+
+test -n "$prefix" \
+  || die "you must specify a --prefix"
+
+case $prefix in
+  /*) ;;
+  *) die 'invalid prefix: '"$prefix"': it must be an absolute name';;
+esac
+
+# Don't run as root.
+# Make sure id -u succeeds.
+my_uid=`id -u`
+test $? = 0 || {
+  echo "$0: cannot run \`id -u'" 1>&2
+  (exit 1); exit 1
+}
+test $my_uid = 0 && die "please don't run this program as root"
+
+# Ensure that prefix is not /usr/bin or /bin, /sbin, etc.
+case $prefix in
+  /bin|/sbin|/usr/bin|/usr/sbin)
+    die "don't set PREFIX to a system directory";;
+  *) ;;
+esac
+
+# Create a build directory, then cd into it for the rest....
+tmpdir=.build-auto-tools
+mkdir -p $tmpdir
+cd $tmpdir
+
+pkgs=$(get_sources)
+
+for pkg in $pkgs; do
+  echo building/installing $pkg...
+  dir=$(basename $pkg .tar.gz)
+  rm -rf dir
+  gzip -dc $pkg|tar xf -
+  cd $dir
+  ./configure CFLAGS=-O2 LDFLAGS=-s --prefix=$prefix    > makerr-config  2>&1
+  make -j1                                              > makerr-build   2>&1
+  if test "$make_check" = yes; then
+    case $pkg in
+      automake*) expected_duration_minutes=40;;
+      autoconf*) expected_duration_minutes=15;;
+      # libtool*) expected_duration_minutes=3;;
+      *);;
+    esac
+    test -n "$expected_duration_minutes" \
+      && echo "running 'make check' for $pkg; NB: this can take over" \
+              "$expected_duration_minutes minutes"
+    case $pkg in
+      # In this package, the check-requires-private test fails.
+      # Change the Makefile so it skips that test.
+      pkg-config-0.21.tar.gz)
+        perl -pi.bak -e 's/check-requires-private //' check/Makefile;;
+
+    esac
+    make -j1 check                                      > makerr-check   2>&1
+  fi
+  make -j1 install                                      > makerr-install 2>&1
+  echo done at $(date +%Y-%m-%d.%T)
+  cd ..
+done
+
+# Without checks (and with existing tarballs), it takes just one minute.
+# Including all checks, it takes nearly an hour on an AMD64/3400+
+
+case $PKG_CONFIG_PATH in
+  $prefix/lib/pkgconfig:/usr/lib/pkgconfig)
+    echo 'Good! your PKG_CONFIG_PATH envvar is already set';;
+  *) cat <<EOF;;
+**************************************************************************
+Be sure that PKG_CONFIG_PATH is set in your environment, e.g.,
+PKG_CONFIG_PATH=$prefix/lib/pkgconfig:/usr/lib/pkgconfig
+**************************************************************************
+EOF
+esac
+
+case $PATH in
+  "$prefix/bin:"*) echo 'Good! your PATH is fine';;
+  *) cat <<EOF;;
+**************************************************************************
+Be sure that "$prefix/bin" is earlier in your PATH than /bin, /usr/bin, etc.
+**************************************************************************
+EOF
+esac
+
+cat <<EOF
+**************************************************************************
+You may want to remove the tool build directory:
+rm -rf $tmpdir
+**************************************************************************
+EOF
+
+## Local Variables:
+## eval: (add-hook 'write-file-hooks 'time-stamp)
+## time-stamp-start: "VERSION='"
+## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
+## time-stamp-time-zone: "UTC"
+## time-stamp-end: "' # UTC"
+## End:

Propchange: incubator/qpid/trunk/qpid/cpp/qpid-autotools-install
------------------------------------------------------------------------------
    svn:executable = *



Mime
View raw message