Updated code to compile on GNU/Linux 5.15.0-75-generic #82-Ubuntu SMP and Code Sourcery MIPS toolchain

This commit is contained in:
David Gartner
2023-07-06 15:58:16 -06:00
parent 72ca88362a
commit a8ad228599
18 changed files with 167 additions and 42 deletions

View File

@@ -3,7 +3,7 @@ BIN = config
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
CXX = g++
CXXFLAGS = -Wall -O
CXXFLAGS = -Wall -O -m32
all: .depend $(BIN)

View File

@@ -55,7 +55,7 @@ DEFS += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=2 -DLED_KERNEL_INVER
DEFS += -DLED_TTY_PORT=TRISE -DLED_TTY_PIN=3 -DLED_TTY_INVERT
DEPFLAGS = -MT $@ -MD -MP -MF .deps/$*.dep
CFLAGS = -O $(DEFS) $(DEPFLAGS)
CFLAGS = -O $(DEFS) $(DEPFLAGS) -m32
ASFLAGS = $(DEFS) $(DEPFLAGS)
CC = $(GCCPREFIX)gcc -EL -g -mips32r2

View File

@@ -1,5 +1,5 @@
CC = ${HOSTCC}gcc -g
CFLAGS = -O -Wall
CFLAGS = -O -Wall -m32
DESTDIR = /usr/local
OBJS = elf2aout.o
PROG = elf2aout
@@ -15,7 +15,7 @@ clean:
rm -f *~ *.o *.lst *.dis $(PROG)
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(PROG).exe: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

View File

@@ -1,5 +1,5 @@
CC = gcc -g
CFLAGS = -O -Wall
CFLAGS = -O -Wall -m32
DESTDIR = /usr/local
OBJS = fsutil.o superblock.o block.c inode.o create.o check.o \
file.o mount.o manifest.o
@@ -29,7 +29,7 @@ clean:
rm -rf *~ *.o *.lst *.dis $(PROG) $(PROG).dSYM
$(PROG): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
$(CC) -m32 $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
root.bin: $(PROG)
./$(PROG) -n16384 -s2048 $@

View File

@@ -1,4 +1,4 @@
CC = gcc -g
CC = gcc -g -m32
CFLAGS = -O -Wall
DESTDIR = /usr/local
OBJS = ice2aout.o

View File

@@ -1,5 +1,5 @@
CC = gcc -g
CFLAGS = -O -Wall -Werror
CC = gcc -g -m32
CFLAGS = -O -Wall -Werror
YACC = byacc -d
DESTDIR = /usr/local
OBJS = config.o main.o lang.o mkioconf.o mkmakefile.o mkswapconf.o

View File

@@ -125,15 +125,15 @@ struct config {
/*
* Config has a global notion of which architecture is being used.
*/
int arch;
char *archname;
extern int arch;
extern char *archname;
#define ARCH_PIC32 1
/*
* For each architecture, a set of CPU's may be specified as supported.
* These and the options (below) are put in the C flags in the makefile.
*/
struct cputype {
extern struct cputype {
char *cpu_name;
struct cputype *cpu_next;
} *cputype;
@@ -143,7 +143,7 @@ struct cputype {
* but which may also specify values for the options.
* A separate set of options may be defined for make-style options.
*/
struct opt {
extern struct opt {
char *op_name;
char *op_value;
struct opt *op_next;
@@ -152,30 +152,30 @@ struct opt {
/*
* Mapping of signal names to pins.
*/
struct signal {
extern struct signal {
char *sig_name;
int sig_pin;
int sig_invert;
struct signal *sig_next;
} *siglist;
char *board;
char *ldscript;
extern char *board;
extern char *ldscript;
int do_trace;
extern int do_trace;
struct device *dtab;
extern struct device *dtab;
char errbuf[80];
int yyline;
extern char errbuf[];
extern int yyline;
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
int zone, hadtz;
int dst;
int debugging;
extern int zone, hadtz;
extern int dst;
extern int debugging;
int maxusers;
extern int maxusers;
#define eq(a,b) (!strcmp(a,b))

View File

@@ -99,14 +99,35 @@
* @(#)config.y 8.1 (Berkeley) 6/6/93
*/
#include <sys/sysmacros.h> //definition for major(), minor() and makedev()
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <sys/stat.h>
struct device cur;
struct device *curp = 0;
struct device *dtab;
struct file_list **confp;
struct opt *opt, *mkopt;
struct signal *siglist;
struct cputype *cputype;
char *temp_id;
char *val_id;
char *archname;
char errbuf[80];
char *board;
char *ldscript;
int arch;
int do_trace;
int maxusers;
int yyline;
int dst;
int hadtz;
int zone;
int yylex(void);
int finddev(dev_t dev);

View File

@@ -38,6 +38,9 @@
#include "y.tab.h"
#include "config.h"
struct file_list *conf_list;
int debugging;
/*
* Config builds a set of files for building a UNIX
* system given a description of the desired system.
@@ -72,7 +75,7 @@ usage: fputs("usage: kconfig [-gp] sysname\n", stderr);
dtab = NULL;
confp = &conf_list;
compp = &comp_list;
//compp = &comp_list;
if (yyparse())
exit(3);

View File

@@ -40,6 +40,8 @@
#include "y.tab.h"
#include "config.h"
struct file_list *ftab;
#define next_word(fp, wd) \
{ register char *word = get_word(fp); \
if (word == (char *)EOF) \
@@ -425,7 +427,7 @@ void makefile()
read_files();
strcpy(line, "../Makefile.kconf");
//strcat(line, archname);
strcat(line, archname);
ifp = fopen(line, "r");
if (ifp == 0) {
perror(line);

View File

@@ -34,6 +34,9 @@
/*
* Build a swap configuration file.
*/
#include <sys/sysmacros.h> //definitions for makedev(), major(), minor()
#include "config.h"
#include <unistd.h>

View File

@@ -1,5 +1,5 @@
LOBJS=fs.o util.o fops.o set.o
CFLAGS=-Wall -Werror -ggdb3
CFLAGS=-Wall -Werror -ggdb3 -m32
PROGS=umkfs umkdir uls uchmod uchown uchgrp ulogin ucd ucat
POBJS=umkfs.o umkdir.o uls.o uchmod.o uchown.o uchgrp.o ulogin.o ucd.o ucat.o
LDFLAGS=-L. -lufs -ggdb3

View File

@@ -1,11 +1,11 @@
OBJS = mkrd.o
BIN = mkrd
CFLAGS = -Wall -Werror -O
CFLAGS = -m32 -Wall -Werror -O
all: $(BIN)
$(BIN): $(OBJS)
$(CC) -o $@ $< $(LIBS) $(LDFLAGS)
$(CC) -m32 -o $@ $< $(LIBS) $(LDFLAGS)
clean:
@rm -f $(BIN) $(OBJS)

View File

@@ -15,8 +15,8 @@ CFLAGS = -DSIM_PIC32 -DPIC32MX7 -DMAX32
# UBW32 with UART console
#CFLAGS = -DSIM_PIC32 -DPIC32MX7 -DUBW32
CC = gcc -g
CFLAGS += -Wall -Werror -MT $@ -MD -MP -MF .deps/$*.dep
CC = gcc -g -m32
CFLAGS += -Wall -MT $@ -MD -MP -MF .deps/$*.dep
LIBS = -lpthread
CFLAGS += $(shell pkg-config libelf --cflags)