summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortodd <todd@openbsd.org>2007-09-19 15:00:01 +0000
committertodd <todd@openbsd.org>2007-09-19 15:00:01 +0000
commit01f8f11c9e869ee926cd6c1e69e00ee67c3bb61c (patch)
treec5d99602e71aca86cfeb067760d43f6b61ec676f
parentAllow lines which do not specify any arguments for command (or cvs). (diff)
downloadwireguard-openbsd-01f8f11c9e869ee926cd6c1e69e00ee67c3bb61c.tar.xz
wireguard-openbsd-01f8f11c9e869ee926cd6c1e69e00ee67c3bb61c.zip
my -fpic flags support, pullup from pcc
thanks to Miod for inspiring this version ok otto@
-rw-r--r--usr.bin/pcc/cc/cc/cc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/pcc/cc/cc/cc.c b/usr.bin/pcc/cc/cc/cc.c
index 4c5bfb9492e..40ea4766d68 100644
--- a/usr.bin/pcc/cc/cc/cc.c
+++ b/usr.bin/pcc/cc/cc/cc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cc.c,v 1.6 2007/09/18 07:16:01 otto Exp $ */
+/* $OpenBSD: cc.c,v 1.7 2007/09/19 15:00:01 todd Exp $ */
/*
* Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
*
@@ -109,7 +109,9 @@ int vflag;
int tflag;
int Eflag;
int Oflag;
-int kflag; /* generate PIC code */
+int kflag; /* generate PIC/pic code */
+#define F_PIC 1
+#define F_pic 2
int Mflag; /* dependencies only */
int pgflag;
int exfail;
@@ -175,7 +177,9 @@ main(int argc, char *argv[])
case 'f': /* GCC compatibility flags */
if (strcmp(argv[i], "-fPIC") == 0)
- kflag++;
+ kflag = F_PIC;
+ if (strcmp(argv[i], "-fpic") == 0)
+ kflag = F_pic;
/* silently ignore the rest */
break;
@@ -195,7 +199,7 @@ main(int argc, char *argv[])
break;
case 'k': /* generate PIC code */
- kflag++;
+ kflag = F_pic;
break;
case 'n': /* handle -n flags */
@@ -215,8 +219,6 @@ main(int argc, char *argv[])
pgflag++;
else if (strcmp(argv[i], "-pthread") == 0)
pthreads++;
- else if (strcmp(argv[i], "-pipe") == 0)
- /* NOTHING YET */;
else
errorx(1, "unknown option %s", argv[i]);
break;