Search code examples
linuxemailinstallationdkim

Cannot install opendkim because cannot find bsd/string.h


I tried to install OpenDKIM 2.9.2 on AWS to generate the DKIM public & private keys. And when I run sudo ./configure --with-openssl=/usr/include/openssl under the opendkim source code folder, it gave me the following error messages.

checking bsd/string.h usability... no
checking bsd/string.h presence... no
checking for bsd/string.h... no
checking for strlcat... no
checking for library containing strlcat... no
checking for library containing strlcpy... no
checking for strlcpy... no
checking for library containing strlcat... (cached) no
checking for library containing strlcpy... (cached) no
configure: error: no strlcpy/strlcat found

I searched the system and I found the string.h files locate at the following folders

/usr/include/bits/string.h
/usr/include/string.h
/usr/include/linux/string.h

And I created a folder called bsd under /usr/include (/usr/include/bsd), and created a soft link to the /usr/include/string.h. Then the install process can find the string.h file, but it still cannot find the strlcat and strlcpy functions in that file. So I guess that I need to installed libbsd. Then I ran "whereis libbsd" and I got "/usr/lib64/libbsd.a". So I guess that the lib has been installed.

So now I have no idea about how to fix the issue and install OpenDKIM from source.

Please help me on this. Thanks in advance.


Solution

  • You need to install libbsd-dev

    if you are using ubuntu

    sudo apt-get install  libbsd-dev
    

    if you are using centOS

    sudo yum install  libbsd-devel
    

    Hope this helps you