Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 78 lines (71 sloc) 2.087 kb
f824a98 @thomasc Allow to choose RNG at configure time
thomasc authored
1 #! /bin/sh
41e4d42 @kostis Add header and modify so that the 'random' module is default
kostis authored
2 # --------------------------------------------------------------------
3 # Copyright 2010-2012 Manolis Papadakis <manopapad@gmail.com>,
4 # Eirini Arvaniti <eirinibob@gmail.com>
5 # and Kostis Sagonas <kostis@cs.ntua.gr>
6 #
7 # This file is part of PropEr.
8 #
9 # PropEr is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
13 #
14 # PropEr is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with PropEr. If not, see <http://www.gnu.org/licenses/>.
21
f824a98 @thomasc Allow to choose RNG at configure time
thomasc authored
22
23 usage()
24 {
41e4d42 @kostis Add header and modify so that the 'random' module is default
kostis authored
25 echo "usage: $0 [--use-sfmt | --help]"
f824a98 @thomasc Allow to choose RNG at configure time
thomasc authored
26 exit 1
27 }
28
29 sfmt()
30 {
31 echo "Using the sfmt-erlang random module"
32 grep -q sfmt rebar.config || cat >> rebar.config <<DONE
33 {deps, [
34 {sfmt, ".*", {git, "https://github.com/jj1bdx/sfmt-erlang.git",
35 {branch, "master"}}}
36 ]}.
37 DONE
38 grep -q USE_SFMT rebar.config || \
39 sed -i "s/debug_info/debug_info, {d, 'USE_SFMT'}/" rebar.config
40 grep -q sfmt src/proper.app.src || \
41 sed -i 's/stdlib/stdlib,sfmt/' src/proper.app.src
42 }
43
44 random()
45 {
46 echo "Using Erlang's random module"
47 grep -q USE_SFMT rebar.config && \
48 sed -i "s/debug_info, {d, 'USE_SFMT'}/debug_info/" rebar.config
49 grep -q sfmt rebar.config && sed -i '/^{deps/,$d' rebar.config
50 grep -q sfmt src/proper.app.src && \
51 sed -i 's/stdlib,sfmt/stdlib/' src/proper.app.src
52 }
53
54 cleanup()
55 {
56 rm -f ebin/*
57 rm -f .eunit/*
58 }
59
41e4d42 @kostis Add header and modify so that the 'random' module is default
kostis authored
60 if [ $# -eq 0 ]; then
61 cleanup
62 random
63 else
64 case $1 in
65 --use-sfmt)
66 cleanup
67 sfmt
68 ;;
69 -h|--help)
70 usage
71 ;;
72 *)
73 echo $0": unrecognized option:" $1
74 exit 1
75 ;;
76 esac
f824a98 @thomasc Allow to choose RNG at configure time
thomasc authored
77 fi
Something went wrong with that request. Please try again.