سؤال

I have the following code in my configure.ac:

AC_SEARCH_LIBS([backtrace], [execinfo], [], [
  AC_MSG_ERROR([unable to find the backtrace() function])
])

I want to change this so a macro is defind in config.h if backtrace is available. I've tried

AC_SEARCH_LIBS([backtrace], [execinfo], [
  AM_CONDITIONAL(HAVE_BACKTRACE, true)
], [
  AM_CONDITIONAL(HAVE_BACKTRACE, true)
])

Note that I've intentionally used true in both places, so that I'm sure the macro is being set either way -- and it's not being set, so I'm most probably doing it the wrong way. What's the proper way to do this?

هل كانت مفيدة؟

المحلول

AM_CONDITIONAL defines an Automake condition.

You want AC_DEFINE, which emits something into config.h.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top