Port to FreeBSD

This commit is contained in:
Raymond Pasco 2015-06-18 20:52:38 -07:00
parent ea7bd8e695
commit 7fdcc66815
4 changed files with 21 additions and 1 deletions

View File

@ -36,10 +36,17 @@ BIN=bin
LIB=$(shell pwd)/urb
RM=rm -f
ifneq ($(UNAME),FreeBSD)
CC=gcc
CXX=g++
CXXFLAGS=$(CFLAGS)
CLD=g++ -O3 -L/usr/local/lib -L/opt/local/lib
else
CC=cc
CXX=c++
CXXFLAGS=$(CFLAGS)
CLD=c++ -O3 -L/usr/local/lib -L/opt/local/lib
endif
ifeq ($(OS),osx)
COSFLAGS=-fno-diagnostics-fixit-info

View File

@ -55,6 +55,10 @@ urbit depends on:
sudo port install git gmp libsigsegv openssl autoconf automake cmake
#### FreeBSD
pkg install gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
Although `automake`/`autoconf`/`libtool` are generally installed by
default, some have reported needing to uninstall and reinstall those
three packages, at least with Homebrew. Your mileage may vary.
@ -74,6 +78,8 @@ Just run `make`:
make
(On FreeBSD, use `gmake` instead.)
Run
---

View File

@ -146,10 +146,12 @@
/* Sync
*/
# if defined(U3_OS_linux) || defined(U3_OS_bsd)
# if defined(U3_OS_linux)
# define c3_sync(fd) (fdatasync(fd))
# elif defined(U3_OS_osx)
# define c3_sync(fd) (fcntl(fd, F_FULLFSYNC, 0))
# elif defined(U3_OS_bsd)
# define c3_sync(fd) (fsync(fd))
# else
# error "port: sync"
# endif

View File

@ -1,6 +1,11 @@
SHELL = sh
UNAME = $(shell uname)
ifneq ($(UNAME),FreeBSD)
CC = gcc
else
CC = cc
endif
FLAGS = -c -fPIC -Iinclude/
CFLAGS = --pedantic -Wall -Wextra -march=native -std=gnu99
INCLUDE = include/anachronism