diff --git a/src/dbase/Makefile b/src/dbase/Makefile index 3a7e989f2..f2d6edb1f 100644 --- a/src/dbase/Makefile +++ b/src/dbase/Makefile @@ -1,52 +1,49 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = findex.o fimonitor.o cachestrapper.o fistore.o \ +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### + +RSOBJ = findex.o fimonitor.o cachestrapper.o fistore.o \ rsexpr.o -EXEC = fitest2 fisavetest ficachetest searchtest +TESTOBJ = fitest2.o fisavetest.o ficachetest.o searchtest.o + +TESTS = fitest2 fisavetest ficachetest searchtest ifeq ($(OS),Linux) - EXEC += fimontest + TESTOBJ += fimontest.o + TESTS += fimontest endif -all : $(OBJ) librs $(EXEC) -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) +ifeq ($(OS),MacOSX) + TESTOBJ += fimontest.o + TESTS += fimontest +endif -ftest: $(OBJ) ftest.o - $(CC) $(CFLAGS) -o ftest $(OBJ) ftest.o $(RSLIBS) -looktest: $(OBJ) looktest.o - $(CC) $(CFLAGS) -o looktest $(OBJ) looktest.o $(RSLIBS) +all: librs tests fitest2 : fitest2.o $(OBJ) - $(CC) $(CFLAGS) -o fitest2 fitest2.o $(OBJ) $(RSLIBS) + $(CC) $(CFLAGS) -o fitest2 fitest2.o $(OBJ) $(LIBS) fisavetest : fisavetest.o $(OBJ) - $(CC) $(CFLAGS) -o fisavetest fisavetest.o $(OBJ) $(RSLIBS) + $(CC) $(CFLAGS) -o fisavetest fisavetest.o $(OBJ) $(LIBS) fimontest : fimontest.o $(OBJ) - $(CC) $(CFLAGS) -o fimontest fimontest.o $(OBJ) $(RSLIBS) + $(CC) $(CFLAGS) -o fimontest fimontest.o $(OBJ) $(LIBS) ficachetest : ficachetest.o $(OBJ) - $(CC) $(CFLAGS) -o ficachetest ficachetest.o $(OBJ) $(RSLIBS) + $(CC) $(CFLAGS) -o ficachetest ficachetest.o $(OBJ) $(LIBS) searchtest : searchtest.o $(OBJ) - $(CC) $(CFLAGS) -o searchtest searchtest.o $(OBJ) $(RSLIBS) + $(CC) $(CFLAGS) -o searchtest searchtest.o $(OBJ) $(LIBS) - -.cc.o: - $(CC) $(CFLAGS) -c $< - -clean: - -/bin/rm $(OBJ) ftest.o looktest.o - -/bin/rm fitest2.o fisavetest.o fimontest.o - -/bin/rm ficachetest.o searchtest.o - -clobber: clean - -/bin/rm $(EXEC) +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/dht/Makefile b/src/dht/Makefile index a5d64daef..dd5b52e3d 100644 --- a/src/dht/Makefile +++ b/src/dht/Makefile @@ -1,18 +1,21 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = b64.o opendhtstr.o opendht.o opendhtmgr.o +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### -#CADKINC = /home/rmf24/prog/src/KadC -#CFLAGS += -I $(CADKINC) -#RSLIBS += -L $(CADKINC) -lKadC +RSOBJ = b64.o opendhtstr.o opendht.o opendhtmgr.o +TESTOBJ = odhtstr_test.o odhtpost_test.o odhtmgr_test.o -all : $(OBJ) librs odhtstr_test odhtpost_test odhtmgr_test +TESTS = odhtstr_test odhtpost_test odhtmgr_test -#dhttest +all: librs tests +#dhttest is OLD dhttest: $(OBJ) dhttest.o $(CC) $(CFLAGS) -o dhttest $(OBJ) dhttest.o $(RSLIBS) @@ -25,19 +28,11 @@ odhtstr_test: $(OBJ) odhtstr_test.o odhtmgr_test: $(OBJ) odhtmgr_test.o $(CC) $(CFLAGS) -o odhtmgr_test $(OBJ) odhtmgr_test.o $(RSLIBS) -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) - -.cc.o: - $(CC) $(CFLAGS) -c $< - +# Extra Rule... .c.o: $(CC) $(CFLAGS) -c $< -clean: - -/bin/rm $(OBJ) dhttest.o - -clobber: clean - -/bin/rm dhttest +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/pqi/Makefile b/src/pqi/Makefile index 5428cfb82..60cdbbbf7 100644 --- a/src/pqi/Makefile +++ b/src/pqi/Makefile @@ -1,9 +1,11 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -# All the executables that should be generated. -EXECS = dht_test conn_test # test_p3items +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### BASE_OBJ = pqi_base.o pqidebug.o pqisecurity.o pqinetwork.o LOOP_OBJ = pqiloopback.o @@ -13,8 +15,6 @@ GRP_OBJ = pqiperson.o pqihandler.o pqiservice.o pqipersongrp.o ifdef PQI_USE_XPGP SSL_OBJ = authxpgp.o -#xpgpcert.o -# Disabled for release... EXECS += p3supernode else SSL_OBJ = sslcert.o endif @@ -22,83 +22,27 @@ endif SSL_OBJ += pqissl.o pqissllistener.o pqisslpersongrp.o UDP_OBJ = pqissludp.o -# Old code - no longer used! -#OLD_OBJ = pqipacket.o p3loopback.o pqi.o -#TUNN_OBJ = pqitunnel.o pqitunneltst.o -#DISC_OBJ = discItem.o p3disc.o -#UDP_OBJ = pqistunner.o pqiudpproxy.o pqissludp.o pqitunnelproxyudp.o -#PRXY_OBJ = pqiproxy.o pqitunnelproxy.o -#CHAN_OBJ = p3channel.o pqichannel.o -#SN_OBJ = pqisupernode.o - -OBJ = $(BASE_OBJ) $(LOOP_OBJ) \ +RSOBJ = $(BASE_OBJ) $(LOOP_OBJ) \ $(STREAM_OBJ) \ $(MGR_OBJ) \ $(SSL_OBJ) \ $(UDP_OBJ) \ $(GRP_OBJ) -# Linux only parts. -ifeq ($(OS),Linux) -# OBJ += $(SN_OBJ) -endif - -BASE_HDR = pqi_base.h pqisecurity.h pqinetwork.h \ - pqidebug.h pqistreamer.h pqiarchive.h pqiindic.h pqibin.h -LOOP_HDR = pqiloopback.h -SSL_HDR = pqissl.h pqissllistener.h xpgpcert.h -GPR_HDR = pqihandler.h pqiperson.h pqiservice.h pqipersongrp.h -STREAM_HDR = pqistreamer.h pqiarchive.h +TESTOBJ = dht_test.o conn_test.o -OLD_HDR = pqipacket.h pqi_data.h p3loopback.h pqi.h -TUNN_HDR = pqitunnel.h pqitunneltst.h -DISC_HDR = discItem.h p3disc.h -UDP_HDR = pqistunner.h pqiudpproxy.h pqissludp.h pqitunnelproxyudp.h -PRXY_HDR = pqitunnelproxy.h pqiproxy.h -CHAN_HDR = pqichannel.h p3channel.h -SN_HDR = pqisupernode.h +TESTS = dht_test conn_test -HDR = $(BASE_HDR) $(LOOP_HDR) $(GRP_HDR) $(SSL_HDR) $(STREAM_HDR) -#$(DISC_HDR) $(TUNN_HDR) -#$(CHAN_HDR) $(PRXY_HDR) $(UDP_HDR) - -LIBPQIA = $(LIBDIR)/libpqi.a -LIBPQISO = $(LIBDIR)/libpqi.so - -# decide on output format...... Lib for Unix, Objs for windows, -ifeq ($(OS),Linux) - -all : librs $(EXECS) - -else - -all : librs - -endif - -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) - -$(OBJ) : $(HDR) - -#p3supernode: p3supernode.o librs -# $(CC) $(CFLAGS) -o p3supernode p3supernode.o $(RSLIBS) +all: librs tests dht_test: dht_test.o librs - $(CC) $(CFLAGS) -o dht_test dht_test.o $(RSLIBS) + $(CC) $(CFLAGS) -o dht_test dht_test.o $(LIBS) conn_test: conn_test.o librs - $(CC) $(CFLAGS) -o conn_test conn_test.o $(RSLIBS) + $(CC) $(CFLAGS) -o conn_test conn_test.o $(LIBS) -.cc.o: - $(CC) $(CFLAGS) -c $< +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### -clean: - -/bin/rm $(OBJ) - -clobber: clean - -/bin/rm $(EXECS) $(LIBPQIA) $(LIBPQISO) - - diff --git a/src/pqi/p3authmgr.cc b/src/pqi/p3authmgr.cc index ee629b602..6ab4047d7 100644 --- a/src/pqi/p3authmgr.cc +++ b/src/pqi/p3authmgr.cc @@ -209,6 +209,11 @@ bool p3DummyAuthMgr::SaveCertificateToFile(std::string id, std::string filename) } /* Signatures */ +bool p3DummyAuthMgr::AuthCertificate(std::string id) +{ + return false; +} + bool p3DummyAuthMgr::SignCertificate(std::string id) { return false; diff --git a/src/pqi/p3authmgr.h b/src/pqi/p3authmgr.h index 2f9bc53cf..8a766cc6c 100644 --- a/src/pqi/p3authmgr.h +++ b/src/pqi/p3authmgr.h @@ -72,6 +72,8 @@ class p3AuthMgr { public: +virtual ~p3AuthMgr() { return; } + /* initialisation -> done by derived classes */ virtual bool active() = 0; virtual int InitAuth(const char *srvr_cert, const char *priv_key, @@ -149,6 +151,7 @@ virtual bool SaveCertificateToFile(std::string id, std::string filename); /* Signatures */ +virtual bool AuthCertificate(std::string uid); virtual bool SignCertificate(std::string id); virtual bool RevokeCertificate(std::string id); virtual bool TrustCertificate(std::string id, bool trust); diff --git a/src/pqi/p3cfgmgr.h b/src/pqi/p3cfgmgr.h index cea392525..ef5610d7b 100644 --- a/src/pqi/p3cfgmgr.h +++ b/src/pqi/p3cfgmgr.h @@ -65,6 +65,7 @@ class pqiConfig { return; } +virtual ~pqiConfig() { return; } virtual bool loadConfiguration(std::string filename, std::string &load) = 0; virtual bool saveConfiguration(std::string filename) = 0; diff --git a/src/pqi/pqinetwork.cc b/src/pqi/pqinetwork.cc index e0c54ef9b..9809a17c7 100644 --- a/src/pqi/pqinetwork.cc +++ b/src/pqi/pqinetwork.cc @@ -444,6 +444,7 @@ int sockaddr_cmp(struct sockaddr_in &addr1, struct sockaddr_in &addr2 ) return (addr1.sin_addr.s_addr - addr2.sin_addr.s_addr); if (addr1.sin_port != addr2.sin_port) return (addr1.sin_port - addr2.sin_port); + return 0; } int inaddr_cmp(struct sockaddr_in addr1, struct sockaddr_in addr2 ) diff --git a/src/rsiface/Makefile b/src/rsiface/Makefile index 89c0efd9e..0b4646b09 100644 --- a/src/rsiface/Makefile +++ b/src/rsiface/Makefile @@ -1,24 +1,25 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = notifytxt.o retroshare.o +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### -TESTS = +OBJ = notifytxt.o retroshare.o -all : $(OBJ) retroshare-nogui +#TESTOBJ = + +TESTS = retroshare-nogui + +all: tests retroshare-nogui: $(OBJ) - $(CC) $(RSCFLAGS) -o retroshare-nogui $(OBJ) $(RSLIBS) - -.cc.o: - $(CC) $(RSCFLAGS) -c $< + $(CC) $(CFLAGS) -o retroshare-nogui $(OBJ) $(LIBS) -clean: - -/bin/rm $(OBJ) - -clobber: clean - -/bin/rm retroshare-nogui - +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/rsserver/Makefile b/src/rsserver/Makefile index 1d32a891c..33de70111 100644 --- a/src/rsserver/Makefile +++ b/src/rsserver/Makefile @@ -1,8 +1,13 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = p3face-file.o \ +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### + +RSOBJ = p3face-file.o \ p3face-msgs.o \ p3face-server.o \ p3face-config.o \ @@ -15,21 +20,16 @@ OBJ = p3face-file.o \ # p3face-people.o # p3face-network.o \ -TESTS = +#TESTOBJ = -all : $(OBJ) librs $(TESTS) +#TESTS = -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) +all: librs tests -.cc.o: - $(CC) $(CFLAGS) -c $< - - -clean: - -/bin/rm $(OBJ) - -clobber: clean +#tlvbase_test : tlvbase_test.o +# $(CC) $(CFLAGS) -o tlvbase_test tlvbase_test.o $(OBJ) $(LIBS) +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/scripts/checks.mk b/src/scripts/checks.mk index 6d1722335..61d242ef0 100644 --- a/src/scripts/checks.mk +++ b/src/scripts/checks.mk @@ -11,17 +11,13 @@ dummy: endif -ifndef KADC_DIR -dummy: - echo "you must define KADC_DIR before you can compile" - -endif - ifneq ($(OS),Linux) - ifndef PTHREADS_DIR + ifneq ($(OS),MacOSX) + ifndef PTHREADS_DIR dummy: echo "you must define PTHREADS_DIR before you can compile" + endif endif endif diff --git a/src/scripts/config-linux.mk b/src/scripts/config-linux.mk index 2de331463..c3aa1a6f3 100644 --- a/src/scripts/config-linux.mk +++ b/src/scripts/config-linux.mk @@ -28,7 +28,8 @@ LIBDIR = $(RS_TOP_DIR)/lib LIBRS = $(LIBDIR)/libretroshare.a # Unix: Linux/Cygwin -INCLUDE = -I $(RS_TOP_DIR) -I$(KADC_DIR) +INCLUDE = -I $(RS_TOP_DIR) +#-I$(KADC_DIR) CFLAGS = -Wall -g $(INCLUDE) ifdef PQI_USE_XPGP @@ -53,6 +54,15 @@ endif RSCFLAGS = -Wall -g $(INCLUDE) +######################################################################### +# OS Compile Options +######################################################################### + +# For the SSL BIO compilation. (Copied from OpenSSL compilation flags) +BIOCC = gcc + +# Linux flags +BIOCFLAGS = -I $(SSL_DIR)/include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM ######################################################################### # OS specific Linking. @@ -63,7 +73,7 @@ ifdef PQI_USE_XPGP LIBS += -L$(SSL_DIR) endif LIBS += -lssl -lcrypto -lpthread -LIBS += -L$(KADC_DIR) -lKadC +#LIBS += -L$(KADC_DIR) -lKadC LIBS += -L$(UPNPC_DIR) -lminiupnpc LIBS += $(XLIB) -ldl -lz diff --git a/src/scripts/config-macosx.mk b/src/scripts/config-macosx.mk new file mode 100644 index 000000000..b21e1fad4 --- /dev/null +++ b/src/scripts/config-macosx.mk @@ -0,0 +1,82 @@ + +ifneq ($(OS),MacOSX) +dummy: + echo "ERROR MacOSX configuration file included, but (OS != MacOSX) + +endif + +############ LINUX CONFIGURATION ######################## + +# flags for components.... +PQI_USE_XPGP = 1 +#PQI_USE_PROXY = 1 +#PQI_USE_CHANNELS = 1 +#USE_FILELOOK = 1 + +SSL_DIR=../../../../../src/openssl-0.9.7g-xpgp-0.1c +UPNPC_DIR=../../../../../src/miniupnpc-20070515 + +include $(RS_TOP_DIR)/scripts/checks.mk + +############ ENFORCE DIRECTORY NAMING ######################## + +CC = g++ +RM = /bin/rm +RANLIB = ranlib +LIBDIR = $(RS_TOP_DIR)/lib +LIBRS = $(LIBDIR)/libretroshare.a + +# Unix: Linux/Cygwin +INCLUDE = -I $(RS_TOP_DIR) +CFLAGS = -Wall -g $(INCLUDE) + +ifdef PQI_USE_XPGP + INCLUDE += -I $(SSL_DIR)/include +endif + +ifdef PQI_USE_XPGP + CFLAGS += -DPQI_USE_XPGP +endif + +ifdef PQI_USE_PROXY + CFLAGS += -DPQI_USE_PROXY +endif + +ifdef PQI_USE_CHANNELS + CFLAGS += -DPQI_USE_CHANNELS +endif + +ifdef USE_FILELOOK + CFLAGS += -DUSE_FILELOOK +endif + + +RSCFLAGS = -Wall -g $(INCLUDE) + +######################################################################### +# OS Compile Options +######################################################################### + +# For the SSL BIO compilation. (Copied from OpenSSL compilation flags) +BIOCC = gcc + +# MacOSX flags +BIOCFLAGS = -I $(SSL_DIR)/include -DOPENSSL_SYSNAME_MACOSX -DOPENSSL_THREADS -D_REENTRANT -DOPENSSL_NO_KRB5 -O3 -fomit-frame-pointer -fno-common -DB_ENDIAN + + +######################################################################### +# OS specific Linking. +######################################################################### + +LIBS = -Wl,-search_paths_first +LIBS += -L$(LIBDIR) -lretroshare +ifdef PQI_USE_XPGP + LIBS += -L$(SSL_DIR) + endif +LIBS += -lssl -lcrypto -lpthread +LIBS += -L$(UPNPC_DIR) -lminiupnpc +LIBS += $(XLIB) -ldl -lz + +RSLIBS = $(LIBS) + + diff --git a/src/scripts/config.mk b/src/scripts/config.mk index 45fdf8921..e7d11205f 100644 --- a/src/scripts/config.mk +++ b/src/scripts/config.mk @@ -4,7 +4,8 @@ ########################################################################### #Define OS. # -OS = Linux +#OS = Linux +OS = MacOSX #OS = Cygwin #OS = Win # MinGw. ########################################################################### @@ -12,10 +13,14 @@ OS = Linux ifeq ($(OS),Linux) include $(RS_TOP_DIR)/scripts/config-linux.mk else - ifeq ($(OS),Cygwin) - include $(RS_TOP_DIR)/scripts/config-cygwin.mk + ifeq ($(OS),MacOSX) + include $(RS_TOP_DIR)/scripts/config-macosx.mk else - include $(RS_TOP_DIR)/scripts/config-mingw.mk + ifeq ($(OS),Cygwin) + include $(RS_TOP_DIR)/scripts/config-cygwin.mk + else + include $(RS_TOP_DIR)/scripts/config-mingw.mk + endif endif endif diff --git a/src/server/Makefile b/src/server/Makefile index 21b6f3dc7..fdf19bd03 100644 --- a/src/server/Makefile +++ b/src/server/Makefile @@ -1,28 +1,24 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = ft.o ftfiler.o hashsearch.o \ - filedexserver.o +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### -EXEC = ftcachetest +RSOBJ = ft.o ftfiler.o hashsearch.o filedexserver.o -all : $(OBJ) librs $(EXEC) +TESTOBJ = ftcachetest.o -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) +TESTS = ftcachetest + +all: librs tests ftcachetest : ftcachetest.o $(OBJ) - $(CC) $(CFLAGS) -o ftcachetest ftcachetest.o $(OBJ) $(RSLIBS) + $(CC) $(CFLAGS) -o ftcachetest ftcachetest.o $(OBJ) $(LIBS) -.cc.o: - $(CC) $(CFLAGS) -c $< - -clean: - -/bin/rm $(OBJ) - -/bin/rm ftcachetest.o - -clobber: clean - -/bin/rm $(EXEC) +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/server/filedexserver.h b/src/server/filedexserver.h index e0afb4fb8..389f82679 100644 --- a/src/server/filedexserver.h +++ b/src/server/filedexserver.h @@ -58,15 +58,8 @@ class FileIndexMonitor; class ftFileRequest; class ftFileData; - -#ifdef PQI_USE_CHANNELS - #include "pqi/pqichannel.h" - #include "pqi/p3channel.h" -#endif - #define MAX_RESULTS 100 // nice balance between results and traffic. - class filedexserver: public p3Config { public: diff --git a/src/server/ftfiler.cc b/src/server/ftfiler.cc index 7b8c62f74..aab966218 100644 --- a/src/server/ftfiler.cc +++ b/src/server/ftfiler.cc @@ -31,22 +31,7 @@ #include "pqi/pqidebug.h" -/**** SHOULDN@T HAVE THIS DEPENDANCY ****/ -/**************** PQI_USE_XPGP ******************/ -#if defined(PQI_USE_XPGP) - -#include "pqi/xpgpcert.h" - -#else /* X509 Certificates */ -/**************** PQI_USE_XPGP ******************/ - -#include "pqi/sslcert.h" - -#endif /* X509 Certificates */ -/**************** PQI_USE_XPGP ******************/ - #include - #include const int ftfilerzone = 86539; diff --git a/src/tcponudp/Makefile b/src/tcponudp/Makefile index 219548d33..efea248ec 100644 --- a/src/tcponudp/Makefile +++ b/src/tcponudp/Makefile @@ -1,74 +1,60 @@ -RS_TOP_DIR=.. +RS_TOP_DIR = .. +##### Define any flags that are needed for this section ####### +############################################################### -include $(RS_TOP_DIR)/make.opt +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### + +BIOOBJ = bss_tou.o + +RSOBJ = tou_net.o udplayer.o udpsorter.o udptestfn.o +RSOBJ += tcppacket.o tcpstream.o tou.o $(BIOOBJ) EXECS = librs udpsock_test udpsort_test udp_server #test_tou pair_tou reset_tou internal_tou largefile_tou -OBJ = tou_net.o udplayer.o udpsorter.o udptestfn.o -OBJ += tcppacket.o tcpstream.o tou.o +TESTOBJ = udpsock_test.o udpsort_test.o udp_server.o test_tou.o +TESTOBJ += pair_tou.o reset_tou.o largefile_tou.o +#internal_tou.o -#tou.o +TESTS = udpsock_test udpsort_test udp_server test_tou +TESTS += pair_tou reset_tou largefile_tou +#internal_tou -all : $(OBJ) $(EXECS) - -.cc.o: - $(CC) $(CFLAGS) -c $< - -clean: - -$(RM) $(OBJ) $(BIOOBJ) udpsock_test.o udpsort_test.o udp_server.o - -#test_tou.o pair_tou.o udp_server.o reset_tou.o internal_tou.o largefile_tou.o - -clobber: clean - -$(RM) udpsock_test udpsort_test udp_server - -#test_tou pair_tou reset_tou internal_tou largefile_tou libtou.so ../lib/libtou.a +all: librs tests udpsock_test : $(OBJ) udpsock_test.o - $(CC) $(CFLAGS) -o udpsock_test $(OBJ) udpsock_test.o -lpthread -L../lib -lretroshare + $(CC) $(CFLAGS) -o udpsock_test udpsock_test.o $(OBJ) $(LIBS) udpsort_test : $(OBJ) udpsort_test.o - $(CC) $(CFLAGS) -o udpsort_test $(OBJ) udpsort_test.o -lpthread -L../lib -lretroshare + $(CC) $(CFLAGS) -o udpsort_test udpsort_test.o $(OBJ) $(LIBS) udp_server: $(OBJ) udp_server.o - $(CC) $(CFLAGS) -o udp_server $(OBJ) udp_server.o -lpthread -L../lib -lretroshare + $(CC) $(CFLAGS) -o udp_server udp_server.o $(OBJ) $(LIBS) test_tou : $(OBJ) test_tou.o - $(CC) $(CFLAGS) -o test_tou $(OBJ) test_tou.o $(LIBS) + $(CC) $(CFLAGS) -o test_tou test_tou.o $(OBJ) $(LIBS) pair_tou : $(OBJ) pair_tou.o - $(CC) $(CFLAGS) -o pair_tou $(OBJ) pair_tou.o $(LIBS) + $(CC) $(CFLAGS) -o pair_tou pair_tou.o $(OBJ) $(LIBS) reset_tou : $(OBJ) reset_tou.o - $(CC) $(CFLAGS) -o reset_tou $(OBJ) reset_tou.o $(LIBS) + $(CC) $(CFLAGS) -o reset_tou reset_tou.o $(OBJ) $(LIBS) internal_tou : $(OBJ) internal_tou.o - $(CC) $(CFLAGS) -o internal_tou $(OBJ) internal_tou.o $(LIBS) + $(CC) $(CFLAGS) -o internal_tou internal_tou.o $(OBJ) $(LIBS) largefile_tou : $(OBJ) largefile_tou.o - $(CC) $(CFLAGS) -o largefile_tou $(OBJ) largefile_tou.o $(LIBS) + $(CC) $(CFLAGS) -o largefile_tou largefile_tou.o $(OBJ) $(LIBS) - -# For BIO Compilation.... SSL Interface. -# - - -BIOOBJ = bss_tou.o -BIOCC = gcc -BIOCFLAGS = -I $(SSL_DIR)/include -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM - - -libtou.a: $(BIOOBJ) $(OBJ) - ar rc ../lib/libtou.a $(BIOOBJ) $(OBJ) - -libtou.so: $(BIOOBJ) $(OBJ) - $(CC) -o libtou.so -shared $(BIOOBJ) $(OBJ) - -librs: $(BIOOBJ) $(OBJ) - ar r ../lib/libretroshare.a $(BIOOBJ) $(OBJ) - +# Extra Rule for BIOFLAGS .c.o: $(BIOCC) $(BIOCFLAGS) -c $< + +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### + diff --git a/src/tcponudp/tcpstream.h b/src/tcponudp/tcpstream.h index 0ae0d4a04..9aaf6a6f2 100644 --- a/src/tcponudp/tcpstream.h +++ b/src/tcponudp/tcpstream.h @@ -74,6 +74,7 @@ class TcpStream: public UdpPeer /* Top-Level exposed */ TcpStream(UdpSorter *lyr); +virtual ~TcpStream() { return; } /* user interface */ int status(std::ostream &out); diff --git a/src/tcponudp/tou.h b/src/tcponudp/tou.h index df5d372d6..9ca0ed35c 100644 --- a/src/tcponudp/tou.h +++ b/src/tcponudp/tou.h @@ -34,7 +34,11 @@ */ #ifndef WINDOWS_SYS + + #include + #include #include + #else #include #include diff --git a/src/tcponudp/tou_net.h b/src/tcponudp/tou_net.h index cae4f6c26..39c02e24f 100644 --- a/src/tcponudp/tou_net.h +++ b/src/tcponudp/tou_net.h @@ -64,6 +64,8 @@ extern "C" { #ifndef WINDOWS_SYS #include +#include + #include #include diff --git a/src/upnp/Makefile b/src/upnp/Makefile index f11b528db..47a9b5069 100644 --- a/src/upnp/Makefile +++ b/src/upnp/Makefile @@ -1,26 +1,28 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = upnphandler.o upnputil.o +EXTRA_CFLAGS += -I$(UPNPC_DIR) -DMINIUPNP_EXPORTS -CFLAGS += -I$(UPNPC_DIR) -DMINIUPNP_EXPORTS +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### -all : $(OBJ) librs upnptest +CFLAGS += $(EXTRA_CFLAGS) + +RSOBJ = upnphandler.o upnputil.o + +TESTOBJ = upnptest.o + +TESTS = upnptest + +all: librs tests upnptest: $(OBJ) upnptest.o $(CC) $(CFLAGS) -o upnptest $(OBJ) upnptest.o $(RSLIBS) -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) - -.cc.o: - $(CC) $(CFLAGS) -c $< - -clean: - -/bin/rm $(OBJ) upnptest.o - -clobber: clean - -/bin/rm upnptest +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/util/Makefile b/src/util/Makefile index c372f2420..fe4187ff2 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -1,28 +1,27 @@ RS_TOP_DIR = .. -include ../make.opt +##### Define any flags that are needed for this section ####### +############################################################### -OBJ = rsthreads.o rsdir.o rsprint.o -# rsrand.o --- not really needed! +############################################################### +include $(RS_TOP_DIR)/scripts/config.mk +############################################################### -all : $(OBJ) librs dirtest dir2test +RSOBJ = rsthreads.o rsdir.o rsprint.o + +TESTOBJ = dirtest.o dir2test.o + +TESTS = dirtest dir2test + +all: librs tests dirtest: $(OBJ) dirtest.o - $(CC) $(CFLAGS) -o dirtest $(OBJ) dirtest.o $(RSLIBS) + $(CC) $(CFLAGS) -o dirtest dirtest.o $(OBJ) $(LIBS) dir2test: $(OBJ) dir2test.o - $(CC) $(CFLAGS) -o dir2test $(OBJ) dir2test.o $(RSLIBS) + $(CC) $(CFLAGS) -o dir2test dir2test.o $(OBJ) $(LIBS) -librs: $(OBJ) - $(AR) r $(LIBRS) $(OBJ) - $(RANLIB) $(LIBRS) - -.cc.o: - $(CC) $(CFLAGS) -c $< - -clean: - -/bin/rm $(OBJ) dirtest.o dir2test.o - -clobber: clean - -/bin/rm dirtest dir2test +############################################################### +include $(RS_TOP_DIR)/scripts/rules.mk +############################################################### diff --git a/src/util/rsnet.h b/src/util/rsnet.h index 0568b6cf6..bbef70c60 100644 --- a/src/util/rsnet.h +++ b/src/util/rsnet.h @@ -32,6 +32,7 @@ #ifndef WINDOWS_SYS #include +#include #include #include