Monday, October 14, 2019

Autoconf: example of checking for a feature in configure.ac


AC_MSG_CHECKING([for string])

AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
                           #include <string>
                           string str = "a string";
                      ]])], 
                  [AC_DEFINE([HAS_STRING], [1], [support string])
                   AC_MSG_RESULT([yes])
                  ],
                  [AC_MSG_RESULT([no])])

 

No comments:

 
Get This <