This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The metaconfig units changes for #10372.
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 1 Jun 2001 15:34:49 +0000 (15:34 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 1 Jun 2001 15:34:49 +0000 (15:34 +0000)
p4raw-id: //depot/metaconfig@10373

U/perl/d_realpath.U [new file with mode: 0644]
U/perl/d_sresgproto.U [new file with mode: 0644]
U/perl/d_sresuproto.U [new file with mode: 0644]
U/perl/gccvers.U
U/perl/i_db.U

diff --git a/U/perl/d_realpath.U b/U/perl/d_realpath.U
new file mode 100644 (file)
index 0000000..aaf9060
--- /dev/null
@@ -0,0 +1,24 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2001 Jarkko Hietaniemi
+?RCS:
+?RCS: You may distribute under the terms of either the GNU General Public
+?RCS: License or the Artistic License, as specified in the README file.
+?RCS:
+?MAKE:d_realpath: Inlibc
+?MAKE: -pick add $@ %<
+?S:d_realpath:
+?S:    This variable conditionally defines the HAS_REALPATH symbol, which
+?S:    indicates to the C program that the realpath() routine is available.
+?S:.
+?C:HAS_REALPATH:
+?C:    This symbol, if defined, indicates that the realpath routine is
+?C:    available to do resolve paths.
+?C:.
+?H:#$d_realpath HAS_REALPATH           /**/
+?H:.
+?LINT:set d_realpath
+: see if realpath exists
+set realpath d_realpath
+eval $inlibc
+
diff --git a/U/perl/d_sresgproto.U b/U/perl/d_sresgproto.U
new file mode 100644 (file)
index 0000000..1e1f3b6
--- /dev/null
@@ -0,0 +1,32 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2001 Jarkko Hietaniemi
+?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:
+?MAKE:d_sresgproto: Hasproto i_unistd
+?MAKE: -pick add $@ %<
+?S:d_sresgproto:
+?S:    This variable conditionally defines the HAS_SETRESGID_PROTO symbol,
+?S:    which indicates to the C program that the system provides
+?S:    a prototype for the setresgid() function.  Otherwise, it is
+?S:    up to the program to supply one.
+?S:.
+?C:HAS_SETRESGID_PROTO:
+?C:    This symbol, if defined, indicates that the system provides
+?C:    a prototype for the setresgid() function.  Otherwise, it is up
+?C:    to the program to supply one.  Good guesses are
+?C:            extern int setresgid(uid_t ruid, uid_t euid, uid_t suid);
+?C:.
+?H:#$d_sresgproto      HAS_SETRESGID_PROTO     /**/
+?H:.
+?LINT:set d_sresgproto 
+: see if prototype for setresgid is available
+echo " "
+set d_sresgproto setresgid $i_unistd unistd.h
+eval $hasproto
+
diff --git a/U/perl/d_sresuproto.U b/U/perl/d_sresuproto.U
new file mode 100644 (file)
index 0000000..c9ac4a8
--- /dev/null
@@ -0,0 +1,32 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2001 Jarkko Hietaniemi
+?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:
+?MAKE:d_sresuproto: Hasproto i_unistd
+?MAKE: -pick add $@ %<
+?S:d_sresuproto:
+?S:    This variable conditionally defines the HAS_SETRESUID_PROTO symbol,
+?S:    which indicates to the C program that the system provides
+?S:    a prototype for the setresuid() function.  Otherwise, it is
+?S:    up to the program to supply one.
+?S:.
+?C:HAS_SETRESUID_PROTO:
+?C:    This symbol, if defined, indicates that the system provides
+?C:    a prototype for the setresuid() function.  Otherwise, it is up
+?C:    to the program to supply one.  Good guesses are
+?C:            extern int setresuid(uid_t ruid, uid_t euid, uid_t suid);
+?C:.
+?H:#$d_sresuproto      HAS_SETRESUID_PROTO     /**/
+?H:.
+?LINT:set d_sresuproto 
+: see if prototype for setresuid is available
+echo " "
+set d_sresuproto setresuid $i_unistd unistd.h
+eval $hasproto
+
index 94f70b0..809ed06 100644 (file)
@@ -29,6 +29,7 @@
 ?LINT:extern ldflags
 ?LINT:extern ccname
 ?LINT:change ccname
+?LINT:change ccflags
 ?X: Check if they have gcc in any guise.  
 echo " "
 echo "Checking for GNU cc in disguise and/or its version number..." >&4
@@ -104,3 +105,12 @@ case "$ccname" in
 '') ccname="$cc" ;;
 esac
 
+case "$gccversion" in
+'') ;;
+*)  case "$ccflags" in
+    *-Wall*) ;;
+    *) ccflags="$ccflags -Wall -ansi" ;;
+    esac
+    ;;
+esac
+
index db49da1..06946b7 100644 (file)
 ?RCS: Revision 3.0.1.1  1994/08/29  16:21:50  ram
 ?RCS: patch32: created by ADO
 ?RCS:
