Configure fails to build Makefile

I am trying to compile GNUCobol on a new release of SCO Openserver6 with gcc 7.3 and new GNU open source modules.
I am getting the following error

checking for curses has_mouse function... no                                    
configure: Checks for Berkeley DB ...                                           
checking db.h usability... yes                                                  
checking db.h presence... yes                                                   
checking for db.h... yes                                                        
configure: db.h reports version "-Berkeley DB 5.3.28: (September  9, 2013)-"    
checking for Berkeley DB db.h version >= 4.1... yes (5.3)                       
checking for Berkeley DB library with version 5.3... no                         
configure: error: BDB library version 5.3 not found                             
bash-4.3# echo $PATH                                                            
/usr/sysv5/bin:/opt/xinuos/bin:/usr/gnu/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/usr/
local/bin                                                                       
bash-4.3# pwd                                                                   
/tmp/gnucobol-3.1.2                                                             
bash-4.3# l /usr/lib/libdb-5.3*                                                 
-r-xr-xr-x    1 root     sys      2189988 Jun 26 18:31 /usr/lib/libdb-5.3.a     
-r-xr-xr-x    1 root     sys          931 Jun 26 18:31 /usr/lib/libdb-5.3.la    
-r-xr-xr-x    1 root     sys      1895036 Jun 26 18:31 /usr/lib/libdb-5.3.so    
-r-xr-xr-x    1 root     sys      1895036 Jun 26 18:31 /usr/lib/libdb-5.3.so.0  
bash-4.3#                                                                       

from configure.
Why is the Berkeley DB library not found?

Hi @jgt,

this is really strange, especially since the libs are in the standard path. $PATH is usually not searched for libs, but the library paths ($LD_LIBRARY_PATH if set, or see ls -lR /etc/ld.so.conf*). With ldconfig -v | less you can display these paths, including all the libs in the current cache.

The timestamps of the libdb* are from yesterday, have you compiled them by yourself? If so, you could try to update the cache via ldconfig /usr/lib.

I wonder whether you need to symlink the db.h to ensure that it finds it. As you indicate, it's definitely installed.

I don't think that's the problem, cause configure says:

It's the lib that is not found.

Sounds like your LDPATH (or similar) environment variable is missing /usr/lib

Please post all your env vars.

Thanks

Environment:

bash-4.3# env                                                                   
HZ=100                                                                          
TERM=ansi                                                                       
SHELL=/bin/sh                                                                   
HUSHLOGIN=FALSE                                                                 
_ENVFILE=/.kshrc                                                                
LD_LIBRARY_PATH=/usr/lib:/opt/xinuos/lib                                        
ENV=${_ENVFILE[(_=1)+(_$-=0)-_${-%%*i*}]}                                       
COLUMNS=80                                                                      
PATH=/usr/sysv5/bin:/opt/xinuos/bin:/usr/gnu/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:
/usr/local/bin                                                                  
MAIL=/usr/spool/mail/root                                                       
PWD=/tmp                                                                        
TZ=EST5EDT                                                                      
LINES=25                                                                        
SHLVL=1                                                                         
HOME=/                                                                          
LOGNAME=root                                                                    
LDPATH=/usr/lib:/opt/xinuos/lib                                                 

I ran configure again, with the same result.
One of my attempts was to copy libdb-5.3 from /opt/xinuos/lib to /usr/lib, so that is why the file date is yesterday. I also renamed /usr/linclude/db.h and copied the version 5.3 of db.h into /usr/include.
There is no ldconfig or ld.so.conf file.

-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-3.0.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-3.so@    
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.0.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.1.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.2.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.3.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.4.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.5.so@  
-r--r--r--    1 bin      bin      1394852 Jun 21 20:33 libdb-4.6.a@   
-r--r--r--    1 bin      bin          790 Jun 21 20:33 libdb-4.6.la@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.6.so@  
-r-xr-xr-x    1 bin      bin      1102108 Jun 21 20:33 libdb-4.so@    
-r-xr-xr-x    1 root     sys      2189988 Jun 26 18:31 libdb-5.3.a    
-r-xr-xr-x    1 root     sys          931 Jun 26 18:31 libdb-5.3.la   
-r-xr-xr-x    1 root     sys      1895036 Jun 26 18:31 libdb-5.3.so   
-r-xr-xr-x    1 root     sys      1895036 Jun 26 18:31 libdb-5.3.so.0 
bash-4.3# pwd                                                         
/usr/lib      
                       
bash-4.3# pwd                                                         
/opt/xinuos/lib                                                       
bash-4.3# l libdb-*                                                   
-rw-r--r--    1 root     sys      2189988 Jan 12  2018 libdb-5.3.a    
-rw-r--r--    1 root     sys          931 Jan 16  2018 libdb-5.3.la   
-rwxr-xr-x    1 root     sys      1895036 Jan 12  2018 libdb-5.3.so@  
-rwxr-xr-x    1 root     sys      1895036 Jan 12  2018 libdb-5.3.so.0 
-rwxr-xr-x    1 root     sys      1895036 Jan 12  2018 libdb-5.so@    
1 Like