Commit | Line | Data |
---|---|---|
d0ec185f MBT |
1 | ?RCS: Copyright (c) 2014-2014, Karl Williamson & H.Merijn Brand |
2 | ?RCS: | |
3 | ?RCS: You may redistribute only under the terms of the Artistic License, | |
4 | ?RCS: as specified in the README file that comes with the distribution. | |
5 | ?RCS: You may reuse parts of this distribution only within the terms of | |
6 | ?RCS: that same Artistic License; a copy of which may be found at the root | |
7 | ?RCS: of the source tree for dist 3.0. | |
8 | ?RCS: | |
9 | ?MAKE:d_wcscmp: Compile cat rm_try run Oldconfig Setvar | |
10 | ?MAKE: -pick add $@ %< | |
11 | ?S:d_wcscmp: | |
12 | ?S: This variable conditionally defines the HAS_WCSCMP symbol if the | |
13 | ?S: wcscmp() routine is available and can be used to compare wide | |
14 | ?S: character strings. | |
15 | ?S:. | |
16 | ?C:HAS_WCSCMP: | |
17 | ?C: This symbol, if defined, indicates that the wcscmp routine is | |
18 | ?C: available to compare two wide character strings. | |
19 | ?C:. | |
20 | ?H:#$d_wcscmp HAS_WCSCMP /**/ | |
21 | ?H:. | |
22 | ?F:!try | |
23 | ?LINT: set d_wcscmp | |
24 | : look for wcscmp | |
25 | echo " " | |
26 | $cat >try.c <<'EOCP' | |
27 | #include <stdio.h> | |
28 | #include <wchar.h> | |
29 | int main () | |
30 | { | |
31 | wchar_t *s = L" "; | |
32 | return (wcscmp (s, s) ? 1 : 0); | |
33 | } | |
34 | EOCP | |
35 | set try | |
36 | ?X: if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then | |
37 | val="$undef" | |
38 | if eval $compile; then | |
39 | `$run ./try` | |
40 | case "$?" in | |
41 | 0) echo "A working wcscmp() found." >&4 | |
42 | val="$define" ;; | |
43 | *) echo "wcscmp() found, but it doesn't work" >&4 | |
44 | ;; | |
45 | esac | |
46 | else | |
47 | echo "wcscmp() NOT found." >&4 | |
48 | fi | |
49 | set d_wcscmp | |
50 | eval $setvar | |
51 | $rm_try | |
52 |