Add STATX_MNT_ID_UNIQUE from Linux 6.8 to bits/statx-generic.h
[glibc.git] / dlfcn / Makefile
blobd473773dd4259be58a41c00f15a7069f625d30ab
1 # Copyright (C) 1995-2024 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 # <https://www.gnu.org/licenses/>.
18 subdir := dlfcn
20 include ../Makeconfig
22 headers := \
23 bits/dl_find_object.h \
24 bits/dlfcn.h \
25 dlfcn.h \
26 # headers
27 extra-libs := libdl
28 libdl-routines := libdl-compat
29 routines = \
30 dladdr \
31 dladdr1 \
32 dlclose \
33 dlerror \
34 dlinfo \
35 dlmopen \
36 dlopen \
37 dlsym \
38 dlvsym \
39 libc_dlerror_result \
40 # routines
42 extra-libs-others := libdl
44 libdl-shared-only-routines += libdl-compat
46 # Pretend that libdl.so is a linker script, so that the symbolic
47 # link is not installed.
48 install-lib-ldscripts = libdl.so
49 $(inst_libdir)/libdl.so:
51 ifeq ($(build-shared),yes)
52 routines += dlopenold
53 shared-only-routines := dlopenold
54 endif
56 ifeq (yes,$(build-shared))
57 tests = \
58 bug-atexit1 \
59 bug-atexit2 \
60 bug-atexit3 \
61 bug-dl-leaf \
62 bug-dlopen1 \
63 bug-dlsym1 \
64 default \
65 errmsg1 \
66 failtest \
67 glrefmain \
68 tst-dladdr \
69 tst-dlinfo \
70 tst-rec-dlopen \
71 tstatexit \
72 tstcxaatexit \
73 # tests
74 endif
75 modules-names = \
76 bug-atexit1-lib \
77 bug-atexit2-lib \
78 bug-dl-leaf-lib \
79 bug-dl-leaf-lib-cb \
80 bug-dlsym1-lib1 \
81 bug-dlsym1-lib2 \
82 defaultmod1 \
83 defaultmod2 \
84 errmsg1mod \
85 failtestmod \
86 glreflib1 \
87 glreflib2 \
88 glreflib3 \
89 modatexit \
90 modcxaatexit \
91 moddummy1 \
92 moddummy2 \
93 # modules-names
95 failtestmod.so-no-z-defs = yes
96 glreflib2.so-no-z-defs = yes
97 errmsg1mod.so-no-z-defs = yes
99 ifeq (yes,$(build-shared))
100 tests += \
101 tststatic \
102 tststatic2 \
103 tststatic3 \
104 tststatic4 \
105 tststatic5 \
106 # tests
107 tests-static += \
108 tststatic \
109 tststatic2 \
110 tststatic3 \
111 tststatic4 \
112 tststatic5 \
113 # tests-static
114 modules-names += \
115 modstatic \
116 modstatic2 \
117 modstatic3 \
118 modstatic5 \
119 # modules-names
120 tststatic-ENV = LD_LIBRARY_PATH=$(ld-library-path):$(common-objpfx)elf
121 tststatic2-ENV = $(tststatic-ENV)
122 tststatic3-ENV = $(tststatic-ENV)
123 tststatic4-ENV = $(tststatic-ENV)
124 tststatic5-ENV = $(tststatic-ENV)
126 tests-internal += \
127 tst-dlinfo-phdr \
128 # tests-internal
130 ifneq (,$(CXX))
131 modules-names += bug-atexit3-lib
132 else
133 tests-unsupported += bug-atexit3
134 endif
135 endif
137 extra-test-objs += $(modules-names:=.os)
138 generated += $(modules-names:=.so)
140 include ../Rules
142 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
144 ifeq ($(build-shared),yes)
145 # Build all the modules even when not actually running test programs.
146 tests: $(test-modules)
147 endif
149 $(objpfx)glrefmain.out: $(objpfx)glrefmain \
150 $(objpfx)glreflib1.so $(objpfx)glreflib2.so
152 $(objpfx)failtest.out: $(objpfx)failtestmod.so
154 $(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so
156 $(objpfx)tst-dlinfo.out: $(objpfx)glreflib3.so
157 LDFLAGS-glreflib3.so = -Wl,-rpath,:
159 LDFLAGS-default = $(LDFLAGS-rdynamic)
160 $(objpfx)default: $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so
161 LDFLAGS-defaultmod2.so = $(LDFLAGS-Bsymbolic)
163 $(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so
165 $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so
167 $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so
169 $(objpfx)tststatic.out: $(objpfx)tststatic $(objpfx)modstatic.so
171 $(objpfx)tststatic2.out: $(objpfx)tststatic2 $(objpfx)modstatic.so \
172 $(objpfx)modstatic2.so
174 $(objpfx)tststatic3.out: $(objpfx)tststatic3 $(objpfx)modstatic3.so
176 $(objpfx)tststatic4.out: $(objpfx)tststatic4 $(objpfx)modstatic3.so
178 $(objpfx)tststatic5.out: $(objpfx)tststatic5 $(objpfx)modstatic5.so
180 $(objpfx)bug-dlsym1: $(objpfx)bug-dlsym1-lib2.so
181 $(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \
182 $(objpfx)bug-dlsym1-lib2.so
183 $(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so
185 $(objpfx)bug-atexit1.out: $(objpfx)bug-atexit1-lib.so
187 $(objpfx)bug-atexit2.out: $(objpfx)bug-atexit2-lib.so
189 ifneq (,$(CXX))
190 LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh
191 $(objpfx)bug-atexit3-lib.so: $(libsupport)
192 $(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so
193 endif
195 $(objpfx)bug-dl-leaf: $(objpfx)bug-dl-leaf-lib.so
196 $(objpfx)bug-dl-leaf.out: $(objpfx)bug-dl-leaf-lib-cb.so
197 $(objpfx)bug-dl-leaf-lib-cb.so: $(objpfx)bug-dl-leaf-lib.so
199 $(objpfx)tst-rec-dlopen.out: $(objpfx)moddummy1.so $(objpfx)moddummy2.so