Link with the configured net lib on vxworks7
authorDouglas Rupp <rupp@adacore.com>
Mon, 13 Apr 2020 17:52:39 +0000 (10:52 -0700)
committerOlivier Hainque <hainque@adacore.com>
Fri, 23 Oct 2020 15:47:45 +0000 (15:47 +0000)
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.

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.

gcc/config/vxworks.h

index 5b1538085e9ead4b278a55a1908c4653af1721b8..b7e5970a8d87bccb7133a10f0f92f27e565ac726 100644 (file)
@@ -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