chiark / gitweb /
build system: provide configure option --enable-hacky-parallel
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 12 Jun 2011 19:20:20 +0000 (20:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jun 2011 11:07:27 +0000 (12:07 +0100)
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 <ijackson@chiark.greenend.org.uk>
Makefile.in
configure
configure.in

index 630ff2d..e5ea84b 100644 (file)
@@ -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 \
index 85a5864..8417ccc 100755 (executable)
--- 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
index 3970809..0f88dac 100644 (file)
@@ -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