[project] Improve cross-compilation of fsnotifier binary on Linux (#306)

https://github.com/JetBrains/intellij-community/pull/306/
This commit is contained in:
Gauthier POGAM--LE MONTAGNER
2015-10-01 14:23:27 +02:00
committed by Roman Shevchenko
parent 2f97c782c2
commit 1e009f843a

View File

@@ -1,11 +1,18 @@
#!/bin/sh #!/bin/sh
CC_FLAGS="-O3 -Wall -std=c99 -D_BSD_SOURCE -D_XOPEN_SOURCE=500" CC_FLAGS="-O3 -Wall -std=c99 -D_DEFAULT_SOURCE"
echo "compiling 32-bit version"
clang -m32 $CC_FLAGS -o fsnotifier main.c inotify.c util.c if [ -f "/usr/include/gnu/stubs-32.h" ] ; then
if [ $? -eq 0 ] ; then echo "compiling 32-bit version"
clang -m32 $CC_FLAGS -o fsnotifier main.c inotify.c util.c
if [ $? -eq 0 ] ; then
chmod 755 fsnotifier
fi
fi
if [ -f "/usr/include/gnu/stubs-64.h" ] ; then
echo "compiling 64-bit version" echo "compiling 64-bit version"
clang -m64 $CC_FLAGS -o fsnotifier64 main.c inotify.c util.c clang -m64 $CC_FLAGS -o fsnotifier64 main.c inotify.c util.c
if [ $? -eq 0 ] ; then if [ $? -eq 0 ] ; then
chmod 755 fsnotifier fsnotifier64 chmod 755 fsnotifier64
fi fi
fi fi