Skip to content

Commit

Permalink
Fix enable cross compilation by removing the AC_CHECK_FILE macro
Browse files Browse the repository at this point in the history
From the man-page on the `AC_CHECK_FILE` macro, we can read that:

```
You might also need to check for the existence of files. Before using these macros, ask yourself whether a runtime test might not be a better solution. Be aware that, like most Autoconf macros, they test a feature of the host machine, and therefore, they die when cross-compiling.
```

Therefore, move to using a simple shell if/else as the replacement.

Signed-off-by: Ole Petter <[email protected]>
  • Loading branch information
oleorhagen authored and simo5 committed Nov 14, 2023
1 parent 208cc98 commit d994cc2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ PKG_CHECK_EXISTS(
)]
)

AC_CHECK_FILE($SOFTOKENDIR/libsoftokn3$SHARED_EXT, [],
[AC_CHECK_FILE($SOFTOKENDIR/nss/libsoftokn3$SHARED_EXT,
[AC_SUBST([SOFTOKEN_SUBDIR], "nss/")],
[AC_MSG_WARN([Softoken library missing, tests will fail!])])
])
if ! test -f $SOFTOKENDIR/libsoftokn3$SHARED_EXT; then
if test -f $SOFTOKENDIR/nss/libsoftokn3$SHARED_EXT; then
AC_SUBST([SOFTOKEN_SUBDIR], "nss/")
else
AC_MSG_WARN([Softoken library missing, tests will fail!])
fi
fi

# find p11-kit-client to separate softhsm openssl context from our tests
PKG_CHECK_EXISTS([p11-kit-1],
Expand Down

0 comments on commit d994cc2

Please sign in to comment.