aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac158
1 files changed, 151 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index b54d0070..558e8a8a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,10 +25,14 @@ fi
# Put the user option stuff up front.
-AC_ARG_WITH([system_openssl], [AS_HELP_STRING([--with-system-openssl], [Link against system copy of OpenSSL])], [], [with_system_openssl=auto])
-AC_ARG_ENABLE([openssl_asm], [AS_HELP_STRING([--disable-openssl-asm], [Don't let OpenSSL build assembler code])], [], [enable_openssl_asm=auto])
-AC_ARG_ENABLE([ca_tools], [AS_HELP_STRING([--disable-ca-tools], [Don't build any of the CA tools])], [], [enable_ca_tools=yes])
-AC_ARG_ENABLE([rpki_rtr], [AS_HELP_STRING([--disable-rpki-rtr], [Don't build the rpki-rtr code])], [], [enable_rpki_rtr=yes])
+AC_ARG_WITH([system_openssl], [AS_HELP_STRING([--with-system-openssl], [Link against system copy of OpenSSL])], [], [with_system_openssl=auto])
+AC_ARG_ENABLE([rcynic_jail], [AS_HELP_STRING([--enable-rcynic-jail], [Run rcynic in chroot jail])], [], [enable_rcynic_jail=no])
+AC_ARG_ENABLE([openssl_asm], [AS_HELP_STRING([--disable-openssl-asm], [Don't let OpenSSL build assembler code])], [], [enable_openssl_asm=auto])
+AC_ARG_ENABLE([ca_tools], [AS_HELP_STRING([--disable-ca-tools], [Don't build any of the CA tools])], [], [enable_ca_tools=yes])
+AC_ARG_ENABLE([rpki_rtr], [AS_HELP_STRING([--disable-rpki-rtr], [Don't build the rpki-rtr code])], [], [enable_rpki_rtr=yes])
+AC_ARG_ENABLE([target_installation], [AS_HELP_STRING([--disable-target-installation], [Don't perform final target installation])],[], [enable_target_installation=yes])
+
+AC_ARG_VAR([RCYNIC_DIR], [Where to put output files from rcynic and rtr-origin; also controls jail location for --enable-rcynic-jail])
# Obsolete options. If you know of a better way to handle this, tell me.
@@ -74,8 +78,12 @@ dnl LDFLAGS="$old_LDFLAGS"
dnl unset old_LDFLAGS
case $host_os in
-freebsd*) LD_STATIC_FLAG='-static';;
-*) LD_STATIC_FLAG='';;
+ freebsd*)
+ LD_STATIC_FLAG='-static'
+ ;;
+ *)
+ LD_STATIC_FLAG=''
+ ;;
esac
AC_SUBST(LD_STATIC_FLAG)
@@ -115,6 +123,7 @@ AC_PATH_PROG([SORT], [sort])
AC_PATH_PROG([RRDTOOL], [rrdtool])
AC_PROG_GREP
AC_PATH_PROG([TRANG], [trang], [\${abs_top_srcdir}/buildtools/trang-not-found])
+AC_PATH_PROG([RSYNC], [rsync])
# Figure out whether we need to build our own OpenSSL library or can
# use the system libraries. We're looking for two recent features:
@@ -220,6 +229,110 @@ case $enable_openssl_asm in
;;
esac
+# RCYNIC_DIR is a "precious" argument variable to this script (see
+# autoconf doc), which means that autoconf is careful with whatever
+# value (if any) was passed in, and that it's already been declared
+# for variable substitution. We still have to set a default value for
+# it, though, and we might as well handle DESTDIR while we're at it.
+
+if test "X$RCYNIC_DIR" = "X"
+then
+ RCYNIC_DIR='${DESTDIR}/var/rcynic'
+else
+ RCYNIC_DIR='${DESTDIR}'"${RCYNIC_DIR}"
+fi
+
+# Figure out whether to run rcynic in a chroot jail, which determines
+# a bunch of other settings.
+
+AC_MSG_CHECKING([whether to build chroot jail for rcynic])
+
+case $enable_rcynic_jail in
+ yes)
+ use_rcynic_jail=yes
+ RCYNIC_CONF_FILE='${RCYNIC_DIR}/etc/rcynic.conf'
+ RCYNIC_TA_DIR='${RCYNIC_DIR}/etc/trust-anchors'
+ RCYNIC_CONF_RSYNC='/bin/rsync'
+ RCYNIC_CONF_DATA='/data'
+ RCYNIC_CONF_TA_DIR='/etc/trust-anchors'
+ RCYNIC_JAIL_DIRS='${RCYNIC_DIR}/bin ${RCYNIC_DIR}/dev ${RCYNIC_DIR}/etc'
+ if test "X$host_os" = "Xlinux"
+ then
+ RCYNIC_JAIL_DIRS="RCYNIC_JAIL_DIRS "'${RCYNIC_DIR}/lib ${RCYNIC_DIR}/lib64 ${RCYNIC_DIR}/usr/lib'
+ fi
+ ;;
+ no)
+ use_rcynic_jail=no
+ RCYNIC_CONF_FILE='${DESTDIR}${sysconfdir}/rcynic.conf'
+ RCYNIC_TA_DIR='${DESTDIR}${sysconfdir}/rpki/trust-anchors'
+ RCYNIC_CONF_RSYNC="${RSYNC}"
+ RCYNIC_CONF_DATA='${RCYNIC_DIR}/data'
+ RCYNIC_CONF_TA_DIR="${RCYNIC_TA_DIR}"
+ RCYNIC_JAIL_DIRS=''
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value for --enable-rcynic-jail: $enable_rcynic_jail])
+ ;;
+esac
+
+AC_SUBST(RCYNIC_JAIL_DIRS)
+AC_SUBST(RCYNIC_CONF_FILE)
+AC_SUBST(RCYNIC_TA_DIR)
+AC_SUBST(RCYNIC_CONF_RSYNC)
+AC_SUBST(RCYNIC_CONF_DATA)
+AC_SUBST(RCYNIC_CONF_TA_DIR)
+
+AC_MSG_RESULT([$use_rcynic_jail])
+
+if test $use_rcynic_jail = yes && test "X$LD_STATIC_FLAG" != "X"
+then
+ RCYNIC_STATIC_RSYNC='static-rsync/rsync'
+else
+ RCYNIC_STATIC_RSYNC=''
+fi
+
+AC_SUBST(RCYNIC_STATIC_RSYNC)
+
+# Check whether to do "final target installation". This means actions
+# that can only be done when installing a package, as opposed to when
+# building a package. On FreeBSD this is sort of irrelevant, because
+# of the way package installs work when building from source, but on
+# Debian and Ubuntu, for example, there's a strict separation between
+# things that are done during package build and things that are done
+# by the binary package's {pre,post}inst scripts.
+
+AC_MSG_CHECKING([whether to do final target installation on "make install"])
+
+case $enable_target_installation in
+ yes|no)
+ ;;
+ *)
+ AC_MSG_ERROR([Unrecognized value for --enable-target-installation: $enable_target_installation])
+ ;;
+esac
+
+AC_MSG_RESULT([$enable_target_installation])
+
+# rcynic jail setup is complicated enough that it's simplest to have
+# different rule sets for different platforms. Icky, but....
+
+case $host_os in
+ darwin*)
+ RCYNIC_MAKE_RULES='rcynic/rules.darwin.mk'
+ ;;
+ freebsd*)
+ RCYNIC_MAKE_RULES='rcynic/rules.freebsd.mk'
+ ;;
+ linux*)
+ RCYNIC_MAKE_RULES='rcynic/rules.linux.mk'
+ ;;
+ *)
+ RCYNIC_MAKE_RULES='rcynic/rules.unknown.mk'
+ ;;
+esac
+
+AC_SUBST_FILE(RCYNIC_MAKE_RULES)
+
# Now a bunch of checks to figure out what we can do with Python. If
# we don't have Python at all, none of the rest of this matters. If
# we do have Python, we need to check for required packages and
@@ -394,6 +507,32 @@ then
AC_MSG_ERROR([Please correct the problems above then re-run this configuration script.])
fi
+# Figure out whether we are on a Debian-derived system where we need
+# to tell setup.py about Debian installation layout.
+
+if test $build_ca_tools = yes
+then
+ AC_MSG_CHECKING([whether we need to tell distutils to use Debian installation layout])
+ use_debian_layout=no
+ if test -x /usr/bin/lsb_release
+ then
+ case `/usr/bin/lsb_release -is` in
+ Debian|Ubuntu)
+ use_debian_layout=yes
+ ;;
+ esac
+ fi
+ AC_MSG_RESULT([$use_debian_layout])
+ if test $use_debian_layout = yes
+ then
+ SETUP_PY_INSTALL_LAYOUT='--install-layout=deb'
+ else
+ SETUP_PY_INSTALL_LAYOUT=''
+
+ fi
+ AC_SUBST(SETUP_PY_INSTALL_LAYOUT)
+fi
+
# Figure out which parts of this package we have to build.
TOP_LEVEL_SUBDIRS=""
@@ -405,9 +544,9 @@ test $build_rpki_rtr = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS rtr-origin"
AC_SUBST(TOP_LEVEL_SUBDIRS)
AC_CONFIG_FILES([Makefile
+ ac_rpki.py
h/Makefile
rcynic/Makefile
- rcynic/static-rsync/Makefile
utils/Makefile
utils/find_roa/Makefile
utils/hashdir/Makefile
@@ -416,6 +555,11 @@ AC_CONFIG_FILES([Makefile
utils/scan_roas/Makefile
utils/uri/Makefile])
+if test "X$RCYNIC_STATIC_RSYNC" != "X"
+then
+ AC_CONFIG_FILES([rcynic/static-rsync/Makefile])
+fi
+
# OpenSSL has its own build system that bears no relationship to
# anything but itself, and our use of it is a bit weird, so this is a
# BFMI (Brute Force and Massive Ignorance) job.