The configure option --prefix
is used to tell the configure script (and the resulting makefiles) where to put the programs which will be installed. It does not tell where to get header-files and libraries.
To tell the configure script where to get files, you may have to adjust these variables:
- CPPFLAGS (for directories containing header-files)
- LDFLAGS (for directories containing libraries)
- LIBS (for the actual library names)
You can pass those values on the command-line to configure, e.g.,
myheader=$HOME/junk/include
mylibs=$HOME/junk/lib
./configure CPPFLAGS="-I$myheader" LDFLAGS="-L$mylibs"
Following up on the clarification (which should have been incorporated into the question)
when I try to build the files in dropbear by running
#!/bin/bash
./configure --prefix=$HOME/Hi3536_SDK_V2.0.4.0/dropbear --with-zlib=$HOME/Hi3536_SDK_V2.0.4.0/zlib/include --host=arm CC=arm-hisiv400-linux-gcc
but it seems that it's unable to local the path to zlib
You can see the problem by looking at the source for the configure script:
# Check if zlib is needed
AC_ARG_WITH(zlib,
[ --with-zlib=PATH Use zlib in PATH],
[
# option is given
if test -d "$withval/lib"; then
LDFLAGS="-L${withval}/lib ${LDFLAGS}"
else
LDFLAGS="-L${withval} ${LDFLAGS}"
fi
if test -d "$withval/include"; then
CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
else
CPPFLAGS="-I${withval} ${CPPFLAGS}"
fi
]
)
That is, it expects the option value to be the pathname of a directory which contains both the include
and lib
subdirectories (or a directory containing the files expected to be in those subdirectories). The comment shows that the given value was the pathname of the include
(sub)directory. The following compile/link check will fail:
AC_CHECK_LIB(z, deflate, , AC_MSG_ERROR([*** zlib missing - install first or check config.log ***]))
The likely fix: change that option to
--with-zlib=$HOME/Hi3536_SDK_V2.0.4.0/zlib
--prefix
indicates where you want to install software, not whereconfigure
is supposed to find it.#!/bin/bash ./configure --prefix=$HOME/Hi3536_SDK_V2.0.4.0/dropbear --with-zlib=$HOME/Hi3536_SDK_V2.0.4.0/zlib/include --host=arm CC=arm-hisiv400-linux-gcc
but it seems that it's unable to local the path to zlib