Skip to content

Commit

Permalink
m4/nut_check_libgd.m4: AX_RUN_OR_LINK_IFELSE() to check that we can a…
Browse files Browse the repository at this point in the history
…ctually build a graphical program

Namely, that further third-party libs are available
for the chosen architecture, not only the headers.
Had a problem with 32/64-bit build agent that only
had a binary lib*.so set for 64-bit after an update.

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Aug 12, 2024
1 parent 015e238 commit b2df27e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions m4/nut_check_libgd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,26 @@ if test -z "${nut_have_libgd_seen}"; then
])
])
if test "${nut_have_libgd}" = "yes"; then
AC_MSG_CHECKING([whether we can build, link and/or run a program with libgd])
AC_LANG_PUSH([C])
AX_RUN_OR_LINK_IFELSE([AC_LANG_PROGRAM([
#include <gd.h>
#include <gdfontmb.h>
],
[
gdImagePtr im = gdImageCreate(64, 128);
int back_color = gdImageColorAllocate(im, 255, 128, 32);
gdImageFilledRectangle(im, 0, 0, 64, 128, back_color);
gdImageColorTransparent(im, back_color);
gdImagePng(im, stdout);
gdImageDestroy(im);
]
)], [], [nut_have_libgd=no])
AC_LANG_POP([C])
AC_MSG_RESULT([${nut_have_libgd}])
fi
if test "${nut_have_libgd}" = "yes"; then
AC_DEFINE(HAVE_LIBGD, 1, [Define if you have Boutell's libgd installed])
LIBGD_CFLAGS="${CFLAGS}"
Expand Down

0 comments on commit b2df27e

Please sign in to comment.