2

when I ran ./configure in dropbear, it says missing zlib; however, I've already added the prefix, i.e., --prefix, to point to the correct directory for zlib, but the problem still persists.

I'm trying 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.

2
  • 3
    What do you mean by ...the correct directory for zlib...? Moreover, --prefix indicates where you want to install software, not where configure is supposed to find it. Sep 28, 2016 at 11:33
  • my apologies, what I meant was 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
    – rainfrost
    Sep 29, 2016 at 1:03

2 Answers 2

0

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
3
  • hi Thomas, it's weird, when I removed CC path away I was able to compile but it's for x86-64 intel platform. I need to compile for ARM embedded, so is there anything wrong with the CC path itself?
    – rainfrost
    Sep 29, 2016 at 10:01
  • #!/bin/bash myheader=$HOME/home/aa/Hi3536_SDK_V2.0.4.0/zlib/include mylibs=$HOME/home/aa/Hi3536_SDK_V2.0.4.0/zlib/lib ./configure --prefix=/home/aa/Hi3536_SDK_V2.0.4.0/dropbear-arm -v CPPFLAGS="-I$myheader" LDFLAGS="-I$mylibs" --with-zlib=$HOME/Hi3536_SDK_V2.0.4.0/zlib --host=arm CC=arm-hisiv400-linux-gcc
    – rainfrost
    Sep 29, 2016 at 10:06
  • perhaps - but if you read config.log, you can see what was tried, and what failed. Sep 29, 2016 at 20:39
0

Check the config.log file. Odds are, you'll find repeated error messages about -Wno-pointer-sign.

What's happening isn't that configure is failing to find zlib, it's that configure is expecting a newer version of GCC than you're using, and GCC is erroring out on the unrecognized command-line option. All the tests are failing, it's just that the test for zlib is the first one where failure is fatal.

To fix this, edit the configure script to remove -Wno-pointer-sign from the CFLAGS parameters (for me, it was on line 3135).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .