mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
Update.
* conform/conformtest.pl: Recognize options --headers and --dialect. Add dialect-specific CFLAGS.
This commit is contained in:
parent
9d48fef0aa
commit
ad4f2ebf64
@ -1,5 +1,8 @@
|
||||
2001-01-25 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* conform/conformtest.pl: Recognize options --headers and
|
||||
--dialect. Add dialect-specific CFLAGS.
|
||||
|
||||
* conform/conformtest.pl: Implement handling of recursive
|
||||
allow-header.
|
||||
|
||||
|
@ -1,10 +1,16 @@
|
||||
#! /usr/bin/perl
|
||||
|
||||
use Getopt::Long;
|
||||
|
||||
$CC = "gcc";
|
||||
$CFLAGS = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
|
||||
|
||||
$dialect="XOPEN2K";
|
||||
GetOptions ('headers=s' => \@headers, 'dialect=s' => \$dialect);
|
||||
@headers = split(/,/,join(',',@headers));
|
||||
|
||||
# List of the headers we are testing.
|
||||
@headers = ("wordexp.h", "wctype.h", "wchar.h", "varargs.h", "utmpx.h",
|
||||
if (@headers == ()) {
|
||||
@headers = ("wordexp.h", "wctype.h", "wchar.h", "varargs.h", "utmpx.h",
|
||||
"utime.h", "unistd.h", "ulimit.h", "ucontext.h", "time.h",
|
||||
"termios.h", "tar.h", "sys/wait.h", "sys/utsname.h", "sys/un.h",
|
||||
"sys/uio.h", "sys/types.h", "sys/times.h", "sys/timeb.h",
|
||||
@ -21,6 +27,20 @@ $CFLAGS = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
|
||||
"fnmatch.h", "fmtmsg.h", "float.h", "fcntl.h", "errno.h",
|
||||
"dlfcn.h", "dirent.h", "ctype.h", "cpio.h", "assert.h",
|
||||
"arpa/inet.h", "aio.h");
|
||||
}
|
||||
|
||||
if ($dialect ne "ISO" && $dialect ne "POSIX" && $dialect ne "XPG3"
|
||||
&& $dialect ne "XPG4" && $dialect ne "UNIX98" && $dialect ne "XOPEN2K") {
|
||||
die "unknown dialect \"$dialect\"";
|
||||
}
|
||||
|
||||
$CFLAGS{"ISO"} = "-I. '-D__attribute__(x)=' -ansi";
|
||||
$CFLAGS{"POSIX"} = "-I. '-D__attribute__(x)=' -D_POSIX_C_SOURCE=199912";
|
||||
$CFLAGS{"XPG3"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE";
|
||||
$CFLAGS{"XPG4"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE_EXTENDED";
|
||||
$CFLAGS{"UNIX98"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=500";
|
||||
$CFLAGS{"XOPEN2K"} = "-I. '-D__attribute__(x)=' -D_XOPEN_SOURCE=600";
|
||||
|
||||
|
||||
# These are the ISO C99 keywords.
|
||||
@keywords = ('auto', 'break', 'case', 'char', 'const', 'continue', 'default',
|
||||
@ -54,13 +74,6 @@ $total = 0;
|
||||
$skipped = 0;
|
||||
$errors = 0;
|
||||
|
||||
#$dialect = "ISO";
|
||||
#$dialect = "POSIX";
|
||||
#$dialect = "XPG3";
|
||||
#$dialect = "XPG4";
|
||||
#$dialect = "UNIX98";
|
||||
$dialect = "XOPEN2K";
|
||||
|
||||
|
||||
sub poorfnmatch {
|
||||
my($pattern, $string) = @_;
|
||||
@ -95,7 +108,7 @@ sub compiletest
|
||||
++$skipped;
|
||||
printf (" SKIP\n");
|
||||
} else {
|
||||
$ret = system "$CC $CFLAGS -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1";
|
||||
$ret = system "$CC $CFLAGS{$dialect} -c $fnamebase.c -o $fnamebase.o > $fnamebase.out 2>&1";
|
||||
if ($ret != 0) {
|
||||
if ($optional != 0) {
|
||||
printf (" $errmsg\n");
|
||||
@ -147,7 +160,7 @@ sub runtest
|
||||
++$skipped;
|
||||
printf (" SKIP\n");
|
||||
} else {
|
||||
$ret = system "$CC $CFLAGS -o $fnamebase $fnamebase.c > $fnamebase.out 2>&1";
|
||||
$ret = system "$CC $CFLAGS{$dialect} -o $fnamebase $fnamebase.c > $fnamebase.out 2>&1";
|
||||
if ($ret != 0) {
|
||||
printf (" FAIL\n");
|
||||
if ($verbose != 0) {
|
||||
@ -227,7 +240,7 @@ sub checknamespace {
|
||||
|
||||
$nerrors = 0;
|
||||
$nknown = 0;
|
||||
open (CONTENT, "$CC $CFLAGS -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
|
||||
open (CONTENT, "$CC $CFLAGS{$dialect} -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |");
|
||||
loop: while (<CONTENT>) {
|
||||
next loop if (/^#undef /);
|
||||
chop;
|
||||
|
Loading…
Reference in New Issue
Block a user