Configuration files for FreeBSD, from Artem Kazakov <kazakov@gmail.com>

This commit is contained in:
Andrew Johnson
2006-11-14 19:40:47 +00:00
parent 20ede98a35
commit 2998cff567
13 changed files with 329 additions and 17 deletions

View File

@@ -0,0 +1,42 @@
#*************************************************************************
# Copyright (c) 2006 UChicago Argonne LLC, 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 is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
# $Id$
#
# This file is maintained by the EPICS community.
# Sites may override these definitions in CONFIG_SITE.Host.freebsd
ARCH_CLASS = freebsd
# 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_ -Dfreebsd
ARCH_DEP_LDLIBS += -lpthread -lreadline -lcurses -lrt
#Allows R3.13 built extensions to load R3.14 shared libs
SYS_DLL_LIBS_freebsd += pthread readline curses rt
# Runtime ldflags
RUNTIME_LIBS =$(EPICS_BASE)/lib/$(EPICS_HOST_ARCH)\
$(EPICS_EXTENSIONS)/lib/$(EPICS_HOST_ARCH)
RUNTIME_LDFLAGS = $(RUNTIME_LIBS:%=-Wl,-rpath,%)

View File

@@ -21,6 +21,7 @@ ARCH_solarisNonshared = solaris-sparc-nonshared
ARCH_solaris = solaris-sparc
ARCH_sun4 = sun4-sparc
ARCH_Linux = linux-x86
ARCH_freebsd = freebsd-x86
ARCH_WIN32 = win32-x86
ARCH_hp700 = hpux-m68k
ARCH_alpha = osf-alpha

View File

@@ -0,0 +1,11 @@
#*************************************************************************
# Copyright (c) 2006 UChicago Argonne LLC, 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 is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
#*************************************************************************
# $Id$
-include $(EPICS_BASE)/config/CONFIG_HOST_ARCH.freebsd

View File

@@ -1,37 +1,30 @@
#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
# Copyright (c) 2006 UChicago Argonne LLC, 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.
# EPICS BASE is distributed subject to a Software License Agreement found
# in the file LICENSE that is included with this distribution.
#*************************************************************************
#
# $Id$
#
# CONFIG_SITE - config file
# by Matthew Needes and Mike Bordua
# CONFIG_SITE - Global site configuration file
#
# This file is to be modified by the build system manager
# only.
#
# The host architecture performing the build, in the form
# <operating system>-<architecture>[-<alternate compiler>]
# <operating system>-<architecture>[-<toolset>]
#
# Currently Supporting:
# aix-ppc (HP compiler used for host builds)
# aix-ppc (IBM compiler used for host builds)
# aix-ppc-gnu (GNU compiler used for host builds)
# cygwin-x86 (cygwin compiler used for host builds)
# darwin-ppc
# darwin-x86
# darwin-ppc (PowerPC based Apple running OSX)
# darwin-x86 (Intel based Apple running OSX)
# darwin-ppcx86 (Universal binaries for both CPUs)
# hpux-parisc (HP compiler used for host builds)
# hpux-parisc-gnu (GNU compiler used for host builds)
# linux-ppc (GNU compiler used for host builds)
# linux-ppc-bgl
# linux-x86 (GNU compiler used for host builds)
# linux-x86_64 (GNU compiler used for host builds)
# linux-x86-borland (Borland C++ compiler used for host builds)
@@ -42,7 +35,7 @@
# solaris-x86 (sun compiler used for host builds)
# solaris-x86-gnu (GNU compiler used for host builds)
# win32-x86 (MS Visual C++ compiler used for host builds)
# win32-x86_mingw (MinGW compiler used for host builds)
# win32-x86-mingw (MinGW compiler used for host builds)
# win32-x86-borland (Borland C++ compiler used for host builds)
# win32-x86-cygwin (WIN32 API with cygwin GNU compiler used for host builds)
@@ -56,7 +49,7 @@
# EPICS_HOST_ARCH is a required environment variable
# Do not set EPICS_HOST_ARCH in this file.
# Use base/startup files to set EPICS_HOST_ARCH or
# set EPICS_HOST_ARCH on the GNU make command line.
# provide EPICS_HOST_ARCH on the GNU make command line.
# The cross-compiler architectures to build EPICS for
#

