From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24118 invoked by alias); 29 Jul 2003 19:25:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24105 invoked from network); 29 Jul 2003 19:25:19 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 29 Jul 2003 19:25:19 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h6TJPJZ20534 for ; Tue, 29 Jul 2003 15:25:19 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6TJPJI32168 for ; Tue, 29 Jul 2003 15:25:19 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h6TJPHL13002 for ; Tue, 29 Jul 2003 15:25:18 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 15EAA2CB2D; Tue, 29 Jul 2003 15:32:48 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16166.52191.925152.253688@localhost.redhat.com> Date: Tue, 29 Jul 2003 19:25:00 -0000 To: gdb-patches@sources.redhat.com Subject: [RFA] testsuite cleanups (part 2) X-SW-Source: 2003-07/txt/msg00515.txt.bz2 Here, I am observing a peculiar situation. If you run the testsuite in a directory that is not the build directory, i.e. the gdb.blah object dirs are recreated outside of the build tree, you will see that all the tests which use pthreads.c will not compile. This is because pthreads.c includes "config.h" which gets created in the build gdb/testsuite directory at configure time. Config.h was used to determine if there is posix thread support or not, but now we use the method of trying to compile with various -lblah so we don't really need this anymore. It took me a while to notice this failure because I have the bad habit of looking just at the unexpected failures, glossing over the unsupported results. OK? elena [PS. I assume I used the correct autoconf, but I am nost sure: I used the autoconf-000227 snapshot]. 2003-07-29 Elena Zannoni * configure.in: Don't generate config.h from config.hin. * configure: Regenerate. * config.h: Remove file. * gdb.mi/pthreads.c: Remove include of config.h, and other ifdefs. * gdb.threads/pthreads.c: Ditto. Index: configure =================================================================== RCS file: /cvs/uberbaum/gdb/testsuite/configure,v retrieving revision 1.9 diff -u -p -r1.9 configure --- configure 1 May 2003 01:09:51 -0000 1.9 +++ configure 29 Jul 2003 19:10:33 -0000 @@ -34,6 +34,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -148,6 +149,7 @@ Configuration: --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages + --site-file=FILE use FILE as the site file --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX @@ -318,6 +320,11 @@ EOF -site=* | --site=* | --sit=*) site="$ac_optarg" ;; + -site-file | --site-file | --site-fil | --site-fi | --site-f) + ac_prev=sitefile ;; + -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) + sitefile="$ac_optarg" ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) @@ -483,12 +490,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +if test -z "$sitefile"; then + if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -528,7 +539,6 @@ fi - ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then @@ -549,7 +559,7 @@ ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:553: checking build system type" >&5 +echo "configure:563: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -573,7 +583,7 @@ else { echo "configure: error: can not r fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:577: checking host system type" >&5 +echo "configure:587: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -594,7 +604,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)- echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:598: checking target system type" >&5 +echo "configure:608: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -709,7 +719,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:713: checking how to run the C preprocessor" >&5 +echo "configure:723: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -724,13 +734,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:734: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -741,13 +751,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -758,13 +768,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:768: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -792,17 +802,17 @@ for ac_hdr in pthread.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:796: checking for $ac_hdr" >&5 +echo "configure:806: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -830,12 +840,12 @@ done echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:834: checking for Cygwin environment" >&5 +echo "configure:844: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -863,19 +873,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:867: checking for mingw32 environment" >&5 +echo "configure:877: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:889: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -894,7 +904,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=y echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:898: checking for executable suffix" >&5 +echo "configure:908: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -904,10 +914,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -990,7 +1000,19 @@ fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -DEFS=-DHAVE_CONFIG_H +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} @@ -1029,7 +1051,7 @@ ac_given_srcdir=$srcdir trap 'rm -fr `echo "Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \ gdb.c++/Makefile gdb.disasm/Makefile gdb.java/Makefile gdb.mi/Makefile \ - gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile config.h:config.hin" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 + gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < $ac_file fi; done rm -f conftest.s* - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. - -rm -f conftest.tail -while : -do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS - echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals -done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - fi - rm -f $ac_file - mv conftest.h $ac_file - fi -fi; done EOF cat >> $CONFIG_STATUS < - -#include "config.h" - -#ifndef HAVE_PTHREAD_H - -/* Don't even try to compile. In fact, cause a syntax error that we can - look for as a compiler error message and know that we have no pthread - support. In that case we can just suppress the test completely. */ - -#error "no posix threads support" - -#else - -/* OK. We have the right header. If we try to compile this and fail, then - there is something wrong and the user should know about it so the testsuite - should issue an ERROR result.. */ - -#ifdef __linux__ -#define _MIT_POSIX_THREADS 1 /* GNU/Linux (or at least RedHat 4.0) - needs this */ -#endif - #include /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create @@ -77,4 +55,3 @@ main (int argc, char *argv[]) return 0; } -#endif /* ifndef HAVE_PTHREAD_H */ Index: gdb.threads/pthreads.c =================================================================== RCS file: /cvs/uberbaum/gdb/testsuite/gdb.threads/pthreads.c,v retrieving revision 1.3 diff -u -p -r1.3 pthreads.c --- gdb.threads/pthreads.c 24 Feb 2002 22:56:08 -0000 1.3 +++ gdb.threads/pthreads.c 29 Jul 2003 19:10:37 -0000 @@ -1,26 +1,4 @@ #include - -#include "config.h" - -#ifndef HAVE_PTHREAD_H - -/* Don't even try to compile. In fact, cause a syntax error that we can - look for as a compiler error message and know that we have no pthread - support. In that case we can just suppress the test completely. */ - -#error "no posix threads support" - -#else - -/* OK. We have the right header. If we try to compile this and fail, then - there is something wrong and the user should know about it so the testsuite - should issue an ERROR result.. */ - -#ifdef __linux__ -#define _MIT_POSIX_THREADS 1 /* GNU/Linux (or at least RedHat 4.0) - needs this */ -#endif - #include /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create @@ -168,4 +146,3 @@ main(argc, argv) exit(0); } -#endif /* ifndef HAVE_PTHREAD_H */