#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
#     National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
#     Operator of Los Alamos National Laboratory.
# EPICS BASE Versions 3.13.7
# and higher are distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution. 
#*************************************************************************
# CONFIG.Host.Linux
#
#  This file is maintained by the EPICS community.
#  Sites may override these definitions in CONFIG_SITE.Host.Linux
 
ARCH_CLASS = Linux

# Include definitions common to all Unix archs
include $(EPICS_BASE)/config/CONFIG.Host.UnixCommon

AR = ar -rc
ARCMD = $(AR) $@
RANLIB = ranlib -t

ANSI=GCC
CPLUSPLUS=G++

GCC_SHRLIB_LDFLAGS_YES +=  -Wl,-soname,$@
G++_SHRLIB_LDFLAGS_YES +=  -Wl,-soname,$@

OP_SYS_CFLAGS += -D_BSD_SOURCE

ARCH_DEP_CFLAGS = -D_X86_ -Dlinux
ARCH_DEP_LDLIBS += -lpthread -lreadline -lcurses -lrt

#Allows R3.13 built extensions to load R3.14 shared libs
SYS_DLL_LIBS_Linux += pthread readline curses rt

#glibc FAQ
#	"_GNU_SOURCE:  glibc does not make the GNU extensions available 
#	automatically.  If a program depends on the GNU extensions or some other
#	non-standard functionality, it is necessary to compile it with the C 
#	compiler option -D_GNU_SOURCE, or better to put #define _GNU_SOURCE at
#	the beginning of your source files, before any C library header files 
#	are included.  This difference normally manifests itself in the form
#	of missing prototypes and/or data type definitions.  Thus, if you get
#	such errors, the first thing you should do is try defining _GNU_SOURCE
#	and see if that makes the problem go away."
#ARCH_DEP_CFLAGS += -D_GNU_SOURCE

# Runtime ldflags
RUNTIME_LIBS =$(EPICS_BASE)/lib/$(EPICS_HOST_ARCH)\
 $(EPICS_EXTENSIONS)/lib/$(EPICS_HOST_ARCH)
RUNTIME_LDFLAGS = $(RUNTIME_LIBS:%=-Wl,-rpath,%)


