Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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_PROGRAMS:=elflint findtextrel elfcmp unstrip stack elfcompress elfclassify srcfiles
  14. PKG_SUBDIRS := \
  15. config \
  16. lib \
  17. libelf \
  18. libcpu \
  19. backends \
  20. libebl \
  21. libdwelf \
  22. libdwfl \
  23. libdw \
  24. src
  25. PKG_GNULIB_BASE:=libgnu
  26. PKG_GNULIB_ARGS = \
  27. --dir=$(HOST_BUILD_DIR) \
  28. --libtool \
  29. --avoid=reallocarray \
  30. --import
  31. PKG_GNULIB_MODS = \
  32. argp \
  33. fallocate-posix \
  34. fnmatch-gnu \
  35. fts \
  36. obstack \
  37. progname \
  38. strchrnul \
  39. tsearch
  40. include $(INCLUDE_DIR)/host-build.mk
  41. export $(PKG_GNULIB_BASE)=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/.libs/$(PKG_GNULIB_BASE).a
  42. export $(PKG_GNULIB_BASE)_fallocate-posix=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-posix_fallocate.o
  43. export $(PKG_GNULIB_BASE)_tsearch=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-tsearch.o
  44. HOST_MAKE_FLAGS += \
  45. DEFAULT_INCLUDES='-I. -I$$$$(top_builddir) -I$$$$(top_srcdir)/$(PKG_GNULIB_BASE)' \
  46. AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \
  47. LIBS+='$$$$(if $$$$(findstring $(lastword $(PKG_SUBDIRS)),$$$$(subdir)), $$$$($(PKG_GNULIB_BASE)))' \
  48. LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_fallocate-posix))' \
  49. LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_tsearch))' \
  50. REPLACE_FCNTL=0 REPLACE_FREE=0 REPLACE_FSTAT=0 REPLACE_OPEN=0 \
  51. bin_PROGRAMS='$(PKG_PROGRAMS)' EXEEXT=
  52. HOST_CPPFLAGS += "'-I$$$$(top_srcdir)/lib'"
  53. ifeq ($(HOST_OS),Darwin)
  54. HOST_CFLAGS += -I/opt/homebrew/include
  55. endif
  56. HOST_CFLAGS += -Wno-error -fPIC -std=gnu17
  57. HOST_CONFIGURE_ARGS += \
  58. --without-libintl-prefix \
  59. --without-libiconv-prefix \
  60. --disable-debuginfod \
  61. --disable-libdebuginfod \
  62. --disable-nls \
  63. --disable-shared \
  64. --enable-static \
  65. --without-lzma \
  66. --without-bzlib \
  67. --without-zstd
  68. ifeq ($(HOST_OS),Darwin)
  69. HOST_CONFIGURE_ARGS += --disable-symbol-versioning
  70. endif
  71. HOST_CONFIGURE_VARS += \
  72. ac_cv_search_argp_parse=yes \
  73. ac_cv_search_fts_close=yes \
  74. ac_cv_search__obstack_free=yes \
  75. ac_cv_buildid=yes
  76. Hooks/HostConfigure/Pre := Host/Gnulib/Prepare $(Hooks/HostConfigure/Pre)
  77. Hooks/HostCompile/Pre := Host/Gnulib/Compile $(Hooks/HostCompile/Pre)
  78. define Host/Uninstall
  79. -$(call Host/Compile/Default,uninstall)
  80. endef
  81. $(eval $(call HostBuild))