dash/depends/packages/expat.mk

38 lines
1.2 KiB
Makefile
Raw Permalink Normal View History

2014-12-31 17:49:12 +01:00
package=expat
Merge bitcoin/bitcoin#25697: depends: expat 2.4.8 & fix building with -flto e838a9847580527b8321d65e57b1c53cc2af6bf4 depends: re-enable using -flto when building expat (fanquake) 304452558c7f6f5e32ba13d8f05325790c8a4f5f depends: expat 2.4.8 (fanquake) Pull request description: Currently, when building the expat package in depends, using `-flto` (`LTO=1`), the configure check can fail, because it cannot determine the system endianess: ```bash configure:18718: result: unknown configure:18733: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help ``` Fix that by defining `_DEFAULT_SOURCE`, which in turn defines `__USE_MISC` (`features.h`): ```c #if defined _DEFAULT_SOURCE # define __USE_MISC1 #endif ``` which exposes additional definitions in `endian.h`: ```c #include <features.h> /* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER. */ #include <bits/endian.h> #ifdef __USE_MISC # define LITTLE_ENDIAN__LITTLE_ENDIAN # define BIG_ENDIAN__BIG_ENDIAN # define PDP_ENDIAN__PDP_ENDIAN # define BYTE_ORDER__BYTE_ORDER #endif ``` and gives us a working configure. You could test building this change with Guix + LTO with [this branch](https://github.com/fanquake/bitcoin/tree/lto_in_guix). Note that that build may fail for other reasons (on x86_64), unrelated to this change. Some related upstream discussion: https://bugs.gentoo.org/757681 https://forums.gentoo.org/viewtopic-t-1013786.html ACKs for top commit: hebasto: re-ACK e838a9847580527b8321d65e57b1c53cc2af6bf4, only [suggested](https://github.com/bitcoin/bitcoin/pull/25697#discussion_r929735675) changes since my recent [review](https://github.com/bitcoin/bitcoin/pull/25697#pullrequestreview-1050657421). jarolrod: code review ACK e838a9847580527b8321d65e57b1c53cc2af6bf4 Tree-SHA512: 9dbf64c9bd1fd995a4d1addc011ffeff83d50df736030012346c97605e63aed4b5bac390a81abe646c1be28ad6fd600f64560dcb26bbc2edf5d513ca3b180bfa
2022-07-27 13:56:03 +02:00
$(package)_version=2.4.8
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
2023-08-03 13:45:17 +02:00
$(package)_file_name=$(package)-$($(package)_version).tar.xz
Merge bitcoin/bitcoin#25697: depends: expat 2.4.8 & fix building with -flto e838a9847580527b8321d65e57b1c53cc2af6bf4 depends: re-enable using -flto when building expat (fanquake) 304452558c7f6f5e32ba13d8f05325790c8a4f5f depends: expat 2.4.8 (fanquake) Pull request description: Currently, when building the expat package in depends, using `-flto` (`LTO=1`), the configure check can fail, because it cannot determine the system endianess: ```bash configure:18718: result: unknown configure:18733: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help ``` Fix that by defining `_DEFAULT_SOURCE`, which in turn defines `__USE_MISC` (`features.h`): ```c #if defined _DEFAULT_SOURCE # define __USE_MISC1 #endif ``` which exposes additional definitions in `endian.h`: ```c #include <features.h> /* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER. */ #include <bits/endian.h> #ifdef __USE_MISC # define LITTLE_ENDIAN__LITTLE_ENDIAN # define BIG_ENDIAN__BIG_ENDIAN # define PDP_ENDIAN__PDP_ENDIAN # define BYTE_ORDER__BYTE_ORDER #endif ``` and gives us a working configure. You could test building this change with Guix + LTO with [this branch](https://github.com/fanquake/bitcoin/tree/lto_in_guix). Note that that build may fail for other reasons (on x86_64), unrelated to this change. Some related upstream discussion: https://bugs.gentoo.org/757681 https://forums.gentoo.org/viewtopic-t-1013786.html ACKs for top commit: hebasto: re-ACK e838a9847580527b8321d65e57b1c53cc2af6bf4, only [suggested](https://github.com/bitcoin/bitcoin/pull/25697#discussion_r929735675) changes since my recent [review](https://github.com/bitcoin/bitcoin/pull/25697#pullrequestreview-1050657421). jarolrod: code review ACK e838a9847580527b8321d65e57b1c53cc2af6bf4 Tree-SHA512: 9dbf64c9bd1fd995a4d1addc011ffeff83d50df736030012346c97605e63aed4b5bac390a81abe646c1be28ad6fd600f64560dcb26bbc2edf5d513ca3b180bfa
2022-07-27 13:56:03 +02:00
$(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
$(package)_build_subdir=build
$(package)_patches += cmake_minimum.patch
2014-12-31 17:49:12 +01:00
Merge bitcoin/bitcoin#25697: depends: expat 2.4.8 & fix building with -flto e838a9847580527b8321d65e57b1c53cc2af6bf4 depends: re-enable using -flto when building expat (fanquake) 304452558c7f6f5e32ba13d8f05325790c8a4f5f depends: expat 2.4.8 (fanquake) Pull request description: Currently, when building the expat package in depends, using `-flto` (`LTO=1`), the configure check can fail, because it cannot determine the system endianess: ```bash configure:18718: result: unknown configure:18733: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help ``` Fix that by defining `_DEFAULT_SOURCE`, which in turn defines `__USE_MISC` (`features.h`): ```c #if defined _DEFAULT_SOURCE # define __USE_MISC1 #endif ``` which exposes additional definitions in `endian.h`: ```c #include <features.h> /* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER. */ #include <bits/endian.h> #ifdef __USE_MISC # define LITTLE_ENDIAN__LITTLE_ENDIAN # define BIG_ENDIAN__BIG_ENDIAN # define PDP_ENDIAN__PDP_ENDIAN # define BYTE_ORDER__BYTE_ORDER #endif ``` and gives us a working configure. You could test building this change with Guix + LTO with [this branch](https://github.com/fanquake/bitcoin/tree/lto_in_guix). Note that that build may fail for other reasons (on x86_64), unrelated to this change. Some related upstream discussion: https://bugs.gentoo.org/757681 https://forums.gentoo.org/viewtopic-t-1013786.html ACKs for top commit: hebasto: re-ACK e838a9847580527b8321d65e57b1c53cc2af6bf4, only [suggested](https://github.com/bitcoin/bitcoin/pull/25697#discussion_r929735675) changes since my recent [review](https://github.com/bitcoin/bitcoin/pull/25697#pullrequestreview-1050657421). jarolrod: code review ACK e838a9847580527b8321d65e57b1c53cc2af6bf4 Tree-SHA512: 9dbf64c9bd1fd995a4d1addc011ffeff83d50df736030012346c97605e63aed4b5bac390a81abe646c1be28ad6fd600f64560dcb26bbc2edf5d513ca3b180bfa
2022-07-27 13:56:03 +02:00
# -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional
# definitions in endian.h, which are required for a working
# endianess check in configure when building with -flto.
2014-12-31 17:49:12 +01:00
define $(package)_set_vars
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DEXPAT_BUILD_TOOLS=OFF
$(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF
$(package)_config_opts += -DBUILD_SHARED_LIBS=OFF
Merge bitcoin/bitcoin#25697: depends: expat 2.4.8 & fix building with -flto e838a9847580527b8321d65e57b1c53cc2af6bf4 depends: re-enable using -flto when building expat (fanquake) 304452558c7f6f5e32ba13d8f05325790c8a4f5f depends: expat 2.4.8 (fanquake) Pull request description: Currently, when building the expat package in depends, using `-flto` (`LTO=1`), the configure check can fail, because it cannot determine the system endianess: ```bash configure:18718: result: unknown configure:18733: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help ``` Fix that by defining `_DEFAULT_SOURCE`, which in turn defines `__USE_MISC` (`features.h`): ```c #if defined _DEFAULT_SOURCE # define __USE_MISC1 #endif ``` which exposes additional definitions in `endian.h`: ```c #include <features.h> /* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER. */ #include <bits/endian.h> #ifdef __USE_MISC # define LITTLE_ENDIAN__LITTLE_ENDIAN # define BIG_ENDIAN__BIG_ENDIAN # define PDP_ENDIAN__PDP_ENDIAN # define BYTE_ORDER__BYTE_ORDER #endif ``` and gives us a working configure. You could test building this change with Guix + LTO with [this branch](https://github.com/fanquake/bitcoin/tree/lto_in_guix). Note that that build may fail for other reasons (on x86_64), unrelated to this change. Some related upstream discussion: https://bugs.gentoo.org/757681 https://forums.gentoo.org/viewtopic-t-1013786.html ACKs for top commit: hebasto: re-ACK e838a9847580527b8321d65e57b1c53cc2af6bf4, only [suggested](https://github.com/bitcoin/bitcoin/pull/25697#discussion_r929735675) changes since my recent [review](https://github.com/bitcoin/bitcoin/pull/25697#pullrequestreview-1050657421). jarolrod: code review ACK e838a9847580527b8321d65e57b1c53cc2af6bf4 Tree-SHA512: 9dbf64c9bd1fd995a4d1addc011ffeff83d50df736030012346c97605e63aed4b5bac390a81abe646c1be28ad6fd600f64560dcb26bbc2edf5d513ca3b180bfa
2022-07-27 13:56:03 +02:00
$(package)_cppflags += -D_DEFAULT_SOURCE
2014-12-31 17:49:12 +01:00
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
endef
2014-12-31 17:49:12 +01:00
define $(package)_config_cmds
$($(package)_cmake) -S .. -B .
2014-12-31 17:49:12 +01:00
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef
define $(package)_postprocess_cmds
rm -rf share lib/cmake
endef