Commit | Line | Data |
42793c05 |
1 | use ExtUtils::MakeMaker; |
0552bf3a |
2 | use ExtUtils::Constant 0.07 'WriteConstants'; |
514114c1 |
3 | use Config; |
4 | my @libs; |
5 | if ($^O ne 'MSWin32') { |
2834bd71 |
6 | @libs = ('LIBS' => ["-lm -lposix -lcposix"]); |
514114c1 |
7 | } |
4ad3186e |
8 | WriteMakefile( |
1adb159c |
9 | NAME => 'POSIX', |
514114c1 |
10 | @libs, |
69158f75 |
11 | MAN3PODS => {}, # Pods will be built by installman. |
4ad3186e |
12 | XSPROTOARG => '-noprototypes', # XXX remove later? |
c07a80fd |
13 | VERSION_FROM => 'POSIX.pm', |
21071c79 |
14 | realclean => {FILES=> 'constants.c constants.xs'}, |
4ad3186e |
15 | ); |
0552bf3a |
16 | |
17 | my @names = |
18 | ( |
19 | qw(ARG_MAX B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 B300 B38400 B4800 |
20 | B50 B600 B75 B9600 BRKINT BUFSIZ CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX |
21 | CLK_TCK CLOCAL CLOCKS_PER_SEC CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB E2BIG |
22 | EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF |
23 | EBUSY ECHILD ECHO ECHOE ECHOK ECHONL ECONNABORTED ECONNREFUSED |
24 | ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG |
25 | EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR |
26 | ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET |
27 | ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM |
28 | ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK |
29 | ENOTTY ENXIO EOF EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM |
30 | EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN |
31 | ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY |
32 | EUSERS EWOULDBLOCK EXDEV FD_CLOEXEC FILENAME_MAX F_DUPFD F_GETFD |
33 | F_GETFL F_GETLK F_OK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK |
34 | F_WRLCK HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR INLCR INPCK |
35 | INT_MAX INT_MIN ISIG ISTRIP IXOFF IXON LC_ALL LC_COLLATE LC_CTYPE |
36 | LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LINK_MAX LONG_MAX LONG_MIN |
37 | L_ctermid L_cuserid L_tmpnam MAX_CANON MAX_INPUT MB_CUR_MAX MB_LEN_MAX |
38 | NAME_MAX NCCS NGROUPS_MAX NOFLSH OPEN_MAX OPOST O_ACCMODE O_APPEND |
39 | O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY |
40 | PARENB PARMRK PARODD PATH_MAX PIPE_BUF RAND_MAX R_OK SCHAR_MAX |
41 | SCHAR_MIN SEEK_CUR SEEK_END SEEK_SET SHRT_MAX SHRT_MIN SIGABRT SIGALRM |
42 | SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT |
43 | SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 |
44 | SIG_BLOCK SIG_SETMASK SIG_UNBLOCK SSIZE_MAX STDERR_FILENO STDIN_FILENO |
45 | STDOUT_FILENO STREAM_MAX S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO |
46 | S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH |
47 | S_IXUSR TCIFLUSH TCIOFF TCIOFLUSH TCION TCOFLUSH TCOOFF TCOON |
48 | TCSADRAIN TCSAFLUSH TCSANOW TMP_MAX TOSTOP TZNAME_MAX VEOF VEOL VERASE |
49 | VINTR VKILL VMIN VQUIT VSTART VSTOP VSUSP VTIME WNOHANG WUNTRACED W_OK |
50 | X_OK _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT |
51 | _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX _PC_PIPE_BUF _PC_VDISABLE |
52 | _SC_ARG_MAX _SC_CHILD_MAX _SC_CLK_TCK _SC_JOB_CONTROL _SC_NGROUPS_MAX |
53 | _SC_OPEN_MAX _SC_SAVED_IDS _SC_STREAM_MAX _SC_TZNAME_MAX _SC_VERSION), |
54 | {name=>"EXIT_FAILURE", default=>["IV", "1"]}, |
55 | {name=>"EXIT_SUCCESS", default=>["IV", "0"]}, |
56 | {name=>"SIG_DFL", value=>"(IV)SIG_DFL"}, |
57 | {name=>"SIG_ERR", value=>"(IV)SIG_ERR"}, |
58 | {name=>"SIG_IGN", value=>"(IV)SIG_IGN"}, |
59 | # L_tmpnam[e] was a typo--retained for compatibility |
60 | {name=>"L_tmpname", value=>"L_tmpnam"}, |
61 | {name=>"NULL", value=>"0"}, |
62 | {name=>"_POSIX_JOB_CONTROL", type=>"YES", default=>["IV", "0"]}, |
63 | {name=>"_POSIX_SAVED_IDS", type=>"YES", default=>["IV", "0"]}, |
64 | {name=>"HUGE_VAL", type=>"NV", |
65 | macro=>[<<'END', "#endif\n"], |
66 | #if (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)) || defined(HUGE_VAL) |
67 | /* HUGE_VALL is admittedly non-POSIX but if we are using long doubles |
68 | * we might as well use long doubles. --jhi */ |
69 | END |
70 | value=>' |
71 | #if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL) |
72 | HUGE_VALL |
73 | #else |
74 | HUGE_VAL |
75 | #endif |
76 | '}); |
77 | |
78 | push @names, {name=>$_, type=>"UV"} |
79 | foreach (qw(SA_NOCLDSTOP SA_NOCLDWAIT SA_NODEFER SA_ONSTACK SA_RESETHAND |
80 | SA_RESTART SA_SIGINFO UCHAR_MAX UINT_MAX ULONG_MAX USHRT_MAX)); |
81 | push @names, {name=>$_, type=>"NV"} |
82 | foreach (qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP |
83 | DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP |
84 | FLT_DIG FLT_EPSILON FLT_MANT_DIG FLT_MAX FLT_MAX_10_EXP |
85 | FLT_MAX_EXP FLT_MIN FLT_MIN_10_EXP FLT_MIN_EXP FLT_RADIX |
86 | FLT_ROUNDS |
87 | LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP |
88 | LDBL_MAX_EXP LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)); |
89 | |
90 | push @names, {name=>$_, type=>"IV", default=>["IV", "0"]} |
91 | foreach (qw(_POSIX_ARG_MAX _POSIX_CHILD_MAX _POSIX_CHOWN_RESTRICTED |
92 | _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX |
93 | _POSIX_NGROUPS_MAX _POSIX_NO_TRUNC _POSIX_OPEN_MAX |
94 | _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX |
95 | _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VDISABLE _POSIX_VERSION |
96 | )); |
97 | |
98 | WriteConstants( |
99 | NAME => 'POSIX', |
100 | NAMES => \@names, |
101 | ); |