dep-selector-libgecode 1.0.0.alpha.1 → 1.0.0.alpha.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3731b6b1fca5ee9be71f1290a6ca7e80334881fe
4
- data.tar.gz: 0ebf347f37bf6244bb10e00c7ad91fdc1f38225c
3
+ metadata.gz: f45b103597f32988c91cbc2db8564d16c52345fd
4
+ data.tar.gz: d15a3547e6b6528a3183463376841c485c022008
5
5
  SHA512:
6
- metadata.gz: f611185842ea091b41f1467293336ed0eb53b2b499eb6cd7a51ad3acd3a09af499b3fd4c7f8553661b9158487bc48f1f65dda9a64771d4eefdba82edff27e4d6
7
- data.tar.gz: 8d7f0c6774110ef695b39541f7e949219a6da5405c7116602d36d24c87128dfe94fba204f879f71d42067604a949bdc34793ab659f963f0f73cd780ff4791727
6
+ metadata.gz: 9a10243cb0e96ed35ecf97a498cc4f245dc7731361ac8d626a6ae9ffa60243a84dc693ae6bc76d620715e0edd9bf1befb0853512bcf84ac9f2218f432c78c4da
7
+ data.tar.gz: 54df34e4fe632f17cc849a01970dcdaf10bc3193c6286658262012e03c12a65addf2574cd15c916ee4180eb0937b29c9997192aa70f576458a0ec938cb31884f
@@ -1,3 +1,5 @@
1
+ exit(0) if ENV["USE_SYSTEM_GECODE"]
2
+
1
3
  require 'pp'
2
4
 
3
5
  module GecodeBuild
@@ -7,20 +9,26 @@ module GecodeBuild
7
9
 
8
10
  PREFIX = File.expand_path("../../../lib/dep-selector-libgecode/vendored-gecode", __FILE__).freeze
9
11
 
10
- LOG_FILE_PATH = File.expand_path("../gecode_build.log", __FILE__)
12
+ def self.windows?
13
+ !!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
14
+ end
11
15
 
12
16
  def self.gecode_vendor_dir
13
17
  GECODE_VENDOR_DIR
14
18
  end
15
19
 
20
+ def self.configure
21
+ File.join(GECODE_VENDOR_DIR, "configure")
22
+ end
23
+
16
24
  def self.prefix
17
25
  PREFIX
18
26
  end
19
27
 
20
- # TODO: this needs to detect windows and add `--with-host-os=windows`
21
28
  def self.configure_cmd
