Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. include $(TOPDIR)/rules.mk
  3. PKG_NAME:=elfutils
  4. PKG_VERSION:=0.191
  5. PKG_RELEASE:=2
  6. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  7. PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)
  8. PKG_HASH:=df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871
  9. PKG_LICENSE:=GPL-3.0-or-later
  10. PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3
  11. PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils
  12. PKG_FIXUP:=autoreconf
  13. PKG_INSTALL:=1
  14. PKG_PROGRAMS:=elflint findtextrel elfcmp unstrip stack elfcompress elfclassify srcfiles
  15. PKG_SUBDIRS := \
  16. libgnu \
  17. config \
  18. lib \
  19. libelf \
  20. libcpu \
  21. backends \
  22. libebl \
  23. libdwelf \
  24. libdwfl \
  25. libdw \
  26. src
  27. PKG_GNULIB_BASE:=libgnu
  28. PKG_GNULIB_ARGS = \
  29. --dir=$(HOST_BUILD_DIR) \
  30. --local-dir=$(STAGING_DIR_HOST)/share/gnulib \
  31. --source-base=$(PKG_GNULIB_BASE) \
  32. --libtool \
  33. --avoid=reallocarray \
  34. --import
  35. PKG_GNULIB_MODS = \
  36. argp \
  37. fallocate-posix \
  38. fnmatch-gnu \
  39. fts \
  40. obstack \
  41. progname \
  42. strchrnul \
  43. tsearch
  44. include $(INCLUDE_DIR)/host-build.mk
  45. export $(PKG_GNULIB_BASE)=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/.libs/$(PKG_GNULIB_BASE).a
  46. export $(PKG_GNULIB_BASE)_fallocate-posix=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-posix_fallocate.o
  47. export $(PKG_GNULIB_BASE)_tsearch=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-tsearch.o
  48. HOST_MAKE_FLAGS += \
  49. DEFAULT_INCLUDES='-I. -I$$$$(top_builddir) -I$$$$(top_srcdir)/$(PKG_GNULIB_BASE)' \
  50. AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \
  51. LIBS+='$$$$(if $$$$(findstring $(lastword $(PKG_SUBDIRS)),$$$$(subdir)), $$$$($(PKG_GNULIB_BASE)))' \
  52. LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_fallocate-posix))' \
  53. LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_tsearch))' \
  54. REPLACE_FCNTL=0 REPLACE_FREE=0 REPLACE_FSTAT=0 REPLACE_OPEN=0 \
  55. bin_PROGRAMS='$(PKG_PROGRAMS)' EXEEXT=
  56. ifeq ($(HOST_OS),Darwin)
  57. HOST_CFLAGS += -I/opt/homebrew/include
  58. endif
  59. HOST_CFLAGS += -Wno-error -fPIC
  60. HOST_CXXFLAGS += -O2
  61. HOST_CONFIGURE_ARGS += \
  62. --without-libintl-prefix \
  63. --without-libiconv-prefix \
  64. --disable-debuginfod \
  65. --disable-libdebuginfod \
  66. --disable-nls \
  67. --disable-shared \
  68. --enable-static \
  69. --without-lzma \
  70. --without-bzlib \
  71. --without-zstd
  72. ifeq ($(HOST_OS),Darwin)
  73. HOST_CONFIGURE_ARGS += --disable-symbol-versioning
  74. endif
  75. HOST_CONFIGURE_VARS += \
  76. ac_cv_search_argp_parse=yes \
  77. ac_cv_search_fts_close=yes \
  78. ac_cv_search__obstack_free=yes \
  79. ac_cv_buildid=yes
  80. Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre)
  81. define Host/Gnulib
  82. $(STAGING_DIR_HOST)/bin/gnulib-tool $(PKG_GNULIB_ARGS) $(PKG_GNULIB_MODS);
  83. ln -sf ../lib/eu-config.h $(HOST_BUILD_DIR)/libgnu/;
  84. endef
  85. define Host/Compile
  86. $(call Host/Compile/Default,SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))')
  87. endef
  88. define Host/Install
  89. $(call Host/Compile/Default,install SUBDIRS='$$$$(wildcard $(PKG_SUBDIRS))')
  90. endef
  91. define Host/Uninstall
  92. -$(call Host/Compile/Default,uninstall)
  93. endef
  94. $(eval $(call HostBuild))