From 288d6286acf91b71c3510fca8553f502c6bdf239 Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Fri, 19 May 2017 20:43:36 -0400
Subject: driver: refine handling of --target.

* for a --target argument that precedes the compiler argument, as in:
  slibtool --target=xxx --mode=compile cc

--> set an explicit (cross-)target,
--> but do not pass the argument to the compiler.

* for a --target argument that follows the compiler argument, as in:
  slibtool --mode=compile cc --target=xxx

--> set an explicit (cross-)target,
--> and also pass the argument to the compiler.
---
 src/driver/slbt_driver_ctx.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

(limited to 'src/driver')

diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 578a7c2..9b984e0 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -296,14 +296,7 @@ static int slbt_split_argv(
 		else if (!(strcmp("Xcompiler",&argv[i][1])))
 			*cargv++ = argv[++i];
 
-		else if (!(strncmp("-target=",&argv[i][1],strlen("-target="))))
-			*targv++ = argv[i];
-
-		else if (!(strcmp("-target",&argv[i][1]))) {
-			*targv++ = argv[i++];
-			*targv++ = argv[i];
-
-		} else if ((argv[i][1] == 'R')  && (argv[i][2] == 0)) {
+		else if ((argv[i][1] == 'R')  && (argv[i][2] == 0)) {
 			*targv++ = argv[i++];
 			*targv++ = argv[i];
 
-- 
cgit v1.2.3