This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig unit change for #16099.
[metaconfig.git] / U / compline / d_gnulibc.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: d_gnulibc.U,v 3.0.1.1 1997/02/28 15:34:33 ram Exp $
2?RCS:
3?RCS: Copyright (c) 1996,1998 Andy Dougherty
4?RCS: Copyright (c) 1996, Sven Verdoolaege
5?RCS: Copyright (c) 1991-1993, Raphael Manfredi
6?RCS:
7?RCS: You may redistribute only under the terms of the Artistic Licence,
8?RCS: as specified in the README file that comes with the distribution.
9?RCS: You may reuse parts of this distribution only within the terms of
10?RCS: that same Artistic Licence; a copy of which may be found at the root
11?RCS: of the source tree for dist 3.0.
12?RCS:
13?RCS: $Log: d_gnulibc.U,v $
14?RCS: Revision 3.0.1.1 1997/02/28 15:34:33 ram
15?RCS: patch61: created
16?RCS:
17?MAKE:d_gnulibc: Myread Oldconfig Setvar rm \
0f00356b 18 Compile run
959f3c4c
JH
19?MAKE: -pick add $@ %<
20?S:d_gnulibc:
21?S: Defined if we're dealing with the GNU C Library.
22?S:.
23?C:HAS_GNULIBC:
24?C: This symbol, if defined, indicates to the C program that
25?C: the GNU C library is being used.
26?C:.
27?H:#$d_gnulibc HAS_GNULIBC /**/
9c23074f
JH
28?H:?%<:#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
29?H:?%<:# define _GNU_SOURCE
30?H:?%<:#endif
959f3c4c
JH
31?H.
32?LINT: set d_gnulibc
33?X: gnulibc can be executed by calling this entry point.
34?X: Ulrich Drepper doesn't think any other libc does that,
35?X: but we check if it says 'GNU C Library' to be sure.
36?X:
37?X: Alas, as of 3/1998 glibc 2.0.7 reportedly isn't going to
38?X: have __libc_main() anymore. :-(. Fortunately, all released
39?X: versions of glibc 2.x.x _do_ have CPP variables. For 2.0.6,
40?X: they are:
41?X: #define __GLIBC__ 2
42?X: #define__GLIBC_MINOR__ 0.
43?X: (The '6' isn't available :-(.
44?X: glibc2.1 will also have
45?X: extern const char * __gnu_get_libc_release(void);
46?X: extern const char * __gnu_get_libc_version(void);
47?X: functions. --thanks to Andreas Jaeger. --AD 6/1998.
48?X:
49echo " "
50echo "Checking for GNU C Library..." >&4
0f00356b 51cat >try.c <<EOM
959f3c4c
JH
52#include <stdio.h>
53int main()
54{
55#ifdef __GLIBC__
56 exit(0);
57#else
58 exit(1);
59#endif
60}
61EOM
0f00356b
JH
62set try
63if eval $compile_ok && $run ./try; then
959f3c4c
JH
64 val="$define"
65 echo "You are using the GNU C Library"
66else
67 val="$undef"
68 echo "You are not using the GNU C Library"
69fi
0f00356b 70$rm -f try try.*
959f3c4c
JH
71set d_gnulibc
72eval $setvar
73