openpty: use TIOCGPTPEER to open slave side fd
[glibc.git] / string / Makefile
blobd7e90a38a5770be9b9380053511be6513d39c951
1 # Copyright (C) 1991-2017 Free Software Foundation, Inc.
2 # This file is part of the GNU C Library.
4 # The GNU C Library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # The GNU C Library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with the GNU C Library; if not, see
16 # <http://www.gnu.org/licenses/>.
19 # Sub-makefile for string portion of library.
21 subdir := string
23 include ../Makeconfig
25 headers := string.h bits/string_fortified.h \
26 strings.h bits/strings_fortified.h \
27 byteswap.h bits/byteswap.h bits/byteswap-16.h \
28 endian.h bits/endian.h bits/uintn-identity.h \
29 memory.h argz.h envz.h
31 routines := strcat strchr strcmp strcoll strcpy strcspn \
32 strverscmp strdup strndup \
33 strerror _strerror strlen strnlen \
34 strncat strncmp strncpy \
35 strrchr strpbrk strsignal strspn strstr strtok \
36 strtok_r strxfrm memchr memcmp memmove memset \
37 mempcpy bcopy bzero ffs ffsll stpcpy stpncpy \
38 strcasecmp strncase strcasecmp_l strncase_l \
39 memccpy memcpy wordcopy strsep strcasestr \
40 swab strfry memfrob memmem rawmemchr strchrnul \
41 $(addprefix argz-,append count create ctsep next \
42 delete extract insert stringify \
43 addsep replace) \
44 envz basename \
45 strcoll_l strxfrm_l string-inlines memrchr \
46 xpg-strerror strerror_l explicit_bzero
48 strop-tests := memchr memcmp memcpy memmove mempcpy memset memccpy \
49 stpcpy stpncpy strcat strchr strcmp strcpy strcspn \
50 strlen strncmp strncpy strpbrk strrchr strspn memmem \
51 strstr strcasestr strnlen strcasecmp strncasecmp \
52 strncat rawmemchr strchrnul bcopy bzero memrchr \
53 explicit_bzero
54 tests := tester inl-tester noinl-tester testcopy test-ffs \
55 tst-strlen stratcliff tst-svc tst-inlcall \
56 bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap \
57 tst-strtok tst-strxfrm bug-strcoll1 tst-strfry \
58 bug-strtok1 $(addprefix test-,$(strop-tests)) \
59 bug-envz1 tst-strxfrm2 tst-endian tst-svc2 \
60 tst-strtok_r bug-strcoll2 tst-cmp tst-xbzero-opt \
61 test-endian-types
63 # This test allocates a lot of memory and can run for a long time.
64 xtests = tst-strcoll-overflow
66 ifeq ($(run-built-tests),yes)
67 tests-special += $(objpfx)tst-svc-cmp.out
68 endif
70 include ../Rules
72 CFLAGS-inl-tester.c = -fno-builtin
73 CFLAGS-noinl-tester.c = -fno-builtin
74 CFLAGS-tst-strlen.c = -fno-builtin
75 CFLAGS-stratcliff.c = -fno-builtin
76 CFLAGS-test-ffs.c = -fno-builtin
77 CFLAGS-tst-inlcall.c = -fno-builtin
78 CFLAGS-tst-xbzero-opt.c = -O3
79 # BZ 21006: Resolve all functions but at least explicit_bzero at startup.
80 # Otherwise the test fails on s390x as the memcpy in prepare_test_buffer is
81 # done by loading r4 / r5 with the test_pattern and using store multiple
82 # instruction to store r4 / r5 to buf. If explicit_bzero would be resolved in
83 # setup_explicit_clear, r4 / r5 would be stored to stack by _dl_runtime_resolve
84 # and the call to memmem in count_test_patterns will find a hit of the
85 # test_pattern on the stack.
86 LDFLAGS-tst-xbzero-opt = -z now
88 # Called during TLS initialization.
89 CFLAGS-memcpy.c = $(no-stack-protector)
90 CFLAGS-wordcopy.c = $(no-stack-protector)
92 ifeq ($(run-built-tests),yes)
93 $(objpfx)tst-svc-cmp.out: tst-svc.expect $(objpfx)tst-svc.out
94 cmp $^ > $@; \
95 $(evaluate-test)
97 LOCALES := de_DE.UTF-8 en_US.ISO-8859-1 en_US.UTF-8 \
98 tr_TR.ISO-8859-9 tr_TR.UTF-8 cs_CZ.UTF-8 \
99 da_DK.ISO-8859-1 en_GB.UTF-8
100 include ../gen-locales.mk
102 $(objpfx)test-strcasecmp.out: $(gen-locales)
103 $(objpfx)test-strncasecmp.out: $(gen-locales)
104 $(objpfx)tst-strxfrm.out: $(gen-locales)
105 $(objpfx)tst-strxfrm2.out: $(gen-locales)
106 # bug-strcoll2 needs cs_CZ.UTF-8 and da_DK.ISO-8859-1.
107 $(objpfx)bug-strcoll2.out: $(gen-locales)
108 $(objpfx)tst-strcoll-overflow.out: $(gen-locales)
110 endif