-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I use two almost identical macros: AC_DEFUN([CL_COMPILE_CHECK], [AC_MSG_CHECKING(for $1) AC_CACHE_VAL($2,[ AC_TRY_COMPILE([$3],[$4], $2=yes, $2=no) ]) AC_MSG_RESULT([$]$2) if test [$]$2 = yes; then ~ ifelse([$5], , :, [$5]) ifelse([$6], , , [else ~ $6 ])dnl fi ]) AC_DEFUN([CL_LINK_CHECK], [AC_MSG_CHECKING(for $1) AC_CACHE_VAL($2,[ AC_TRY_LINK([$3],[$4], $2=yes, $2=no) ]) AC_MSG_RESULT([$]$2) if test [$]$2 = yes; then ~ ifelse([$5], , :, [$5]) ifelse([$6], , , [else ~ $6 ])dnl fi ]) and I though that I could replace them with this: AC_DEFUN([CL_CHECK],[dnl AC_CACHE_CHECK(for $2,$3,$1(AC_LANG_PROGRAM([$4],[$5]),[$3=yes], [$3=no])) if test [$]$3 = yes; then ~ ifelse([$6], , :, [$6]) ifelse([$7], , , [else ~ $7 ])dnl fi ]) AC_DEFUN([CL_COMPILE_CHECK], [CL_CHECK(AC_COMPILE_IFELSE,[$1],[$2],[$3],[$4],[$5],[$6])]) AC_DEFUN([CL_LINK_CHECK], [CL_CHECK(AC_LINK_IFELSE,[$1],[$2],[$3],[$4],[$5],[$6])]) alas, I get this error: NONE:0: error: m4_init: unbalanced m4_divert_push: configure.ac:19: m4_divert_push: BODY any ideas? Another question - is there a way to reuse the results of AC_LANG_PROGRAM? here it is called with the same arguments twice: AC_CACHE_CHECK([if XauGetAuthByAddr needs -lXau], [cl_cv_need_lXau], ~ [ cl_LIBS_save=$LIBS ~ cl_CFLAGS_save=$CFLAGS ~ LIBS="$X_LIBS $X_PRE_LIBS -lX11 $LIBS" ~ CFLAGS="$CFLAGS $X_CFLAGS" ~ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h> #include <X11/Xlib.h> #include <X11/Xauth.h>], [XauGetAuthByAddr(AF_INET,0,"",13,"localhost:0.0",13,"localhost:0.0");])], ~ [cl_cv_need_lXau=no], [cl_cv_need_lXau=maybe]) ~ if test $cl_cv_need_lXau = maybe; then ~ LIBS="$X_LIBS -lXau $X_PRE_LIBS $LIBS" ~ CFLAGS="$CFLAGS $X_CFLAGS" ~ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <sys/socket.h> #include <X11/Xlib.h> #include <X11/Xauth.h>], [XauGetAuthByAddr(AF_INET,0,"",13,"localhost:0.0",13,"localhost:0.0");])], ~ [cl_cv_need_lXau=yes], ~ AC_MSG_FAILURE([XauGetAuthByAddr was not found])) ~ fi ~ LIBS=$cl_LIBS_save ~ CFLAGS=$cl_CFLAGS_save]) thanks -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIPtNcPp1Qsf2qnMcRAnhBAJ9WS4jbML1f1tCbcOMFgzWKKaMlZQCaA6vb IgXsqjk1dzxC9RJf9j+1GFk= =9UdB -----END PGP SIGNATURE----- _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx http://lists.gnu.org/mailman/listinfo/autoconf