summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-05-24 00:38:25 +0200
committerHaru <haru@dotalux.com>2014-05-25 17:13:24 +0200
commitb7373b6de5b41a4b420741da9ebf0570e36c11c7 (patch)
tree0058b108f2df1745b86cbadfb48fea9fa0aad4bf /src
parent9089ea1e9998663f0573abca89ed542f19418b11 (diff)
downloadhercules-b7373b6de5b41a4b420741da9ebf0570e36c11c7.tar.gz
hercules-b7373b6de5b41a4b420741da9ebf0570e36c11c7.tar.bz2
hercules-b7373b6de5b41a4b420741da9ebf0570e36c11c7.tar.xz
hercules-b7373b6de5b41a4b420741da9ebf0570e36c11c7.zip
Improved CFLAGS/CPPFLAGS handling
- Language extensions, such as _GNU_SOURCE are now enabled through CPPFLAGS by the configure script, rather than within the source code. - Moved some configure-time CFLAGS to CPPFLAGS, where appropriate. - Fixes bugreport:8211, thanks to Neoth http://hercules.ws/board/tracker/issue-8211-compiling-warning-in-linux Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/char/Makefile.in4
-rw-r--r--src/common/Makefile.in8
-rw-r--r--src/common/strlib.h9
-rw-r--r--src/login/Makefile.in4
-rw-r--r--src/map/Makefile.in4
-rw-r--r--src/plugins/Makefile.in2
-rw-r--r--src/test/Makefile.in4
-rw-r--r--src/tool/Makefile.in4
8 files changed, 23 insertions, 16 deletions
diff --git a/src/char/Makefile.in b/src/char/Makefile.in
index ecaad3602..59dc56076 100644
--- a/src/char/Makefile.in
+++ b/src/char/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -96,7 +98,7 @@ char-server: ../../char-server@EXEEXT@
obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 623c59c2e..5dfdd35bd 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -114,15 +116,15 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_
obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(MT19937AR_OBJ):
diff --git a/src/common/strlib.h b/src/common/strlib.h
index decf661a6..f93d8ad67 100644
--- a/src/common/strlib.h
+++ b/src/common/strlib.h
@@ -6,17 +6,10 @@
#define _COMMON_STRLIB_H_
#include <stdarg.h>
+#include <string.h>
#include "../common/cbasetypes.h"
-#ifndef __USE_GNU
-# define __USE_GNU // required to enable strnlen on some platforms
-# include <string.h>
-# undef __USE_GNU
-#else
-# include <string.h>
-#endif
-
#ifdef WIN32
#define HAVE_STRTOK_R
#define strtok_r(s,delim,save_ptr) _strtok_r((s),(delim),(save_ptr))
diff --git a/src/login/Makefile.in b/src/login/Makefile.in
index 033dad25b..7551eed5f 100644
--- a/src/login/Makefile.in
+++ b/src/login/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -92,7 +94,7 @@ login-server: ../../login-server@EXEEXT@
obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index e4f2d9953..fc58c9d70 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -109,7 +111,7 @@ map-server: ../../map-server@EXEEXT@
obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 11e93973d..77040d567 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
################ PLUGIN CONFIGURATION ##############################
# #
# When you add a plugin, add its name here: #
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index 2ee4e29b7..dea126e46 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -68,7 +70,7 @@ test_spinlock: $(TEST_SPINLOCK_DEPENDS) Makefile
obj/%.o: %.c $(TEST_SPINLOCK_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj
@echo " CC $<"
- @$(CC) @CFLAGS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in
index 07b03e334..127d3841b 100644
--- a/src/tool/Makefile.in
+++ b/src/tool/Makefile.in
@@ -1,6 +1,8 @@
# Copyright (c) Hercules Dev Team, licensed under GNU GPL.
# See the LICENSE file
+# @configure_input@
+
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -68,7 +70,7 @@ obj_all:
obj_all/%.o: %.c $(MAPCACHE_H) $(COMMON_H) $(CONFIG_H) $(LIBCONFIG_H) | obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing common object files
$(COMMON_D)/obj_all/common_mini.a: