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