Use INTERNAL_SYSCALL.
[glibc.git] / dlfcn / Makefile
blob33f6e92c3b2a64334d5c62daf8bfce13975194be
1 # Copyright (C) 1995-1999, 2000, 2001, 2002 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 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 \
26 bug-dlsym1-lib1.c bug-dlsym1-lib2.c
28 extra-libs-others := libdl
30 include ../Makeconfig
32 ifeq ($(versioning),yes)
33 libdl-routines += dlopenold
34 libdl-shared-only-routines := dlopenold
35 endif
36 libdl-shared-only-routines += eval
38 ifeq (yes,$(build-shared))
39 tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
40 bug-dlopen1 bug-dlsym1
41 ifeq (yes,$(have-protected))
42 tests += tstatexit
43 endif
44 endif
45 modules-names = glreflib1 glreflib2 failtestmod defaultmod1 defaultmod2 \
46 errmsg1mod modatexit modcxaatexit \
47 bug-dlsym1-lib1 bug-dlsym1-lib2
49 ifeq (yesyesyes,$(build-static)$(build-shared)$(elf))
50 tests += tststatic
51 tests-static += tststatic
52 modules-names += modstatic
53 tststatic-ENV = LD_LIBRARY_PATH=$(objpfx):$(common-objpfx):$(common-objpfx)elf
54 endif
56 extra-objs += $(modules-names:=.os) eval.os
57 generated := $(modules-names:=.so)
59 include ../Rules
61 LDFLAGS-dl.so = -Wl,-dynamic-linker,$(slibdir)/$(rtld-installed-name)
63 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(modules-names)))
64 $(test-modules): $(objpfx)%.so: $(objpfx)%.os
65 $(build-module)
67 $(objpfx)glrefmain: $(libdl)
68 $(objpfx)glrefmain.out: $(objpfx)glrefmain \
69 $(objpfx)glreflib1.so $(objpfx)glreflib2.so
71 $(objpfx)failtest: $(libdl)
72 $(objpfx)failtest.out: $(objpfx)failtestmod.so
74 $(objpfx)tst-dladdr: $(libdl)
75 $(objpfx)tst-dladdr.out: $(objpfx)glreflib1.so
77 LDFLAGS-default = $(LDFLAGS-rdynamic)
78 $(objpfx)default: $(libdl) $(objpfx)defaultmod1.so $(objpfx)defaultmod2.so
79 $(objpfx)defaultmod1.so: $(libdl) $(common-objpfx)libc_nonshared.a
80 LDFLAGS-defaultmod2.so = $(LDFLAGS-Bsymbolic)
81 $(objpfx)defaultmod2.so: $(libdl) $(common-objpfx)libc_nonshared.a
83 $(objpfx)errmsg1: $(libdl)
84 $(objpfx)errmsg1.out: $(objpfx)errmsg1 $(objpfx)errmsg1mod.so
86 $(objpfx)tstatexit: $(libdl)
87 $(objpfx)tstatexit.out: $(objpfx)tstatexit $(objpfx)modatexit.so
89 CPPFLAGS-modcxaatexit.c = -DNOT_IN_libc
90 $(objpfx)tstcxaatexit: $(libdl)
91 $(objpfx)tstcxaatexit.out: $(objpfx)tstcxaatexit $(objpfx)modcxaatexit.so
93 $(objpfx)modatexit.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
95 $(objpfx)tststatic: $(objpfx)libdl.a
96 $(objpfx)tststatic.out: $(objpfx)tststatic $(objpfx)modstatic.so
98 $(objpfx)modstatic.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a
100 $(objpfx)bug-dlopen1: $(libdl)
102 $(objpfx)bug-dlsym1: $(libdl) $(objpfx)bug-dlsym1-lib2.so
103 $(objpfx)bug-dlsym1.out: $(objpfx)bug-dlsym1-lib1.so \
104 $(objpfx)bug-dlsym1-lib2.so
105 $(objpfx)bug-dlsym1-lib1.so: $(objpfx)bug-dlsym1-lib2.so \
106 $(common-objpfx)libc.so \
107 $(common-objpfx)libc_nonshared.a
108 $(objpfx)bug-dlsym1-lib2.so: $(common-objpfx)libc.so \
109 $(common-objpfx)libc_nonshared.a
113 # Depend on libc.so so a DT_NEEDED is generated in the shared objects.
114 # This ensures they will load libc.so for needed symbols if loaded by
115 # a statically-linked program that hasn't already loaded it.
116 $(objpfx)libdl.so: $(common-objpfx)libc.so $(common-objpfx)libc_nonshared.a