From e1b81bd68228f908e7e69794386947d7f7f98451 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 12 Jun 2011 20:20:20 +0100 Subject: [PATCH] build system: provide configure option --enable-hacky-parallel This allows -DHACKY_PARALLEL to be turned on with an option to configure. The corresponding comments in the Makefile.in, suggesting to edit it by hand there, are therefore removed. Signed-off-by: Ian Jackson --- Makefile.in | 3 --- configure | 19 +++++++++++++++++++ configure.in | 10 ++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 630ff2d..e5ea84b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,9 +31,6 @@ CC:=@CC@ INSTALL:=@INSTALL@ INSTALL_PROGRAM:=@INSTALL_PROGRAM@ -# Use -DHACKY_PARALLEL if you are compiling secnet for an extremely -# slow machine -#CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -DHACKY_PARALLEL CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -Werror \ -W -Wno-unused \ -Wno-pointer-sign -Wstrict-prototypes -Wmissing-prototypes \ diff --git a/configure b/configure index 85a5864..8417ccc 100755 --- a/configure +++ b/configure @@ -654,6 +654,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_hacky_parallel ' ac_precious_vars='build_alias host_alias @@ -1271,6 +1272,12 @@ if test -n "$ac_init_help"; then esac cat <<\_ACEOF +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-hacky-parallel parallelise slow cryptography (default is no) + Some influential environment variables: CC C compiler command CFLAGS C compiler flags @@ -4186,6 +4193,18 @@ $as_echo "$ac_cv_prog_cc_no_writeable_strings" >&6; } +# Check whether --enable-hacky-parallel was given. +if test "${enable_hacky_parallel+set}" = set; then : + enableval=$enable_hacky_parallel; + case "$enableval" in + n|0|no) ;; + y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;; + *) ;; + esac + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpz_init_set_str in -lgmp" >&5 diff --git a/configure.in b/configure.in index 3970809..0f88dac 100644 --- a/configure.in +++ b/configure.in @@ -33,6 +33,16 @@ AC_CHECK_SIZEOF(unsigned short) AC_CHECK_SIZEOF(unsigned char) AC_PROG_CC_NO_WRITEABLE_STRINGS(WRITESTRINGS) +AC_ARG_ENABLE(hacky-parallel, + [AS_HELP_STRING([--enable-hacky-parallel], + [parallelise slow cryptography (default is no)])], [ + case "$enableval" in + n|0|no) ;; + y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;; + *) ;; + esac +]) + AC_DEFUN([REQUIRE_HEADER],[AC_CHECK_HEADER($1,,[AC_MSG_ERROR($1 not found)])]) dnl the order in which libraries is checked is important -- 2.30.2