configure.sh fixes

This commit is contained in:
p.kosyh 2009-11-08 14:51:26 +00:00
parent 4a0c8adab1
commit d9821b77ae
2 changed files with 38 additions and 16 deletions

View file

@ -16,7 +16,6 @@ clean:
@for dir in $(SUBDIRS); do \
$(MAKE) clean -C $$dir $(@) || exit 1; \
done;
$(RM) config.make
install: all
ifeq ($(SYSTEMSETUP), yes)

View file

@ -7,18 +7,18 @@ if ! pkg-config --version >/dev/null 2>&1; then
fi
echo "ok"
echo -n "Checking pkg-config --cflags lua[5.1]..."
if ! pkg-config --cflags lua >/dev/null 2>&1; then
if ! pkg-config --cflags lua5.1 >/dev/null 2>&1; then
if ! pkg-config --cflags lua5.1 >/dev/null 2>&1; then
if ! pkg-config --cflags lua >/dev/null 2>&1; then
echo "failed: no package lua/lua5.1"
exit 1
fi
echo "lua5.1"
lua_cflags="pkg-config --cflags lua5.1"
lua_libs="pkg-config --libs lua5.1"
else
echo "lua"
lua_cflags="pkg-config --cflags lua"
lua_libs="pkg-config --libs lua"
lua_cflags="pkg-config --cflags lua"
lua_libs="pkg-config --libs lua"
else
echo "lua5.1"
lua_cflags="pkg-config --cflags lua5.1"
lua_libs="pkg-config --libs lua5.1"
fi
echo -n "Checking sdl-config..."
@ -27,13 +27,13 @@ if ! sdl-config --version >/dev/null 2>&1; then
exit 1
fi
echo "ok"
echo -n "Checking sdl-config --cflags..."
if ! sdl-config --cflags >/dev/null 2>&1; then
echo "failed."
exit 1
fi
echo "ok"
ops=`$lua_cflags`
ops=$ops" "`$lua_libs`
@ -69,7 +69,7 @@ echo -n "Checking test build...("
echo -n $cc /tmp/sdl-test.c $ops `sdl-config --cflags` `sdl-config --libs` -lSDL_ttf -lSDL_mixer -lSDL_image -o /tmp/sdl-test
if ! $cc /tmp/sdl-test.c $ops `sdl-config --cflags` `sdl-config --libs` -lSDL_ttf -lSDL_mixer -lSDL_image -o /tmp/sdl-test; then
echo ") failed".
echo "Please, check those dev packages installed: SDL_ttf SDL_mixer SDL_image."
echo "Please, check those dev packages installed: SDL, SDL_ttf, SDL_mixer, SDL_image."
rm -f /tmp/sdl-test.c /tmp/sdl-test
exit 1
fi
@ -85,20 +85,43 @@ echo "LUA_LFLAGS=\$(shell $lua_libs)" >> config.make
echo "SDL_CFLAGS=\$(shell sdl-config --cflags)" >> config.make
echo "SDL_LFLAGS=\$(shell sdl-config --libs) -lSDL_ttf -lSDL_mixer -lSDL_image" >> config.make
echo "ok"
echo -n "Do you want game will run standalone(1) or will be installed in system(2): "
echo -n "Do you want game will run standalone(1) or will be installed in system(2) [1]: "
read ans
if [ "$ans" == "1" ]; then
if [ "x$ans" == "x1" -o "x$ans" == "x" ]; then
echo " * Standalone version"
rm -f Rules.make
ln -s Rules.make.standalone Rules.make
echo "Ok, now do:"
echo " make; ./sdl-instead"
elif [ "$ans" == "2" ]; then
echo " make && ./sdl-instead"
elif [ "x$ans" == "x2" ]; then
echo " * System version"
echo -n "Enter prefix path [/usr/local]:"
read ans
if [ "x$ans" == "x" ]; then
prefix="/usr/local"
else
prefix="$ans"
fi
rm -f Rules.make
ln -s Rules.make.system Rules.make
echo "PREFIX=/usr/local" >> config.make
echo "BIN=\$(DESTDIR)\$(PREFIX)/bin/" >> config.make
echo "STEADPATH=\$(DESTDIR)\$(PREFIX)/share/instead" >> config.make
echo "THEMESPATH=\$(STEADPATH)/themes" >> config.make
echo "GAMESPATH=\$(STEADPATH)/games" >> config.make
echo "ICONPATH=\$(DESTDIR)\$(PREFIX)/share/pixmaps" >> config.make
echo "DOCPATH=\$(DESTDIR)\$(PREFIX)/share/doc/instead" >> config.make
echo "LANGPATH=\$(STEADPATH)/languages" >> config.make
echo "MANPATH=\$(DESTDIR)\$(PREFIX)/share/man/man6" >> config.make
echo "Ok, now do:"
echo " make; make install; sdl-instead"
echo " make && make install && sdl-instead"
else
echo "Huh!!! Wrong answer."
exit 1
fi
echo "Bye..."