View File

@@ -0,0 +1,34 @@
# $Id$
#
# This file is maintained by the build community.
#
# Definitions for freebsd-x86_64 target builds
# Sites may override these definitions in CONFIG_SITE.Common.freebsd-x86_64
#-------------------------------------------------------
# Include definitions common to all freebsd targets
include $(CONFIG)/os/CONFIG.Common.freebsdCommon
ARCH_CLASS = x86_64
ARCH_DEP_CPPFLAGS += -D_X86_64_
ifeq ($(BUILD_CLASS),CROSS)
ifeq ($(EPICS_HOST_ARCH),freebsd-x86_64)
# Added for 386,486,... cross builds
CMPLR_PREFIX=
CROSS_INCLUDES=
CROSS_LDFLAGS=
# Use -w not -Wall
#WARN_CFLAGS_YES = -w
#WARN_CXXFLAGS_YES = -w
-include $(CONFIG)/os/CONFIG_SITE.Common.freebsd-x86_64
-include $(CONFIG)/os/CONFIG.freebsd-x86_64.freebsd-x86_64
-include $(CONFIG)/os/CONFIG_SITE.freebsd-x86_64.freebsd-x86_64
else
GNU_TARGET=i586-pc-freebsd-gnu
CMPLR_SUFFIX=
CMPLR_PREFIX=$(addsuffix -,$(GNU_TARGET))
endif
endif

View File

@@ -0,0 +1,31 @@
# $Id$
#
# This file is maintained by the build community.
#
# Definitions for freebsd target builds
# Sites may override these definitions in CONFIG_SITE.Common.freebsdCommon
#-------------------------------------------------------
# Include definitions common to all Unix targets
include $(CONFIG)/os/CONFIG.Common.UnixCommon
OS_CLASS = freebsd
CODE_CPPFLAGS = -D_REENTRANT
#POSIX_CPPFLAGS = -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500
POSIX_CPPFLAGS = -D_POSIX_THREADS
POSIX_LDLIBS = -lpthread
# -D_BSD_SOURCE for gethostname() in unistd.h as needed by cacChannelIO.cpp.
OP_SYS_CPPFLAGS += -D_BSD_SOURCE
OP_SYS_CPPFLAGS += -Dfreebsd
#OP_SYS_LDLIBS += -lrt
# Set runtime path for shared libraries
RUNTIME_LDFLAGS = $(SHRLIB_SEARCH_FULLPATHDIRS:%=-Wl,-rpath,%)
# Definitions used when COMMANDLINE_LIBRARY is READLINE
LDLIBS_READLINE = -lreadline -lcurses
GNU_LDLIBS_YES = -lgcc_pic

View File

@@ -0,0 +1,11 @@
# $Id$
#
# This file is maintained by the build community.
#
# Definitions for freebsd host builds
# Sites may override these definitions in CONFIG_SITE.freebsd.Common
#-------------------------------------------------------
# Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common

View File

@@ -0,0 +1,20 @@
# $Id$
#
# Definitions for freebsd-x86_64 host - freebsd-x86_64 target builds
# Sites may override these definitions in CONFIG_SITE.freebsd-x86_64.freebsd-x86_64
#-------------------------------------------------------
# Include common gnu compiler definitions
include $(CONFIG)/CONFIG.gnuCommon
GNU_DIR = /usr
GNU_LDLIBS_YES =
STATIC_LDFLAGS_YES= -Wl,-Bstatic
STATIC_LDFLAGS_NO=
STATIC_LDLIBS_YES= -Wl,-Bdynamic
STATIC_LDLIBS_NO=
SHRLIB_LDFLAGS += -shared -fPIC
LOADABLE_SHRLIB_LDFLAGS = -shared -fPIC

