.
[glibc/history.git] / dlfcn / Makefile
blob9115d30c2a11b38d21d90f3c77c0875107a1da65
1 # Copyright (C) 1995-2002, 2003 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, write to the Free
16 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 # 02111-1307 USA.
19 subdir := dlfcn
20 headers := bits/dlfcn.h dlfcn.h
21 extra-libs := libdl
22 libdl-routines := dlopen dlclose dlsym dlvsym dlerror dladdr dladdr1 dlinfo \
23 eval
24 distribute := dlopenold.c glreflib1.c glreflib2.c failtestmod.c eval.c \
25 defaultmod1.c defaultmod2.c errmsg1mod.c modatexit.c \
26 modcxaatexit.c modstatic.c \
27 bug-dlsym1-lib1.c bug-dlsym1-lib2.c
29 extra-libs-others := libdl
31 include ../Makeconfig
33 ifeq ($(versioning),yes)
34 libdl-routines += dlopenold
35 libdl-shared-only-routines := dlopenold
36 endif
37 libdl-shared-only-routines += eval
39 ifeq (yes,$(build-shared))
40 tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
41 bug-dlopen1 bug-dlsym1 tst-dlinfo
42 ifeq (yes,$(have-protected))
43 tests += tstatexit
44 endif
45 endif
46 modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
47 errmsg1mod modatexit modcxaatexit \
48 bug-dlsym1-lib1 bug-dlsym1-lib2
50 ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
51 tests += tststatic
52 tests-static += tststatic
53 modules-names += modstatic
54 tststatic-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
55 endif
57 extra-objs += $(modules-names:=.os) eval.os
58 generated := $(modules-names:=.so)
60 include ../Rules
62 LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name)
64 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
65 $(test-modules): $(objpfx)%.so: $(objpfx)%.os
66 $(build-module)
68 $(objpfx)glrefmain: $(libdl)
69 $(objpfx)glrefmain.out: $(objpfx)glrefmain \
70 $(objpfx)glreflib1.so $(objpfx)glreflib2.so
72 $(objpfx)failtest: $(libdl)
73 $(objpfx)failtest.out: $(objpfx)failtestmod.so
75 $(objpfx)tst-dladdr: $(libdl)
76 $(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so
78 $(objpfx)tst-dlinfo: $(libdl)
79 $(objpfx)tst-dlinfo.out: $(objpfx)glreflib1.so
81 LDFLAGS-default = $(LDFLAGS-rdynamic)
82 $(objpfx)default: $(libdl) $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so
83 $(objpfx)defaultmod1.so: $(libdl) $(common-objpfx)libc_nonshared.a
84 LDFLAGS-defaultmod2.so = $(LDFLAGS-Bsymbolic)
85 $(objpfx)defaultmod2.so: $(libdl) $(common-objpfx)libc_nonshared.a
87 $(objpfx)errmsg1: $(libdl)
88 $(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so
90 $(objpfx)tstatexit: $(libdl)
91 $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so
93 CPPFLAGS-modcxaatexit.c = -DNOT_IN_libc
94 $(objpfx)tstcxaatexit: $(libdl)
95 $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so
97 $(objpfx)modatexit.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
99 $(objpfx)tststatic: $(objpfx)libdl.a
100 $(objpfx)tststatic.out: $(objpfx)tststatic $(objpfx)modstatic.so
102 $(objpfx)modstatic.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
104 $(objpfx)bug-dlopen1: $(libdl)
106 $(objpfx)bug-dlsym1: $(libdl) $(objpfx)bug-dlsym1-lib2.so
107 $(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \
108 $(objpfx)bug-dlsym1-lib2.so
109 $(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so \
110 $(common-objpfx)libc.so \
111 $(common-objpfx)libc_nonshared.a
112 $(objpfx)bug-dlsym1-lib2.so: $(common-objpfx)libc.so \
113 $(common-objpfx)libc_nonshared.a
117 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
118 # This ensures they will load libc.so for needed symbols if loaded by
119 # a statically-linked program that hasn't already loaded it.
120 $(objpfx)libdl.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a \
121 $(if $(filter yes,$(elf)), $(elfobjdir)/ld.so)