# ********************************************************************** # # Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # ********************************************************************** # # This file is included by Make.rules when uname is Linux. # USE_SPARC_ASM = irrelevant MACHINE = $(shell uname -m) SUSE_i586 = $(shell grep i586 /etc/SuSE-release 2>/dev/null) ifneq ($(shell grep 'release 4' /etc/redhat-release 2>/dev/null),) NPTL_LIB = -L/usr/$(libsubdir)/nptl NPTL_FLAGS = -I/usr/include/nptl endif # # Default compiler is c++ (aka g++). # ifeq ($(CXX),) CXX = g++ endif ifeq ($(CXX),c++) CXX = g++ endif ifeq ($(CXX),clang++) GCC_COMPILER = yes endif ifeq ($(CXX:g++%=g++),g++) GCC_COMPILER = yes endif ifeq ($(GCC_COMPILER),yes) ifneq ($(SUSE_i586),) CXXARCHFLAGS += -march=i586 endif ifeq ($(CPP11), yes) CXXFLAGS += -std=c++0x endif ifeq ($(MACHINE),sparc64) # # We are an ultra, at least, and so have the atomic instructions # $(warning ===================================================================) $(warning Linux on SPARC is currently unsupported. The Ice team does not) $(warning maintain SPARC specific portions of the source code or build) $(warning system. Contact sales@zeroc.com if you wish to sponsor official) $(warning support.) $(warning ===================================================================) USE_SPARC_ASM = yes CXXARCHFLAGS += -mcpu=ultrasparc -pipe -Wno-deprecated -DUSE_SPARC_ASM endif ifeq ($(MACHINE),sparc) # # We are a sun4m or sun4c # On sun4m, there is a bug in some CPU/kernel/gcc configurations which # prevent us from using '-mcpu=v8' # $(warning ===================================================================) $(warning Linux on SPARC is currently unsupported. The Ice team does not) $(warning maintain SPARC specific portions of the source code or build) $(warning system. Contact sales@zeroc.com if you wish to sponsor official) $(warning support.) $(warning ===================================================================) USE_SPARC_ASM = no CXXARCHFLAGS += -mtune=v8 -pipe -Wno-deprecated -DICE_USE_MUTEX_SHARED endif # # Only use multilib -m32/-m64 options for amd64 arch, x32 arch can also run # in amd64 macines but doesn't use multilib, in this case MACHINE_TYPE will # be x86_64 and HOST_ARCH x32. # ifeq ($(HOST_ARCH),amd64) ifeq ($(LP64),yes) CXXARCHFLAGS += -m64 else CXXARCHFLAGS += -m32 endif endif CXXFLAGS += $(CXXARCHFLAGS) -fvisibility=hidden -Wall -Werror -pthread # If MAXWARN is set then enable extra warnings ifeq ($(MAXWARN),yes) CXXFLAGS += -Wextra -Wshadow GCC_GTEQ_460 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40600) ifeq ($(GCC_GTEQ_460),1) CXXFLAGS += -Wredundant-decls endif endif ifneq ($(GENPIC),no) CXXFLAGS += -fPIC endif ifeq ($(OPTIMIZE),yes) CXXFLAGS += -O2 -DNDEBUG else CXXFLAGS += -g endif # # Add RPATH to LDEXEFLAGS if embedded_runpath is set to yes # ifeq ($(embedded_runpath),yes) LOADER_PATH = \$$ORIGIN ifneq ($(embedded_runpath_prefix),) RPATH_DIR = $(embedded_runpath_prefix) endif ifeq ($(RPATH_DIR),) ifdef ice_src_dist RPATH_DIR = \$$ORIGIN/$(libdir) else RPATH_DIR = $(ice_dir)/$(libsubdir) endif endif # # Clear the rpath dir when doing a system install. # ifeq ($(prefix), $(usr_dir)) RPATH_DIR = endif # # Clear the rpath dir when building agains system install. # ifeq ($(ice_dir),$(usr_dir)) RPATH_DIR = endif # # Unless new_dtags is set to yes we use old style dtags, to add a RPATH # entry instead of RUNPATH entry, this allow the plug-ins to load without # need to set LD_LIBRARY_PATH # ifeq ($(new_dtags),yes) DTAGS = -Wl,--enable-new-dtags else DTAGS = -Wl,--disable-new-dtags endif ifneq ($(RPATH_DIR),) LDEXEFLAGS = $(DTAGS) -Wl,-rpath,$(RPATH_DIR) endif endif # # C++ run-time libraries, necessary for linking some shared libraries. # CXXLIBS = mkshlib = $(CXX) -shared $(LDFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4) mklib = ar cr $(1) $(2) rpathlink = -Wl,-rpath-link,$(1) LDPLATFORMFLAGS += -rdynamic endif ifeq ($(CXX),icpc) $(warning ===================================================================) $(warning Intel C++ is currently not supported. The Ice team does not) $(warning maintain Intel C++ specific portions of the source code or build) $(warning system. Contact sales@zeroc.com if you wish to sponsor official) $(warning support.) $(warning ===================================================================) CXXFLAGS = -D_REENTRANT ifneq ($(GENPIC),no) CXXFLAGS += -fPIC endif ifeq ($(OPTIMIZE),yes) CXXFLAGS += -O2 -DNDEBUG else CXXFLAGS += -g endif # # C++ run-time libraries, necessary for linking some shared libraries. # CXXLIBS = mkshlib = $(CXX) -shared $(LDFLAGS) -o $(1) -Wl,-h,$(2) $(3) $(4) -lpthread mklib = ar cr $(1) $(2) rpathlink = -Wl,-rpath-link,$(1) endif BASELIBS = -lIceUtil ifneq ($(NPTL_LIB),) CXXFLAGS += $(NPTL_FLAGS) BASELIBS := $(NPTL_LIB) $(BASELIBS) endif ICESSL_LIBS = $(OPENSSL_RPATH_LINK) -lIceSSL LIBS = $(BZIP2_RPATH_LINK) -lIce $(BASELIBS) CRYPT_OS_LIBS = -lcrypt ICEUTIL_OS_LIBS = -lrt $(OPENSSL_RPATH_LINK) -lcrypto ICE_OS_LIBS = -ldl PLATFORM_HAS_READLINE = yes