View File

@@ -18,6 +18,7 @@ ARCH_hp700 = hpux-parisc
ARCH_alpha = osf-alpha
ARCH_cygwin32 = cygwin-x86
ARCH_Borland = win32-x86-borland
ARCH_freebsd = freebsd-x86
ifndef EPICS_HOST_ARCH
ifdef HOST_ARCH

View File

@@ -0,0 +1,83 @@
/*************************************************************************\
* Copyright (c) 2006 UChicago Argonne LLC, 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 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
#ifndef osdSockH
#define osdSockH
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <sys/types.h>
#include <sys/param.h> /* for MAXHOSTNAMELEN */
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <netdb.h>
#include <unistd.h> /* close() and others */
#ifdef __cplusplus
}
#endif
#ifndef IPPORT_USERRESERVED
#define IPPORT_USERRESERVED 5000
#endif
typedef int SOCKET;
#define INVALID_SOCKET (-1)
#define SOCKERRNO errno
#define socket_ioctl(A,B,C) ioctl(A,B,C)
typedef int osiSockIoctl_t;
typedef socklen_t osiSocklen_t;
#define FD_IN_FDSET(FD) ((FD)<FD_SETSIZE)
#define SOCK_EWOULDBLOCK EWOULDBLOCK
#define SOCK_ENOBUFS ENOBUFS
#define SOCK_ECONNRESET ECONNRESET
#define SOCK_ETIMEDOUT ETIMEDOUT
#define SOCK_EADDRINUSE EADDRINUSE
#define SOCK_ECONNREFUSED ECONNREFUSED
#define SOCK_ECONNABORTED ECONNABORTED
#define SOCK_EINPROGRESS EINPROGRESS
#define SOCK_EISCONN EISCONN
#define SOCK_EALREADY EALREADY
#define SOCK_EINVAL EINVAL
#define SOCK_EINTR EINTR
#define SOCK_EPIPE EPIPE
#define SOCK_EMFILE EMFILE
#define SOCK_SHUTDOWN ESHUTDOWN
#define SOCK_ENOTSOCK ENOTSOCK
#define SOCK_EBADF EBADF
#ifndef SHUT_RD
# define SHUT_RD 0
#endif
#ifndef SHUT_WR
# define SHUT_WR 1
#endif
#ifndef SHUT_RDWR
# define SHUT_RDWR 2
#endif
#define ifreq_size(pifreq) (sizeof(pifreq->ifr_name))
#endif /*osdSockH*/

View File

@@ -0,0 +1,33 @@
/*************************************************************************\
* Copyright (c) 2002 The University of Saskatchewan
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* $Id$
*
* Author: Eric Norum
*/
#ifndef osdTimeh
#define osdTimeh
/*
* We need this include file since the POSIX version
* causes `struct timespec' to be defined in more than one place.
*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
epicsShareFunc void epicsShareAPI
convertDoubleToWakeTime(double timeout,struct timespec *wakeTime);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* ifndef osdTimeh */

View File

@@ -0,0 +1,20 @@
/*************************************************************************\
* Copyright (c) 2006 UChicago Argonne LLC, 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 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* osiFileName.h
* Author: Jeff Hill
*
*
*/
#ifndef osiFileNameH
#define osiFileNameH
#include "unixFileName.h"
#endif /* osiFileNameH */

View File

@@ -0,0 +1,32 @@
/*************************************************************************\
* Copyright (c) 2006 UChicago Argonne LLC, 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 is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
/*
* $Id$
*
*
* L O S A L A M O S
* Los Alamos National Laboratory
* Los Alamos, New Mexico 87545
*
* Copyright, 1986, The Regents of the University of California.
*
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*/
#include <unistd.h>
/*
* Some systems fail to provide prototypes of these functions.
* Others provide different prototypes.
* There seems to be no way to handle this automatically, so
* if you get compile errors, just make the appropriate changes here.
*/