22
- %W[
23
- ./configure
29
+ args = %W[
30
+ sh
31
+ #{configure}
24
32
  --prefix=#{prefix}
25
33
  --disable-doc-dot
26
34
  --disable-doc-search
@@ -31,14 +39,24 @@ module GecodeBuild
31
39
  --disable-examples
32
40
  --disable-flatzinc
33
41
  ]
42
+ args << "--with-host-os=windows" if windows?
43
+ args
44
+ end
45
+
46
+ def self.setup_env
47
+ if windows?
48
+ ENV['CC'] = 'gcc'
49
+ ENV['CXX'] = 'g++'
50
+ end
34
51
  end
35
52
 
36
53
  def self.system(*args)
37
54
  print("-> #{args.join(' ')}\n")
38
- super(*args, [:out, :err] => [LOG_FILE_PATH, "w"])
55
+ super(*args)
39
56
  end
40
57
 
41
58
  def self.run_build_commands
59
+ setup_env
42
60
  system(*configure_cmd) &&
43
61
  system("make", "clean") &&
44
62
  system("make", "-j", "5") &&
@@ -47,11 +65,10 @@ module GecodeBuild
47
65
 
48
66
  def self.run
49
67
  Dir.chdir(gecode_vendor_dir) do
50
- run_build_commands or raise BuildError, "Failed to build gecode library. See log for details: #{LOG_FILE_PATH}"
68
+ run_build_commands or raise BuildError, "Failed to build gecode library."
51
69
  end
52
70
  end
53
71
 
54
72
  end
55
73
 
56
74
  GecodeBuild.run
57
-
@@ -54,7 +54,6 @@ typedef int flex_int32_t;
54
54
  typedef unsigned char flex_uint8_t;
55
55
  typedef unsigned short int flex_uint16_t;
56
56
  typedef unsigned int flex_uint32_t;
57
- #endif /* ! C99 */
58
57
 
59
58
  /* Limits of integral types. */
60
59
  #ifndef INT8_MIN
@@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t;
85
84
  #define UINT32_MAX (4294967295U)
86
85
  #endif
87
86
 
87
+ #endif /* ! C99 */
88
+
88
89
  #endif /* ! FLEXINT_H */
89
90
 
90
91
  #ifdef __cplusplus
@@ -158,7 +159,15 @@ typedef void* yyscan_t;
158
159
 
159
160
  /* Size of default input buffer. */
160
161
  #ifndef YY_BUF_SIZE
162
+ #ifdef __ia64__
163
+ /* On IA-64, the buffer size is 16k, not 8k.
164
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
165
+ * Ditto for the __ia64__ case accordingly.
166
+ */
167
+ #define YY_BUF_SIZE 32768
168
+ #else
161
169
  #define YY_BUF_SIZE 16384
170
+ #endif /* __ia64__ */
162
171
  #endif
163
172
 
164
173
  /* The state buf must be large enough to hold one state per character in the main buffer.
@@ -599,8 +608,8 @@ static yyconst flex_int32_t yy_rule_can_match_eol[57] =
599
608
  * Guido Tack, 2007
600
609
  *
601
610
  * Last modified:
602
- * $Date: 2012-03-21 16:25:08 +1100 (Wed, 21 Mar 2012) $ by $Author: tack $
603
- * $Revision: 12605 $
611
+ * $Date: 2006-12-11 03:27:31 +1100 (Mon, 11 Dec 2006) $ by $Author: schulte $
612
+ * $Revision: 4024 $
604
613
  *
605
614
  * This file is part of Gecode, the generic constraint
606
615
  * development environment:
@@ -647,7 +656,7 @@ int stringbufpos;
647
656
  int yy_input_proc(char* buf, int size, yyscan_t yyscanner);
648
657
  #define YY_INPUT(buf, result, max_size) \
649
658
  result = yy_input_proc(buf, max_size, yyscanner);
650
- #line 651 "gecode/flatzinc/lexer.yy.cpp"
659
+ #line 660 "gecode/flatzinc/lexer.yy.cpp"
651
660
 
652
661
  #define INITIAL 0
653
662
 
@@ -776,7 +785,12 @@ static int input (yyscan_t yyscanner );
776
785
 
777
786
  /* Amount of stuff to slurp up with each read. */
778
787
  #ifndef YY_READ_BUF_SIZE
788
+ #ifdef __ia64__
789
+ /* On IA-64, the buffer size is 16k, not 8k */
790
+ #define YY_READ_BUF_SIZE 16384
791
+ #else
779
792
  #define YY_READ_BUF_SIZE 8192
793
+ #endif /* __ia64__ */
780
794
  #endif
781
795
 
782
796
  /* Copy whatever the last rule matched to the standard output. */
@@ -784,7 +798,7 @@ static int input (yyscan_t yyscanner );
784
798
  /* This used to be an fputs(), but since the string might contain NUL's,
785
799
  * we now use fwrite().
786
800
  */
787
- #define ECHO fwrite( yytext, yyleng, 1, yyout )
801
+ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
788
802
  #endif
789
803
 
790
804
  /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -795,7 +809,7 @@ static int input (yyscan_t yyscanner );
795
809
  if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
796
810
  { \
797
811
  int c = '*'; \
798
- yy_size_t n; \
812
+ size_t n; \
799
813
  for ( n = 0; n < max_size && \
800
814
  (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
801
815
  buf[n] = (char) c; \
@@ -883,7 +897,7 @@ YY_DECL
883
897
  #line 66 "./gecode/flatzinc/lexer.lxx"
884
898
 
885
899
 
886
- #line 887 "gecode/flatzinc/lexer.yy.cpp"
900
+ #line 901 "gecode/flatzinc/lexer.yy.cpp"
887
901
 
888
902
  yylval = yylval_param;
889
903
 
@@ -959,7 +973,7 @@ yy_find_action:
959
973
 
960
974
  if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
961
975
  {
962
- yy_size_t yyl;
976
+ int yyl;
963
977
  for ( yyl = 0; yyl < yyleng; ++yyl )
964
978
  if ( yytext[yyl] == '\n' )
965
979
 
@@ -1267,7 +1281,7 @@ YY_RULE_SETUP
1267
1281
  #line 130 "./gecode/flatzinc/lexer.lxx"
1268
1282
  ECHO;
1269
1283
  YY_BREAK
1270
- #line 1271 "gecode/flatzinc/lexer.yy.cpp"
1284
+ #line 1285 "gecode/flatzinc/lexer.yy.cpp"
1271
1285
  case YY_STATE_EOF(INITIAL):
1272
1286
  yyterminate();
1273
1287
 
@@ -2050,8 +2064,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
2050
2064
 
2051
2065
  /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
2052
2066
  * scan from a @e copy of @a bytes.
2053
- * @param bytes the byte buffer to scan
2054
- * @param len the number of bytes in the buffer pointed to by @a bytes.
2067
+ * @param yybytes the byte buffer to scan
2068
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
2055
2069
  * @param yyscanner The scanner object.
2056
2070
  * @return the newly allocated buffer state object.
2057
2071
  */