This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backport #30919; remove \n; add $run
authorJarkko Hietaniemi <jhi@iki.fi>
Wed, 18 Apr 2007 06:49:59 +0000 (09:49 +0300)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Wed, 18 Apr 2007 18:31:15 +0000 (18:31 +0000)
30919: When removing the test program source,
       also remove the compiled executable.
Subject: [PATCH] Configure: echo without \n but run with $run
Message-Id: <200704180349.l3I3nxDh017058@vipunen.hut.fi>

p4raw-id: //depot/metaconfig@30976

U/compline/d_castneg.U
U/modified/d_strctcpy.U [new file with mode: 0644]
U/modified/d_volatile.U [new file with mode: 0644]
U/modified/i_dirent.U [new file with mode: 0644]
U/modified/voidflags.U
U/perl/i_db.U
U/protos/Hasfield.U
U/protos/Hasstruct.U

index 8093bf0..e952fe5 100644 (file)
@@ -157,5 +157,5 @@ case "$castflags" in
 esac
 set d_castneg
 eval $setvar
-$rm -f try.*
+$rm -f try try.*
 
diff --git a/U/modified/d_strctcpy.U b/U/modified/d_strctcpy.U
new file mode 100644 (file)
index 0000000..4e2f9fb
--- /dev/null
@@ -0,0 +1,53 @@
+?RCS: $Id: d_strctcpy.U,v 3.0 1993/08/18 12:07:34 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: 
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: d_strctcpy.U,v $
+?RCS: Revision 3.0  1993/08/18  12:07:34  ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:d_strctcpy: cat rm cc Setvar
+?MAKE: -pick add $@ %<
+?S:d_strctcpy:
+?S:    This variable conditionally defines the USE_STRUCT_COPY symbol, which
+?S:    indicates to the C program that this C compiler knows how to copy
+?S:    structures.
+?S:.
+?C:USE_STRUCT_COPY (STRUCTCOPY):
+?C:    This symbol, if defined, indicates that this C compiler knows how
+?C:    to copy structures.  If undefined, you'll need to use a block copy
+?C:    routine of some sort instead.
+?C:.
+?H:#$d_strctcpy        USE_STRUCT_COPY /**/
+?H:.
+?LINT:set d_strctcpy
+: check for structure copying
+echo " "
+echo "Checking to see if your C compiler can copy structs..." >&4
+$cat >try.c <<'EOCP'
+int main()
+{
+       struct blurfl {
+               int dyick;
+       } foo, bar;
+
+       foo = bar;
+}
+EOCP
+if $cc -c try.c >/dev/null 2>&1 ; then
+       val="$define"
+       echo "Yup, it can."
+else
+       val="$undef"
+       echo "Nope, it can't."
+fi
+set d_strctcpy
+eval $setvar
+$rm -f try try.*
+
diff --git a/U/modified/d_volatile.U b/U/modified/d_volatile.U
new file mode 100644 (file)
index 0000000..418f1bc
--- /dev/null
@@ -0,0 +1,74 @@
+?RCS: $Id: d_volatile.U,v 3.0.1.2 1995/07/25 14:08:49 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: 
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: d_volatile.U,v $
+?RCS: Revision 3.0.1.2  1995/07/25  14:08:49  ram
+?RCS: patch56: made cc and ccflags optional dependencies
+?RCS:
+?RCS: Revision 3.0.1.1  1993/09/09  11:49:51  ram
+?RCS: patch9: volatile definition was swapped over with undef
+?RCS:
+?RCS: Revision 3.0  1993/08/18  12:07:57  ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?MAKE:d_volatile: cat +cc +ccflags rm Setvar
+?MAKE: -pick add $@ %<
+?S:d_volatile:
+?S:    This variable conditionally defines the HASVOLATILE symbol, which
+?S:    indicates to the C program that this C compiler knows about the
+?S:    volatile declaration.
+?S:.
+?C:HASVOLATILE ~ %<:
+?C:    This symbol, if defined, indicates that this C compiler knows about
+?C:    the volatile declaration.
+?C:.
+?H:?%<:#$d_volatile    HASVOLATILE     /**/
+?H:?%<:#ifndef HASVOLATILE
+?H:?%<:#define volatile
+?H:?%<:#endif
+?H:.
+?W:%<:volatile
+?LINT:set d_volatile
+?LINT:known volatile
+: check for volatile keyword
+echo " "
+echo 'Checking to see if your C compiler knows about "volatile"...' >&4
+$cat >try.c <<'EOCP'
+int main()
+{
+?X:
+?X: The following seven lines added by Bill Campbell <billc@sierra.com>
+?X: detect that MIPS compilers do not handle volatile in all situations.
+?X:
+       typedef struct _goo_struct goo_struct;
+       goo_struct * volatile goo = ((goo_struct *)0);
+       struct _goo_struct {
+               long long_int;
+               int reg_int;
+               char char_var;
+       };
+       typedef unsigned short foo_t;
+       char *volatile foo;
+       volatile int bar;
+       volatile foo_t blech;
+       foo = foo;
+}
+EOCP
+if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
+       val="$define"
+       echo "Yup, it does."
+else
+       val="$undef"
+       echo "Nope, it doesn't."
+fi
+set d_volatile
+eval $setvar
+$rm -f try try.*
+
diff --git a/U/modified/i_dirent.U b/U/modified/i_dirent.U
new file mode 100644 (file)
index 0000000..871c36f
--- /dev/null
@@ -0,0 +1,146 @@
+?RCS: $Id: i_dirent.U,v 3.0.1.4 1994/10/29 16:20:01 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: 
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: i_dirent.U,v $
+?RCS: Revision 3.0.1.4  1994/10/29  16:20:01  ram
+?RCS: patch36: failed scanning for 'd_namlen' with missing <dirent.h> (ADO)
+?RCS:
+?RCS: Revision 3.0.1.3  1994/06/20  07:01:25  ram
+?RCS: patch30: added direntrytype for hints, merely for NeXT (ADO)
+?RCS: patch30: now checks for both struct dirent and direct (ADO)
+?RCS:
+?RCS: Revision 3.0.1.2  1994/05/13  15:22:37  ram
+?RCS: patch27: new variable direntrytype for proper type setting (ADO)
+?RCS:
+?RCS: Revision 3.0.1.1  1994/01/24  14:11:15  ram
+?RCS: patch16: added new Direntry_t pseudo-type for directory entries
+?RCS:
+?RCS: Revision 3.0  1993/08/18  12:08:17  ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?X:
+?X: This unit looks whether there is a dirent system or not
+?X:
+?MAKE:i_dirent d_dirnamlen direntrytype: test contains Setvar \
+       Myread Findhdr cppstdin cppflags cppminus rm
+?MAKE: -pick add $@ %<
+?S:i_dirent:
+?S:    This variable conditionally defines I_DIRENT, which indicates
+?S:    to the C program that it should include <dirent.h>.
+?S:.
+?S:d_dirnamlen:
+?S:    This variable conditionally defines DIRNAMLEN, which indicates
+?S:    to the C program that the length of directory entry names is
+?S:    provided by a d_namelen field.
+?S:.
+?S:direntrytype:
+?S:    This symbol is set to 'struct direct' or 'struct dirent' depending on
+?S:    whether dirent is available or not. You should use this pseudo type to
+?S:    portably declare your directory entries.
+?S:.
+?C:I_DIRENT:
+?C:    This symbol, if defined, indicates to the C program that it should
+?C:    include <dirent.h>. Using this symbol also triggers the definition
+?C:    of the Direntry_t define which ends up being 'struct dirent' or
+?C:    'struct direct' depending on the availability of <dirent.h>.
+?C:.
+?C:DIRNAMLEN:
+?C:    This symbol, if defined, indicates to the C program that the length
+?C:    of directory entry names is provided by a d_namlen field.  Otherwise
+?C:    you need to do strlen() on the d_name field.
+?C:.
+?C:Direntry_t:
+?C:    This symbol is set to 'struct direct' or 'struct dirent' depending on
+?C:    whether dirent is available or not. You should use this pseudo type to
+?C:    portably declare your directory entries.
+?C:.
+?H:#$i_dirent I_DIRENT         /**/
+?H:#$d_dirnamlen DIRNAMLEN     /**/
+?H:?%<:@if I_DIRENT && Direntry_t
+?H:?%<:#define Direntry_t $direntrytype
+?H:?%<:@end
+?H:.
+?T:xinc guess1 guess2
+?LINT:set i_dirent d_dirnamlen direntrytype
+: see if this is a dirent system
+echo " "
+if xinc=`./findhdr dirent.h`; $test "$xinc"; then
+       val="$define"
+       echo "<dirent.h> found." >&4
+else
+       val="$undef"
+       if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
+               echo "<sys/dir.h> found." >&4
+               echo " "
+       else
+               xinc=`./findhdr sys/ndir.h`
+       fi
+       echo "<dirent.h> NOT found." >&4
+fi
+set i_dirent
+eval $setvar
+
+?X: Use struct dirent or struct direct?   If we're using dirent.h, 
+?X: it's probably struct dirent, but apparently not always.
+?X: Assume $xinc still contains the name of the header file we're using.
+@if direntrytype || Direntry_t
+: Look for type of directory structure.
+echo " "
+$cppstdin $cppflags $cppminus < "$xinc" > try.c
+
+case "$direntrytype" in
+''|' ')
+       case "$i_dirent" in
+       $define) guess1='struct dirent' ;;
+       *) guess1='struct direct'  ;;
+       esac
+       ;;
+*)     guess1="$direntrytype"
+       ;;
+esac
+
+case "$guess1" in
+'struct dirent') guess2='struct direct' ;;
+*) guess2='struct dirent' ;;
+esac
+               
+if $contains "$guess1" try.c >/dev/null 2>&1; then
+       direntrytype="$guess1"
+       echo "Your directory entries are $direntrytype." >&4
+elif $contains "$guess2" try.c >/dev/null 2>&1; then
+       direntrytype="$guess2"
+       echo "Your directory entries seem to be $direntrytype." >&4
+else
+       echo "I don't recognize your system's directory entries." >&4
+       rp="What type is used for directory entries on this system?"
+       dflt="$guess1"
+       . ./myread
+       direntrytype="$ans"
+fi
+$rm -f try try.c
+
+@end
+
+@if d_dirnamlen || DIRNAMLEN
+: see if the directory entry stores field length
+echo " "
+$cppstdin $cppflags $cppminus < "$xinc" > try.c
+if $contains 'd_namlen' try.c >/dev/null 2>&1; then
+       echo "Good, your directory entry keeps length information in d_namlen." >&4
+       val="$define"
+else
+       echo "Your directory entry does not know about the d_namlen field." >&4
+       val="$undef"
+fi
+set d_dirnamlen
+eval $setvar
+$rm -f try try.c
+
+@end
index 7f5204c..f5099af 100644 (file)
@@ -159,5 +159,5 @@ EOM
        voidflags="$ans"
        ;;
 esac
