296 |
|
|
297 |
|
|
298 |
# Platform-specific options |
# Platform-specific options |
299 |
|
|
300 |
|
#Endianess |
301 |
|
cat >conftest.$$.c << EOF |
302 |
|
#include <stdlib.h> |
303 |
|
#include <signal.h> |
304 |
|
|
305 |
|
int main(int argc, char **argv) |
306 |
|
{ |
307 |
|
int test = 1; |
308 |
|
|
309 |
|
return(*(unsigned char*) (&test)); |
310 |
|
} |
311 |
|
EOF |
312 |
|
$cc -o conftest.$$ conftest.$$.c |
313 |
|
./conftest.$$ |
314 |
|
if [ "$?" = "0" ]; then |
315 |
|
echo "Architecture is big-endian" |
316 |
|
echo |
317 |
|
cflags="$cflags -DB_ENDIAN" |
318 |
|
else |
319 |
|
echo "Architecture is little-endian" |
320 |
|
echo |
321 |
|
cflags="$cflags -DL_ENDIAN" |
322 |
|
fi |
323 |
|
rm conftest.$$ conftest.$$.c |
324 |
|
|
325 |
|
#Alignment |
326 |
cat >conftest.$$.c << EOF |
cat >conftest.$$.c << EOF |
327 |
#include <stdlib.h> |
#include <stdlib.h> |
328 |
#include <signal.h> |
#include <signal.h> |
344 |
if [ "$need_alignment" = "yes" ]; then |
if [ "$need_alignment" = "yes" ]; then |
345 |
echo "Architecture needs alignment" |
echo "Architecture needs alignment" |
346 |
echo |
echo |
347 |
cflags="$cflags -DNEED_ALIGNMENT" |
cflags="$cflags -DNEED_ALIGN" |
348 |
fi |
fi |
349 |
rm conftest.$$ conftest.$$.c |
rm conftest.$$ conftest.$$.c |
350 |
|
|