This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure patch to add detection for DIR.dd_fd member variable
authorSteve Peters <steve@fisharerojo.org>
Sun, 5 Nov 2006 01:40:34 +0000 (19:40 -0600)
committerH.Merijn Brand <h.m.brand@xs4all.nl>
Wed, 8 Nov 2006 16:18:12 +0000 (16:18 +0000)
Message-ID: <fd7a59d30611042340p5543442ctad306aeb748b6bfe@mail.gmail.com>

p4raw-id: //depot/metaconfig@29237

U/perl/d_dir_dd_fd.U [new file with mode: 0644]

diff --git a/U/perl/d_dir_dd_fd.U b/U/perl/d_dir_dd_fd.U
new file mode 100644 (file)
index 0000000..9c98cda
--- /dev/null
@@ -0,0 +1,61 @@
+?RCS: $Id$
+?RCS:
+?RCS: Copyright (c) 2006-2006, H.Merijn Brand
+?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:
+?MAKE:d_dir_dd_fd: Compile cat rm Setvar i_dirent i_stdlib
+?MAKE: -pick add $@ %<
+?S:d_dir_dd_fd (d_dir_dd_fd.U):
+?S:    This variable conditionally defines the HAS_DIR_DD_FD symbol, which
+?S:    indicates that the DIR directory stream type contains a member
+?S:    variable called dd_fd.
+?S:.
+?C:HAS_DIR_DD_FD:
+?C:    This symbol, if defined, indicates that the the DIR* dirstream
+?C:    structure contains a member variable named dd_fd.
+?C:.
+?H:#$d_dir_dd_fd HAS_DIR_DD_FD         /**/
+?H:.
+?LINT:set d_dir_dd_fd
+: Look for DIR.dd_fd
+case "$i_dirent" in
+"$define")
+    echo "Checking to see if DIR has a dd_fd member variable" >&4
+    $cat >try.c <<EOCP
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#include <dirent.h>
+
+int main() {
+    DIR dir;
+    dir.dd_fd = 1;
+    return 0;
+}
+EOCP
+    val=$undef
+    set try
+    if eval $compile; then
+        echo "Yes, it does."
+        val="$define"
+    else
+        echo "No, it does not."
+        val="$undef"
+    fi
+    ;;
+*)
+    echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
+    val="$undef"
+    ;;
+esac
+set d_dir_dd_fd
+eval $setvar
+$rm -f try try.*
+