diff options
| author | NIIBE Yutaka <[email protected]> | 2026-06-23 03:21:33 +0200 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2026-06-23 03:21:33 +0200 |
| commit | 61d9a64f91aa89652265da97e32edee86d5fba45 (patch) | |
| tree | 1ca9f6810208ab4e3f123e7f4cf4c1c77aca8cc1 /src | |
| parent | Fix bug reference for the 1.61 release (diff) | |
| download | libgpg-error-61d9a64f91aa89652265da97e32edee86d5fba45.tar.gz libgpg-error-61d9a64f91aa89652265da97e32edee86d5fba45.zip | |
build: No use of awk with gen-lock-obj.sh.
* configure.ac: For invocation of gen-lock-obj.sh, use NM instead of
OBJDUMP, use no AWK.
* src/gen-lock-obj.sh: Use NM with option -P and -t d for portable
output in decimal. No use of AWK, simply use cut.
--
Signed-off-by: Alexis Lothoré <[email protected]>
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src')
| -rwxr-xr-x | src/gen-lock-obj.sh | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh index a8d9352..dccd02b 100755 --- a/src/gen-lock-obj.sh +++ b/src/gen-lock-obj.sh @@ -24,8 +24,7 @@ # Following variables should be defined to invoke this script # # CC -# OBJDUMP -# AWK +# NM # ac_ext # ac_object # host @@ -34,8 +33,8 @@ # An example: # # LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \ -# CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \ -# AWK=gawk ./gen-lock-obj.sh +# CC=$host_alias-gcc NM=$NM ac_ext=c ac_objext=o \ +# ./gen-lock-obj.sh # if test -n "`echo -n`"; then @@ -61,23 +60,19 @@ typedef struct #define GPGRT_LOCK_INITIALIZER {-1} EOF else -AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }') -if test -n "$AWK_VERSION_OUTPUT"; then - # It's GNU awk, which supports PROCINFO. - AWK_OPTION=--non-decimal-data -fi - cat <<'EOF' >conftest.$ac_ext #include <pthread.h> pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER; EOF +# +# Note: NM actually comes with the option -B, because of libtool.m4. +# We override with the -P option (Use POSIX.2 standard format). +# if $CC -c conftest.$ac_ext; then : - ac_mtx_size=$($OBJDUMP -t conftest.$ac_objext \ - | $AWK $AWK_OPTION ' -/mtx$/ { mtx_size = int("0x" $5) } -END { print mtx_size }') -else + ac_mtx_size=$($NM -P -t d conftest.$ac_objext | cut -d ' ' -f 4) +fi +if test -z "$ac_mtx_size"; then echo "Can't determine mutex size" exit 1 fi |
