1 # Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
3 # This file is part of GCC.
5 # GCC is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
10 # GCC is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>.
19 # Compile crtbeginS.o and crtendS.o with pic.
20 CRTSTUFF_T_CFLAGS_S = -fPIC
22 # Compile libgcc2.a with pic.
23 TARGET_LIBGCC2_CFLAGS = -fPIC
25 # Build a shared libgcc library.
27 SHLIB_NAME = @shlib_base_name@.so
28 SHLIB_SONAME = @shlib_base_name@.so.1
29 SHLIB_OBJS = @shlib_objs@
31 # Beware *not* to hide the POSIX threads related symbols provided by
32 # gthr-posix.c, as this would prevent their preemption by real symbols.
33 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
34 -Wl,-msym -Wl,-set_version,gcc.1 -Wl,-soname,$(SHLIB_SONAME) \
35 -o $(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) -lc && \
36 rm -f $(SHLIB_SONAME) && \
37 if [ -f $(SHLIB_NAME) ]; then \
38 mv -f $(SHLIB_NAME) $(SHLIB_NAME).backup; \
40 mv $(SHLIB_NAME).tmp $(SHLIB_NAME) && \
41 $(LN_S) $(SHLIB_NAME) $(SHLIB_SONAME)
42 # $(slibdir) double quoted to protect it from expansion while building
43 # libgcc.mk. We want this delayed until actual install time.
45 $$(mkinstalldirs) $$(DESTDIR)$$(slibdir); \
46 $(INSTALL_DATA) $(SHLIB_NAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_SONAME); \
47 rm -f $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME); \
48 $(LN_S) $(SHLIB_SONAME) $$(DESTDIR)$$(slibdir)/$(SHLIB_NAME)