Imported Upstream version 1.1
[platform/upstream/libunwind.git] / src / Makefile.am
1 SOVERSION=8:1:0         # See comments at end of file.
2 SETJMP_SO_VERSION=0:0:0
3 COREDUMP_SO_VERSION=0:0:0
4 #
5 # Don't link with start-files since we don't use any constructors/destructors:
6 #
7 COMMON_SO_LDFLAGS =     -XCClinker -nostartfiles
8
9 lib_LIBRARIES =
10 lib_LTLIBRARIES =
11 if !REMOTE_ONLY
12 lib_LTLIBRARIES += libunwind.la libunwind-ptrace.la
13 if BUILD_COREDUMP
14 lib_LTLIBRARIES += libunwind-coredump.la
15 endif
16 endif
17
18 noinst_HEADERS =
19 noinst_LTLIBRARIES =
20
21 pkgconfigdir = $(libdir)/pkgconfig
22 pkgconfig_DATA = libunwind-generic.pc
23
24 if !REMOTE_ONLY
25 pkgconfig_DATA += unwind/libunwind.pc ptrace/libunwind-ptrace.pc         \
26                   setjmp/libunwind-setjmp.pc
27 endif
28
29 if BUILD_COREDUMP
30 pkgconfig_DATA += coredump/libunwind-coredump.pc
31 endif
32
33 ### libunwind-ptrace:
34 libunwind_ptrace_la_SOURCES =                                             \
35         ptrace/_UPT_elf.c                                                 \
36         ptrace/_UPT_accessors.c ptrace/_UPT_access_fpreg.c                \
37         ptrace/_UPT_access_mem.c ptrace/_UPT_access_reg.c                 \
38         ptrace/_UPT_create.c ptrace/_UPT_destroy.c                        \
39         ptrace/_UPT_find_proc_info.c ptrace/_UPT_get_dyn_info_list_addr.c \
40         ptrace/_UPT_put_unwind_info.c ptrace/_UPT_get_proc_name.c         \
41         ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c
42 noinst_HEADERS += ptrace/_UPT_internal.h
43
44 ### libunwind-coredump:
45 libunwind_coredump_la_SOURCES = \
46         coredump/_UCD_accessors.c \
47         coredump/_UCD_create.c \
48         coredump/_UCD_destroy.c \
49         coredump/_UCD_access_mem.c \
50         coredump/_UCD_elf_map_image.c \
51         coredump/_UCD_find_proc_info.c \
52         coredump/_UCD_get_proc_name.c \
53         \
54         coredump/_UPT_elf.c \
55         coredump/_UPT_access_fpreg.c \
56         coredump/_UPT_get_dyn_info_list_addr.c \
57         coredump/_UPT_put_unwind_info.c \
58         coredump/_UPT_resume.c
59 libunwind_coredump_la_LDFLAGS = $(COMMON_SO_LDFLAGS) \
60                                 -version-info $(COREDUMP_SO_VERSION)
61 noinst_HEADERS += coredump/_UCD_internal.h
62
63 ### libunwind-setjmp:
64 libunwind_setjmp_la_LDFLAGS             = $(COMMON_SO_LDFLAGS)               \
65                                           -version-info $(SETJMP_SO_VERSION)
66
67 if USE_ELF32
68 LIBUNWIND_ELF = libunwind-elf32.la
69 endif
70 if USE_ELF64
71 LIBUNWIND_ELF = libunwind-elf64.la
72 endif
73 if USE_ELFXX
74 LIBUNWIND_ELF = libunwind-elfxx.la
75 endif
76
77 libunwind_setjmp_la_LIBADD              = $(LIBUNWIND_ELF)      \
78                                           libunwind-$(arch).la  \
79                                           libunwind.la -lc
80 libunwind_setjmp_la_SOURCES             = setjmp/longjmp.c      \
81                                           setjmp/siglongjmp.c
82 noinst_HEADERS                          += setjmp/setjmp_i.h
83
84 ### libunwind:
85 libunwind_la_LIBADD =
86
87 # List of arch-independent files needed by both local-only and generic
88 # libraries:
89 libunwind_la_SOURCES_common =                                   \
90         $(libunwind_la_SOURCES_os)                              \
91         mi/init.c mi/flush_cache.c mi/mempool.c mi/strerror.c
92
93 # List of arch-independent files needed by generic library (libunwind-$ARCH):
94 libunwind_la_SOURCES_generic =                                          \
95         mi/Gdyn-extract.c mi/Gdyn-remote.c mi/Gfind_dynamic_proc_info.c \
96         mi/Gget_accessors.c                                             \
97         mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c                   \
98         mi/Gput_dynamic_unwind_info.c mi/Gdestroy_addr_space.c          \
99         mi/Gget_reg.c mi/Gset_reg.c                                     \
100         mi/Gget_fpreg.c mi/Gset_fpreg.c                                 \
101         mi/Gset_caching_policy.c
102
103 if SUPPORT_CXX_EXCEPTIONS
104 libunwind_la_SOURCES_local_unwind =                                     \
105         unwind/Backtrace.c unwind/DeleteException.c                     \
106         unwind/FindEnclosingFunction.c unwind/ForcedUnwind.c            \
107         unwind/GetBSP.c unwind/GetCFA.c unwind/GetDataRelBase.c         \
108         unwind/GetGR.c unwind/GetIP.c unwind/GetLanguageSpecificData.c  \
109         unwind/GetRegionStart.c unwind/GetTextRelBase.c                 \
110         unwind/RaiseException.c unwind/Resume.c                         \
111         unwind/Resume_or_Rethrow.c unwind/SetGR.c unwind/SetIP.c        \
112         unwind/GetIPInfo.c
113
114 #  _ReadULEB()/_ReadSLEB() are needed for Intel C++ 8.0 compatibility
115 libunwind_la_SOURCES_os_linux_local = mi/_ReadULEB.c mi/_ReadSLEB.c
116 endif
117
118 # List of arch-independent files needed by local-only library (libunwind):
119 libunwind_la_SOURCES_local_nounwind =                                   \
120         $(libunwind_la_SOURCES_os_local)                                \
121         mi/backtrace.c                                                  \
122         mi/dyn-cancel.c mi/dyn-info-list.c mi/dyn-register.c            \
123         mi/Ldyn-extract.c mi/Lfind_dynamic_proc_info.c                  \
124         mi/Lget_accessors.c                                             \
125         mi/Lget_proc_info_by_ip.c mi/Lget_proc_name.c                   \
126         mi/Lput_dynamic_unwind_info.c mi/Ldestroy_addr_space.c          \
127         mi/Lget_reg.c   mi/Lset_reg.c                                   \
128         mi/Lget_fpreg.c mi/Lset_fpreg.c                                 \
129         mi/Lset_caching_policy.c
130
131 libunwind_la_SOURCES_local =                                            \
132         $(libunwind_la_SOURCES_local_nounwind)                          \
133         $(libunwind_la_SOURCES_local_unwind)
134
135 noinst_HEADERS += os-linux.h
136 libunwind_la_SOURCES_os_linux = os-linux.c
137
138 libunwind_la_SOURCES_os_hpux = os-hpux.c
139
140 libunwind_la_SOURCES_os_freebsd = os-freebsd.c
141
142 libunwind_dwarf_common_la_SOURCES = dwarf/global.c
143
144 libunwind_dwarf_local_la_SOURCES = \
145         dwarf/Lexpr.c dwarf/Lfde.c dwarf/Lparser.c dwarf/Lpe.c dwarf/Lstep.c \
146         dwarf/Lfind_proc_info-lsb.c \
147         dwarf/Lfind_unwind_table.c
148 libunwind_dwarf_local_la_LIBADD = libunwind-dwarf-common.la
149
150 libunwind_dwarf_generic_la_SOURCES = \
151         dwarf/Gexpr.c dwarf/Gfde.c dwarf/Gparser.c dwarf/Gpe.c dwarf/Gstep.c \
152         dwarf/Gfind_proc_info-lsb.c \
153         dwarf/Gfind_unwind_table.c
154 libunwind_dwarf_generic_la_LIBADD = libunwind-dwarf-common.la
155
156 if USE_DWARF
157  noinst_LTLIBRARIES += libunwind-dwarf-common.la libunwind-dwarf-generic.la
158 if !REMOTE_ONLY
159  noinst_LTLIBRARIES += libunwind-dwarf-local.la
160 endif
161  libunwind_la_LIBADD += libunwind-dwarf-local.la
162 endif
163
164 noinst_HEADERS += elf32.h elf64.h elfxx.h
165
166 libunwind_elf32_la_SOURCES = elf32.c
167 libunwind_elf64_la_SOURCES = elf64.c
168 libunwind_elfxx_la_SOURCES = elfxx.c
169
170 noinst_LTLIBRARIES += $(LIBUNWIND_ELF)
171 libunwind_la_LIBADD += $(LIBUNWIND_ELF)
172
173 # The list of files that go into libunwind and libunwind-arm:
174 noinst_HEADERS += arm/init.h arm/offsets.h arm/unwind_i.h
175 libunwind_la_SOURCES_arm_common = $(libunwind_la_SOURCES_common)            \
176         arm/is_fpreg.c arm/regname.c
177
178 # The list of files that go into libunwind:
179 libunwind_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common)               \
180         $(libunwind_la_SOURCES_local)                                       \
181         arm/getcontext.S                                                    \
182         arm/Lcreate_addr_space.c arm/Lget_proc_info.c arm/Lget_save_loc.c   \
183         arm/Lglobal.c arm/Linit.c arm/Linit_local.c arm/Linit_remote.c      \
184         arm/Lis_signal_frame.c arm/Lregs.c arm/Lresume.c arm/Lstep.c        \
185         arm/Lex_tables.c
186
187 libunwind_arm_la_SOURCES_arm = $(libunwind_la_SOURCES_arm_common)           \
188         $(libunwind_la_SOURCES_generic)                                     \
189         arm/Gcreate_addr_space.c arm/Gget_proc_info.c arm/Gget_save_loc.c   \
190         arm/Gglobal.c arm/Ginit.c arm/Ginit_local.c arm/Ginit_remote.c      \
191         arm/Gis_signal_frame.c arm/Gregs.c arm/Gresume.c arm/Gstep.c        \
192         arm/Gex_tables.c
193
194 # The list of files that go both into libunwind and libunwind-ia64:
195 noinst_HEADERS += ia64/init.h ia64/offsets.h ia64/regs.h                    \
196         ia64/ucontext_i.h ia64/unwind_decoder.h ia64/unwind_i.h
197 libunwind_la_SOURCES_ia64_common = $(libunwind_la_SOURCES_common)           \
198         ia64/regname.c
199
200 # The list of files that go into libunwind:
201 libunwind_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common)              \
202         $(libunwind_la_SOURCES_local)                                        \
203                                                                              \
204         ia64/dyn_info_list.S ia64/getcontext.S                               \
205                                                                              \
206         ia64/Lcreate_addr_space.c ia64/Lget_proc_info.c ia64/Lget_save_loc.c \
207         ia64/Lglobal.c ia64/Linit.c ia64/Linit_local.c ia64/Linit_remote.c   \
208         ia64/Linstall_cursor.S ia64/Lis_signal_frame.c ia64/Lparser.c        \
209         ia64/Lrbs.c ia64/Lregs.c ia64/Lresume.c ia64/Lscript.c ia64/Lstep.c  \
210         ia64/Ltables.c ia64/Lfind_unwind_table.c
211
212 # The list of files that go into libunwind-ia64:
213 libunwind_ia64_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common)         \
214         $(libunwind_la_SOURCES_generic)                                      \
215         ia64/Gcreate_addr_space.c ia64/Gget_proc_info.c ia64/Gget_save_loc.c \
216         ia64/Gglobal.c ia64/Ginit.c ia64/Ginit_local.c ia64/Ginit_remote.c   \
217         ia64/Ginstall_cursor.S ia64/Gis_signal_frame.c ia64/Gparser.c        \
218         ia64/Grbs.c ia64/Gregs.c ia64/Gresume.c ia64/Gscript.c ia64/Gstep.c  \
219         ia64/Gtables.c ia64/Gfind_unwind_table.c
220
221 # The list of files that go both into libunwind and libunwind-hppa:
222 noinst_HEADERS += hppa/init.h hppa/offsets.h hppa/unwind_i.h
223 libunwind_la_SOURCES_hppa_common = $(libunwind_la_SOURCES_common)       \
224         hppa/regname.c
225
226 # The list of files that go into libunwind:
227 libunwind_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common)         \
228         $(libunwind_la_SOURCES_local)                                   \
229         hppa/getcontext.S hppa/setcontext.S                             \
230         hppa/Lcreate_addr_space.c hppa/Lget_save_loc.c hppa/Lglobal.c   \
231         hppa/Linit.c hppa/Linit_local.c hppa/Linit_remote.c             \
232         hppa/Lis_signal_frame.c hppa/Lget_proc_info.c hppa/Lregs.c      \
233         hppa/Lresume.c hppa/Lstep.c
234
235 # The list of files that go into libunwind-hppa:
236 libunwind_hppa_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common)    \
237         $(libunwind_la_SOURCES_generic)                                 \
238         hppa/Gcreate_addr_space.c hppa/Gget_save_loc.c hppa/Gglobal.c   \
239         hppa/Ginit.c hppa/Ginit_local.c hppa/Ginit_remote.c             \
240         hppa/Gis_signal_frame.c hppa/Gget_proc_info.c hppa/Gregs.c      \
241         hppa/Gresume.c hppa/Gstep.c
242
243 # The list of files that go info libunwind and libunwind-mips:
244 noinst_HEADERS += mips/init.h mips/offsets.h
245 libunwind_la_SOURCES_mips_common = $(libunwind_la_SOURCES_common)           \
246         mips/is_fpreg.c mips/regname.c
247
248 # The list of files that go into libunwind:
249 libunwind_la_SOURCES_mips = $(libunwind_la_SOURCES_mips_common)             \
250         $(libunwind_la_SOURCES_local)                                       \
251         mips/getcontext.S                                                   \
252         mips/Lcreate_addr_space.c mips/Lget_proc_info.c mips/Lget_save_loc.c   \
253         mips/Lglobal.c mips/Linit.c mips/Linit_local.c mips/Linit_remote.c  \
254         mips/Lis_signal_frame.c mips/Lregs.c mips/Lresume.c mips/Lstep.c
255
256 libunwind_mips_la_SOURCES_mips = $(libunwind_la_SOURCES_mips_common)        \
257         $(libunwind_la_SOURCES_generic)                                     \
258         mips/Gcreate_addr_space.c mips/Gget_proc_info.c mips/Gget_save_loc.c   \
259         mips/Gglobal.c mips/Ginit.c mips/Ginit_local.c mips/Ginit_remote.c          \
260         mips/Gis_signal_frame.c mips/Gregs.c mips/Gresume.c mips/Gstep.c
261
262 # The list of files that go both into libunwind and libunwind-x86:
263 noinst_HEADERS += x86/init.h x86/offsets.h x86/unwind_i.h
264 libunwind_la_SOURCES_x86_common = $(libunwind_la_SOURCES_common)        \
265         x86/is_fpreg.c x86/regname.c
266
267 # The list of files that go into libunwind:
268 libunwind_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common)           \
269         $(libunwind_la_SOURCES_x86_os_local)                            \
270         $(libunwind_la_SOURCES_local)                                   \
271         x86/Lcreate_addr_space.c x86/Lget_save_loc.c x86/Lglobal.c      \
272         x86/Linit.c x86/Linit_local.c x86/Linit_remote.c                \
273         x86/Lget_proc_info.c x86/Lregs.c                                \
274         x86/Lresume.c x86/Lstep.c
275
276 # The list of files that go into libunwind-x86:
277 libunwind_x86_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common)       \
278         $(libunwind_la_SOURCES_x86_os)                                  \
279         $(libunwind_la_SOURCES_generic)                                 \
280         x86/Gcreate_addr_space.c x86/Gget_save_loc.c x86/Gglobal.c      \
281         x86/Ginit.c x86/Ginit_local.c x86/Ginit_remote.c                \
282         x86/Gget_proc_info.c x86/Gregs.c                                \
283         x86/Gresume.c x86/Gstep.c
284
285 # The list of files that go both into libunwind and libunwind-x86_64:
286 noinst_HEADERS += x86_64/offsets.h                                      \
287         x86_64/init.h x86_64/unwind_i.h x86_64/ucontext_i.h
288 libunwind_la_SOURCES_x86_64_common = $(libunwind_la_SOURCES_common)     \
289         x86_64/is_fpreg.c x86_64/regname.c
290
291 # The list of files that go into libunwind:
292 libunwind_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common)         \
293         $(libunwind_la_SOURCES_x86_64_os_local)                             \
294         $(libunwind_la_SOURCES_local)                                       \
295         x86_64/setcontext.S                                                 \
296         x86_64/Lcreate_addr_space.c x86_64/Lget_save_loc.c x86_64/Lglobal.c \
297         x86_64/Linit.c x86_64/Linit_local.c x86_64/Linit_remote.c           \
298         x86_64/Lget_proc_info.c x86_64/Lregs.c x86_64/Lresume.c             \
299         x86_64/Lstash_frame.c x86_64/Lstep.c x86_64/Ltrace.c x86_64/getcontext.S
300
301 # The list of files that go into libunwind-x86_64:
302 libunwind_x86_64_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common)  \
303         $(libunwind_la_SOURCES_x86_64_os)                                   \
304         $(libunwind_la_SOURCES_generic)                                     \
305         x86_64/Gcreate_addr_space.c x86_64/Gget_save_loc.c x86_64/Gglobal.c \
306         x86_64/Ginit.c x86_64/Ginit_local.c x86_64/Ginit_remote.c           \
307         x86_64/Gget_proc_info.c x86_64/Gregs.c x86_64/Gresume.c             \
308         x86_64/Gstash_frame.c x86_64/Gstep.c x86_64/Gtrace.c
309
310 # The list of local files that go to Power 64 and 32:
311 libunwind_la_SOURCES_ppc = ppc/Lcreate_addr_space.c                     \
312         ppc/Lget_proc_info.c ppc/Lget_save_loc.c ppc/Linit_local.c      \
313         ppc/Linit_remote.c ppc/Lis_signal_frame.c
314
315 # The list of generic files that go to Power 64 and 32:
316 libunwind_ppc_la_SOURCES_ppc_generic = ppc/Gcreate_addr_space.c         \
317         ppc/Gget_proc_info.c ppc/Gget_save_loc.c ppc/Ginit_local.c      \
318         ppc/Ginit_remote.c ppc/Gis_signal_frame.c
319
320 # The list of files that go both into libunwind and libunwind-ppc32:
321 noinst_HEADERS += ppc32/init.h ppc32/unwind_i.h ppc32/ucontext_i.h
322 libunwind_la_SOURCES_ppc32_common = $(libunwind_la_SOURCES_common)      \
323         ppc32/is_fpreg.c ppc32/regname.c ppc32/get_func_addr.c
324
325 # The list of files that go into libunwind:
326 libunwind_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common)       \
327         $(libunwind_la_SOURCES_local)                                   \
328         $(libunwind_la_SOURCES_ppc)                                     \
329         ppc32/Lglobal.c ppc32/Linit.c                                   \
330         ppc32/Lregs.c ppc32/Lresume.c ppc32/Lstep.c
331
332 # The list of files that go into libunwind-ppc32:
333 libunwind_ppc32_la_SOURCES_ppc32 = $(libunwind_la_SOURCES_ppc32_common) \
334         $(libunwind_la_SOURCES_generic)                                 \
335         $(libunwind_ppc_la_SOURCES_ppc_generic)                         \
336         ppc32/Gglobal.c ppc32/Ginit.c                                   \
337         ppc32/Gregs.c ppc32/Gresume.c ppc32/Gstep.c
338
339 # The list of files that go both into libunwind and libunwind-ppc64:
340 noinst_HEADERS += ppc64/init.h ppc64/unwind_i.h ppc64/ucontext_i.h
341 libunwind_la_SOURCES_ppc64_common = $(libunwind_la_SOURCES_common)      \
342         ppc64/is_fpreg.c ppc64/regname.c ppc64/get_func_addr.c
343
344 # The list of files that go into libunwind:
345 libunwind_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common)       \
346         $(libunwind_la_SOURCES_local)                                   \
347         $(libunwind_la_SOURCES_ppc)                                     \
348         ppc64/Lglobal.c ppc64/Linit.c                                   \
349         ppc64/Lregs.c ppc64/Lresume.c ppc64/Lstep.c
350
351 # The list of files that go into libunwind-ppc64:
352 libunwind_ppc64_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \
353         $(libunwind_la_SOURCES_generic)                                 \
354         $(libunwind_ppc_la_SOURCES_ppc_generic)                         \
355         ppc64/Gglobal.c ppc64/Ginit.c                                   \
356         ppc64/Gregs.c ppc64/Gresume.c ppc64/Gstep.c
357
358 # The list of files that go into libunwind and libunwind-sh:
359 noinst_HEADERS += sh/init.h sh/offsets.h sh/unwind_i.h
360 libunwind_la_SOURCES_sh_common = $(libunwind_la_SOURCES_common)         \
361         sh/is_fpreg.c sh/regname.c
362
363 # The list of files that go into libunwind:
364 libunwind_la_SOURCES_sh = $(libunwind_la_SOURCES_sh_common)             \
365         $(libunwind_la_SOURCES_local)                                   \
366         sh/Lcreate_addr_space.c sh/Lget_proc_info.c sh/Lget_save_loc.c  \
367         sh/Lglobal.c sh/Linit.c sh/Linit_local.c sh/Linit_remote.c      \
368         sh/Lis_signal_frame.c sh/Lregs.c sh/Lresume.c sh/Lstep.c
369
370 libunwind_sh_la_SOURCES_sh = $(libunwind_la_SOURCES_sh_common)          \
371         $(libunwind_la_SOURCES_generic)                                 \
372         sh/Gcreate_addr_space.c sh/Gget_proc_info.c sh/Gget_save_loc.c  \
373         sh/Gglobal.c sh/Ginit.c sh/Ginit_local.c sh/Ginit_remote.c      \
374         sh/Gis_signal_frame.c sh/Gregs.c sh/Gresume.c sh/Gstep.c
375
376 if REMOTE_ONLY
377 install-exec-hook:
378 #       Nothing to do here....
379 else
380 #
381 # This is not ideal, but I know of no other way to install an
382 # alias for a library.  For the shared version, we have to do
383 # a file check before creating the link, because it isn't going
384 # to be there if the user configured with --disable-shared.
385 #
386 install-exec-hook:
387         $(LN_S) -f libunwind-$(arch).a  $(DESTDIR)$(libdir)/libunwind-generic.a
388         if test -f $(DESTDIR)$(libdir)/libunwind-$(arch).so; then \
389             $(LN_S) -f libunwind-$(arch).so \
390                 $(DESTDIR)$(libdir)/libunwind-generic.so; \
391         fi
392 endif
393
394 if OS_LINUX
395  libunwind_la_SOURCES_os              = $(libunwind_la_SOURCES_os_linux)
396  libunwind_la_SOURCES_os_local        = $(libunwind_la_SOURCES_os_linux_local)
397  libunwind_la_SOURCES_x86_os          = x86/Gos-linux.c
398  libunwind_x86_la_SOURCES_os          = x86/getcontext-linux.S
399  libunwind_la_SOURCES_x86_os_local    = x86/Los-linux.c
400  libunwind_la_SOURCES_x86_64_os       = x86_64/Gos-linux.c
401  libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-linux.c
402  libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_linux.c
403 endif
404
405 if OS_HPUX
406  libunwind_la_SOURCES_os        = $(libunwind_la_SOURCES_os_hpux)
407  libunwind_la_SOURCES_os_local  = $(libunwind_la_SOURCES_os_hpux_local)
408 endif
409
410 if OS_FREEBSD
411  libunwind_la_SOURCES_os        = $(libunwind_la_SOURCES_os_freebsd)
412  libunwind_la_SOURCES_os_local  = $(libunwind_la_SOURCES_os_freebsd_local)
413  libunwind_la_SOURCES_x86_os          = x86/Gos-freebsd.c
414  libunwind_x86_la_SOURCES_os          = x86/getcontext-freebsd.S
415  libunwind_la_SOURCES_x86_os_local    = x86/Los-freebsd.c
416  libunwind_la_SOURCES_x86_64_os       = x86_64/Gos-freebsd.c
417  libunwind_la_SOURCES_x86_64_os_local = x86_64/Los-freebsd.c
418  libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_freebsd.c
419 endif
420
421 if ARCH_ARM
422  lib_LTLIBRARIES += libunwind-arm.la
423  libunwind_la_SOURCES = $(libunwind_la_SOURCES_arm)
424  libunwind_arm_la_SOURCES = $(libunwind_arm_la_SOURCES_arm)
425  libunwind_arm_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
426  libunwind_arm_la_LIBADD = libunwind-dwarf-generic.la
427  libunwind_arm_la_LIBADD += libunwind-elf32.la
428 if !REMOTE_ONLY
429  libunwind_arm_la_LIBADD += libunwind.la -lc
430 endif
431  libunwind_setjmp_la_SOURCES += arm/siglongjmp.S
432 else
433 if ARCH_IA64
434  BUILT_SOURCES = Gcursor_i.h Lcursor_i.h
435 mk_Gcursor_i.s: $(srcdir)/ia64/mk_Gcursor_i.c
436         $(COMPILE) -S "$(srcdir)/ia64/mk_Gcursor_i.c" -o mk_Gcursor_i.s
437 mk_Lcursor_i.s: $(srcdir)/ia64/mk_Lcursor_i.c
438         $(COMPILE) -S "$(srcdir)/ia64/mk_Lcursor_i.c" -o mk_Lcursor_i.s
439 Gcursor_i.h: mk_Gcursor_i.s
440         "$(srcdir)/ia64/mk_cursor_i" mk_Gcursor_i.s > Gcursor_i.h
441 Lcursor_i.h: mk_Lcursor_i.s
442         "$(srcdir)/ia64/mk_cursor_i" mk_Lcursor_i.s > Lcursor_i.h
443
444  lib_LTLIBRARIES += libunwind-ia64.la
445  libunwind_la_SOURCES = $(libunwind_la_SOURCES_ia64)
446  libunwind_ia64_la_SOURCES = $(libunwind_ia64_la_SOURCES_ia64)
447  libunwind_ia64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
448  libunwind_ia64_la_LIBADD = libunwind-elf64.la
449 if !REMOTE_ONLY
450  libunwind_ia64_la_LIBADD += libunwind.la -lc
451 endif
452  libunwind_setjmp_la_SOURCES += ia64/setjmp.S  ia64/sigsetjmp.S  \
453                                 ia64/longjmp.S ia64/siglongjmp.S
454 else
455 if ARCH_HPPA
456  lib_LTLIBRARIES += libunwind-hppa.la
457  libunwind_la_SOURCES = $(libunwind_la_SOURCES_hppa)
458  libunwind_hppa_la_SOURCES = $(libunwind_hppa_la_SOURCES_hppa)
459  libunwind_hppa_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
460  libunwind_hppa_la_LIBADD = libunwind-dwarf-generic.la
461  libunwind_hppa_la_LIBADD += libunwind-elf32.la
462 if !REMOTE_ONLY
463  libunwind_hppa_la_LIBADD += libunwind.la -lc
464 endif
465  libunwind_setjmp_la_SOURCES += hppa/siglongjmp.S
466 else
467 if ARCH_MIPS
468  lib_LTLIBRARIES += libunwind-mips.la
469  libunwind_la_SOURCES = $(libunwind_la_SOURCES_mips)
470  libunwind_mips_la_SOURCES = $(libunwind_mips_la_SOURCES_mips)
471  libunwind_mips_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
472  libunwind_mips_la_LIBADD = libunwind-dwarf-generic.la
473  libunwind_mips_la_LIBADD += libunwind-elfxx.la
474 if !REMOTE_ONLY
475  libunwind_mips_la_LIBADD += libunwind.la -lc
476 endif
477  libunwind_setjmp_la_SOURCES += mips/siglongjmp.S
478 else
479 if ARCH_X86
480  lib_LTLIBRARIES += libunwind-x86.la
481  libunwind_la_SOURCES = $(libunwind_la_SOURCES_x86) $(libunwind_x86_la_SOURCES_os)
482  libunwind_x86_la_SOURCES = $(libunwind_x86_la_SOURCES_x86)
483  libunwind_x86_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
484  libunwind_x86_la_LIBADD = libunwind-dwarf-generic.la
485  libunwind_x86_la_LIBADD += libunwind-elf32.la
486 if !REMOTE_ONLY
487  libunwind_x86_la_LIBADD += libunwind.la -lc
488 endif
489  libunwind_setjmp_la_SOURCES += x86/longjmp.S x86/siglongjmp.S
490 else
491 if ARCH_X86_64
492  lib_LTLIBRARIES += libunwind-x86_64.la
493  libunwind_la_SOURCES = $(libunwind_la_SOURCES_x86_64)
494  libunwind_x86_64_la_SOURCES = $(libunwind_x86_64_la_SOURCES_x86_64)
495  libunwind_x86_64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
496  libunwind_x86_64_la_LIBADD = libunwind-dwarf-generic.la
497  libunwind_x86_64_la_LIBADD += libunwind-elf64.la
498 if !REMOTE_ONLY
499  libunwind_x86_64_la_LIBADD += libunwind.la -lc
500 endif
501  libunwind_setjmp_la_SOURCES += x86_64/longjmp.S x86_64/siglongjmp.S
502 else
503 if ARCH_PPC32
504  lib_LTLIBRARIES += libunwind-ppc32.la
505  libunwind_la_SOURCES = $(libunwind_la_SOURCES_ppc32)
506  libunwind_ppc32_la_SOURCES = $(libunwind_ppc32_la_SOURCES_ppc32)
507  libunwind_ppc32_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
508  libunwind_ppc32_la_LIBADD = libunwind-dwarf-generic.la
509  libunwind_ppc32_la_LIBADD += libunwind-elf32.la
510 if !REMOTE_ONLY
511  libunwind_ppc32_la_LIBADD += libunwind.la -lc
512 endif
513  libunwind_setjmp_la_SOURCES += ppc/longjmp.S ppc/siglongjmp.S
514 else
515 if ARCH_PPC64
516  lib_LTLIBRARIES += libunwind-ppc64.la
517  libunwind_la_SOURCES = $(libunwind_la_SOURCES_ppc64)
518  libunwind_ppc64_la_SOURCES = $(libunwind_ppc64_la_SOURCES_ppc64)
519  libunwind_ppc64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
520  libunwind_ppc64_la_LIBADD = libunwind-dwarf-generic.la
521  libunwind_ppc64_la_LIBADD += libunwind-elf64.la
522 if !REMOTE_ONLY
523  libunwind_ppc64_la_LIBADD += libunwind.la -lc
524 endif
525  libunwind_setjmp_la_SOURCES += ppc/longjmp.S ppc/siglongjmp.S
526 else
527 if ARCH_SH
528  lib_LTLIBRARIES += libunwind-sh.la
529  libunwind_la_SOURCES = $(libunwind_la_SOURCES_sh)
530  libunwind_sh_la_SOURCES = $(libunwind_sh_la_SOURCES_sh)
531  libunwind_sh_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
532  libunwind_sh_la_LIBADD = libunwind-dwarf-generic.la
533  libunwind_sh_la_LIBADD += libunwind-elf32.la
534 if !REMOTE_ONLY
535  libunwind_sh_la_LIBADD += libunwind.la -lc
536 endif
537  libunwind_setjmp_la_SOURCES += sh/siglongjmp.S
538
539 endif # ARCH_SH
540 endif # ARCH_PPC64
541 endif # ARCH_PPC32
542 endif # ARCH_X86_64
543 endif # ARCH_X86
544 endif # ARCH_MIPS
545 endif # ARCH_HPPA
546 endif # ARCH_IA64
547 endif # ARCH_ARM
548
549 # libunwind-setjmp depends on libunwind-$(arch). Therefore must be added
550 # at the end.
551 if !REMOTE_ONLY
552 lib_LTLIBRARIES += libunwind-setjmp.la
553 endif
554
555 #
556 # Don't link with standard libraries, because those may mention
557 # libunwind already.
558 #
559 libunwind_la_LDFLAGS =  $(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
560                         $(LDFLAGS_STATIC_LIBCXA) -version-info $(SOVERSION)
561 libunwind_la_LIBADD  += -lc $(LIBCRTS)
562 if HAVE_LZMA
563  libunwind_la_LIBADD += -llzma
564 endif
565
566 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
567 AM_CCASFLAGS = $(AM_CPPFLAGS)
568 noinst_HEADERS += unwind/unwind-internal.h
569
570 EXTRA_DIST =    $(libunwind_la_SOURCES_arm)                     \
571                 $(libunwind_la_SOURCES_hppa)                    \
572                 $(libunwind_la_SOURCES_ia64)                    \
573                 $(libunwind_la_SOURCES_mips)                    \
574                 $(libunwind_la_SOURCES_sh)                      \
575                 $(libunwind_la_SOURCES_x86)                     \
576                 $(libunwind_la_SOURCES_os_freebsd)              \
577                 $(libunwind_la_SOURCES_os_linux)                \
578                 $(libunwind_la_SOURCES_os_hpux)                 \
579                 $(libunwind_la_SOURCES_common)                  \
580                 $(libunwind_la_SOURCES_local)                   \
581                 $(libunwind_la_SOURCES_generic)                 \
582                 $(libunwind_arm_la_SOURCES_arm)                 \
583                 $(libunwind_hppa_la_SOURCES_hppa)               \
584                 $(libunwind_ia64_la_SOURCES_ia64)               \
585                 $(libunwind_mips_la_SOURCES_mips)               \
586                 $(libunwind_sh_la_SOURCES_sh)                   \
587                 $(libunwind_x86_la_SOURCES_x86)                 \
588                 $(libunwind_x86_64_la_SOURCES_x86_64)
589
590 MAINTAINERCLEANFILES = Makefile.in
591
592 # The -version-info flag accepts an argument of the form
593 # `current[:revision[:age]]'. So, passing `-version-info 3:12:1' sets
594 # current to 3, revision to 12, and age to 1.
595
596 # If either revision or age are omitted, they default to 0. Also note
597 # that age must be less than or equal to the current interface number.
598
599 # Here are a set of rules to help you update your library version
600 # information:
601
602 #    1. Start with version information of `0:0:0' for each libtool
603 #       library.
604
605 #    2. Update the version information only immediately before a public
606 #       release of your software. More frequent updates are unnecessary,
607 #       and only guarantee that the current interface number gets larger
608 #       faster.
609
610 #    3. If the library source code has changed at all since the last
611 #       update, then increment revision (`c:r:a' becomes `c:r+1:a').
612
613 #    4. If any interfaces have been added, removed, or changed since the
614 #       last update, increment current, and set revision to 0.
615
616 #    5. If any interfaces have been added since the last public release,
617 #       then increment age.
618
619 #    6. If any interfaces have been removed since the last public
620 #       release, then set age to 0.