rake-convert 0.0.2.1 → 0.0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rake/convert.rb +12 -7
- metadata +2 -2
data/lib/rake/convert.rb
CHANGED
@@ -36,7 +36,7 @@ def die (text)
|
|
36
36
|
|
37
37
|
if [[ "$LAST" == "no" ]]; then
|
38
38
|
echo -e "#{text}"
|
39
|
-
|
39
|
+
do_exit
|
40
40
|
fi
|
41
41
|
|
42
42
|
}
|
@@ -69,7 +69,7 @@ cat > $FILE.c <<EOF
|
|
69
69
|
EOF
|
70
70
|
|
71
71
|
echo -n "Checking for #{header}... "
|
72
|
-
if [[ "`($CC $CFLAGS -c $FILE.c) 2>&1`" == "" ]]; then
|
72
|
+
if [[ "`($CC $CFLAGS -pipe -o $FILE -c $FILE.c) 2>&1`" == "" ]]; then
|
73
73
|
DEFS="$DEFS\\n#define #{"HAVE_#{header.tr_cpp}"} 1"
|
74
74
|
|
75
75
|
echo yes
|
@@ -99,7 +99,7 @@ cat > $FILE.c <<EOF
|
|
99
99
|
EOF
|
100
100
|
|
101
101
|
echo -n "Checking for #{lib}... "
|
102
|
-
if [[ "`($CC $CFLAGS -o $FILE $FILE.c -l#{lib} $LIBS) 2>&1`" == "" ]]; then
|
102
|
+
if [[ "`($CC $CFLAGS -pipe -o $FILE $FILE.c -l#{lib} $LIBS) 2>&1`" == "" ]]; then
|
103
103
|
LAST=yes
|
104
104
|
|
105
105
|
LIBS="$LIBS -l#{lib}"
|
@@ -131,7 +131,7 @@ cat > $FILE.c <<EOF
|
|
131
131
|
EOF
|
132
132
|
|
133
133
|
echo -n "Checking for #{func}()#{" in #{[headers].flatten.join(' ')}" if headers}... "
|
134
|
-
if [[ "`($CC $CFLAGS -Wall -c $FILE.c) 2>&1`" == "" ]]; then
|
134
|
+
if [[ "`($CC $CFLAGS -Wall -pipe -o $FILE -c $FILE.c) 2>&1`" == "" ]]; then
|
135
135
|
DEFS="$DEFS\\n#define #{"HAVE_#{func.tr_cpp}"} 1"
|
136
136
|
|
137
137
|
echo yes
|
@@ -161,7 +161,7 @@ cat > $FILE.c <<EOF
|
|
161
161
|
EOF
|
162
162
|
|
163
163
|
echo -n "Checking for #{macro}#{" in #{[headers].flatten.join(' ')}" if headers}... "
|
164
|
-
if [[ "`($CC $CFLAGS -c $FILE.c) 2>&1`" == "" ]]; then
|
164
|
+
if [[ "`($CC $CFLAGS -pipe -o $FILE -c $FILE.c) 2>&1`" == "" ]]; then
|
165
165
|
DEFS="$DEFS\\n#define #{"HAVE_#{macro.tr_cpp}"} 1"
|
166
166
|
|
167
167
|
echo yes
|
@@ -193,7 +193,7 @@ EOF
|
|
193
193
|
$CC $CFLAGS -o $FILE $FILE.c
|
194
194
|
|
195
195
|
echo -n "Checking size of #{type}#{" in #{[headers].flatten.join(' ')}" if headers}... "
|
196
|
-
if [[ "`($CC $CFLAGS -o $FILE $FILE.c) 2>&1`" == "" ]]; then
|
196
|
+
if [[ "`($CC $CFLAGS -pipe -o $FILE $FILE.c) 2>&1`" == "" ]]; then
|
197
197
|
SIZE=$(exec $FILE)
|
198
198
|
DEFS="$DEFS\\n#define #{"SIZEOF_#{type.tr_cpp}"} $SIZE"
|
199
199
|
|
@@ -324,7 +324,12 @@ task :convert => clean do |task|
|
|
324
324
|
f.puts 'FILE=`mktemp -u`'
|
325
325
|
f.puts 'DEFS='
|
326
326
|
|
327
|
-
f.
|
327
|
+
f.puts 'function do_clean { rm -f $FILE; rm -f $FILE.c; rm -f $FILE.o; }'
|
328
|
+
f.puts 'function do_exit { do_clean; exit 1; }'
|
329
|
+
|
330
|
+
f.puts $configure
|
331
|
+
|
332
|
+
f.puts 'do_clean'
|
328
333
|
}
|
329
334
|
|
330
335
|
$makefile = ''
|