-$rm -f try.* .out
+$rm -f try try.* .out
 
index c86e653..74879d1 100644 (file)
@@ -184,7 +184,7 @@ EOCP
                        ;;
                esac
        fi
-       $rm -f try.*
+       $rm -f try try.*
        ;;
 esac
 
@@ -228,7 +228,7 @@ EOCP
                echo "Help:  I can't seem to compile the db test program." >&4
                echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
        fi
-       $rm -f try.*
+       $rm -f try try.*
        echo "Your version of Berkeley DB uses $db_hashtype for hash."
        ;;
 *)     db_hashtype=u_int32_t
@@ -275,7 +275,7 @@ EOCP
                echo "Help:  I can't seem to compile the db test program." >&4
                echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
        fi
-       $rm -f try.*
+       $rm -f try try.*
        echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
        ;;
 *)     db_prefixtype='size_t'
index 4606ed7..15c3f10 100644 (file)
@@ -40,5 +40,5 @@ else
 fi;
 set $varname;
 eval $setvar;
-$rm -f try.c try.o'
+$rm -f try try.c try.o'
 
index 1014c57..c72a057 100644 (file)
@@ -40,5 +40,5 @@ else
 fi;
 set $varname;
 eval $setvar;
-$rm -f try.c try.o'
+$rm -f try try.c try.o'