Update.
[glibc.git] / dlfcn / Makefile
blob7bd74689939189a141ab0e13497b98a9d8afbfa6
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 Library General Public License as
6 # published by the Free Software Foundation; either version 2 of the
7 # 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 # Library General Public License for more details.
14 # You should have received a copy of the GNU Library General Public
15 # License along with the GNU C Library; see the file COPYING.LIB. If not,
16 # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 # Boston, MA 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 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
27 extra-libs-others := libdl
29 include ../Makeconfig
31 ifeq ($(versioning),yes)
32 libdl-routines += dlopenold
33 libdl-shared-only-routines := dlopenold
34 endif
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))
40 tests += tstatexit
41 endif
42 endif
43 modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
44 errmsg1mod modatexit modcxaatexit
45 extra-objs += $(modules-names:=.os) eval.os
46 generated := $(modules-names:=.so)
48 include ../Rules
50 LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name)
52 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
53 $(test-modules): $(objpfx)%.so: $(objpfx)%.os
54 $(build-module)
56 $(objpfx)glrefmain: $(libdl)
57 $(objpfx)glrefmain.out: $(objpfx)glrefmain \
58 $(objpfx)glreflib1.so $(objpfx)glreflib2.so
60 $(objpfx)failtest: $(libdl)
61 $(objpfx)failtest.out: $(objpfx)failtestmod.so
63 $(objpfx)tst-dladdr: $(libdl)
64 $(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so
66 LDFLAGS-default = -rdynamic
67 $(objpfx)default: $(libdl) $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so
68 $(objpfx)defaultmod1.so: $(libdl)
69 LDFLAGS-defaultmod2.so = -Bsymbolic
70 $(objpfx)defaultmod2.so: $(libdl)
72 $(objpfx)errmsg1: $(libdl)
73 $(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so
75 $(objpfx)tstatexit: $(libdl)
76 $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so
78 $(objpfx)tstcxaatexit: $(libdl)
79 $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so
81 $(objpfx)modatexit.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
83 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
84 # This ensures they will load libc.so for needed symbols if loaded by
85 # a statically-linked program that hasn't already loaded it.
86 $(objpfx)libdl.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a