#
# $Id: icc.config 580483 2007-09-28 20:55:52Z sebor $
#
# configuration file for Intel C++
#
##############################################################################
#
# Licensed to the Apache Software  Foundation (ASF) under one or more
# contributor  license agreements.  See  the NOTICE  file distributed
# with  this  work  for  additional information  regarding  copyright
# ownership.   The ASF  licenses this  file to  you under  the Apache
# License, Version  2.0 (the  "License"); you may  not use  this file
# except in  compliance with the License.   You may obtain  a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the  License is distributed on an  "AS IS" BASIS,
# WITHOUT  WARRANTIES OR CONDITIONS  OF ANY  KIND, either  express or
# implied.   See  the License  for  the  specific language  governing
# permissions and limitations under the License.
#
# Copyright 1999-2007 Rogue Wave Software, Inc.
#
##############################################################################

CXX = icc

ifeq ($(shell uname -m),ia64)
# check if icc works (prior to 8.0 the name of the IA64 compiler was ecc
  ifneq ($(shell $(CXX) -v >/dev/null 2>&1 && echo $$?),0)
    CXX = ecc
  endif
endif

CCVER          := $(shell $(CXX) -V foo.c 2>&1 | sed -n "s/.*Version *\([0-9.]*\).*/\1/p")
CXX_MAJOR      := $(shell echo "$(CCVER)" | sed "s/^\([1-9][0-9]*\).*/\1/")
CXX_MINOR      := $(shell echo "$(CCVER)" | sed "s/[1-9]*\.\([0-9]*\).*/\1/")


CPPFLAGS        = -I$(TOPDIR)/include/ansi

WARNFLAGS       = -w1
PHWARNFLAGS     =
DEPENDFLAGS     = -M
PICFLAGS        = -fpic
PRELINKFLAGS    =

ICCDIR          = `which $(CXX) | sed 's:bin/$(CXX):lib:'`

LDSOFLAGS       = -shared

# -cxxlib-nostd, present in all compilers since 8.1, will be documented in 10.x
ifeq ($(shell [ $(CXX_MAJOR) -gt 8 -o $(CXX_MAJOR) -eq 8 -a $(CXX_MINOR) -ge 1 ]), 0)
  LD            = $(CXX) -no_cpprt $(ICCDIR)/crtxi.o
  CXXFLAGS      = -Xc -no_cpprt
  LDFLAGS       =
  LDLIBS        = -Bstatic -lcxa -lunwind -Bdynamic $(ICCDIR)/crtxn.o
else
  LD            = $(CXX)
  CXXFLAGS      = -cxxlib-nostd
  LDFLAGS       = -cxxlib-nostd
  LDLIBS        = -lcxaguard -lsupc++
endif


# The flag(s) to use to embed a library search path into generated executables.
RPATH           = -Wl,-R

# debug/optimization options
DEBUG_CXXFLAGS  = -g
DEBUG_CPPFLAGS  =

OPTMZ_CXXFLAGS  = -O2
OPTMZ_CPPFLAGS  =

# shared/archive library options
SHARED_CXXFLAGS =
SHARED_CPPFLAGS =
SHARED_LDFLAGS  = 

STATIC_CXXFLAGS =
STATIC_CPPFLAGS =
STATIC_LDFLAGS  =

# compiler and linker flags for thread safety
MULTI_CPPFLAGS_POSIX   = -D_REENTRANT
MULTI_CPPFLAGS_SOLARIS = 
MULTI_CPPFLAGS_DCE     = 

MULTI_LDFLAGS_POSIX    = -lpthread
MULTI_LDFLAGS_SOLARIS  = 
MULTI_LDFLAGS_DCE      = 

# POSIX
MULTI_CPPFLAGS = $(MULTI_CPPFLAGS_POSIX)
MULTI_LDFLAGS  = $(MULTI_LDFLAGS_POSIX)

SINGL_CPPFLAGS  =
SINGL_LDFLAGS   =
