diff --git a/amxmodx/Makefile b/amxmodx/Makefile index adee7a18..f2ec112e 100755 --- a/amxmodx/Makefile +++ b/amxmodx/Makefile @@ -6,9 +6,9 @@ MM_ROOT = ../metamod/metamod ### EDIT BELOW FOR OTHER PROJECTS ### -OPT_FLAGS = -O2 -funroll-loops -s -fomit-frame-pointer -pipe +OPT_FLAGS = -O2 -fno-strict-aliasing -funroll-loops -s -fomit-frame-pointer -pipe DEBUG_FLAGS = -g -ggdb3 -CPP = gcc +CPP = gcc-4.1 NAME = amxmodx BIN_SUFFIX_32 = mm_i386.so @@ -26,6 +26,12 @@ LINK = /lib/libstdc++.a INCLUDE = -I. -I$(HLSDK) -I$(HLSDK)/dlls -I$(HLSDK)/engine -I$(HLSDK)/game_shared -I$(HLSDK)/game_shared \ -I$(MM_ROOT) -Lzlib -I$(HLSDK)/common +GCC_VERSION := $(shell $(CPP) -dumpversion >&1 | cut -b1) + +ifeq "$(GCC_VERSION)" "4" + OPT_FLAGS += -fvisibility=hidden -fvisibility-inlines-hidden +endif + ifeq "$(DEBUG)" "true" BIN_DIR = Debug CFLAGS = $(DEBUG_FLAGS) diff --git a/amxmodx/modules.h b/amxmodx/modules.h index 5441a1b6..85b7a011 100755 --- a/amxmodx/modules.h +++ b/amxmodx/modules.h @@ -38,7 +38,7 @@ #ifndef __linux__ #define DLLEXPORT __declspec(dllexport) #else - #define DLLEXPORT + #define DLLEXPORT __attribute__((visibility("default"))) #define WINAPI #endif