summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-04-09 15:59:01 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2020-04-09 15:59:01 +0900
commit988211d3d4c1f3d5cfa6b460210f65ab636763b5 (patch)
treeb8c5b749ab6e95e13bdf7b5001bb0f47c2a1b416
parent50e62b36ea01ed25d12c443088b85d4f41a2b3e1 (diff)
downloadlibgpg-error-988211d3d4c1f3d5cfa6b460210f65ab636763b5.tar.gz
build: Use gen-lock-obj.sh script when possible.
* configure.ac (HAVE_GENERATED_LOCK_OBJ_H): New. * src/Makefile.am: Support HAVE_GENERATED_LOCK_OBJ_H. -- For cross build, when possible (currently for GNU/Linux), generate lock-obj-pub.native.h by the script. GnuPG-bug-id: 4774 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--configure.ac14
-rw-r--r--src/Makefile.am7
2 files changed, 21 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index bfebf37..7fb7d46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -595,7 +595,20 @@ if test "$have_w32_system" = yes; then
force_use_syscfg=yes
fi
if test x$cross_compiling = xyes; then
+ case $host in
+ *-*-linux*)
+ lock_obj_h_generated=yes
+ LOCK_ABI_VERSION=1 host=$host host_alias=$host_alias \
+ CC=$CC OBJDUMP=$host_alias-objdump \
+ ac_ext=$ac_ext ac_objext=$ac_objext \
+ AWK=$AWK $srcdir/src/gen-lock-obj.sh \
+ >src/lock-obj-pub.native.h
+ AC_MSG_NOTICE([generated src/lock-obj-pub.native.h])
+ ;;
+ *)
force_use_syscfg=yes
+ ;;
+ esac
fi
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
@@ -603,6 +616,7 @@ AM_CONDITIONAL(HAVE_W64_SYSTEM, test "$have_w64_system" = yes)
AM_CONDITIONAL(HAVE_W32CE_SYSTEM, test "$have_w32ce_system" = yes)
AM_CONDITIONAL(CROSS_COMPILING, test x$cross_compiling = xyes)
AM_CONDITIONAL(FORCE_USE_SYSCFG, test x$force_use_syscfg = xyes)
+AM_CONDITIONAL(HAVE_GENERATED_LOCK_OBJ_H, test x$lock_obj_h_generated = xyes)
AC_DEFINE_UNQUOTED(HOST_TRIPLET_STRING, "$host", [The host triplet])
diff --git a/src/Makefile.am b/src/Makefile.am
index 336fe2a..1cd2f05 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -318,6 +318,12 @@ pre_mkheader_cmds = if test -f lock-obj-pub.native.h; \
then rm lock-obj-pub.native.h; fi
mkheader_opts = --cross
else
+if HAVE_GENERATED_LOCK_OBJ_H
+# lock-obj-pub.native.h is generated at configure time
+pre_mkheader_cmds = :
+mkheader_opts =
+parts_of_gpg_error_h += ./lock-obj-pub.native.h
+else
pre_mkheader_cmds = :
mkheader_opts =
parts_of_gpg_error_h += ./lock-obj-pub.native.h
@@ -325,6 +331,7 @@ parts_of_gpg_error_h += ./lock-obj-pub.native.h
./lock-obj-pub.native.h: Makefile gen-posix-lock-obj$(EXEEXT) posix-lock-obj.h
./gen-posix-lock-obj >$@
endif
+endif
# We also depend on versioninfo.rc because that is build by
# config.status and thus has up-to-date version numbers.