How to configure configure script to check dependencies

I created a configure script with autoconf to create my project.

It works fine if I don't have a library installed. A return error if some files are missing, but it should be checked with the configure script, I think?

So my question is: how to change the autoconf script created to look for dependencies and tell the user which libraries he is missing?

+3
source share
3 answers

Depending on the dependency, there is no general solution.

AC_CHECK_LIB AC_SEARCH_LIBS , , .

pkg-config - , , .

, AC pkg-config , , , , , , .

+4

, . Stick, , ( Shlomi Fish) configure.ac:

if test "x$requires_libavl" = "xyes" ; then
    AC_CHECK_LIB(avl, avl_create, [], [
        echo "Error! You need to have libavl around."
        exit -1
        ])
fi

, pre-2.5 autoconf, configure.in.

+2

, , - , , , / configure script. , , . , , .

+1

Source: https://habr.com/ru/post/1710494/


All Articles