| 1 | #! /bin/sh |
|---|
| 2 | # Run this to generate all the initial makefiles, etc. |
|---|
| 3 | # Set CONFIG_ARGS to the argument list you wish to pass to configure |
|---|
| 4 | |
|---|
| 5 | set -e |
|---|
| 6 | |
|---|
| 7 | # Run in most basic of locales to avoid performance overhead (and risk of bugs) |
|---|
| 8 | # involved in localization, encoding issues etc. We only do ASCII here. |
|---|
| 9 | export LC_ALL=C |
|---|
| 10 | |
|---|
| 11 | ver="" |
|---|
| 12 | for amv in "1.6" "1.7" "1.8" "1.9" ; do |
|---|
| 13 | if which "automake-$amv" >/dev/null 2>&1; then |
|---|
| 14 | ver="-$amv" |
|---|
| 15 | fi |
|---|
| 16 | done |
|---|
| 17 | |
|---|
| 18 | # The VERSION file defines our versioning |
|---|
| 19 | PQXXVERSION=`grep '\<PQXXVERSION\>' VERSION | sed -e 's/^[[:space:]A-Z_]*//' -e 's/[[:space:]]*#.*$//'` |
|---|
| 20 | echo "libpqxx version $PQXXVERSION" |
|---|
| 21 | |
|---|
| 22 | # Generate configure.ac based on current version numbers |
|---|
| 23 | sed -e "s/@PQXXVERSION@/$PQXXVERSION/g" configure.ac.in >configure.ac |
|---|
| 24 | |
|---|
| 25 | # Generate test/Makefile.am |
|---|
| 26 | ./tools/maketestam.pl test >test/Makefile.am |
|---|
| 27 | |
|---|
| 28 | # Generate Windows makefiles (adding carriage returns to make it MS-DOS format) |
|---|
| 29 | ./tools/maketestvcmak.pl test | sed -e 's/$/\r/' >win32/test.mak |
|---|
| 30 | ./tools/makevcmake.pl src | sed -e 's/$/\r/' >win32/libpqxx.mak |
|---|
| 31 | ./tools/makemingwmak.pl src | sed -e 's/$/\r/' >win32/MinGW.mak |
|---|
| 32 | |
|---|
| 33 | autoheader |
|---|
| 34 | |
|---|
| 35 | libtoolize --force --automake --copy |
|---|
| 36 | aclocal${ver} -I . -I config/m4 |
|---|
| 37 | automake${ver} --verbose --add-missing --copy |
|---|
| 38 | autoconf |
|---|
| 39 | |
|---|
| 40 | conf_flags="--enable-maintainer-mode $CONFIG_ARGS" |
|---|
| 41 | if test -z "$NOCONFIGURE" ; then |
|---|
| 42 | echo Running $srcdir/configure $conf_flags "$@" ... |
|---|
| 43 | ./configure $conf_flags "$@" \ |
|---|
| 44 | && echo Now type \`make\' to compile $PKG_NAME || exit 1 |
|---|
| 45 | else |
|---|
| 46 | echo Skipping configure process. |
|---|
| 47 | fi |
|---|
| 48 | |
|---|