Makefile.am revision 32e2187fab8d7a0adaa099b7bdaefca50628de88
1SOVERSION=7:0:0		# See comments at end of file.
2SETJMP_SO_VERSION=0:0:0
3#
4# Don't link with start-files since we don't use any constructors/destructors:
5#
6COMMON_SO_LDFLAGS =	-XCClinker -nostartfiles
7
8if REMOTE_ONLY
9LIBRARIES_cdep			=
10lib_LTLIBRARIES_cdep		=
11lib_LTLIBRARIES_cdep_setjmp	=
12else
13LIBRARIES_cdep			= libunwind-ptrace.a
14lib_LTLIBRARIES_cdep		= libunwind.la
15lib_LTLIBRARIES_cdep_setjmp	= libunwind-setjmp.la
16endif
17
18### libunwind-ptrace:
19libunwind_ptrace_a_SOURCES =						  \
20	ptrace/_UPT_elf.c						  \
21	ptrace/_UPT_internal.h						  \
22	ptrace/_UPT_accessors.c ptrace/_UPT_access_fpreg.c		  \
23	ptrace/_UPT_access_mem.c ptrace/_UPT_access_reg.c		  \
24	ptrace/_UPT_create.c ptrace/_UPT_destroy.c			  \
25	ptrace/_UPT_find_proc_info.c ptrace/_UPT_get_dyn_info_list_addr.c \
26	ptrace/_UPT_put_unwind_info.c ptrace/_UPT_get_proc_name.c	  \
27	ptrace/_UPT_reg_offset.c ptrace/_UPT_resume.c
28
29### libunwind-setjmp:
30libunwind_setjmp_la_LDFLAGS		= $(COMMON_SO_LDFLAGS)		     \
31					  -version-info $(SETJMP_SO_VERSION)
32libunwind_setjmp_la_LIBADD		= libunwind-$(arch).la -lc
33libunwind_setjmp_la_SOURCES_common	= setjmp/setjmp_i.h 	\
34					  setjmp/longjmp.c	\
35					  setjmp/siglongjmp.c
36libunwind_setjmp_la_SOURCES_ia64	= ia64/setjmp.S  ia64/sigsetjmp.S  \
37					  ia64/longjmp.S ia64/siglongjmp.S
38libunwind_setjmp_la_SOURCES_hppa	= hppa/siglongjmp.S
39libunwind_setjmp_la_SOURCES_x86		= x86/longjmp.S x86/siglongjmp.S
40libunwind_setjmp_la_SOURCES_x86_64	= x86_64/longjmp.S x86_64/siglongjmp.S
41libunwind_setjmp_la_SOURCES_ppc64       = ppc64/longjmp.S ppc64/siglongjmp.S
42
43### libunwind:
44
45# List of arch-independent files needed by both local-only and generic
46# libraries:
47libunwind_la_SOURCES_common =					\
48	$(libunwind_la_SOURCES_os)				\
49	mi/init.c mi/flush_cache.c mi/mempool.c mi/strerror.c
50
51# List of arch-independent files needed by generic library (libunwind-$ARCH):
52libunwind_la_SOURCES_generic =						\
53	mi/Gdyn-extract.c mi/Gdyn-remote.c mi/Gfind_dynamic_proc_info.c	\
54	mi/Gget_accessors.c						\
55	mi/Gget_proc_info_by_ip.c mi/Gget_proc_name.c			\
56	mi/Gput_dynamic_unwind_info.c mi/Gdestroy_addr_space.c		\
57	mi/Gget_reg.c mi/Gset_reg.c					\
58	mi/Gget_fpreg.c mi/Gset_fpreg.c					\
59	mi/Gset_caching_policy.c
60
61# List of arch-independent files needed by local-only library (libunwind):
62libunwind_la_SOURCES_local =						\
63	$(libunwind_la_SOURCES_os_local)				\
64	mi/backtrace.c							\
65	mi/dyn-cancel.c mi/dyn-info-list.c mi/dyn-register.c		\
66	mi/Ldyn-extract.c mi/Lfind_dynamic_proc_info.c			\
67	mi/Lget_accessors.c						\
68	mi/Lget_proc_info_by_ip.c mi/Lget_proc_name.c			\
69	mi/Lput_dynamic_unwind_info.c mi/Ldestroy_addr_space.c		\
70	mi/Lget_reg.c   mi/Lset_reg.c					\
71	mi/Lget_fpreg.c mi/Lset_fpreg.c					\
72	mi/Lset_caching_policy.c					\
73	unwind/Backtrace.c unwind/DeleteException.c			\
74	unwind/FindEnclosingFunction.c unwind/ForcedUnwind.c		\
75	unwind/GetBSP.c unwind/GetCFA.c unwind/GetDataRelBase.c		\
76	unwind/GetGR.c unwind/GetIP.c unwind/GetLanguageSpecificData.c	\
77	unwind/GetRegionStart.c unwind/GetTextRelBase.c			\
78	unwind/RaiseException.c unwind/Resume.c				\
79	unwind/Resume_or_Rethrow.c unwind/SetGR.c unwind/SetIP.c
80
81libunwind_la_SOURCES_os_linux = os-linux.h os-linux.c
82
83#  _ReadULEB()/_ReadSLEB() are needed for Intel C++ 8.0 compatibility
84libunwind_la_SOURCES_os_linux_local = mi/_ReadULEB.c mi/_ReadSLEB.c
85libunwind_la_SOURCES_os_hpux = os-hpux.c
86
87dwarf_SOURCES_common =				\
88	dwarf/global.c
89
90dwarf_SOURCES_local =							     \
91	dwarf/Lexpr.c dwarf/Lfde.c dwarf/Lparser.c dwarf/Lpe.c dwarf/Lstep.c
92
93dwarf_SOURCES_generic =							     \
94	dwarf/Gexpr.c dwarf/Gfde.c dwarf/Gparser.c dwarf/Gpe.c dwarf/Gstep.c
95
96# The list of files that go both into libunwind and libunwind-ia64:
97libunwind_la_SOURCES_ia64_common = $(libunwind_la_SOURCES_common)	    \
98	elf64.c elf64.h							    \
99	ia64/init.h ia64/offsets.h ia64/regs.h				    \
100	ia64/ucontext_i.h ia64/unwind_decoder.h ia64/unwind_i.h		    \
101	ia64/regname.c
102
103# The list of files that go into libunwind:
104libunwind_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common)		     \
105	$(libunwind_la_SOURCES_local)					     \
106									     \
107	ia64/dyn_info_list.S ia64/getcontext.S				     \
108									     \
109	ia64/Lcreate_addr_space.c ia64/Lget_proc_info.c ia64/Lget_save_loc.c \
110	ia64/Lglobal.c ia64/Linit.c ia64/Linit_local.c ia64/Linit_remote.c   \
111	ia64/Linstall_cursor.S ia64/Lis_signal_frame.c ia64/Lparser.c	     \
112	ia64/Lrbs.c ia64/Lregs.c ia64/Lresume.c ia64/Lscript.c ia64/Lstep.c  \
113	ia64/Ltables.c
114
115# The list of files that go into libunwind-ia64:
116libunwind_ia64_la_SOURCES_ia64 = $(libunwind_la_SOURCES_ia64_common)	     \
117	$(libunwind_la_SOURCES_generic)					     \
118	ia64/Gcreate_addr_space.c ia64/Gget_proc_info.c ia64/Gget_save_loc.c \
119	ia64/Gglobal.c ia64/Ginit.c ia64/Ginit_local.c ia64/Ginit_remote.c   \
120	ia64/Ginstall_cursor.S ia64/Gis_signal_frame.c ia64/Gparser.c	     \
121	ia64/Grbs.c ia64/Gregs.c ia64/Gresume.c ia64/Gscript.c ia64/Gstep.c  \
122	ia64/Gtables.c
123
124# The list of files that go both into libunwind and libunwind-hppa:
125libunwind_la_SOURCES_hppa_common = $(libunwind_la_SOURCES_common)	\
126	$(dwarf_SOURCES_common)						\
127	elf32.c elf32.h							\
128	hppa/init.h hppa/offsets.h hppa/unwind_i.h			\
129	hppa/regname.c
130
131# The list of files that go into libunwind:
132libunwind_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common)		\
133	$(libunwind_la_SOURCES_local)					\
134	hppa/getcontext.S hppa/setcontext.S				\
135	$(dwarf_SOURCES_local)						\
136	dwarf/Lfind_proc_info-lsb.c					\
137	hppa/Lcreate_addr_space.c hppa/Lget_save_loc.c hppa/Lglobal.c	\
138	hppa/Linit.c hppa/Linit_local.c hppa/Linit_remote.c		\
139	hppa/Lis_signal_frame.c hppa/Lget_proc_info.c hppa/Lregs.c	\
140	hppa/Lresume.c hppa/Lstep.c
141
142# The list of files that go into libunwind-hppa:
143libunwind_hppa_la_SOURCES_hppa = $(libunwind_la_SOURCES_hppa_common)	\
144	$(libunwind_la_SOURCES_generic)					\
145	$(dwarf_SOURCES_generic)					\
146	dwarf/Gfind_proc_info-lsb.c					\
147	hppa/Gcreate_addr_space.c hppa/Gget_save_loc.c hppa/Gglobal.c	\
148	hppa/Ginit.c hppa/Ginit_local.c hppa/Ginit_remote.c		\
149	hppa/Gis_signal_frame.c hppa/Gget_proc_info.c hppa/Gregs.c	\
150	hppa/Gresume.c hppa/Gstep.c
151
152# The list of files that go both into libunwind and libunwind-x86:
153libunwind_la_SOURCES_x86_common = $(libunwind_la_SOURCES_common)	\
154	$(dwarf_SOURCES_common)						\
155	elf32.c elf32.h							\
156	x86/init.h x86/offsets.h x86/unwind_i.h				\
157	x86/is_fpreg.c x86/regname.c
158
159# The list of files that go into libunwind:
160libunwind_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common)		\
161	$(libunwind_la_SOURCES_local)					\
162	$(dwarf_SOURCES_local)						\
163	dwarf/Lfind_proc_info-lsb.c					\
164	x86/Lcreate_addr_space.c x86/Lget_save_loc.c x86/Lglobal.c	\
165	x86/Linit.c x86/Linit_local.c x86/Linit_remote.c		\
166	x86/Lis_signal_frame.c x86/Lget_proc_info.c x86/Lregs.c		\
167	x86/Lresume.c x86/Lstep.c
168
169# The list of files that go into libunwind-x86:
170libunwind_x86_la_SOURCES_x86 = $(libunwind_la_SOURCES_x86_common)	\
171	$(libunwind_la_SOURCES_generic)					\
172	$(dwarf_SOURCES_generic)					\
173	dwarf/Gfind_proc_info-lsb.c					\
174	x86/Gcreate_addr_space.c x86/Gget_save_loc.c x86/Gglobal.c	\
175	x86/Ginit.c x86/Ginit_local.c x86/Ginit_remote.c		\
176	x86/Gis_signal_frame.c x86/Gget_proc_info.c x86/Gregs.c		\
177	x86/Gresume.c x86/Gstep.c
178
179# The list of files that go both into libunwind and libunwind-x86_64:
180libunwind_la_SOURCES_x86_64_common = $(libunwind_la_SOURCES_common)	\
181	$(dwarf_SOURCES_common)						\
182	elf64.c elf64.h							\
183	x86_64/init.h x86_64/unwind_i.h x86_64/ucontext_i.h		\
184	x86_64/is_fpreg.c x86_64/regname.c x86_64/offsets.h
185
186# The list of files that go into libunwind:
187libunwind_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common)	    \
188	$(libunwind_la_SOURCES_local)					    \
189	$(dwarf_SOURCES_local)						    \
190	dwarf/Lfind_proc_info-lsb.c					    \
191	x86_64/setcontext.S						\
192	x86_64/Lcreate_addr_space.c x86_64/Lget_save_loc.c x86_64/Lglobal.c \
193	x86_64/Linit.c x86_64/Linit_local.c x86_64/Linit_remote.c	    \
194	x86_64/Lis_signal_frame.c x86_64/Lget_proc_info.c x86_64/Lregs.c    \
195	x86_64/Lresume.c x86_64/Lstep.c
196
197# The list of files that go into libunwind-x86_64:
198libunwind_x86_64_la_SOURCES_x86_64 = $(libunwind_la_SOURCES_x86_64_common)  \
199	$(libunwind_la_SOURCES_generic)					    \
200	$(dwarf_SOURCES_generic)					    \
201	dwarf/Gfind_proc_info-lsb.c					    \
202	x86_64/Gcreate_addr_space.c x86_64/Gget_save_loc.c x86_64/Gglobal.c \
203	x86_64/Ginit.c x86_64/Ginit_local.c x86_64/Ginit_remote.c	    \
204	x86_64/Gis_signal_frame.c x86_64/Gget_proc_info.c x86_64/Gregs.c    \
205	x86_64/Gresume.c x86_64/Gstep.c
206
207# The list of files that go both into libunwind and libunwind-ppc64:
208libunwind_la_SOURCES_ppc64_common = $(libunwind_la_SOURCES_common)      \
209        $(dwarf_SOURCES_common)                                         \
210        elf64.c elf64.h                                                 \
211        ppc64/init.h ppc64/unwind_i.h ppc64/ucontext_i.h		\
212        ppc64/is_fpreg.c ppc64/regname.c ppc64/get_func_addr.c
213
214# The list of files that go into libunwind:
215libunwind_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common)       \
216        $(libunwind_la_SOURCES_local)                                   \
217        $(dwarf_SOURCES_local)                                          \
218        dwarf/Lfind_proc_info-lsb.c                                     \
219	ppc64/Lcreate_addr_space.c ppc64/Lget_save_loc.c		\
220        ppc64/Lglobal.c ppc64/Linit.c ppc64/Linit_local.c               \
221	ppc64/Linit_remote.c ppc64/Lis_signal_frame.c 			\
222	ppc64/Lget_proc_info.c ppc64/Lregs.c   				\
223        ppc64/Lresume.c ppc64/Lstep.c
224
225# The list of files that go into libunwind-ppc64:
226libunwind_ppc64_la_SOURCES_ppc64 = $(libunwind_la_SOURCES_ppc64_common) \
227        $(libunwind_la_SOURCES_generic)                                 \
228        $(dwarf_SOURCES_generic)                                        \
229        dwarf/Gfind_proc_info-lsb.c                                     \
230        ppc64/Gcreate_addr_space.c                                      \
231        ppc64/Gget_proc_info.c 				                \
232        ppc64/Gget_save_loc.c ppc64/Gglobal.c                           \
233        ppc64/Ginit.c ppc64/Ginit_local.c ppc64/Ginit_remote.c          \
234        ppc64/Gis_signal_frame.c ppc64/Gregs.c ppc64/Gresume.c          \
235        ppc64/Gstep.c
236
237if REMOTE_ONLY
238install-exec-hook:
239#	Nothing to do here....
240else
241#
242# This is not ideal, but I know of no other way to install an
243# alias for a library.
244#
245install-exec-hook:
246	$(LN_S) -f libunwind-$(arch).a  $(DESTDIR)$(libdir)/libunwind-generic.a
247	$(LN_S) -f libunwind-$(arch).so \
248		$(DESTDIR)$(libdir)/libunwind-generic.so
249endif
250
251if OS_LINUX
252 libunwind_la_SOURCES_os	= $(libunwind_la_SOURCES_os_linux)
253 libunwind_la_SOURCES_os_local	= $(libunwind_la_SOURCES_os_linux_local)
254endif
255
256if OS_HPUX
257 libunwind_la_SOURCES_os	= $(libunwind_la_SOURCES_os_hpux)
258 libunwind_la_SOURCES_os_local	= $(libunwind_la_SOURCES_os_hpux_local)
259endif
260
261if ARCH_IA64
262 ia64_mk_Gcursor_i_SOURCES = ia64/mk_Gcursor_i.c
263 ia64_mk_Lcursor_i_SOURCES = ia64/mk_Lcursor_i.c
264 noinst_PROGRAMS = ia64/mk_Gcursor_i ia64/mk_Lcursor_i
265 BUILT_SOURCES = Gcursor_i.h Lcursor_i.h
266Gcursor_i.h: ia64/mk_Gcursor_i
267	ia64/mk_Gcursor_i > $@
268Lcursor_i.h: ia64/mk_Lcursor_i
269	ia64/mk_Lcursor_i > $@
270 lib_LTLIBRARIES_arch = libunwind-ia64.la
271 libunwind_la_SOURCES = $(libunwind_la_SOURCES_ia64)
272 libunwind_ia64_la_SOURCES = $(libunwind_ia64_la_SOURCES_ia64)
273 libunwind_ia64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
274if !REMOTE_ONLY
275 libunwind_ia64_la_LIBADD = libunwind.la -lc
276endif
277 libunwind_setjmp_la_SOURCES	= $(libunwind_setjmp_la_SOURCES_common) \
278				  $(libunwind_setjmp_la_SOURCES_ia64)
279else
280if ARCH_HPPA
281 lib_LTLIBRARIES_arch = libunwind-hppa.la
282 libunwind_la_SOURCES = $(libunwind_la_SOURCES_hppa)
283 libunwind_hppa_la_SOURCES = $(libunwind_hppa_la_SOURCES_hppa)
284 libunwind_hppa_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
285if !REMOTE_ONLY
286 libunwind_hppa_la_LIBADD = libunwind.la -lc
287endif
288 libunwind_setjmp_la_SOURCES	= $(libunwind_setjmp_la_SOURCES_common) \
289				  $(libunwind_setjmp_la_SOURCES_hppa)
290else
291if ARCH_X86
292 lib_LTLIBRARIES_arch = libunwind-x86.la
293 libunwind_la_SOURCES = $(libunwind_la_SOURCES_x86)
294 libunwind_x86_la_SOURCES = $(libunwind_x86_la_SOURCES_x86)
295 libunwind_x86_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
296if !REMOTE_ONLY
297 libunwind_x86_la_LIBADD = libunwind.la -lc
298endif
299 libunwind_setjmp_la_SOURCES	= $(libunwind_setjmp_la_SOURCES_common) \
300				  $(libunwind_setjmp_la_SOURCES_x86)
301else
302if ARCH_X86_64
303 lib_LTLIBRARIES_arch = libunwind-x86_64.la
304 libunwind_la_SOURCES = $(libunwind_la_SOURCES_x86_64)
305 libunwind_x86_64_la_SOURCES = $(libunwind_x86_64_la_SOURCES_x86_64)
306 libunwind_x86_64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
307if !REMOTE_ONLY
308 libunwind_x86_64_la_LIBADD = libunwind.la -lc
309endif
310 libunwind_setjmp_la_SOURCES	= $(libunwind_setjmp_la_SOURCES_common) \
311				  $(libunwind_setjmp_la_SOURCES_x86_64)
312
313else
314if ARCH_PPC64
315 lib_LTLIBRARIES_arch = libunwind-ppc64.la
316 libunwind_la_SOURCES = $(libunwind_la_SOURCES_ppc64)
317 libunwind_ppc64_la_SOURCES = $(libunwind_ppc64_la_SOURCES_ppc64)
318 libunwind_ppc64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
319if !REMOTE_ONLY
320 libunwind_ppc64_la_LIBADD = libunwind.la -lc
321endif
322 libunwind_setjmp_la_SOURCES    = $(libunwind_setjmp_la_SOURCES_common) \
323                                  $(libunwind_setjmp_la_SOURCES_ppc64)
324
325endif # ARCH_PPC64
326endif # ARCH_X86_64
327endif # ARCH_X86
328endif # ARCH_HPPA
329endif # ARCH_IA64
330
331#
332# Don't link with standard libraries, because those may mention
333# libunwind already.
334#
335libunwind_la_LDFLAGS =	$(COMMON_SO_LDFLAGS) -XCClinker -nostdlib \
336			$(LDFLAGS_STATIC_LIBCXA) -version-info $(SOVERSION)
337libunwind_la_LIBADD  = -lc $(LIBCRTS)
338
339lib_LIBRARIES = $(LIBRARIES_cdep)
340lib_LTLIBRARIES = $(lib_LTLIBRARIES_cdep) $(lib_LTLIBRARIES_arch) \
341		  $(lib_LTLIBRARIES_cdep_setjmp)
342
343AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/include/tdep-$(arch) -I.
344AM_CCASFLAGS = $(AM_CPPFLAGS)
345
346EXTRA_DIST =	elfxx.h elfxx.c unwind/unwind-internal.h	\
347		$(libunwind_la_SOURCES_hppa)			\
348		$(libunwind_la_SOURCES_ia64)			\
349		$(libunwind_la_SOURCES_x86)			\
350		$(libunwind_la_SOURCES_os_linux)		\
351		$(libunwind_la_SOURCES_os_hpux)			\
352		$(libunwind_la_SOURCES_common)			\
353		$(libunwind_la_SOURCES_local)			\
354		$(libunwind_la_SOURCES_generic)			\
355		$(libunwind_hppa_la_SOURCES_hppa)		\
356		$(libunwind_ia64_la_SOURCES_ia64)		\
357		$(libunwind_x86_la_SOURCES_x86)			\
358		$(libunwind_x86_64_la_SOURCES_x86_64)		\
359		$(libunwind_ptrace_a_SOURCES)			\
360		$(libunwind_setjmp_la_SOURCES_common)		\
361		$(libunwind_setjmp_la_SOURCES_hppa)		\
362		$(libunwind_setjmp_la_SOURCES_ia64)		\
363		$(libunwind_setjmp_la_SOURCES_x86)		\
364		$(libunwind_setjmp_la_SOURCES_x86_64)		\
365		$(libunwind_setjmp_la_SOURCES_ppc64)
366
367
368# The -version-info flag accepts an argument of the form
369# `current[:revision[:age]]'. So, passing `-version-info 3:12:1' sets
370# current to 3, revision to 12, and age to 1.
371
372# If either revision or age are omitted, they default to 0. Also note
373# that age must be less than or equal to the current interface number.
374
375# Here are a set of rules to help you update your library version
376# information:
377
378#    1. Start with version information of `0:0:0' for each libtool
379#       library.
380
381#    2. Update the version information only immediately before a public
382#       release of your software. More frequent updates are unnecessary,
383#       and only guarantee that the current interface number gets larger
384#       faster.
385
386#    3. If the library source code has changed at all since the last
387#       update, then increment revision (`c:r:a' becomes `c:r+1:a').
388
389#    4. If any interfaces have been added, removed, or changed since the
390#       last update, increment current, and set revision to 0.
391
392#    5. If any interfaces have been added since the last public release,
393#       then increment age.
394
395#    6. If any interfaces have been removed since the last public
396#       release, then set age to 0.
397