diff mbox series

vxworks: Link with the configured net lib on vxworks7

Message ID 9F532EA6-6E8F-475D-8664-846FE9B60FD2@adacore.com
State New
Headers show
Series vxworks: Link with the configured net lib on vxworks7 | expand

Commit Message

Olivier Hainque Oct. 23, 2020, 3:45 p.m. UTC
The net library is configurable on vxworks7. Pick the library
to include in link closures in accordance with the availability
of a revealing header file, using the recently introduced 
if-exist-then-else spec builtin function.

Tested on a mix of gcc-9 and gcc-10 based builds for Vxworks7r2,
and sanity checked that a powerpc-vxworks build passes for languages=c,c++
with mainline sources.

Committing to mainline.

Olivier

2021-10-23  Douglas Rupp  <rupp@adacore.com>
    
gcc/
	* config/vxworks.h (VXWORKS_NET_LIBS_RTP): Use -lrtnet if
	rtnetStackLib.h is available, fallback to -lnet otherwise.
diff mbox series

Patch

--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -90,7 +90,7 @@  along with GCC; see the file COPYING3.  If not see
 #define VXWORKS_SYSCALL_LIBS_RTP
 
 #if TARGET_VXWORKS7
-#define VXWORKS_NET_LIBS_RTP "-lnet"
+#define VXWORKS_NET_LIBS_RTP "-l%:if-exists-then-else(%:getenv(VSB_DIR /usr/h/public/rtnetStackLib.h) rtnet net)"
 #else
 #define VXWORKS_NET_LIBS_RTP "-lnet -ldsi"
 #endif