Commit 792b97e6 authored by deuce's avatar deuce
Browse files

Use machine for lib dirs instead of os

parent e7b1979b
...@@ -15,13 +15,13 @@ else ...@@ -15,13 +15,13 @@ else
JS_CFLAGS += -I$(XPDEV)../../include/mozilla/js JS_CFLAGS += -I$(XPDEV)../../include/mozilla/js
endif endif
ifndef JSLIBDIR ifndef JSLIBDIR
JSLIBDIR := $(XPDEV)../../lib/mozilla/js/$(os).$(BUILD) JSLIBDIR := $(XPDEV)../../lib/mozilla/js/$(machine).$(BUILD)
endif endif
ifndef JSLIB ifndef JSLIB
JSLIB := js JSLIB := js
endif endif
ifndef NSPRDIR ifndef NSPRDIR
NSPRDIR := $(XPDEV)../../lib/mozilla/nspr/$(os).$(BUILD) NSPRDIR := $(XPDEV)../../lib/mozilla/nspr/$(machine).$(BUILD)
endif endif
JS_LDFLAGS += -L$(JSLIBDIR) -l$(JSLIB) JS_LDFLAGS += -L$(JSLIBDIR) -l$(JSLIB)
#The following is needed for nspr support on Linux #The following is needed for nspr support on Linux
......
...@@ -43,7 +43,10 @@ CFLAGS += -I$(XPDEV) ...@@ -43,7 +43,10 @@ CFLAGS += -I$(XPDEV)
CFLAGS += $(UIFC_CFLAGS) CFLAGS += $(UIFC_CFLAGS)
ifndef bcc ifndef bcc
LDFLAGS += -lm -lutil LDFLAGS += -lm
ifneq ($(os),sunos)
LDFLAGS += -lutil
endif
endif endif
ifeq ($(os),sunos) # Solaris ifeq ($(os),sunos) # Solaris
...@@ -80,6 +83,7 @@ $(SBBSLIB) : $(SBBS) ...@@ -80,6 +83,7 @@ $(SBBSLIB) : $(SBBS)
$(QUIET)touch -- '$(SBBSLIB)' $(QUIET)touch -- '$(SBBSLIB)'
ifneq ($(os),darwin) ifneq ($(os),darwin)
ifneq ($(os),sunos)
SBBSLDFLAGS := $(LDFLAGS) -rpath-link ./$(LIBODIR) -rpath ./ SBBSLDFLAGS := $(LDFLAGS) -rpath-link ./$(LIBODIR) -rpath ./
#LDFLAGS += -Wl,-rpath-link,./$(LIBODIR),-rpath,./ #LDFLAGS += -Wl,-rpath-link,./$(LIBODIR),-rpath,./
LDFLAGS += -Xlinker -rpath LDFLAGS += -Xlinker -rpath
...@@ -93,6 +97,7 @@ LDFLAGS += -Xlinker -rpath-link ...@@ -93,6 +97,7 @@ LDFLAGS += -Xlinker -rpath-link
LDFLAGS += -Xlinker $(NSPRDIR) LDFLAGS += -Xlinker $(NSPRDIR)
endif endif
endif endif
endif
CON_OBJS = $(LIBODIR)/sbbscon.o $(LIBODIR)/conwrap.o \ CON_OBJS = $(LIBODIR)/sbbscon.o $(LIBODIR)/conwrap.o \
$(LIBODIR)/sbbs_ini.o $(LIBODIR)/sbbs_ini.o
......
...@@ -17,17 +17,23 @@ ...@@ -17,17 +17,23 @@
#USE_CURSES = 1 # Curses version of UIFC #USE_CURSES = 1 # Curses version of UIFC
#USE_FLTK = 1 # Windowed version of UIFC #USE_FLTK = 1 # Windowed version of UIFC
USE_UIFC32 := 1 # New 32-bit version of UIFC USE_UIFC32 := 1 # New 32-bit version of UIFC
UIFC = ../../uifc/ UIFC_SRC = ../../uifc/
XPDEV = ../../xpdev/ XPDEV = ../../xpdev/
NEED_UIFC := 1 NEED_UIFC := 1
include $(XPDEV)/Common.gmake include $(XPDEV)/Common.gmake
include $(UIFC)/Common.gmake include $(UIFC_SRC)/Common.gmake
CFLAGS += -I../
ifdef STATIC ifdef STATIC
LDFLAGS += -static LDFLAGS += -static
endif endif
ifeq ($(os),sunos)
LDFLAGS += -lsocket -lnsl
endif
$(SBBSINST): $(OBJS) $(SBBSINST): $(OBJS)
ifdef USE_DIALOG ifdef USE_DIALOG
$(QUIET)$(MAKE) --no-print-directory -C ../../libdialog $(QUIET)$(MAKE) --no-print-directory -C ../../libdialog
......
...@@ -12,4 +12,5 @@ OBJS = $(LIBODIR)$(SLASH)sbbsinst.$(OFILE)\ ...@@ -12,4 +12,5 @@ OBJS = $(LIBODIR)$(SLASH)sbbsinst.$(OFILE)\
$(LIBODIR)$(SLASH)genwrap.$(OFILE)\ $(LIBODIR)$(SLASH)genwrap.$(OFILE)\
$(LIBODIR)$(SLASH)dirwrap.$(OFILE)\ $(LIBODIR)$(SLASH)dirwrap.$(OFILE)\
$(LIBODIR)$(SLASH)filewrap.$(OFILE)\ $(LIBODIR)$(SLASH)filewrap.$(OFILE)\
$(LIBODIR)$(SLASH)httpio.$(OFILE) $(LIBODIR)$(SLASH)httpio.$(OFILE)\
$(LIBODIR)$(SLASH)uifcx.$(OFILE)
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
#ifdef __unix__ #ifdef __unix__
#include <sys/un.h> #include <sys/un.h>
#ifndef SUN_LEN
#define SUN_LEN(su) \
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif
#endif #endif
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -4004,7 +4008,7 @@ void DLLCALL bbs_thread(void* arg) ...@@ -4004,7 +4008,7 @@ void DLLCALL bbs_thread(void* arg)
#ifdef __unix__ // unix-domain spy sockets #ifdef __unix__ // unix-domain spy sockets
for(i=first_node;i<=last_node;i++) { for(i=first_node;i<=last_node;i++) {
if((uspy_listen_socket[i-1]=socket(PF_LOCAL,SOCK_STREAM,0))==INVALID_SOCKET) if((uspy_listen_socket[i-1]=socket(PF_UNIX,SOCK_STREAM,0))==INVALID_SOCKET)
lprintf(LOG_ERR,"Node %d !ERROR %d creating local spy socket" lprintf(LOG_ERR,"Node %d !ERROR %d creating local spy socket"
, i, errno); , i, errno);
else { else {
...@@ -4013,7 +4017,7 @@ void DLLCALL bbs_thread(void* arg) ...@@ -4013,7 +4017,7 @@ void DLLCALL bbs_thread(void* arg)
startup->socket_open(startup->cbdata,TRUE); startup->socket_open(startup->cbdata,TRUE);
} }
uspy_addr.sun_family=AF_LOCAL; uspy_addr.sun_family=AF_UNIX;
if((unsigned int)snprintf(str,sizeof(uspy_addr.sun_path), if((unsigned int)snprintf(str,sizeof(uspy_addr.sun_path),
"%slocalspy%d.sock", startup->temp_dir, i) "%slocalspy%d.sock", startup->temp_dir, i)
>=sizeof(uspy_addr.sun_path)) >=sizeof(uspy_addr.sun_path))
......
...@@ -1024,6 +1024,11 @@ BOOL md(char *path); ...@@ -1024,6 +1024,11 @@ BOOL md(char *path);
/* file.cpp */ /* file.cpp */
BOOL filematch(char *filename, char *filespec); BOOL filematch(char *filename, char *filespec);
/* sbbscon.c */
#if defined(__unix__) && defined(NEEDS_DAEMON)
int daemon(int nochdir, int noclose);
#endif
#endif /* SBBS */ #endif /* SBBS */
extern const char* wday[]; /* abbreviated weekday names */ extern const char* wday[]; /* abbreviated weekday names */
......
...@@ -68,45 +68,100 @@ ...@@ -68,45 +68,100 @@
#include <termios.h> #include <termios.h>
#if defined(__QNX__) /*
/* * Control Character Defaults
* Control Character Defaults */
*/ #ifndef CTRL
#define CTRL(x) (x&037) #define CTRL(x) (x&037)
#endif
#ifndef CEOF
#define CEOF CTRL('d') #define CEOF CTRL('d')
#endif
#ifndef CEOL
#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */ #define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
#endif
#ifndef CERASE
#define CERASE 0177 #define CERASE 0177
#endif
#ifndef CERASE2
#define CERASE2 CTRL('h') #define CERASE2 CTRL('h')
#endif
#ifndef CINTR
#define CINTR CTRL('c') #define CINTR CTRL('c')
#endif
#ifndef CSTATUS
#define CSTATUS CTRL('t') #define CSTATUS CTRL('t')
#endif
#ifndef CKILL
#define CKILL CTRL('u') #define CKILL CTRL('u')
#endif
#ifndef CMIN
#define CMIN 1 #define CMIN 1
#endif
#ifndef CQUIT
#define CQUIT 034 /* FS, ^\ */ #define CQUIT 034 /* FS, ^\ */
#endif
#ifndef CSUSP
#define CSUSP CTRL('z') #define CSUSP CTRL('z')
#endif
#ifndef CTIME
#define CTIME 0 #define CTIME 0
#endif
#ifndef CDSUSP
#define CDSUSP CTRL('y') #define CDSUSP CTRL('y')
#endif
#ifndef CSTART
#define CSTART CTRL('q') #define CSTART CTRL('q')
#endif
#ifndef CSTOP
#define CSTOP CTRL('s') #define CSTOP CTRL('s')
#endif
#ifndef CLNEXT
#define CLNEXT CTRL('v') #define CLNEXT CTRL('v')
#endif
#ifndef CDISCARD
#define CDISCARD CTRL('o') #define CDISCARD CTRL('o')
#endif
#ifndef CWERASE
#define CWERASE CTRL('w') #define CWERASE CTRL('w')
#endif
#ifndef CREPRINT
#define CREPRINT CTRL('r') #define CREPRINT CTRL('r')
#endif
#ifndef CEOT
#define CEOT CEOF #define CEOT CEOF
/* compat */ #endif
/* compat */
#ifndef CBRK
#define CBRK CEOL #define CBRK CEOL
#endif
#ifndef CRPRNT
#define CRPRNT CREPRINT #define CRPRNT CREPRINT
#endif
#ifndef CFLUSH
#define CFLUSH CDISCARD #define CFLUSH CDISCARD
#endif #endif
#if defined(__solaris__) || defined(__QNX__) #ifndef TTYDEF_IFLAG
#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY) #define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
#endif
#ifndef TTYDEF_OFLAG
#define TTYDEF_OFLAG (OPOST | ONLCR) #define TTYDEF_OFLAG (OPOST | ONLCR)
#endif
#ifndef TTYDEF_LFLAG
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL) #define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
#endif
#ifndef TTYDEF_CFLAG
#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL) #define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
#endif
#if defined(__QNX__) || defined(__solaris__)
static cc_t ttydefchars[NCCS] = { static cc_t ttydefchars[NCCS] = {
CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT, CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
CERASE2, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT, CERASE2, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE CDISCARD, CMIN, CTIME, CSTATUS
#ifndef __solaris__
, _POSIX_VDISABLE
#endif
}; };
#endif #endif
...@@ -1004,6 +1059,35 @@ BYTE* lf_expand(BYTE* inbuf, ulong inlen, BYTE* outbuf, ulong& newlen) ...@@ -1004,6 +1059,35 @@ BYTE* lf_expand(BYTE* inbuf, ulong inlen, BYTE* outbuf, ulong& newlen)
#define MAX_ARGS 1000 #define MAX_ARGS 1000
#ifdef NEEDS_SETENV
static int setenv(const char *name, const char *value, int overwrite)
{
char *envstr;
char *oldenv;
if(overwrite || getenv(name)==NULL) {
envstr=(char *)malloc(strlen(name)+strlen(value)+2);
if(envstr==NULL) {
errno=ENOMEM;
return(-1);
}
putenv(envstr);
}
return(0);
}
#endif
#ifdef NEEDS_CFMAKERAW
void
cfmakeraw(struct termios *t)
{
t->c_iflag &= ~(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
t->c_oflag &= ~OPOST;
t->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
t->c_cflag &= ~(CSIZE|PARENB);
t->c_cflag |= CS8;
}
#endif
#ifdef NEEDS_FORKPTY #ifdef NEEDS_FORKPTY
static int login_tty(int fd) static int login_tty(int fd)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment