aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-05 15:53:06 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-13 17:49:55 +0200
commit04b9164a17bf7f572e0ac57e1824b649e1d238be (patch)
tree70cba445def05f866bc2877bacc41e8a47c91d49
parent490d0caa578ca8ff8be0b20536040ac7d129520b (diff)
downloadsparse-04b9164a17bf7f572e0ac57e1824b649e1d238be.tar.gz
cgcc: remove now unneeded options & defines
Now that the OS can be specified to sparse via an option (--os=$OS) and that sparse knows about their specificities, it's no more needed or useful to also define them in cgcc. So, remove from cgcc the OS-specificities known to sparse (a few few exotic ones remain for now) but ensure that the info about the correct OS is passed to sparse. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rwxr-xr-xcgcc32
1 files changed, 8 insertions, 24 deletions
diff --git a/cgcc b/cgcc
index 9c6ad883..9c78ee63 100755
--- a/cgcc
+++ b/cgcc
@@ -221,48 +221,32 @@ sub float_types {
sub add_specs {
my ($spec) = @_;
if ($spec eq 'sunos') {
- return &add_specs ('unix') .
- ' -D__sun__=1 -D__sun=1 -Dsun=1' .
- ' -D__svr4__=1 -DSVR4=1' .
+ return " --os=$spec" .
+ ' -DSVR4=1' .
' -D__STDC__=0' .
' -D_REENTRANT' .
' -D_SOLARIS_THREADS' .
' -DNULL="((void *)0)"';
} elsif ($spec eq 'linux') {
- return &add_specs ('unix') .
- ' -D__linux__=1 -D__linux=1 -Dlinux=1';
+ return " --os=$spec";
} elsif ($spec eq 'gnu/kfreebsd') {
return &add_specs ('unix') .
' -D__FreeBSD_kernel__=1';
} elsif ($spec eq 'openbsd') {
- return &add_specs ('unix') .
- ' -D__OpenBSD__=1';
+ return " --os=$spec";
} elsif ($spec eq 'freebsd') {
- return &add_specs ('unix') .
- ' -D__FreeBSD__=1';
+ return " --os=$spec";
} elsif ($spec eq 'netbsd') {
- return &add_specs ('unix') .
- ' -D__NetBSD__=1';
+ return " --os=$spec";
} elsif ($spec eq 'darwin') {
- return
- ' -D__APPLE__=1 -D__APPLE_CC__=1 -D__MACH__=1';
+ return " --os=$spec";
} elsif ($spec eq 'gnu') { # Hurd
return &add_specs ('unix') . # So, GNU is Unix, uh?
' -D__GNU__=1 -D__gnu_hurd__=1 -D__MACH__=1';
} elsif ($spec eq 'unix') {
return ' -Dunix=1 -D__unix=1 -D__unix__=1';
} elsif ( $spec =~ /^cygwin/) {
- return &add_specs ('unix') .
- ' -fshort-wchar' .
- ' -D__CYGWIN__=1' .
- ($m32 ? ' -D__CYGWIN32__=1' : '') .
- " -D'_cdecl=__attribute__((__cdecl__))'" .
- " -D'__cdecl=__attribute__((__cdecl__))'" .
- " -D'_stdcall=__attribute__((__stdcall__))'" .
- " -D'__stdcall=__attribute__((__stdcall__))'" .
- " -D'_fastcall=__attribute__((__fastcall__))'" .
- " -D'__fastcall=__attribute__((__fastcall__))'" .
- " -D'__declspec(x)=__attribute__((x))'";
+ return ' --os=cygwin';
} elsif ($spec eq 'i386') {
$m32 = 1;
return (