Skip to content

Commit

Permalink
ports/libgpg-error: Pass host flags correctly to host compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
mintsuki committed Aug 27, 2024
1 parent a01bfba commit b92af14
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions patches/libgpg-error/jinx-working-patch.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git libgpg-error-clean/configure.ac libgpg-error-workdir/configure.ac
index a24453e..f34d313 100644
--- libgpg-error-clean/configure.ac
+++ libgpg-error-workdir/configure.ac
@@ -197,6 +197,10 @@ esac
# We need to compile and run a program on the build machine.
AX_CC_FOR_BUILD

+AC_ARG_VAR([CFLAGS_FOR_BUILD], [CFLAGS for host])
+AC_ARG_VAR([CPPFLAGS_FOR_BUILD], [CPPFLAGS for host])
+AC_ARG_VAR([LDFLAGS_FOR_BUILD], [LDFLAGS for host])
+
AH_BOTTOM([
/* Force using of NLS for W32 even if no libintl has been found. This is
okay because we have our own gettext implementation for W32. */
diff --git libgpg-error-clean/src/Makefile.am libgpg-error-workdir/src/Makefile.am
index 9389e99..4919a12 100644
--- libgpg-error-clean/src/Makefile.am
+++ libgpg-error-workdir/src/Makefile.am
@@ -256,6 +256,10 @@ gpg-error.def: Makefile gpg-error.def.in
grep -v '^#' >$@
-rm _$@.h

+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
+CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
+LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
+
# It is correct to use $(CC_FOR_BUILD) here. We want to run the
# program at build time.
mkerrcodes$(EXEEXT_FOR_BUILD): mkerrcodes.c mkerrcodes.h Makefile
3 changes: 3 additions & 0 deletions recipes/libgpg-error
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ regenerate() {
build() {
cp -rp "${source_dir}"/. ./

CFLAGS_FOR_BUILD="$HOST_CFLAGS" \
CXXFLAGS_FOR_BUILD="$HOST_CXXFLAGS" \
LDFLAGS_FOR_BUILD="$HOST_LDFLAGS" \
configure_script_path=./configure \
autotools_configure

Expand Down

0 comments on commit b92af14

Please sign in to comment.