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