summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-15 15:28:22 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-03-15 15:28:22 +0000
commita50476a588b2d7bc819cf0235a093dcddef9f2bf (patch)
treecee58f81c6c89b6ec1e00f7c3842747969991a3d
parenta709396e2957e4cf70c8f5061ea62073b7f6f0f6 (diff)
downloadhercules-a50476a588b2d7bc819cf0235a093dcddef9f2bf.tar.gz
hercules-a50476a588b2d7bc819cf0235a093dcddef9f2bf.tar.bz2
hercules-a50476a588b2d7bc819cf0235a093dcddef9f2bf.tar.xz
hercules-a50476a588b2d7bc819cf0235a093dcddef9f2bf.zip
Added GCC4 autodetection for -Wno-unused-parameter and -Wno-pointer-sign in Makefile
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10017 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 0d95c0f86..cd0c40f02 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,9 @@ CC = gcc -pipe
MAKE = make
# MAKE = gmake
+# Detecting gcc version
+GCC_VERSION = $(shell $(CC) -v 2>&1 | grep version | cut -d' ' -f3 | cut -d'.' -f1)
+
OPT = -g
OPT += -O2
# OPT += -O3
@@ -23,8 +26,9 @@ OPT += -ffast-math
# OPT += -fstack-protector
# OPT += -fomit-frame-pointer
OPT += -Wall -Wno-sign-compare
-# Uncomment this one if you are using GCC 4.X
-# OPT += -Wno-unused-parameter -Wno-pointer-sign
+ifeq ($(GCC_VERSION), 4)
+ OPT += -Wno-unused-parameter -Wno-pointer-sign
+endif
# Server Packet Protocol version (also defined in src/common/mmo.h)
# OPT += -DPACKETVER=8
# Makes map-wide script variables be saved to SQL instead of TXT files.