Commit 82205bb4 authored by deuce's avatar deuce
Browse files

Changed to make work with OpenBSD and shared libs.

SHLIBOPTS macro now contains params to pass to gcc and g++ to create shared
libs.
parent 70dc04ec
...@@ -58,7 +58,6 @@ endif ...@@ -58,7 +58,6 @@ endif
SLASH = / SLASH = /
OFILE = o OFILE = o
LIBFILE = .so
UIFC = ../uifc/ UIFC = ../uifc/
XPDEV = ../xpdev/ XPDEV = ../xpdev/
LIBPREFIX = lib LIBPREFIX = lib
...@@ -74,6 +73,12 @@ os := $(shell echo $(os) | tr "[ A-Z]" "[\-a-z]") ...@@ -74,6 +73,12 @@ os := $(shell echo $(os) | tr "[ A-Z]" "[\-a-z]")
# remove '/' from "os/2" # remove '/' from "os/2"
os := $(shell echo $(os) | tr -d "/") os := $(shell echo $(os) | tr -d "/")
ifeq ($(os),openbsd)
LIBFILE = .so.0.0
else
LIBFILE = .so
endif
ifeq ($(os),freebsd) ifeq ($(os),freebsd)
BSD = 1 BSD = 1
else else
...@@ -176,7 +181,7 @@ $(SBBSLIB) : $(SBBS) ...@@ -176,7 +181,7 @@ $(SBBSLIB) : $(SBBS)
vpath %.c $(XPDEV) $(UIFC) vpath %.c $(XPDEV) $(UIFC)
vpath %.cpp $(UIFC) vpath %.cpp $(UIFC)
LFLAGS += -L./$(LIBODIR) LFLAGS += -L./$(LIBODIR) -L../../lib/mozilla/js/$(os).$(BUILD) -L../../lib/mozilla/nspr/$(os).$(BUILD)
SBBSLDFLAGS := $(LFLAGS) -rpath-link ./$(LIBODIR) -rpath ./ SBBSLDFLAGS := $(LFLAGS) -rpath-link ./$(LIBODIR) -rpath ./
#LFLAGS += -Wl,-rpath-link,./$(LIBODIR),-rpath,./ #LFLAGS += -Wl,-rpath-link,./$(LIBODIR),-rpath,./
LFLAGS += -Xlinker -rpath LFLAGS += -Xlinker -rpath
...@@ -188,6 +193,8 @@ LFLAGS += -Xlinker -rpath-link ...@@ -188,6 +193,8 @@ LFLAGS += -Xlinker -rpath-link
LFLAGS += -Xlinker ../../lib/mozilla/js/$(os).$(BUILD) LFLAGS += -Xlinker ../../lib/mozilla/js/$(os).$(BUILD)
LFLAGS += -Xlinker -rpath-link LFLAGS += -Xlinker -rpath-link
LFLAGS += -Xlinker ../../lib/mozilla/nspr/$(os).$(BUILD) LFLAGS += -Xlinker ../../lib/mozilla/nspr/$(os).$(BUILD)
else
LFLAGS += -ljs -lnspr4
endif endif
ifeq ($(os),freebsd) ifeq ($(os),freebsd)
LFLAGS += -pthread LFLAGS += -pthread
...@@ -232,6 +239,7 @@ SMBLIB_OBJS = \ ...@@ -232,6 +239,7 @@ SMBLIB_OBJS = \
$(LIBODIR)/filewrap.o \ $(LIBODIR)/filewrap.o \
$(LIBODIR)/crc16.o $(LIBODIR)/crc16.o
SHLIBOPTS := -shared
# Monolithic Synchronet executable Build Rule # Monolithic Synchronet executable Build Rule
FORCE$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS) FORCE$(SBBSMONO): $(MONO_OBJS) $(OBJS) $(LIBS)
...@@ -245,35 +253,35 @@ FORCE$(SBBS): $(OBJS) $(LIBS) ...@@ -245,35 +253,35 @@ FORCE$(SBBS): $(OBJS) $(LIBS)
$(SBBS): $(OBJS) $(LIBS) $(SBBS): $(OBJS) $(LIBS)
@echo Linking $@ @echo Linking $@
$(QUIET)$(CCPP) $(LFLAGS) -o $(SBBS) $(JSLIB) $^ -shared -o $@ $(QUIET)$(CCPP) $(LFLAGS) -o $(SBBS) $(JSLIB) $^ $(SHLIBOPTS) -o $@
# FTP Server Link Rule # FTP Server Link Rule
FORCE$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB) FORCE$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
$(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB) $(FTPSRVR): $(LIBODIR)/ftpsrvr.o $(SBBSLIB)
@echo Linking $@ @echo Linking $@
$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@ $(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) $(SHLIBOPTS) -o $@
# Mail Server Link Rule # Mail Server Link Rule
FORCE$(MAILSRVR): $(MAIL_OBJS) $(LIBODIR)$(SLASH)$(SBBSLIB) FORCE$(MAILSRVR): $(MAIL_OBJS) $(LIBODIR)$(SLASH)$(SBBSLIB)
$(MAILSRVR): $(MAIL_OBJS) $(SBBSLIB) $(MAILSRVR): $(MAIL_OBJS) $(SBBSLIB)
@echo Linking $@ @echo Linking $@
$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@ $(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) $(SHLIBOPTS) -o $@
# Mail Server Link Rule # Mail Server Link Rule
FORCE$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB) FORCE$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)
$(WEBSRVR): $(WEB_OBJS) $(SBBSLIB) $(WEBSRVR): $(WEB_OBJS) $(SBBSLIB)
@echo Linking $@ @echo Linking $@
$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@ $(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) $(SHLIBOPTS) -o $@
# Services Link Rule # Services Link Rule
FORCE$(SERVICES): $(WEB_OBJS) $(SBBSLIB) FORCE$(SERVICES): $(WEB_OBJS) $(SBBSLIB)
$(SERVICES): $(SERVICE_OBJS) $(SBBSLIB) $(SERVICES): $(SERVICE_OBJS) $(SBBSLIB)
@echo Linking $@ @echo Linking $@
$(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) -shared -o $@ $(QUIET)$(CC) $(LFLAGS) $^ $(JSLIB) $(SHLIBOPTS) -o $@
# Synchronet Console Build Rule # Synchronet Console Build Rule
FORCE$(SBBSCON): $(CON_OBJS) $(SBBSLIB) $(FTP_OBJS) $(MAIL_OBJS) $(WEB_OBJS) $(SERVICE_OBJS) FORCE$(SBBSCON): $(CON_OBJS) $(SBBSLIB) $(FTP_OBJS) $(MAIL_OBJS) $(WEB_OBJS) $(SERVICE_OBJS)
......
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