This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
DBL_EPSILON DBL_MIN FLT_EPSILON FLT_MIN are not C constant expressions
[perl5.git] / ext / POSIX / Makefile.PL
CommitLineData
170888cf
AD
1# Explicitly avoid including '.' in @INC; autoloader gets confused since it
2# can find POSIX.pm, but can't find autosplit.ix.
3BEGIN { @INC = '../../lib';}
4#
42793c05 5use ExtUtils::MakeMaker;
1cb0fb50 6use ExtUtils::Constant 0.11 'WriteConstants';
514114c1 7use Config;
d5b7de33
NC
8my $rt_signals;
9if ($Config{sig_name} =~ /\bRTMIN\b/ && $Config{sig_name} =~ /\bRTMAX\b/) {
10 # Yes, it really has them. (Some systems define the C pre-processor
11 # symbols, but they depend on other macros that are only defined during
12 # kernel compilation
13 $rt_signals++;
14}
15
514114c1
GS
16my @libs;
17if ($^O ne 'MSWin32') {
2834bd71 18 @libs = ('LIBS' => ["-lm -lposix -lcposix"]);
514114c1 19}
4ad3186e 20WriteMakefile(
1adb159c 21 NAME => 'POSIX',
514114c1 22 @libs,
3609ea0d
JH
23 MAN3PODS => {}, # Pods will be built by installman.
24 XSPROTOARG => '-noprototypes', # XXX remove later?
ece2ffd9 25 VERSION_FROM => 'POSIX.pm',
3609ea0d 26 realclean => {FILES=> 'const-c.inc const-xs.inc'},
4ad3186e 27);
0552bf3a
NC
28
29my @names =
30 (
31 qw(ARG_MAX B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 B300 B38400 B4800
32 B50 B600 B75 B9600 BRKINT BUFSIZ CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX
ae052913 33 CLOCAL CLOCKS_PER_SEC CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB E2BIG
0552bf3a
NC
34 EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
35 EBUSY ECHILD ECHO ECHOE ECHOK ECHONL ECONNABORTED ECONNREFUSED
36 ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG
37 EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR
38 ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET
39 ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM
40 ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK
41 ENOTTY ENXIO EOF EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM
42 EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN
43 ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY
33fb14dc
NC
44 EUSERS EWOULDBLOCK EXDEV FILENAME_MAX F_OK HUPCL ICANON ICRNL IEXTEN
45 IGNBRK IGNCR IGNPAR INLCR INPCK INT_MAX INT_MIN ISIG ISTRIP IXOFF IXON
46 LC_ALL LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
47 LINK_MAX LONG_MAX LONG_MIN L_ctermid L_cuserid L_tmpnam MAX_CANON
807fcc3a
SP
48 MAX_INPUT MB_LEN_MAX MSG_CTRUNC MSG_DONTROUTE MSG_EOR MSG_OOB MSG_PEEK
49 MSG_TRUNC MSG_WAITALL NAME_MAX NCCS NGROUPS_MAX NOFLSH OPEN_MAX OPOST
0552bf3a
NC
50 PARENB PARMRK PARODD PATH_MAX PIPE_BUF RAND_MAX R_OK SCHAR_MAX
51 SCHAR_MIN SEEK_CUR SEEK_END SEEK_SET SHRT_MAX SHRT_MIN SIGABRT SIGALRM
52 SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT
6800c0cf 53 SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU
3609ea0d
JH
54 SIGUSR1 SIGUSR2 SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SSIZE_MAX
55 STDERR_FILENO STDIN_FILENO STDOUT_FILENO STREAM_MAX
56 S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID
57 S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR TCIFLUSH TCIOFF
58 TCIOFLUSH TCION TCOFLUSH TCOOFF TCOON TCSADRAIN TCSAFLUSH TCSANOW
59 TMP_MAX TOSTOP TZNAME_MAX VEOF VEOL VERASE VINTR VKILL VMIN VQUIT
60 VSTART VSTOP VSUSP VTIME WNOHANG WUNTRACED W_OK X_OK
61 _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT
0552bf3a
NC
62 _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE
63 _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX
d61b6859
BZ
64 _SC_OPEN_MAX _SC_PAGESIZE _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX
65 _SC_VERSION),
ae052913 66 {name=>"CLK_TCK", not_constant=>1},
64bb7586 67 {name=>"MB_CUR_MAX", not_constant=>1},
0552bf3a
NC
68 {name=>"EXIT_FAILURE", default=>["IV", "1"]},
69 {name=>"EXIT_SUCCESS", default=>["IV", "0"]},
583e5548
NC
70 {name=>"SIG_DFL", value=>"(IV)SIG_DFL", not_constant=>1},
71 {name=>"SIG_ERR", value=>"(IV)SIG_ERR", not_constant=>1},
72 {name=>"SIG_IGN", value=>"(IV)SIG_IGN", not_constant=>1},
0552bf3a
NC
73 # L_tmpnam[e] was a typo--retained for compatibility
74 {name=>"L_tmpname", value=>"L_tmpnam"},
75 {name=>"NULL", value=>"0"},
76 {name=>"_POSIX_JOB_CONTROL", type=>"YES", default=>["IV", "0"]},
77 {name=>"_POSIX_SAVED_IDS", type=>"YES", default=>["IV", "0"]},
64bb7586 78 {name=>'FLT_ROUNDS', type=>"NV", not_constant=>1},
6800c0cf 79 {name=>"HUGE_VAL", type=>"NV", not_constant=>1,
0552bf3a
NC
80 macro=>[<<'END', "#endif\n"],
81#if (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)) || defined(HUGE_VAL)
82 /* HUGE_VALL is admittedly non-POSIX but if we are using long doubles
83 * we might as well use long doubles. --jhi */
84END
85 value=>'
86#if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)
87 HUGE_VALL
88#else
89 HUGE_VAL
90#endif
91 '});
92
93push @names, {name=>$_, type=>"UV"}
94 foreach (qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND
95 SA_RESTART SA_SIGINFO UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX));
6800c0cf 96push @names, {name=>$_, type=>"NV", not_constant=>1}
2da69e32
NC
97 foreach (qw(DBL_MAX FLT_MAX LDBL_MAX LDBL_MIN LDBL_EPSILON
98 DBL_EPSILON DBL_MIN FLT_EPSILON FLT_MIN));
6800c0cf 99
0552bf3a 100push @names, {name=>$_, type=>"NV"}
2da69e32
NC
101 foreach (qw(DBL_DIG DBL_MANT_DIG DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN_10_EXP
102 DBL_MIN_EXP FLT_DIG FLT_MANT_DIG FLT_MAX_10_EXP FLT_MAX_EXP
103 FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX LDBL_DIG LDBL_MANT_DIG
104 LDBL_MAX_10_EXP LDBL_MAX_EXP LDBL_MIN_10_EXP LDBL_MIN_EXP));
0552bf3a
NC
105
106push @names, {name=>$_, type=>"IV", default=>["IV", "0"]}
107 foreach (qw(_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED
108 _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX
109 _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX
110 _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX
111 _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION
112 ));
113
d5b7de33
NC
114if ($rt_signals) {
115 push @names, {name=>"SIGRTMAX", not_constant=>1},
116 {name=>"SIGRTMIN", not_constant=>1},
117} else {
118 # Well, it seems that your vendor has defined them, but not in a way that
119 # would actually compile.
120 push @names, {name=>"SIGRTMAX", macro=>0},
121 {name=>"SIGRTMIN", macro=>0},
122}
123
0552bf3a 124WriteConstants(
8ad94821 125 ($] > 5.009002 ? (PROXYSUBS => 1) : ()),
0552bf3a
NC
126 NAME => 'POSIX',
127 NAMES => \@names,
128);