rake-convert 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/rake/convert.rb +25 -12
  2. metadata +2 -2
@@ -30,6 +30,21 @@ end
30
30
  # Makefile stuff
31
31
 
32
32
  # configure stuff
33
+ def die (text)
34
+ if $convert
35
+ $configure << %{
36
+
37
+ if [[ "$LAST" == "no" ]]; then
38
+ echo -e "#{text}"
39
+ exit 1
40
+ fi
41
+
42
+ }
43
+ else
44
+ fail(text)
45
+ end
46
+ end
47
+
33
48
  if $".grep(/mkmf\.rb$/).first
34
49
  alias __have_header have_header
35
50
  alias __have_library have_library
@@ -65,7 +80,7 @@ fi
65
80
  }
66
81
  end
67
82
 
68
- result
83
+ $convert ? false : result
69
84
  end
70
85
 
71
86
  def have_library (lib, func = nil, headers = nil, &block)
@@ -84,20 +99,18 @@ cat > $FILE.c <<EOF
84
99
  EOF
85
100
 
86
101
  echo -n "Checking for #{lib}... "
87
- if [[ "`($CC $CFLAGS -o $FILE -c $FILE.c -l#{lib}) 2>&1`" == "" ]]; then
88
- echo yes
102
+ if [[ "`($CC $CFLAGS -o $FILE $FILE.c -l#{lib}) 2>&1`" == "" ]]; then
103
+ LAST=yes
89
104
  else
90
- echo no
91
-
92
- echo "Install #{lib} and try again"
93
-
94
- exit 1
105
+ LAST=no
95
106
  fi
96
107
 
108
+ echo $LAST
109
+
97
110
  }
98
111
  end
99
112
 
100
- result
113
+ $convert ? false : result
101
114
  end
102
115
 
103
116
  def have_func (func, headers = nil, &block)
@@ -127,7 +140,7 @@ fi
127
140
  }
128
141
  end
129
142
 
130
- result
143
+ $convert ? false : result
131
144
  end
132
145
 
133
146
  def have_macro (macro, headers = nil, opts = '', &block)
@@ -157,7 +170,7 @@ fi
157
170
  }
158
171
  end
159
172
 
160
- result
173
+ $convert ? false : result
161
174
  end
162
175
 
163
176
  def check_sizeof (type, headers = nil, opts = '', &block)
@@ -194,7 +207,7 @@ fi
194
207
  }
195
208
  end
196
209
 
197
- result
210
+ $convert ? false : result
198
211
  end
199
212
 
200
213
  def create_header (header = 'extconf.h')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - meh.