m4 macro whose name depends on a a variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hey,

I want to write a generic macro that check if different image library (libjpeg, libpng, etc...) are available.

I want it to be called like that:

EVAS_CHECK_IMAGE_LOADER([Jpeg], [yes])
EVAS_CHECK_IMAGE_LOADER([Png], [yes])
etc...

In it, I want to call a macro that checks if a library is available. What I do:


dnl use: EVAS_CHECK_LOADER_DEP_JPEG(loader[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EVAS_CHECK_LOADER_DEP_JPEG],
[
****
]

dnl use: EVAS_CHECK_LOADER_DEP_PNG(loader[, ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
AC_DEFUN([EVAS_CHECK_LOADER_DEP_PNG],
[
*****
]


dnl use: EVAS_CHECK_IMAGE_LOADER(loader, want_loader)
AC_DEFUN([EVAS_CHECK_IMAGE_LOADER],
[

pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl

have_evas_image_loader_[]DOWN="no"

EVAS_CHECK_LOADER_DEP_[]UP(
   [DOWN],
   [have_evas_image_loader_[]DOWN="yes"],
   [have_evas_image_loader_[]DOWN="no"])

popdef([UP])
popdef([DOWN])

])

in the  configure script, I only obtain:

EVAS_CHECK_LOADER_DEP_JPEG
EVAS_CHECK_LOADER_DEP_PNG

and the parameters are not taken into account. I've tried several things without success.

Is it possible to achieve what I want ?

thank you

Vincent Torri


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux