Next: Other Build Systems, Up: Basic Usage [Contents][Index]
Common autoconf macros can be used to find the library, such as:
AC_SEARCH_LIBS([micro_benchmark_init], [mbenchmark], [...])
MicroBenchmark comes with some (experimental) macros too:
MICRO_BENCHMARK_CHECK_C
Search MicroBenchmark library on some predefined routes and call
AC_SUBST
on the following variables:
Contains the compiler flags needed to find the headers of the local installation of MicroBenchmark.
Contains the compiler flags needed to compile and link a program with MicroBenchmark.
Contains the linker flags needed to link a program with MicroBenchmark.
Contains a reference to MicroBenchmark libtool file, when available.
MICRO_BENCHMARK_CHECK_CXX
Search MicroBenchmark C++ library on some predefined routes and call
AC_SUBST
on the following variables:
Contains the compiler flags needed to find the headers of the local installation of MicroBenchmark.
Contains the compiler flags needed to compile and link a C++ program with MicroBenchmark.
Contains the linker flags needed to link a program against MicroBenchmark C++ binding.
Contains the reference to MicroBenchmark C++ libtool file, when available.
MICRO_BENCHMARK_CHECK_GUILE
Check that the modules availability and the library version.
This could be a basic example of their usage:
configure.ac: ---
@dots{} AS_IF([@dots{}], [dnl To substitute CFLAGS/LIBS/LTLIBS MICRO_BENCHMARK_CHECK_C @dots{} dnl To substitute CXXFLAGS/CXXLIBS/CXXLTLIBS MICRO_BENCHMARK_CHECK_CXX @dots{} dnl For Guile, only checks are performed MICRO_BENCHMARK_CHECK_GUILE ]) @dots{}
--- Makefile.am: ---
@dots{} ctest_CFLAGS += $(MICRO_BENCHMARK_CFLAGS) ctest_LIBS += $(MICRO_BENCHMARK_LIBS) @dots{} # For the C++ library cpptest_CXXFLAGS += $(MICRO_BENCHMARK_CXXFLAGS) cpptest_LIBS += $(MICRO_BENCHMARK_CXXLIBS) @dots{} # Or with libtool ltctest_LDADD += $(MICRO_BENCHMARK_LTLIBS) ltcxxlttest_LDADD += $(MICRO_BENCHMARK_CXXLTLIBS) @dots{}
---
Next: Other Build Systems, Up: Basic Usage [Contents][Index]