diff options
author | Rob Austein <sra@hactrn.net> | 2010-12-17 01:17:21 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2010-12-17 01:17:21 +0000 |
commit | f70a7dc781531f839db5b1e11164d9930d70259d (patch) | |
tree | f47b2ad50c702c1f11a21e2eeade9938777bc83d /configure.ac | |
parent | d97690e09b1485269e5af6a1445a14df3802c531 (diff) |
First of several rounds of autoconf changes
svn path=/configure; revision=3570
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 94 |
1 files changed, 89 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index bfbf6fca..b5185db2 100644 --- a/configure.ac +++ b/configure.ac @@ -57,9 +57,96 @@ esac AC_SUBST(OPENSSL_CONFIG_COMMAND) AC_MSG_RESULT([$OPENSSL_CONFIG_COMMAND]) -AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc]) +AC_PATH_PROG([XSLTPROC], [xsltproc]) +AC_PATH_PROG([AWK], [awk]) -AC_PATH_PROG([AWK], [awk], [awk]) +if test "x$XSLTPROC" != "x" && test "x$AWK" != "x" +then + AC_CONFIG_FILES([rcynic/show.sh], [chmod +x rcynic/show.sh]) +fi + +# We should have checked whether we even need to build our own OpenSSL +# libraries before we get anywhere near the Python code. Need to +# write tests to see whether there are system OpenSSL libraries, and +# whether they're good enough (include both CMS and RFC 3779 support). + +AC_CHECK_LIB([crypto], [v3_addr_validate_path], + [AC_MSG_NOTICE([System OpenSSL libcrypto has RFC 3779])], + [AC_MSG_NOTICE([Can't find system OpenSSL libcrypto with RFC 3779])]) +AC_CHECK_LIB([crypto], [CMS_VERIFY], + [AC_MSG_NOTICE([System OpenSSL libcrypto has CMS])], + [AC_MSG_NOTICE([Can't find system OpenSSL libcrypto with CMS])]) + +# Yeah, but how do we check that these two calls both found the same library?!? + + + + +AC_PATH_PROG([PYTHON], [python]) + +# Maze of Python-related tests is complicated. +# +# - If we don't have Python at all, we can't run any of the Python +# tools and probably should not even attempt to configure them. +# +# - If the system Python executable was linked against OpenSSL -and- +# we had to build our own copy of OpenSSL (because the system copy +# wasn't good enough), we need to build pywrap and configure scripts +# to use it. +# +# - Otherwise (we have python and it's not linked against the wrong +# version of OpenSSL), we can use the system Python executable and +# don't need pywrap. +# +# - Unless we're punting on Python entirely, we need to build POW, +# either against the system OpenSSL or against our own copy. +# +# - If we're building either POW or pywrap, we need Python.h. +# +# If any of this fails, we need to tell the user and give useful hint +# on what to do next (doc reference, whatever). +# +# Oh, and the user has to be able to override all of our guessing, +# with --enable/--disable or whatever autoconf hack we're using this +# week. + +if test "x$PYTHON" = "x" +then + have_python=no + AC_MSG_WARN([Can't find Python, not configuring Python programs or building Python extension modules]) +else + have_python=yes + + AC_MSG_NOTICE([Yay, we have $PYTHON]) + + # Check for Python.h + python_h=`$PYTHON -c 'import distutils.sysconfig; print distutils.sysconfig.get_python_inc() + "/Python.h"'` + AC_CHECK_HEADER([$python_h], [want_pow=yes], [want_pow=no]) + + AC_MSG_NOTICE([Should we build POW? $want_pow]) + + # This is sick, but we're checking for a dynamic library + # linked into a system executable, so our options are limited. + + if test "x$want_pow" = "xyes" && ldd $PYTHON 2>/dev/null | $PYTHON -c 'import sys; sys.exit("libcrypto" not in sys.stdin.read())' + then + want_pywrap=yes + else + want_pywrap=no + fi + + AC_MSG_NOTICE([Should we build pywrap? $want_pywrap]) + + AC_CONFIG_FILES([rpkid/backup-sql], [chmod +x rpkid/backup-sql]) + AC_CONFIG_FILES([rpkid/irbe_cli], [chmod +x rpkid/irbe_cli]) + AC_CONFIG_FILES([rpkid/irdbd], [chmod +x rpkid/irdbd]) + AC_CONFIG_FILES([rpkid/myrpki], [chmod +x rpkid/myrpki]) + AC_CONFIG_FILES([rpkid/pubd], [chmod +x rpkid/pubd]) + AC_CONFIG_FILES([rpkid/rootd], [chmod +x rpkid/rootd]) + AC_CONFIG_FILES([rpkid/rpkid], [chmod +x rpkid/rpkid]) + AC_CONFIG_FILES([rpkid/sql-setup], [chmod +x rpkid/sql-setup]) + AC_CONFIG_FILES([rpkid/start-servers], [chmod +x rpkid/start-servers]) +fi # This isn't the complete list of Makefiles (let alone setup.py, etc # files) in this tree, just the ones we're customizing today. At some @@ -69,9 +156,6 @@ AC_PATH_PROG([AWK], [awk], [awk]) AC_CONFIG_FILES([Makefile openssl/Makefile rcynic/Makefile - rcynic/show.sh rpkid/rpki/__doc__.py]) -AC_CONFIG_COMMANDS([chmod], [chmod a+x rcynic/show.sh]) - AC_OUTPUT |