iconv now tested in configure.sh

This commit is contained in:
p.kosyh 2010-07-24 17:51:08 +00:00
parent 21cb8e23e1
commit 8ff3e5ab20
3 changed files with 39 additions and 2 deletions

View file

@ -27,7 +27,7 @@ LUA_LFLAGS=$(shell pkg-config --libs lua5.1)
SDL_CFLAGS=$(shell sdl-config --cflags)
SDL_LFLAGS=$(shell sdl-config --libs) -lSDL_ttf -lSDL_mixer -lSDL_image
CFLAGS += -g -Wall -D_HAVE_ICONV -Dunix -D_USE_UNPACK -D_LOCAL_APPDATA # -D_SDL_MOD_BUG
CFLAGS += -g -Wall -Dunix -D_USE_UNPACK -D_LOCAL_APPDATA # -D_SDL_MOD_BUG
INSTALLD=echo "Do not install standalone version!"
INSTALLB=echo "Do not install standalone version!"

View file

@ -28,7 +28,7 @@ LUA_LFLAGS=$(shell pkg-config --libs lua5.1)
SDL_CFLAGS=$(shell sdl-config --cflags)
SDL_LFLAGS=$(shell sdl-config --libs) -lSDL_ttf -lSDL_mixer -lSDL_image
CFLAGS += -Wall -Dunix -D_HAVE_ICONV -D_USE_UNPACK # -D_SDL_MOD_BUG
CFLAGS += -Wall -Dunix -D_USE_UNPACK # -D_SDL_MOD_BUG
INSTALLD=install -d -m 0755
INSTALLB=install -m 0755

View file

@ -1,4 +1,6 @@
#!/bin/bash
cflags=""
lflags=""
echo -n "Checking pkg-config..."
if ! pkg-config --version >/dev/null 2>&1; then
@ -109,11 +111,46 @@ if ! $cc /tmp/sdl-test.c $ops `sdl-config --cflags` `sdl-config --libs` -lSDL_tt
fi
echo "ok"
rm -f /tmp/sdl-test.c /tmp/sdl-test
cat << EOF >/tmp/iconv-test.c
#include <iconv.h>
int main(int argc, char **argv)
{
iconv_open("","");
}
EOF
echo $cc
echo -n "Checking iconv...("
echo -n "$cc /tmp/iconv-test.c -o iconv-test)..."
if ! $cc /tmp/iconv-test.c -o iconv-test; then
if ! $cc /tmp/iconv-test.c -liconv -o iconv-test; then
echo -n "failed. Build without iconv.".
else
cflags="-D_HAVE_ICONV"
lflags="-liconv"
echo "ok, with -liconv"
fi
else
cflags="-D_HAVE_ICONV"
echo "ok"
fi
rm -f /tmp/iconv-test.c /tmp/iconv-test
if ! make clean >/dev/null 2>&1; then
echo " * Warning!!! Can not do make clean..."
fi
echo -n "Generating config.make..."
echo "# autamatically generated by configure.sh" >config.make
if [[ ! -z "$cflags" ]]; then
echo "EXTRA_CFLAGS+=$cflags" >> config.make
fi
if [[ ! -z "$lflags" ]]; then
echo "EXTRA_LDFLAGS+=$lflags" >> config.make
fi
if [[ ! -z "$gtk_cflags" ]]; then
echo "EXTRA_CFLAGS+=-D_USE_GTK -D_USE_BROWSE" >> config.make
echo "EXTRA_CFLAGS+=\$(shell $gtk_cflags)" >> config.make