-?MAKE:i_db db_hashtype db_prefixtype: Inhdr +cc +ccflags rm contains cat \
-               Compile d_const libs sed
+?MAKE:i_db db_hashtype db_prefixtype \
+       db_version_major db_version_minor db_version_patch : \
+       Inhdr +cc +ccflags rm contains cat \
+       Compile d_const libs sed
 ?MAKE: -pick add $@ %<
 ?S:i_db:
 ?S:    This variable conditionally defines the I_DB symbol, and indicates
 ?S:    in the <db.h> header file.  In older versions of DB, it was
 ?S:    int, while in newer ones it is size_t.
 ?S:.
+?S:db_version_major:
+?S:    This variable contains the major version number of
+?S:    Berkeley DB found in the <db.h> header file.
+?S:.
+?S:db_version_minor:
+?S:    This variable contains the minor version number of
+?S:    Berkeley DB found in the <db.h> header file.
+?S:    For DB version 1 this is always 0.
+?S:.
+?S:db_version_patch:
+?S:    This variable contains the patch version number of
+?S:    Berkeley DB found in the <db.h> header file.
+?S:    For DB version 1 this is always 0.
+?S:.
 ?C:I_DB:
 ?C:    This symbol, if defined, indicates to the C program that it should
 ?C:    include Berkeley's DB include file <db.h>.
 ?C:    in the <db.h> header file.  In older versions of DB, it was
 ?C:    int, while in newer ones it is size_t.
 ?C:.
+?C:DB_VERSION_MAJOR_CFG:
+?C:    This symbol, if defined, defines the major version number of
+?C:    Berkeley DB found in the <db.h> header when Perl was configured.
+?C:.
+?C:DB_VERSION_MINOR_CFG:
+?C:    This symbol, if defined, defines the minor version number of
+?C:    Berkeley DB found in the <db.h> header when Perl was configured.
+?C:    For DB version 1 this is always 0.
+?C:.
+?C:DB_VERSION_PATCH_CFG:
+?C:    This symbol, if defined, defines the patch version number of
+?C:    Berkeley DB found in the <db.h> header when Perl was configured.
+?C:    For DB version 1 this is always 0.
+?C:.
 ?H:#$i_db I_DB         /**/
 ?H:#define DB_Hash_t   $db_hashtype            /**/
 ?H:#define DB_Prefix_t $db_prefixtype          /**/
+?H:#define DB_VERSION_MAJOR_CFG        $db_version_major       /**/
+?H:#define DB_VERSION_MINOR_CFG        $db_version_minor       /**/
+?H:#define DB_VERSION_PATCH_CFG        $db_version_patch       /**/
 ?H:.
+?F:!try
 ?LINT:set i_db
 ?LINT:change libs
 : see if this is a db.h system
@@ -74,13 +108,19 @@ $define)
 #include <sys/types.h>
 #include <stdio.h>
 #include <db.h>
-int main()
+int main(int argc, char *argv[])
 {
 #ifdef DB_VERSION_MAJOR        /* DB version >= 2 */
     int Major, Minor, Patch ;
     unsigned long Version ;
     (void)db_version(&Major, &Minor, &Patch) ;
-    printf("You have Berkeley DB Version 2 or greater\n");
+    if (argc == 2) {
+        printf("%d %d %d %d %d %d\n",
+               DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
+               Major, Minor, Patch);
+        exit(0);
+    }
+    printf("You have Berkeley DB Version 2 or greater.\n");
 
     printf("db.h is from Berkeley DB Version %d.%d.%d\n",
                DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
@@ -89,11 +129,11 @@ int main()
 
     /* check that db.h & libdb are compatible */
     if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
-       printf("db.h and libdb are incompatible\n") ;
+       printf("db.h and libdb are incompatible.\n") ;
         exit(3);       
     }
 
-    printf("db.h and libdb are compatible\n") ;
+    printf("db.h and libdb are compatible.\n") ;
 
     Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
                + DB_VERSION_PATCH ;
@@ -101,14 +141,18 @@ int main()
     /* needs to be >= 2.3.4 */
     if (Version < 2003004) {
     /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
-       printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
+       printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
         exit(2);       
     }
 
     exit(0);
 #else
 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
-    printf("You have Berkeley DB Version 1\n");
+    if (argc == 2) {
+        printf("1 0 0\n");
+        exit(0);
+    }
+    printf("You have Berkeley DB Version 1.\n");
     exit(0);   /* DB version < 2: the coast is clear. */
 #else
     exit(1);   /* <db.h> not Berkeley DB? */
@@ -119,6 +163,10 @@ EOCP
        set try
        if eval $compile_ok && ./try; then
                echo 'Looks OK.' >&4
+               set `./try 1`
+               db_version_major=$1
+               db_version_minor=$2
+               db_version_patch=$3
        else
                echo "I can't use Berkeley DB with your <db.h>.  I'll disable Berkeley DB." >&4
                i_db=$undef