Scons can't find Lualib

I’m trying to install Stratagus from source and I need to generate makefile.am.

I’ve tried with Scons and I do have all the lualib packages I could install, yet this is what I get:

linux-6y6q:/home/shauna/Documents/LinuxSetups/Games/stratagus-2.2.4 # scons
scons: Reading SConscript files ...
build_config.py doesn't exist or out of date.
Generating new build config...
Checking for C library SDL... yes
Checking for C library png... yes
Checking for C library z... yes
Checking for C library dl... yes
Checking for C library lua... yes
Checking for C library lualib... no
Checking for C library lualib50... no
Checking for C library lualib5.0... no
Checking for C library lualib51... no
Checking for C library lualib5.1... no
Did not find required lua library. Exiting!

I’ve also tried with Autotools, and it can’t seem to find what it needs, even though I’ve made sure it’s installed with yast.

linux-6y6q:/home/shauna/Documents/LinuxSetups/Games/stratagus-2.2.4 # sh autogen.sh
: command not found aclocal
: command not found autoheader
: command not found autoconf

It seems there’s a problem with library linking, but how do I fix this?

Usually when you compile something that needs to be linked against a library, say call it foo, you will need the foo-devel package installed, which usually contains include files needed. In this case, try installing the lua-devel package first, then do the ./configure again.

Thanks! I had the 5.1 devel package installed, and apparently it’s not backwards compatible, so I tried the 5.0 devel package and I got a little further.

scons: Reading SConscript files ...                                                                            
build_config.py doesn't exist or out of date.                                                                  
Generating new build config...                                                                                 
Checking for C library SDL... (cached) yes                                                                     
Checking for C library png... (cached) yes                                                                     
Checking for C library z... (cached) yes                                                                       
Checking for C library dl... (cached) yes                                                                      
Checking for C library lua... (cached) yes                                                                     
Checking for C library lualib... (cached) yes                                                                  
Checking for C library bz2... (cached) yes                                                                     
Checking for C library ogg... (cached) yes                                                                     
Checking for C library vorbis... (cached) yes                                                                  
Checking for C library theora... yes                                                                           
Checking for C library mikmod... yes                                                                           
Checking for C library mad... yes                                                                              
Checking for C library FLAC... yes                                                                             
Checking for C function strcasestr()... yes                                                                    
Checking for C header file X11/Xlib.h... yes                                                                   
Checking for C header file X11/Xatom.h... yes                                                                  
Checking for C library X11... yes                                                                              
scons: done reading SConscript files.             

Now, I’m getting other errors, and can’t make sense of them. Any ideas?

linux-6y6q:/home/shauna/Documents/LinuxSetups/Games/stratagus-2.2.4 # scons
scons: Reading SConscript files ...
Using build_config.py
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/stratagus/util.o -c -fsigned-char -O2 -pipe -fomit-frame-pointer -fexpensive-optimizations -ffast-math -DUSE_HP_FOR_XP -D_GNU_SOURCE=1 -D_REENTRANT -DUSE_ZLIB -DUSE_BZ2LIB -DUSE_OGG -DUSE_VORBIS -DUSE_THEORA -DUSE_MIKMOD -DUSE_MAD -DUSE_FLAC -DHAVE_STRCASESTR -DHAVE_X -I/usr/include/SDL -Isrc/include -Isrc/guichan/include src/stratagus/util.cpp
src/stratagus/util.cpp: In function 'size_t strnlen(const char*, size_t)':
src/stratagus/util.cpp:151: error: declaration of 'size_t strnlen(const char*, size_t)' throws different exceptions
src/include/util.h:78: error: from previous declaration 'size_t strnlen(const char*, size_t) throw ()'
scons: *** [build/stratagus/util.o] Error 1
scons: building terminated because of errors.

Looks like the scons code isn’t clean enough for a current g++ version. It seems strlen was already previously declared. Complain to the scons author.

What about auto tools? It doesn’t work either. Is the whole stratagus source bad? Could utils.cpp or sconscript be edited to fix the problem?

That I think is due to autoconf tools you have not installed on your machine. Unfortunately I forget the order in which files are generated, was it ./autoconfigure or ./autogen or what. The whole thing of GNU autoconf scripts generating other scripts just turns my brain to mush an hour after I’ve worked it out. You’ll have to nut this one out yourself.

Well, I skipped using autogen.sh and just ran aclocal, autoheader, and autoconf manually… for some reason the package didn’t come with makefile.am though… and yes, apparently I will have to do this myself, or find a different forum, because Opensuse users are obviously very lazy due to the OS ALMOST doing everything right out of the box… There’s not nearly as many developers on this forum as on other Linux forums… thanks anyway

Yeah I have compiled packages myself in the past, but lately I haven’t had to, with so many packages being ready to install. Even when I had to, usually ./configure was sufficient. It was very rare that I had to go through the whole autoconf shebang. Life’s too short to not take advantage of a time saving when you can. Good luck with autoconf.