From 1e009f843ac73df8775a9dcb214f112f6d92991d Mon Sep 17 00:00:00 2001 From: Gauthier POGAM--LE MONTAGNER Date: Thu, 1 Oct 2015 14:23:27 +0200 Subject: [PATCH] [project] Improve cross-compilation of fsnotifier binary on Linux (#306) https://github.com/JetBrains/intellij-community/pull/306/ --- native/fsNotifier/linux/make.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/native/fsNotifier/linux/make.sh b/native/fsNotifier/linux/make.sh index 3a582d6ed56c..cdb060c8eb7c 100755 --- a/native/fsNotifier/linux/make.sh +++ b/native/fsNotifier/linux/make.sh @@ -1,11 +1,18 @@ #!/bin/sh -CC_FLAGS="-O3 -Wall -std=c99 -D_BSD_SOURCE -D_XOPEN_SOURCE=500" -echo "compiling 32-bit version" -clang -m32 $CC_FLAGS -o fsnotifier main.c inotify.c util.c -if [ $? -eq 0 ] ; then +CC_FLAGS="-O3 -Wall -std=c99 -D_DEFAULT_SOURCE" + +if [ -f "/usr/include/gnu/stubs-32.h" ] ; 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" clang -m64 $CC_FLAGS -o fsnotifier64 main.c inotify.c util.c if [ $? -eq 0 ] ; then - chmod 755 fsnotifier fsnotifier64 + chmod 755 fsnotifier64 fi fi