[Box Backup] LLONG_MAX configure mistake with gcc 4.1.1 (Linux)

Stuart Hickinbottom boxbackup@fluffy.co.uk
Sat, 10 Jun 2006 07:50:57 +0100


I'm upgrading a test box backup server running Gentoo Linux to gcc
4.1.1. Recompiling everything has gone well, but I've hit a problem with
box backup not compiling. I'm using box backup 0.10

The error I get is because of missing LLONG_MIN and LLONG_MAX definitions:

----- tail of build output
make[1]: Entering directory
`/var/tmp/portage/boxbackup-0.10/work/boxbackup-0.10/bin/bbackupquery'
g++ -DNDEBUG -O2 -Wall -I../../lib/common -I../../lib/compress
-I../../lib/crypto -I../../lib/server -I../../lib/backupclient
-DBOX_VERSION="\"0.10\""   -mmmx -march=pentium2 -fomit-frame-pointer
-pipe -Wall -c bbackupquery.cpp -o
../../release/bin/bbackupquery/bbackupquery.o
g++ -DNDEBUG -O2 -Wall -I../../lib/common -I../../lib/compress
-I../../lib/crypto -I../../lib/server -I../../lib/backupclient
-DBOX_VERSION="\"0.10\""   -mmmx -march=pentium2 -fomit-frame-pointer
-pipe -Wall -c BackupQueries.cpp -o
../../release/bin/bbackupquery/BackupQueries.o
BackupQueries.cpp: In member function 'void
BackupQueries::CommandGetObject(const
std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > >&, const bool*)':
BackupQueries.cpp:818: error: 'LLONG_MIN' was not declared in this scope
BackupQueries.cpp:818: error: 'LLONG_MAX' was not declared in this scope
BackupQueries.cpp: In member function 'void
BackupQueries::CommandGet(const std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >&, const bool*)':
BackupQueries.cpp:904: error: 'LLONG_MIN' was not declared in this scope
BackupQueries.cpp:904: error: 'LLONG_MAX' was not declared in this scope
BackupQueries.cpp: In member function 'void
BackupQueries::CommandRestore(const std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >&, const bool*)':
BackupQueries.cpp:1697: error: 'LLONG_MIN' was not declared in this scope
BackupQueries.cpp:1697: error: 'LLONG_MAX' was not declared in this scope
make[1]: *** [../../release/bin/bbackupquery/BackupQueries.o] Error 1
make[1]: Leaving directory
`/var/tmp/portage/boxbackup-0.10/work/boxbackup-0.10/bin/bbackupquery'
make: *** [parcels/boxbackup-0.10-backup-client-linux-gnu.tgz] Error 2
------

Looking into it a bit more, configure on gcc 3.4.6 puts definitions for
these constants into BoxConfig.h, but leaves those definitions out when
configuring on gcc 4.1.1 - so, it seems like configure gets it wrong.

I have looked into the configure.log and the relevant lines seem to be
as follows:

------ gcc 3.4.6 configure.log fragment
configure:12051: result: no
configure:12058: checking for max value of long long
configure:12112: g++ -o conftest -g -O2     conftest.cc -lcrypto -lssl
-ldb -lz  >&5
configure:12115: $? = 0
configure:12117: ./conftest
Using system header for LLONG_MIN and LLONG_MAX
configure:12120: $? = 0
configure:12124: result: 9223372036854775807
configure:12131: checking for min value of long long
configure:12133: result: -9223372036854775808
------ gcc 4.1.1 configure.log fragment
configure:12051: result: no
configure:12058: checking for max value of long long
configure:12112: g++ -o conftest -g -O2     conftest.cc -lcrypto -lssl
-ldb -lz  >&5
configure:12115: $? = 0
configure:12117: ./conftest
Using system header for LLONG_MIN and LLONG_MAX
configure:12120: $? = 2
configure: program exited with status 2
configure: failed program was:
------

I can look into this some more if someone could give me a couple of
pointers - I've never delved too deeply into configure scripts before
(and having done a little now I can see why!).

Thanks again for box backup - it fits my needs very well indeed.

Stuart