diff --git a/Jamrules b/Jamrules index 71b8e8a6d4..615fea3191 100644 --- a/Jamrules +++ b/Jamrules @@ -107,6 +107,11 @@ switch $(TARGET_PLATFORM) HAIKU_COMPATIBLE = true ; } } +if $(BONE_COMPATIBLE) { + NETWORK_LIBS = libsocket.so libbind.so ; +} else { + NETWORK_LIBS = libnet.so ; +} # Determine if we're building on PPC or x86 # Determine mimetype of executable diff --git a/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile b/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile index 72a93503d4..24555ab8ac 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile +++ b/src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile @@ -20,18 +20,12 @@ Addon IMAP : mail_daemon inbound_protocols : imap_config.cpp NestedString.cpp ; -LinkSharedOSLibs IMAP : be libmail.so ; +LinkSharedOSLibs IMAP : be libmail.so $(NETWORK_LIBS) ; if $(USESSL) { LinkSharedOSLibs IMAP : ssl crypto ; } -if $(BONE_COMPATIBLE) { - LinkSharedOSLibs IMAP : socket bind ; -} else { - LinkSharedOSLibs IMAP : net ; -} - Package haiku-maildaemon-cvs : IMAP : boot home config add-ons mail_daemon inbound_protocols ; diff --git a/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile b/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile index 8379953bfd..9ac5edc1e4 100644 --- a/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile +++ b/src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile @@ -20,18 +20,12 @@ Addon POP3 : mail_daemon inbound_protocols : SimpleMailProtocol.cpp md5c.c ; -LinkSharedOSLibs POP3 : be libmail.so ; +LinkSharedOSLibs POP3 : be libmail.so $(NETWORK_LIBS) ; if $(USESSL) { LinkSharedOSLibs POP3 : ssl crypto ; } -if $(BONE_COMPATIBLE) { - LinkSharedOSLibs POP3 : socket bind ; -} else { - LinkSharedOSLibs POP3 : net ; -} - Package haiku-maildaemon-cvs : POP3 : boot home config add-ons mail_daemon inbound_protocols ; diff --git a/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile b/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile index 90be7c02d6..46705ff2ae 100644 --- a/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile +++ b/src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile @@ -13,13 +13,7 @@ Addon SMTP : mail_daemon outbound_protocols : smtp.cpp md5c.c ; -LinkSharedOSLibs SMTP : be libmail.so ; - -if $(BONE_COMPATIBLE) { - LinkSharedOSLibs SMTP : socket bind ; -} else { - LinkSharedOSLibs SMTP : net ; -} +LinkSharedOSLibs SMTP : be libmail.so $(NETWORK_LIBS) ; Package haiku-maildaemon-cvs : SMTP : diff --git a/src/add-ons/print/transports/ipp/Jamfile b/src/add-ons/print/transports/ipp/Jamfile index 0b5275906d..32e6d38c36 100644 --- a/src/add-ons/print/transports/ipp/Jamfile +++ b/src/add-ons/print/transports/ipp/Jamfile @@ -21,7 +21,7 @@ ObjectReferences DbgMsg.o ; -LinkSharedOSLibs IPP : be libsocket.so libbind.so libnet.so stdc++.r4 ; +LinkSharedOSLibs IPP : be $(NETWORK_LIBS) stdc++.r4 ; Package haiku-printingkit-cvs : IPP : diff --git a/src/add-ons/print/transports/lpr/Jamfile b/src/add-ons/print/transports/lpr/Jamfile index d013504d7d..11bd519b82 100644 --- a/src/add-ons/print/transports/lpr/Jamfile +++ b/src/add-ons/print/transports/lpr/Jamfile @@ -18,8 +18,8 @@ ObjectReferences DbgMsg.o ; -LinkSharedOSLibs LPR : be libsocket.so libbind.so libnet.so stdc++.r4 ; +LinkSharedOSLibs LPR : be $(NETWORK_LIBS) stdc++.r4 ; Package haiku-printingkit-cvs : LPR : - boot home config add-ons Print transport ; \ No newline at end of file + boot home config add-ons Print transport ; diff --git a/src/add-ons/print/transports/shared/Jamfile b/src/add-ons/print/transports/shared/Jamfile index ad44d8a95a..22ce10706a 100644 --- a/src/add-ons/print/transports/shared/Jamfile +++ b/src/add-ons/print/transports/shared/Jamfile @@ -2,7 +2,11 @@ SubDir OBOS_TOP src add-ons print transports shared ; SetupObjectsDir ; -ObjectC++Flags Socket.cpp : -DHAVE_ARPA_INET -Dclosesocket=close ; +if $(BONE_COMPATIBLE) { + ObjectC++Flags Socket.cpp : -DHAVE_ARPA_INET -Dclosesocket=close ; +} else { + ObjectC++Flags Socket.cpp : -DHAVE_ARPA_INET -DBUILDING_R5_LIBNET ; +} Objects DbgMsg.cpp diff --git a/src/apps/bin/arp/Jamfile b/src/apps/bin/arp/Jamfile index 98e25bd55c..192363638a 100644 --- a/src/apps/bin/arp/Jamfile +++ b/src/apps/bin/arp/Jamfile @@ -2,9 +2,13 @@ SubDir OBOS_TOP src apps bin arp ; UsePrivateHeaders net ; +if ! $(BONE_COMPATIBLE) { + SubDirCcFlags -DBUILDING_R5_LIBNET ; +} + BinCommand arp : arp.c -: libsocket.so libbind.so ; +: $(NETWORK_LIBS) ; # Installation -- in the test directory for the time being OBOSInstall install-networking diff --git a/src/apps/bin/ifconfig/Jamfile b/src/apps/bin/ifconfig/Jamfile index ec5d13aede..1e7d757f34 100644 --- a/src/apps/bin/ifconfig/Jamfile +++ b/src/apps/bin/ifconfig/Jamfile @@ -2,9 +2,13 @@ SubDir OBOS_TOP src apps bin ifconfig ; UsePrivateHeaders net ; +if ! $(BONE_COMPATIBLE) { + SubDirCcFlags -DBUILDING_R5_LIBNET -Dclose=closesocket ; +} + BinCommand ifconfig : ifconfig.c -: libsocket.so libbind.so ; +: $(NETWORK_LIBS) ; # Installation -- in the test directory for the time being OBOSInstall install-networking diff --git a/src/apps/bin/ping/Jamfile b/src/apps/bin/ping/Jamfile index 303bcff959..f29fc33cf7 100644 --- a/src/apps/bin/ping/Jamfile +++ b/src/apps/bin/ping/Jamfile @@ -2,9 +2,13 @@ SubDir OBOS_TOP src apps bin ping ; UsePrivateHeaders net ; +if ! $(BONE_COMPATIBLE) { + SubDirCcFlags -DBUILDING_R5_LIBNET ; +} + BinCommand ping : ping.c -: libsocket.so libbind.so ; +: $(NETWORK_LIBS) ; # Installation -- in the test directory for the time being OBOSInstall install-networking diff --git a/src/apps/bin/route/Jamfile b/src/apps/bin/route/Jamfile index 6e53308e16..e095561311 100644 --- a/src/apps/bin/route/Jamfile +++ b/src/apps/bin/route/Jamfile @@ -2,11 +2,15 @@ SubDir OBOS_TOP src apps bin route ; UsePrivateHeaders net ; +if ! $(BONE_COMPATIBLE) { + SubDirCcFlags -DBUILDING_R5_LIBNET ; +} + BinCommand route : keywords.c route.c show.c -: libsocket.so libbind.so ; +: $(NETWORK_LIBS) ; # Installation -- in the test directory for the time being OBOSInstall install-networking diff --git a/src/apps/bin/traceroute/Jamfile b/src/apps/bin/traceroute/Jamfile index 7ccf8845fe..d3c8147de8 100644 --- a/src/apps/bin/traceroute/Jamfile +++ b/src/apps/bin/traceroute/Jamfile @@ -2,9 +2,13 @@ SubDir OBOS_TOP src apps bin traceroute ; UsePrivateHeaders net ; +if ! $(BONE_COMPATIBLE) { + SubDirCcFlags -DBUILDING_R5_LIBNET ; +} + BinCommand traceroute : traceroute.c -: libsocket.so libbind.so ; +: $(NETWORK_LIBS) ; # Installation -- in the test directory for the time being OBOSInstall install-networking diff --git a/src/kits/mail/Jamfile b/src/kits/mail/Jamfile index 60df8ce029..3740b7b8f7 100644 --- a/src/kits/mail/Jamfile +++ b/src/kits/mail/Jamfile @@ -51,14 +51,9 @@ LinkSharedOSLibs libmail.so : libtextencoding.so tracker stdc++.r4 + $(NETWORK_LIBS) ; -if $(BONE_COMPATIBLE) { - LinkSharedOSLibs libmail.so : socket ; -} else { - LinkSharedOSLibs libmail.so : net ; -} - MakeLocate libmail.so : $(OBOS_STLIB_DIR) ; RelSymLink libmail.so : libmail.so ; diff --git a/src/servers/mail/Jamfile b/src/servers/mail/Jamfile index f6dbc0a221..68b7781fab 100644 --- a/src/servers/mail/Jamfile +++ b/src/servers/mail/Jamfile @@ -18,13 +18,7 @@ Server mail_daemon : main.cpp ; -LinkSharedOSLibs mail_daemon : be libmail.so tracker stdc++.r4 ; - -if $(BONE_COMPATIBLE) { - LinkSharedOSLibs mail_daemon : socket ; -} else { - LinkSharedOSLibs mail_daemon : net ; -} +LinkSharedOSLibs mail_daemon : be libmail.so tracker stdc++.r4 $(NETWORK_LIBS) ; Package haiku-maildaemon-cvs : mail_daemon : diff --git a/src/tests/kits/net/netperf/Jamfile b/src/tests/kits/net/netperf/Jamfile index 62e6c84b8d..218b232f2a 100644 --- a/src/tests/kits/net/netperf/Jamfile +++ b/src/tests/kits/net/netperf/Jamfile @@ -2,6 +2,10 @@ SubDir OBOS_TOP src tests kits net netperf ; Depends netperf : install_netperf_scripts ; +if ! $(BONE_COMPATIBLE) { + SubDirCcFlags -DBUILDING_R5_LIBNET -Dclose=closesocket ; +} + SimpleTest netperf : netperf.c netsh.c @@ -12,7 +16,7 @@ SimpleTest netperf : nettest_xti.c nettest_ipv6.c nettest_dns.c - : libsocket.so libbind.so + : $(NETWORK_LIBS) ; SimpleTest netserver : @@ -25,7 +29,7 @@ SimpleTest netserver : nettest_xti.c nettest_ipv6.c nettest_dns.c - : libsocket.so libbind.so + : $(NETWORK_LIBS) ; OBOSInstall install_netperf_scripts : [ FDirName $(OBOS_TEST_DIR) kits net netperf ] :