libtool.mk 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #############################################################
  2. #
  3. # libtool
  4. #
  5. #############################################################
  6. LIBTOOL_SOURCE:=libtool-1.5.8.tar.gz
  7. LIBTOOL_SITE:=ftp://ftp.gnu.org/gnu/libtool
  8. LIBTOOL_CAT:=zcat
  9. LIBTOOL_DIR:=$(BUILD_DIR)/libtool-1.5.8
  10. LIBTOOL_BINARY:=libtool
  11. LIBTOOL_TARGET_BINARY:=usr/bin/libtool
  12. $(DL_DIR)/$(LIBTOOL_SOURCE):
  13. $(WGET) -P $(DL_DIR) $(LIBTOOL_SITE)/$(LIBTOOL_SOURCE)
  14. libtool-source: $(DL_DIR)/$(LIBTOOL_SOURCE)
  15. $(LIBTOOL_DIR)/.unpacked: $(DL_DIR)/$(LIBTOOL_SOURCE)
  16. $(LIBTOOL_CAT) $(DL_DIR)/$(LIBTOOL_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
  17. touch $(LIBTOOL_DIR)/.unpacked
  18. $(LIBTOOL_DIR)/.configured: $(LIBTOOL_DIR)/.unpacked
  19. (cd $(LIBTOOL_DIR); rm -rf config.cache; \
  20. $(TARGET_CONFIGURE_OPTS) \
  21. CFLAGS="$(TARGET_CFLAGS)" \
  22. ./configure \
  23. --target=$(GNU_TARGET_NAME) \
  24. --host=$(GNU_TARGET_NAME) \
  25. --build=$(GNU_HOST_NAME) \
  26. --prefix=/usr \
  27. --exec-prefix=/usr \
  28. --bindir=/usr/bin \
  29. --sbindir=/usr/sbin \
  30. --libexecdir=/usr/lib \
  31. --sysconfdir=/etc \
  32. --datadir=/usr/share \
  33. --localstatedir=/var \
  34. --mandir=/usr/man \
  35. --infodir=/usr/info \
  36. $(DISABLE_NLS) \
  37. );
  38. touch $(LIBTOOL_DIR)/.configured
  39. $(LIBTOOL_DIR)/$(LIBTOOL_BINARY): $(LIBTOOL_DIR)/.configured
  40. $(MAKE) CC=$(TARGET_CC) -C $(LIBTOOL_DIR)
  41. touch -c $(LIBTOOL_DIR)/$(LIBTOOL_BINARY)
  42. $(TARGET_DIR)/$(LIBTOOL_TARGET_BINARY): $(LIBTOOL_DIR)/$(LIBTOOL_BINARY)
  43. $(MAKE) \
  44. prefix=$(TARGET_DIR)/usr \
  45. exec_prefix=$(TARGET_DIR)/usr \
  46. bindir=$(TARGET_DIR)/usr/bin \
  47. sbindir=$(TARGET_DIR)/usr/sbin \
  48. libexecdir=$(TARGET_DIR)/usr/lib \
  49. datadir=$(TARGET_DIR)/usr/share \
  50. sysconfdir=$(TARGET_DIR)/etc \
  51. localstatedir=$(TARGET_DIR)/var \
  52. libdir=$(TARGET_DIR)/usr/lib \
  53. infodir=$(TARGET_DIR)/usr/info \
  54. mandir=$(TARGET_DIR)/usr/man \
  55. includedir=$(TARGET_DIR)/usr/include \
  56. -C $(LIBTOOL_DIR) install;
  57. $(STRIP) $(TARGET_DIR)//usr/lib/libltdl.so.*.*.* > /dev/null 2>&1
  58. $(SED) "s,^CC.*,CC=\"/usr/bin/gcc\"," $(TARGET_DIR)/usr/bin/libtool
  59. $(SED) "s,^LD.*,LD=\"/usr/bin/ld\"," $(TARGET_DIR)/usr/bin/libtool
  60. rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
  61. $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
  62. libtool: uclibc $(TARGET_DIR)/$(LIBTOOL_TARGET_BINARY)
  63. libtool-clean:
  64. $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(LIBTOOL_DIR) uninstall
  65. -$(MAKE) -C $(LIBTOOL_DIR) clean
  66. libtool-dirclean:
  67. rm -rf $(LIBTOOL_DIR)
  68. #############################################################
  69. #
  70. # Toplevel Makefile options
  71. #
  72. #############################################################
  73. ifeq ($(strip $(BR2_PACKAGE_LIBTOOL)),y)
  74. TARGETS+=libtool
  75. endif