diff options
-rwxr-xr-x | configure | 16 | ||||
-rw-r--r-- | configure.ac | 17 | ||||
-rw-r--r-- | rcynic/Makefile.in | 21 | ||||
-rw-r--r-- | rcynic/rcynic.c | 6 | ||||
-rw-r--r-- | utils/find_roa/Makefile.in | 21 | ||||
-rw-r--r-- | utils/hashdir/Makefile.in | 20 | ||||
-rw-r--r-- | utils/print_manifest/Makefile.in | 19 | ||||
-rw-r--r-- | utils/print_roa/Makefile.in | 18 | ||||
-rw-r--r-- | utils/uri/Makefile.in | 18 |
9 files changed, 83 insertions, 73 deletions
@@ -700,6 +700,7 @@ XSLTPROC AWK PYTHON TOP_LEVEL_SUBDIRS +RPKITOOLS_TOP_BUILDDIR OPENSSL_CONFIG_COMMAND PYWRAP LIBOBJS @@ -3837,8 +3838,8 @@ _ACEOF # know how to do it on all platforms, so we try the hack we know, and # if that doesn't work, oh well. -{ $as_echo "$as_me:$LINENO: checking if linker supports -static" >&5 -$as_echo_n "checking if linker supports -static... " >&6; } +{ $as_echo "$as_me:$LINENO: checking whether linker supports -static" >&5 +$as_echo_n "checking whether linker supports -static... " >&6; } old_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" cat >conftest.$ac_ext <<_ACEOF @@ -4503,6 +4504,12 @@ test $build_python = yes && TOP_LEVEL_SUBDIRS="$TOP_LEVEL_SUBDIRS pow rpkid" ac_config_files="$ac_config_files Makefile rcynic/Makefile utils/Makefile utils/find_roa/Makefile utils/hashdir/Makefile utils/print_manifest/Makefile utils/print_roa/Makefile utils/uri/Makefile" +# If there's some sane way to do this with a built-in autoconf +# variable, I don't know what it is, so copy what BIND9 does. + +RPKITOOLS_TOP_BUILDDIR=`pwd` + + # OpenSSL has its own build system that bears no relationship to # anything but itself. On at least one platform, OpenSSL's opinion on # the right thing to do is so completely at odds with everything else @@ -4530,6 +4537,9 @@ $as_echo_n "checking what configuration target to use when building OpenSSL... " { $as_echo "$as_me:$LINENO: result: $OPENSSL_CONFIG_COMMAND" >&5 $as_echo "$OPENSSL_CONFIG_COMMAND" >&6; } + + LDFLAGS="$LDFLAGS -L$RPKITOOLS_TOP_BUILDDIR/openssl/openssl" + CFLAGS="$CFLAGS -I$RPKITOOLS_TOP_BUILDDIR/openssl/openssl/include" fi # Sort out which interpreter POW-using Python programs should use. @@ -4538,7 +4548,7 @@ if test $build_pywrap = yes then # Eventually this should be the installation directory, but # for now we're still running out of the build tree. - PYWRAP=`pwd`/pow/pywrap/pywrap + PYWRAP=$RPKITOOLS_TOP_BUILDDIR/pow/pywrap/pywrap else # If we don't need pywrap, just make it expand to python PYWRAP=$PYTHON diff --git a/configure.ac b/configure.ac index cfe4e7a0..28f41b9d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,10 +1,6 @@ # -*- Autoconf -*- # $Id$ -# Bare-bones autoconf for RPKI tools. This will almost certainly -# expand later, right now I'm only using it for things that absolutely -# must be configured just to get the code to build at all. - AC_PREREQ(2.61) AC_INIT(rpkitools, 1.0,) AC_CONFIG_SRCDIR([rcynic/rcynic.c]) @@ -20,7 +16,7 @@ AC_CHECK_SIZEOF([long]) # know how to do it on all platforms, so we try the hack we know, and # if that doesn't work, oh well. -AC_MSG_CHECKING([if linker supports -static]) +AC_MSG_CHECKING([whether linker supports -static]) old_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -static" AC_LINK_IFELSE( @@ -212,6 +208,12 @@ AC_CONFIG_FILES([Makefile utils/print_roa/Makefile utils/uri/Makefile]) +# If there's some sane way to do this with a built-in autoconf +# variable, I don't know what it is, so copy what BIND9 does. + +RPKITOOLS_TOP_BUILDDIR=`pwd` +AC_SUBST(RPKITOOLS_TOP_BUILDDIR) + # OpenSSL has its own build system that bears no relationship to # anything but itself. On at least one platform, OpenSSL's opinion on # the right thing to do is so completely at odds with everything else @@ -236,6 +238,9 @@ then esac AC_SUBST(OPENSSL_CONFIG_COMMAND) AC_MSG_RESULT([$OPENSSL_CONFIG_COMMAND]) + + LDFLAGS="$LDFLAGS -L$RPKITOOLS_TOP_BUILDDIR/openssl/openssl" + CFLAGS="$CFLAGS -I$RPKITOOLS_TOP_BUILDDIR/openssl/openssl/include" fi # Sort out which interpreter POW-using Python programs should use. @@ -244,7 +249,7 @@ if test $build_pywrap = yes then # Eventually this should be the installation directory, but # for now we're still running out of the build tree. - PYWRAP=`pwd`/pow/pywrap/pywrap + PYWRAP=$RPKITOOLS_TOP_BUILDDIR/pow/pywrap/pywrap else # If we don't need pywrap, just make it expand to python PYWRAP=$PYTHON diff --git a/rcynic/Makefile.in b/rcynic/Makefile.in index 1d146b7c..b003437e 100644 --- a/rcynic/Makefile.in +++ b/rcynic/Makefile.in @@ -1,25 +1,22 @@ # $Id$ -OPENSSL_DIR = ../openssl/openssl +NAME = rcynic -# Disable -Werror as long as we're using OpenSSL snapshots. +BIN = ${NAME} +SRC = ${NAME}.c +OBJ = ${NAME}.o -CFLAGS = -g -I${OPENSSL_DIR}/include -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations -LDFLAGS = @LD_STATIC_FLAG@ - -# -H -Wl,-t - -BIN = rcynic -OBJ = rcynic.o -LIB = ${OPENSSL_DIR}/libcrypto.a +CFLAGS = @CFLAGS@ -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations +LDFLAGS = @LDFLAGS@ @LD_STATIC_FLAG@ +LIBS = @LIBS@ all: ${BIN} clean: rm -f ${BIN} ${OBJ} -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} ${LDFLAGS} +${BIN}: ${SRC} + ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS} test: ${BIN} if test -r rcynic.conf; then ./${BIN} -j 0 && echo && ./show.sh; else echo No rcynic.conf, skipping test; fi diff --git a/rcynic/rcynic.c b/rcynic/rcynic.c index 988736ac..b78e2410 100644 --- a/rcynic/rcynic.c +++ b/rcynic/rcynic.c @@ -1363,8 +1363,10 @@ static int rsync(const rcynic_ctx_t *rc, close(pipe_fds[1]); - deadline = time(0) + rc->rsync_timeout; + now = time(0); + deadline = now + rc->rsync_timeout; + n = -1; i = 0; while ((wpid = waitpid(pid, &pid_status, WNOHANG)) == 0 && (!rc->rsync_timeout || (now = time(0)) < deadline)) { @@ -3226,7 +3228,7 @@ int main(int argc, char *argv[]) time_t tad_time = time(0); struct tm *tad_tm = gmtime(&tad_time); int ok = 1, use_stdout = !strcmp(xmlfile, "-"); - FILE *f; + FILE *f = NULL; strftime(tad, sizeof(tad), "%Y-%m-%dT%H:%M:%SZ", tad_tm); diff --git a/utils/find_roa/Makefile.in b/utils/find_roa/Makefile.in index 7d22c936..559d1370 100644 --- a/utils/find_roa/Makefile.in +++ b/utils/find_roa/Makefile.in @@ -1,26 +1,25 @@ # $Id$ -OPENSSL_DIR = ../../openssl/openssl - -CFLAGS = -g -I${OPENSSL_DIR}/include -Wall - -# -H -Wl,-t - NAME = find_roa BIN = ${NAME} +SRC = ${NAME}.c OBJ = ${NAME}.o -LIB = ${OPENSSL_DIR}/libcrypto.a + +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ all: ${BIN} clean: - rm -rf ${BIN} ${OBJ} hashed-pem-dir + rm -f ${BIN} ${OBJ} + +${BIN}: ${SRC} + ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS} -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} -TEST_ARGS = ../../rcynic/rcynic-data/authenticated 10.3.0.44 10.2.0.6 10.0.0.0/24 +TEST_ARGS = @top_srcdir@/rcynic/rcynic-data/authenticated 10.3.0.44 10.2.0.6 10.0.0.0/24 test: ${BIN} # ./${BIN} ${TEST_ARGS} diff --git a/utils/hashdir/Makefile.in b/utils/hashdir/Makefile.in index 7c779d7a..29004c6f 100644 --- a/utils/hashdir/Makefile.in +++ b/utils/hashdir/Makefile.in @@ -1,24 +1,24 @@ # $Id$ -OPENSSL_DIR = ../../openssl/openssl +NAME = hashdir -CFLAGS = -g -I${OPENSSL_DIR}/include +BIN = ${NAME} +SRC = ${NAME}.c +OBJ = ${NAME}.o -# -H -Wl,-t - -BIN = hashdir -OBJ = hashdir.o -LIB = ${OPENSSL_DIR}/libcrypto.a +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ all: ${BIN} clean:: rm -f ${BIN} ${OBJ} -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} +${BIN}: ${SRC} + ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS} -INPUT = ../../rcynic/rcynic-data/authenticated +INPUT = @top_srcdir@/rcynic/rcynic-data/authenticated OUTPUT = hashed-pem-dir test: ${BIN} diff --git a/utils/print_manifest/Makefile.in b/utils/print_manifest/Makefile.in index 1e6cb878..c1d8ca40 100644 --- a/utils/print_manifest/Makefile.in +++ b/utils/print_manifest/Makefile.in @@ -1,26 +1,25 @@ # $Id$ -OPENSSL_DIR = ../../openssl/openssl - -CFLAGS = -g -I${OPENSSL_DIR}/include -Wall - -# -H -Wl,-t - NAME = print_manifest + BIN = ${NAME} +SRC = ${NAME}.c OBJ = ${NAME}.o -LIB = ${OPENSSL_DIR}/libcrypto.a + +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ all: ${BIN} clean: rm -f ${BIN} ${OBJ} -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} +${BIN}: ${SRC} + ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS} -MANIFEST_DIR = ../../rpkid/tests/smoketest.dir/publication +MANIFEST_DIR = @top_srcdir@/rpkid/tests/smoketest.dir/publication test: all -date -u +'now: %Y%m%d%H%M%SZ' diff --git a/utils/print_roa/Makefile.in b/utils/print_roa/Makefile.in index 2d6dcddc..c4da5730 100644 --- a/utils/print_roa/Makefile.in +++ b/utils/print_roa/Makefile.in @@ -1,26 +1,24 @@ # $Id$ -OPENSSL_DIR = ../../openssl/openssl - -CFLAGS = -g -I${OPENSSL_DIR}/include -Wall - -# -H -Wl,-t - NAME = print_roa BIN = ${NAME} +SRC = ${NAME}.c OBJ = ${NAME}.o -LIB = ${OPENSSL_DIR}/libcrypto.a + +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ all: ${BIN} clean: rm -f ${BIN} ${OBJ} -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} +${BIN}: ${SRC} + ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS} -ROA_DIR = ../../rpkid/tests/smoketest.dir/publication +ROA_DIR = @top_srcdir@/rpkid/tests/smoketest.dir/publication test: all -date -u +'now: %Y%m%d%H%M%SZ' diff --git a/utils/uri/Makefile.in b/utils/uri/Makefile.in index 229dc702..88f12de7 100644 --- a/utils/uri/Makefile.in +++ b/utils/uri/Makefile.in @@ -1,22 +1,22 @@ # $Id$ -OPENSSL_DIR = ../../openssl/openssl +NAME = uri -CFLAGS = -g -I${OPENSSL_DIR}/include +BIN = ${NAME} +SRC = ${NAME}.c +OBJ = ${NAME}.o -# -H -Wl,-t - -BIN = uri -OBJ = uri.o -LIB = ${OPENSSL_DIR}/libcrypto.a +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ all: ${BIN} clean: rm -f ${BIN} ${OBJ} -${BIN}: ${OBJ} ${LIB} Makefile - ${CC} -g -o $@ ${OBJ} ${LIB} +${BIN}: ${SRC} + ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS} test: @true |