1 # ====================================================================
5 # Dynamic loader configuration data
7 # ====================================================================
8 #####ECOSGPLCOPYRIGHTBEGIN####
9 ## -------------------------------------------
10 ## This file is part of eCos, the Embedded Configurable Operating System.
11 ## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
13 ## eCos is free software; you can redistribute it and/or modify it under
14 ## the terms of the GNU General Public License as published by the Free
15 ## Software Foundation; either version 2 or (at your option) any later version.
17 ## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
18 ## WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 ## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 ## You should have received a copy of the GNU General Public License along
23 ## with eCos; if not, write to the Free Software Foundation, Inc.,
24 ## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
26 ## As a special exception, if other files instantiate templates or use macros
27 ## or inline functions from this file, or you compile this file and link it
28 ## with other works to produce a work based on this file, this file does not
29 ## by itself cause the resulting work to be covered by the GNU General Public
30 ## License. However the source code for this file must still be made available
31 ## in accordance with section (3) of the GNU General Public License.
33 ## This exception does not invalidate any other reasons why a work based on
34 ## this file might be covered by the GNU General Public License.
36 ## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
37 ## at http://sources.redhat.com/ecos/ecos-license/
38 ## -------------------------------------------
39 #####ECOSGPLCOPYRIGHTEND####
40 # ====================================================================
41 ######DESCRIPTIONBEGIN####
47 #####DESCRIPTIONEND####
49 # ====================================================================
51 cdl_package CYGPKG_LOADER {
52 display "Dynamic loader"
54 This package provides support for dynamic code loading."
55 include_dir cyg/loader
56 compile loader.cxx dload.cxx
58 requires { CYGBLD_ISO_DLFCN_HEADER == "<cyg/loader/dlfcn.h>" }
59 implements CYGINT_ISO_DLFCN
61 # ====================================================================
63 cdl_component CYGPKG_LOADER_OPTIONS {
64 display "Common memory allocator package build options"
68 Package specific build options including control over
69 compiler flags used only in building this package,
70 and details of which tests are built."
72 cdl_option CYGPKG_LOADER_CFLAGS_ADD {
73 display "Additional compiler flags"
78 This option modifies the set of compiler flags for
79 building this package. These flags are used in addition
80 to the set of global flags."
83 cdl_option CYGPKG_LOADER_CFLAGS_REMOVE {
84 display "Suppressed compiler flags"
87 default_value { "-O2 -fvtable-gc" }
89 This option modifies the set of compiler flags for
90 building this package. These flags are removed from
91 the set of global flags if present."
94 cdl_option CYGPKG_LOADER_LDFLAGS_ADD {
95 display "Additional compiler flags"
98 # default_value { "-L$(PREFIX)/lib -ldlforce" }
101 This option modifies the set of compiler flags for
102 building this package. These flags are used in addition
103 to the set of global flags."
106 cdl_option CYGPKG_LOADER_LDFLAGS_REMOVE {
107 display "Suppressed compiler flags"
110 default_value { "-Wl,-static -Wl,--gc-sections" }
112 This option modifies the set of compiler flags for
113 building this package. These flags are removed from
114 the set of global flags if present."
119 # ====================================================================
120 # Dynamic library build options
122 cdl_option CYGBLD_LOADER_DYNAMIC_LD {
123 display "Build linker script for dynamic libraries"
126 description "Build a linker script for creating dynamic libraries"
129 <PREFIX>/lib/dynamic.ld: <PACKAGE>/src/dynamic.ld
130 $(CC) -E -P -Wp,-MD,dynamic.tmp -DEXTRAS=1 -xc $(INCLUDE_PATH) $(CFLAGS) -o $@ $<
131 @echo $@ ": \\" > $(notdir $@).deps
132 @tail -n +2 dynamic.tmp >> $(notdir $@).deps
133 @echo >> $(notdir $@).deps
139 cdl_option CYGBLD_LOADER_CRTBEGINS {
140 display "Build special crtbeginS.o for dynamic libraries"
145 <PREFIX>/lib/crtbeginS.o : <PACKAGE>/src/crtbeginS.c
146 $(CC) -Wp,-MD,crtbeginS.tmp $(INCLUDE_PATH) -g0 -Wall -finhibit-size-directive -fno-inline-functions -fno-exceptions -c -o $@ $<
147 @echo $@ ": \\" > $(notdir $@).deps
148 @tail -n +2 crtbeginS.tmp >> $(notdir $@).deps
149 @echo >> $(notdir $@).deps
154 cdl_option CYGBLD_LOADER_CRTENDS {
155 display "Build special crtendS.o for dynamic libraries"
160 <PREFIX>/lib/crtendS.o : <PACKAGE>/src/crtendS.c
161 $(CC) -Wp,-MD,crtendS.tmp $(INCLUDE_PATH) -g0 -Wall -finhibit-size-directive -fno-inline-functions -fno-exceptions -c -o $@ $<
162 @echo $@ ": \\" > $(notdir $@).deps
163 @tail -n +2 crtendS.tmp >> $(notdir $@).deps
164 @echo >> $(notdir $@).deps
169 cdl_option CYGBLD_LOADER_DLFORCE_LIB {
170 display "Build dynamic load library"
173 description "Build a shared library that is to be linked with the executable
174 to force it to be built in such a way that it is suitable for
175 having some other shared library load against it. This is the
176 most portable way of achieving this."
179 <PREFIX>/lib/libdlforce.so : <PACKAGE>/src/dlforce.c
180 $(CC) $(CFLAGS) -Wp,-MD,dlforce.tmp $(INCLUDE_PATH) -shared -c -o src/dlforce.o $<
181 $(CC) -g -nostdlib -L$(PREFIX)/lib -shared -Tdynamic.ld -o $@ $(PREFIX)/lib/crtbeginS.o src/dlforce.o $(PREFIX)/lib/crtendS.o
182 @echo $@ ": \\" > $(notdir $@).deps
183 @tail -n +2 dlforce.tmp >> $(notdir $@).deps
184 @echo >> $(notdir $@).deps
189 # ====================================================================
193 cdl_option CYGBLD_LOADER_TEST_FOO_LIB {
194 display "Build a dynamic load library"
197 description "Build a shared library for testing."
200 tests/libfoo.so : <PACKAGE>/tests/foo.c
202 $(CC) $(CFLAGS) -Wp,-MD,foo.tmp $(INCLUDE_PATH) -shared -c -o tests/foo.o $<
203 $(CC) $(LDFLAGS) -L$(PREFIX)/lib -shared -Tdynamic.ld -o $@ $(PREFIX)/lib/crtbeginS.o tests/foo.o $(PREFIX)/lib/crtendS.o
204 @echo $@ ": \\" > $(notdir $@).deps
205 @tail -n +2 foo.tmp >> $(notdir $@).deps
206 @echo >> $(notdir $@).deps
208 cc -o entable $(REPOSITORY)/$(PACKAGE)/tests/entable.c
209 ./entable libfoo <tests/libfoo.so >tests/libfoo.so.c
213 cdl_option CYGBLD_LOADER_TEST_LOADFOO {
214 display "Build library load test program"
217 description "Build a test program that will load the test shared library"
220 <PREFIX>/tests/services/loader/current/tests/loadfoo : <PACKAGE>/tests/loadfoo.cxx
221 mkdir -p $(PREFIX)/tests/services/loader/current/tests
222 $(CC) $(CFLAGS) -Wp,-MD,loadfoo.tmp $(INCLUDE_PATH) -c -o tests/loadfoo.o $<
223 # $(CC) $(LDFLAGS) -L$(PREFIX)/lib -Ttarget.ld -ldlforce -o $@ $(PREFIX)/lib/crtbeginS.o tests/loadfoo.o $(PREFIX)/lib/crtendS.o
224 $(CC) $(LDFLAGS) -Wl,-E -L$(PREFIX)/lib -Ttarget.ld -ldlforce -o $@ tests/loadfoo.o
225 @echo $@ ": \\" > $(notdir $@).deps
226 @tail -n +2 loadfoo.tmp >> $(notdir $@).deps
227 @echo >> $(notdir $@).deps
233 # cdl_option CYGPKG_LOADER_TESTS {
237 # calculated { "tests/loadfoo" }
239 # This option specifies the set of tests for this package."
244 # ====================================================================