RetroBSD now builds on FreeBSD.

This commit is contained in:
Brian Callahan
2016-06-13 06:47:48 -04:00
parent 148bb1cac6
commit d048ee200e
11 changed files with 42 additions and 6 deletions

View File

@@ -38,6 +38,7 @@
# include <stdio.h> # include <stdio.h>
# include <string.h> # include <string.h>
# include <stdlib.h> # include <stdlib.h>
# include <time.h>
# include <errno.h> # include <errno.h>
# include <getopt.h> # include <getopt.h>
#else #else

View File

@@ -97,7 +97,7 @@ typedef struct {
/* Header structure internal format. */ /* Header structure internal format. */
typedef struct { typedef struct {
off_t size; /* size of the object in bytes */ off_t size; /* size of the object in bytes */
long date; /* date */ time_t date; /* date */
int lname; /* size of the long name in bytes */ int lname; /* size of the long name in bytes */
int gid; /* group */ int gid; /* group */
int uid; /* owner */ int uid; /* owner */

View File

@@ -2,7 +2,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/termios.h> #include <termios.h>
#include <strings.h> #include <strings.h>
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -33,6 +33,17 @@ ifndef MIPS_GCC_PREFIX
endif endif
endif endif
# Generic MIPS toolchain on *BSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
# Maybe you can install it from packages one day too.
ifndef MIPS_GCC_PREFIX
ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mips-elf-gcc))
MIPS_GCC_PREFIX = /usr/local/mips-elf/bin/mips-elf-
endif
endif
# Mentor Sourcery CodeBench Lite toolchain # Mentor Sourcery CodeBench Lite toolchain
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ifndef MIPS_GCC_PREFIX ifndef MIPS_GCC_PREFIX

View File

@@ -41,6 +41,19 @@ ifeq (/usr/local/mips-gcc-4.8.1/bin/mips-elf-gcc,$(wildcard /usr/local/mips-gcc-
endif endif
endif endif
# Generic MIPS toolchain on *BSD
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can build it from sources, as described on page
# http://retrobsd.org/wiki/doku.php/doc/toolchain-mips
# Maybe you can install it from packages one day too.
ifndef GCCPREFIX
ifeq (/usr/local/mips-elf/bin/mips-elf-gcc,$(wildcard /usr/local/mips-elf/bin/mips-elf-gcc))
GCCPREFIX = /usr/local/mips-elf/bin/mips-elf-
LDFLAGS =
INCLUDES =
endif
endif
# Mentor Sourcery CodeBench Lite toolchain # Mentor Sourcery CodeBench Lite toolchain
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# You can download a Linux or Windows binary package from # You can download a Linux or Windows binary package from

View File

@@ -2,6 +2,7 @@
BIN = config BIN = config
SRCS = main.cpp config.cpp mapping.cpp device.cpp cluster.cpp util.cpp core.cpp gstore.cpp SRCS = main.cpp config.cpp mapping.cpp device.cpp cluster.cpp util.cpp core.cpp gstore.cpp
OBJS = main.o config.o mapping.o device.o cluster.o util.o core.o gstore.o OBJS = main.o config.o mapping.o device.o cluster.o util.o core.o gstore.o
CXX = g++
CXXFLAGS = -Wall -O CXXFLAGS = -Wall -O
all: .depend $(BIN) all: .depend $(BIN)

View File

@@ -22,6 +22,7 @@
* this software. * this software.
*/ */
#include <stdio.h> #include <stdio.h>
#include <time.h>
#include "bsdfs.h" #include "bsdfs.h"
extern int verbose; extern int verbose;

View File

@@ -77,7 +77,7 @@ typedef struct {
unsigned ilock; /* lock during I list manipulation */ unsigned ilock; /* lock during I list manipulation */
unsigned fmod; /* super block modified flag */ unsigned fmod; /* super block modified flag */
unsigned ronly; /* mounted read-only flag */ unsigned ronly; /* mounted read-only flag */
long utime; /* current date of last update */ time_t utime; /* current date of last update */
unsigned tfree; /* total free blocks */ unsigned tfree; /* total free blocks */
unsigned tinode; /* total free inodes */ unsigned tinode; /* total free inodes */
char fsmnt [MAXMNTLEN]; /* ordinary file mounted on */ char fsmnt [MAXMNTLEN]; /* ordinary file mounted on */
@@ -127,9 +127,9 @@ typedef struct {
#define SYS_IMMUTABLE 0x0200 /* file may not be changed */ #define SYS_IMMUTABLE 0x0200 /* file may not be changed */
#define SYS_APPEND 0x0400 /* writes to file may only append */ #define SYS_APPEND 0x0400 /* writes to file may only append */
long atime; /* time last accessed */ time_t atime; /* time last accessed */
long mtime; /* time last modified */ time_t mtime; /* time last modified */
long ctime; /* time created */ time_t ctime; /* time created */
} fs_inode_t; } fs_inode_t;
typedef struct { typedef struct {

View File

@@ -23,6 +23,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <time.h>
#include "bsdfs.h" #include "bsdfs.h"
extern int verbose; extern int verbose;

View File

@@ -131,10 +131,17 @@ static void add_entry (manifest_t *m, int filetype, char *path, char *link,
/* /*
* Compare two entries of file traverse scan. * Compare two entries of file traverse scan.
*/ */
#ifdef __FreeBSD__
static int ftsent_compare (const FTSENT * const *a, const FTSENT *const *b)
{
return strcmp((*a)->fts_name, (*b)->fts_name);
}
#else
static int ftsent_compare (const FTSENT **a, const FTSENT **b) static int ftsent_compare (const FTSENT **a, const FTSENT **b)
{ {
return strcmp((*a)->fts_name, (*b)->fts_name); return strcmp((*a)->fts_name, (*b)->fts_name);
} }
#endif
/* /*
* Scan the directory and create a manifest from it's contents. * Scan the directory and create a manifest from it's contents.

View File

@@ -13,6 +13,7 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#include <sys/signal.h> #include <sys/signal.h>
#include <sys/socket.h>
#include <string.h> #include <string.h>
#include "vm.h" #include "vm.h"