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
JS_CFLAGS += -I$(XPDEV)../../include/mozilla/js
endif
ifndef JSLIBDIR
JSLIBDIR := $(XPDEV)../../lib/mozilla/js/$(os).$(BUILD)
JSLIBDIR := $(XPDEV)../../lib/mozilla/js/$(machine).$(BUILD)
endif
ifndef JSLIB
JSLIB := js
endif
ifndef NSPRDIR
NSPRDIR := $(XPDEV)../../lib/mozilla/nspr/$(os).$(BUILD)
NSPRDIR := $(XPDEV)../../lib/mozilla/nspr/$(machine).$(BUILD)
endif
JS_LDFLAGS += -L$(JSLIBDIR) -l$(JSLIB)
#The following is needed for nspr support on Linux
......
......@@ -43,7 +43,10 @@ CFLAGS += -I$(XPDEV)
CFLAGS += $(UIFC_CFLAGS)
ifndef bcc
LDFLAGS += -lm -lutil
LDFLAGS += -lm
ifneq ($(os),sunos)
LDFLAGS += -lutil
endif
endif
ifeq ($(os),sunos) # Solaris
......@@ -80,6 +83,7 @@ $(SBBSLIB) : $(SBBS)
$(QUIET)touch -- '$(SBBSLIB)'
ifneq ($(os),darwin)
ifneq ($(os),sunos)
SBBSLDFLAGS := $(LDFLAGS) -rpath-link ./$(LIBODIR) -rpath ./
#LDFLAGS += -Wl,-rpath-link,./$(LIBODIR),-rpath,./
LDFLAGS += -Xlinker -rpath
......@@ -93,6 +97,7 @@ LDFLAGS += -Xlinker -rpath-link
LDFLAGS += -Xlinker $(NSPRDIR)
endif
endif
endif
CON_OBJS = $(LIBODIR)/sbbscon.o $(LIBODIR)/conwrap.o \
$(LIBODIR)/sbbs_ini.o
......
......@@ -17,17 +17,23 @@
#USE_CURSES = 1 # Curses version of UIFC
#USE_FLTK = 1 # Windowed version of UIFC
USE_UIFC32 := 1 # New 32-bit version of UIFC
UIFC = ../../uifc/
UIFC_SRC = ../../uifc/
XPDEV = ../../xpdev/
NEED_UIFC := 1
include $(XPDEV)/Common.gmake
include $(UIFC)/Common.gmake
include $(UIFC_SRC)/Common.gmake
CFLAGS += -I../
ifdef STATIC
LDFLAGS += -static
endif
ifeq ($(os),sunos)
LDFLAGS += -lsocket -lnsl
endif
$(SBBSINST): $(OBJS)
ifdef USE_DIALOG
$(QUIET)$(MAKE) --no-print-directory -C ../../libdialog
......
......@@ -12,4 +12,5 @@ OBJS = $(LIBODIR)$(SLASH)sbbsinst.$(OFILE)\
$(LIBODIR)$(SLASH)genwrap.$(OFILE)\
$(LIBODIR)$(SLASH)dirwrap.$(OFILE)\
$(LIBODIR)$(SLASH)filewrap.$(OFILE)\
$(LIBODIR)$(SLASH)httpio.$(OFILE)
$(LIBODIR)$(SLASH)httpio.$(OFILE)\
$(LIBODIR)$(SLASH)uifcx.$(OFILE)
......@@ -41,6 +41,10 @@
#ifdef __unix__
#include <sys/un.h>
#ifndef SUN_LEN
#define SUN_LEN(su) \
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif
#endif
//---------------------------------------------------------------------------
......@@ -4004,7 +4008,7 @@ void DLLCALL bbs_thread(void* arg)
#ifdef __unix__ // unix-domain spy sockets
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"
, i, errno);
else {
......@@ -4013,7 +4017,7 @@ void DLLCALL bbs_thread(void* arg)
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),
"%slocalspy%d.sock", startup->temp_dir, i)
>=sizeof(uspy_addr.sun_path))
......
......@@ -1024,6 +1024,11 @@ BOOL md(char *path);
/* file.cpp */
BOOL filematch(char *filename, char *filespec);
/* sbbscon.c */
#if defined(__unix__) && defined(NEEDS_DAEMON)
int daemon(int nochdir, int noclose);
#endif
#endif /* SBBS */
extern const char* wday[]; /* abbreviated weekday names */
......
......@@ -68,45 +68,100 @@
#include <termios.h>
#if defined(__QNX__)
/*
* Control Character Defaults
*/
/*
* Control Character Defaults
*/
#ifndef CTRL
#define CTRL(x) (x&037)
#endif
#ifndef CEOF
#define CEOF CTRL('d')
#endif
#ifndef CEOL
#define CEOL 0xff /* XXX avoid _POSIX_VDISABLE */
#endif
#ifndef CERASE
#define CERASE 0177
#endif
#ifndef CERASE2
#define CERASE2 CTRL('h')
#endif
#ifndef CINTR
#define CINTR CTRL('c')
#endif
#ifndef CSTATUS
#define CSTATUS CTRL('t')
#endif
#ifndef CKILL
#define CKILL CTRL('u')
#endif
#ifndef CMIN
#define CMIN 1
#endif
#ifndef CQUIT
#define CQUIT 034 /* FS, ^\ */
#endif
#ifndef CSUSP
#define CSUSP CTRL('z')
#endif
#ifndef CTIME
#define CTIME 0
#endif
#ifndef CDSUSP
#define CDSUSP CTRL('y')
#endif
#ifndef CSTART
#define CSTART CTRL('q')
#endif
#ifndef CSTOP
#define CSTOP CTRL('s')
#endif
#ifndef CLNEXT
#define CLNEXT CTRL('v')
#endif
#ifndef CDISCARD
#define CDISCARD CTRL('o')
#endif
#ifndef CWERASE
#define CWERASE CTRL('w')
#endif
#ifndef CREPRINT
#define CREPRINT CTRL('r')
#endif
#ifndef CEOT
#define CEOT CEOF
/* compat */
#endif
/* compat */
#ifndef CBRK
#define CBRK CEOL
#endif
#ifndef CRPRNT
#define CRPRNT CREPRINT
#endif
#ifndef CFLUSH
#define CFLUSH CDISCARD
#endif
#if defined(__solaris__) || defined(__QNX__)
#ifndef TTYDEF_IFLAG
#define TTYDEF_IFLAG (BRKINT | ICRNL | IMAXBEL | IXON | IXANY)
#endif
#ifndef TTYDEF_OFLAG
#define TTYDEF_OFLAG (OPOST | ONLCR)
#endif
#ifndef TTYDEF_LFLAG
#define TTYDEF_LFLAG (ECHO | ICANON | ISIG | IEXTEN | ECHOE|ECHOKE|ECHOCTL)
#endif
#ifndef TTYDEF_CFLAG
#define TTYDEF_CFLAG (CREAD | CS8 | HUPCL)
#endif
#if defined(__QNX__) || defined(__solaris__)
static cc_t ttydefchars[NCCS] = {
CEOF, CEOL, CEOL, CERASE, CWERASE, CKILL, CREPRINT,
CERASE2, CINTR, CQUIT, CSUSP, CDSUSP, CSTART, CSTOP, CLNEXT,
CDISCARD, CMIN, CTIME, CSTATUS, _POSIX_VDISABLE
CDISCARD, CMIN, CTIME, CSTATUS
#ifndef __solaris__
, _POSIX_VDISABLE
#endif
};
#endif
......@@ -1004,6 +1059,35 @@ BYTE* lf_expand(BYTE* inbuf, ulong inlen, BYTE* outbuf, ulong& newlen)
#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
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