t-slibgcc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # Copyright (C) 2001-2022 Free Software Foundation, Inc.
  2. #
  3. # This file is part of GCC.
  4. #
  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)
  8. # any later version.
  9. #
  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.
  14. #
  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/>.
  18. # Build a shared libgcc library.
  19. SHLIB_EXT = .so
  20. SHLIB_SOLINK = @shlib_base_name@.so
  21. SHLIB_SOVERSION = 1
  22. SHLIB_SONAME = @shlib_base_name@.so.$(SHLIB_SOVERSION)
  23. SHLIB_MAP = @shlib_map_file@
  24. SHLIB_OBJS = @shlib_objs@
  25. SHLIB_DIR = @multilib_dir@
  26. SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
  27. SHLIB_LC = -lc
  28. SHLIB_MAKE_SOLINK = $(LN_S) $(SHLIB_SONAME) $(SHLIB_DIR)/$(SHLIB_SOLINK)
  29. SHLIB_INSTALL_SOLINK = $(LN_S) $(SHLIB_SONAME) \
  30. $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
  31. SHLIB_LINK = $(CC) $(LIBGCC2_CFLAGS) -shared -nodefaultlibs \
  32. $(SHLIB_LDFLAGS) $(LDFLAGS) \
  33. -o $(SHLIB_DIR)/$(SHLIB_SONAME).tmp @multilib_flags@ \
  34. $(SHLIB_OBJS) $(SHLIB_LC) && \
  35. rm -f $(SHLIB_DIR)/$(SHLIB_SOLINK) && \
  36. if [ -f $(SHLIB_DIR)/$(SHLIB_SONAME) ]; then \
  37. mv -f $(SHLIB_DIR)/$(SHLIB_SONAME) \
  38. $(SHLIB_DIR)/$(SHLIB_SONAME).backup; \
  39. else true; fi && \
  40. mv $(SHLIB_DIR)/$(SHLIB_SONAME).tmp $(SHLIB_DIR)/$(SHLIB_SONAME) && \
  41. $(SHLIB_MAKE_SOLINK)
  42. INSTALL_SHLIB = $(INSTALL_DATA)
  43. SHLIB_INSTALL = \
  44. $(mkinstalldirs) $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
  45. $(INSTALL_SHLIB) $(SHLIB_DIR)/$(SHLIB_SONAME) \
  46. $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
  47. rm -f $(DESTDIR)$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
  48. $(SHLIB_INSTALL_SOLINK)