1 # Copyright (C) 1995-1999, 2000, 2001 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
20 headers
:= bits
/dlfcn.h dlfcn.h
22 libdl-routines
:= dlopen dlclose dlsym dlvsym dlerror dladdr eval
23 distribute
:= dlopenold.c glreflib1.c glreflib2.c failtestmod.c eval.c \
24 defaultmod1.c defaultmod2.c errmsg1mod.c modatexit.c \
25 modcxaatexit.c modstatic.c
27 extra-libs-others
:= libdl
31 ifeq ($(versioning
),yes
)
32 libdl-routines
+= dlopenold
33 libdl-shared-only-routines
:= dlopenold
35 libdl-shared-only-routines
+= eval
37 ifeq (yes
,$(build-shared
))
38 tests
= glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit
39 ifeq (yes
,$(have-protected
))
43 modules-names
= glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
44 errmsg1mod modatexit modcxaatexit
46 ifeq (yesyesyes
,$(build-static
)$(build-shared
)$(elf
))
48 tests-static
+= tststatic
49 modules-names
+= modstatic
50 tststatic-ENV
= LD_LIBRARY_PATH
=$(objpfx
):$(common-objpfx
):$(common-objpfx
)elf
53 extra-objs
+= $(modules-names
:=.os
) eval.os
54 generated
:= $(modules-names
:=.so
)
58 LDFLAGS-dl.so
= -Wl
,-dynamic-linker
,$(slibdir
)/$(rtld-installed-name
)
60 test-modules
= $(addprefix $(objpfx
),$(addsuffix .so
,$(modules-names
)))
61 $(test-modules
): $(objpfx
)%.so
: $(objpfx
)%.os
64 $(objpfx
)glrefmain
: $(libdl
)
65 $(objpfx
)glrefmain.out
: $(objpfx
)glrefmain \
66 $(objpfx
)glreflib1.so
$(objpfx
)glreflib2.so
68 $(objpfx
)failtest
: $(libdl
)
69 $(objpfx
)failtest.out
: $(objpfx
)failtestmod.so
71 $(objpfx
)tst-dladdr
: $(libdl
)
72 $(objpfx
)tst-dladdr.out
: $(objpfx
)glreflib1.so
74 LDFLAGS-default
= $(LDFLAGS-rdynamic
)
75 $(objpfx
)default
: $(libdl
) $(objpfx
)defaultmod1.so
$(objpfx
)defaultmod2.so
76 $(objpfx
)defaultmod1.so
: $(libdl
) $(common-objpfx
)libc_nonshared.a
77 LDFLAGS-defaultmod2.so
= $(LDFLAGS-Bsymbolic
)
78 $(objpfx
)defaultmod2.so
: $(libdl
) $(common-objpfx
)libc_nonshared.a
80 $(objpfx
)errmsg1
: $(libdl
)
81 $(objpfx
)errmsg1.out
: $(objpfx
)errmsg1
$(objpfx
)errmsg1mod.so
83 $(objpfx
)tstatexit
: $(libdl
)
84 $(objpfx
)tstatexit.out
: $(objpfx
)tstatexit
$(objpfx
)modatexit.so
86 $(objpfx
)tstcxaatexit
: $(libdl
)
87 $(objpfx
)tstcxaatexit.out
: $(objpfx
)tstcxaatexit
$(objpfx
)modcxaatexit.so
89 $(objpfx
)modatexit.so
: $(common-objpfx
)libc.so
$(common-objpfx
)libc_nonshared.a
91 $(objpfx
)tststatic
: $(objpfx
)libdl.a
92 $(objpfx
)tststatic.out
: $(objpfx
)tststatic
$(objpfx
)modstatic.so
94 $(objpfx
)modstatic.so
: $(common-objpfx
)libc.so
$(common-objpfx
)libc_nonshared.a
96 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
97 # This ensures they will load libc.so for needed symbols if loaded by
98 # a statically-linked program that hasn't already loaded it.
99 $(objpfx
)libdl.so
: $(common-objpfx
)libc.so
$(common-objpfx
)libc_nonshared.a