remove compile noise when gcc version >= 7

pull/487/head
YuQing 2021-01-06 12:02:32 +08:00
parent 01b2b399a1
commit 255f167491
3 changed files with 10 additions and 4 deletions

View File

@ -8,7 +8,13 @@ WITH_LINUX_SERVICE=1
DEBUG_FLAG=1
CFLAGS='-Wall -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE'
export CC=gcc
CFLAGS='-Wall'
GCC_VERSION=$(gcc -dM -E - < /dev/null | grep -w __GNUC__ | awk '{print $NF;}')
if [ -n "$GCC_VERSION" ] && [ $GCC_VERSION -ge 7 ]; then
CFLAGS="$CFLAGS -Wformat-truncation=0 -Wformat-overflow=0"
fi
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE"
if [ "$DEBUG_FLAG" = "1" ]; then
CFLAGS="$CFLAGS -g -O1 -DDEBUG_FLAG"
else

View File

@ -36,6 +36,6 @@ install:
mkdir -p $(TARGET_PATH)
mkdir -p $(CONFIG_PATH)
cp -f $(ALL_PRGS) $(TARGET_PATH)
if [ ! -f $(CONFIG_PATH)/storage.conf.sample ]; then cp -f ../conf/storage.conf $(CONFIG_PATH)/storage.conf.sample; fi
if [ ! -f $(CONFIG_PATH)/storage.conf ]; then cp -f ../conf/storage.conf $(CONFIG_PATH)/storage.conf; fi
clean:
rm -f $(ALL_OBJS) $(ALL_PRGS)

View File

@ -27,7 +27,7 @@ install:
mkdir -p $(TARGET_PATH)
mkdir -p $(CONFIG_PATH)
cp -f $(ALL_PRGS) $(TARGET_PATH)
if [ ! -f $(CONFIG_PATH)/tracker.conf.sample ]; then cp -f ../conf/tracker.conf $(CONFIG_PATH)/tracker.conf.sample; fi
if [ ! -f $(CONFIG_PATH)/storage_ids.conf.sample ]; then cp -f ../conf/storage_ids.conf $(CONFIG_PATH)/storage_ids.conf.sample; fi
if [ ! -f $(CONFIG_PATH)/tracker.conf ]; then cp -f ../conf/tracker.conf $(CONFIG_PATH)/tracker.conf; fi
if [ ! -f $(CONFIG_PATH)/storage_ids.conf ]; then cp -f ../conf/storage_ids.conf $(CONFIG_PATH)/storage_ids.conf; fi
clean:
rm -f $(ALL_OBJS) $(ALL_PRGS)