1 AC_INIT([ssphys], [0.20.1])
3 AC_CONFIG_SRCDIR([version.in])
4 AC_CONFIG_AUX_DIR([config])
9 # we will build libraries in some subdirectories
11 # add an install target to Makefile
14 # we need some subversion tools if this is a working copy
15 AC_ARG_VAR([SVNWCREV], [tool for incorporating subversion information into source])
16 AC_ARG_VAR([SVN], [subversion commandline client])
17 AC_ARG_VAR([SVNVERSION], [subversion version number tool])
19 # test to see if this is a working copy
20 # if it's not a wc, use the included version.h
22 # check for commandline tools to create version.h
23 AC_CHECK_PROG([SVNWCREV], [svnwcrev], [svnwcrev])
24 AC_CHECK_PROG([SVN], [svn], [svn])
25 AC_CHECK_PROG([SVNVERSION], [svnversion], [svnversion])
26 if test "x$SVNWCREV" != "x"; then
27 cat > svnwcrev.sh <<EOF
32 AC_MSG_NOTICE([wrote svnwcrev.sh])
33 elif test "x$SVN" != "x" -a "x$SVNVERSION" != "x"; then
34 cat > svnwcrev.sh <<EOF
36 vss2svn_wcrange=\`$SVN info \$1 | $SED -ne "s/^Revision: \(.*\)\$/\1/p"\`
37 vss2svn_wcurl=\`$SVN info \$1 | $SED -ne "s/^URL: \(.*\)\$/\1/p"\`
38 vss2svn_wcrev=\`$SVN info \$1 | $SED -ne "s/^Revision: \(.*\:\)\{0,1\}\(.*\)\$/\2/p"\`
39 vss2svn_wcmixed=\`$SVNVERSION \$1 | $SED -ne "s/^[[^:]]*\$/2/p; s/^\(.*\):\(.*\)\$/1/p"\`
40 vss2svn_wcdate=\`$SVN info \$1 | $SED -ne "s/^Last Changed Date: \(....-..-.. ..:..:..\).*\$/\\1/p"\`
41 vss2svn_wcmods=\`$SVNVERSION \$1 | $SED -ne "s/^\([[0-9]]*:\)\{0,1\}[[0-9]]*S\{0,1\}\$/2/p; s/^\([[0-9]]*:\)\{0,1\}[[0-9]]*MS\{0,1\}\$/1/p"\`
42 vss2svn_wcnow=\`date "+%Y-%m-%d %H:%M:%S"\`
43 $AWK -v rev=\$vss2svn_wcrev -v range=\$vss2svn_wcrange -v wcdate="\$vss2svn_wcdate" -v url="\$vss2svn_wcurl" -v now="\$vss2svn_wcnow" '! /\\\$WCNOW\\$|\\\$WCURL\\$|\\\$WCREV\\$|\\\$WCRANGE\\$|\\\$WCDATE\\$/ { print \$0; } /\\\$WCNOW\\$/ { gsub(/\\\$WCNOW\\$/, now); print \$0;} /\\\$WCURL\\$/ { gsub(/\\\$WCURL\\$/, url); print \$0; } /\\\$WCREV\\$/ { gsub(/\\\$WCREV\\$/, rev); print \$0; } /\\\$WCRANGE\\$/ { gsub(/\\\$WCRANGE\\$/, range); print \$0; } /\\\$WCDATE\\$/ { gsub(/\\\$WCDATE\\$/, wcdate); print \$0; }' \$2 | $SED -e "s/\\\$WCMODS?\(.*\):\(.*\)\\\\$/\\\\\$vss2svn_wcmods/g;" | $SED -e "s/\\\$WCMIXED?\(.*\):\(.*\)\\\\$/\\\\\$vss2svn_wcmixed/g;" > \$3
46 AC_MSG_NOTICE([wrote svnwcrev.sh])
48 # this will be fatal, as version.h should never be committed
49 AC_MSG_ERROR([in a working copy, but no commandline tools to recreate version.h!])
53 # add libtool dependencies
54 AC_SUBST(LIBTOOL_DEPS)
56 # Check for the C++ Boost library with Program Options support
57 AC_CHECK_LIB(boost_program_options, main,, [
58 AC_MSG_ERROR([You need the C++ boost Program Options library (1.32 or later).])])
59 AC_CHECK_LIB(boost_filesystem, main,, [
60 AC_MSG_ERROR([You need the C++ boost filesystem library.])])