# SUNMP use Solaris. Solaris on monoprocessors is returned as SUN4SOL2

SOLARIS_VERSION=$(shell $(CIAOSRC)/etc/which_solaris_version)

# Threads and locks in Solaris
ifeq ($(USE_THREADS),yes)
ifeq ($(SOLARIS_VERSION),pre_7)
    LD_THREAD_LIB=-lpthread
else
    LD_THREAD_LIB=-lpthread -lrt
endif
ifeq ($(USE_POSIX_LOCKS),yes)
    THREAD_FLAG=-D_REENTRANT -DTHREADS
    LD_LOCK_LIB=-lposix4
else
    THREAD_FLAG=-D_REENTRANT -DTHREADS
    LD_LOCK_LIB=
endif
else
    LD_THREAD_LIB=
    THREAD_FLAG=
    LD_LOCK_LIB=
endif

FOREIGN_FILES_FLAG=-DFOREIGN_FILES

#  Local C compiler
LCC=$(CC)

# C compiler
CC=gcc

# Linker
LD=ld

# C compiler options for generating shared libraries code
CCSHARED=

# Linker specific options
ifeq ($(DEBUG_LEVEL),profile)
    LDFLAGS=-pg
else
    LDFLAGS=
endif

# Linker options for shared objects
LDSHARED=-G

# Linker options to combine objects
LDCOMBINE=-r

# Include path at compile time
LDRPATH=-R

# Extension of shared libraries
SOSUFFIX=.so

## Changed these (DCG)
# This is (hopefully) for a modular system using POSIX threads
LIBS=-ldl -lm -lnsl $(LD_THREAD_LIB) $(LD_LOCK_LIB) $(DEBUG_LIBS)

STAT_LIBS=-lsocket

ARCHNAME=Sparc64

# Architecture-specific flags

ARCHFLAGS=-m32

# Operating system version
OSNAME=Solaris

# Memory management primitives
# See engine/configure.c: HAS_MMAP includes USE_OWN_MALLOC
MEM_MNG_FLAG=-DHAS_MMAP -DANONYMOUS_MMAP

# How to install an make directories
MKDIR="mkdir -p"
INSTALL=/usr/bin/cp

# Making etags
ETAGS=etags -t *.[ch]
DEFAULTYPE=dyn

# We are not using strict-aliasing to avoid problems in SolarisSparc64

ifeq ($(OPTIM_LEVEL),optimized)
     OPTIM_FLAGS=-O2 -Wall -fno-strict-aliasing
endif
