mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 06:15:04 +00:00
(svn r14515) -Fix (r7759): iconv is included in glibc-2.1 and higher, so we don't need to link to a most likely non-existing libiconv in those situations.
This commit is contained in:
parent
c10f7db576
commit
fcb6f0bafe
31
config.lib
31
config.lib
@ -1276,10 +1276,12 @@ make_cflags_and_ldflags() {
|
|||||||
|
|
||||||
if [ "$with_iconv" != "0" ]; then
|
if [ "$with_iconv" != "0" ]; then
|
||||||
CFLAGS="$CFLAGS -DWITH_ICONV"
|
CFLAGS="$CFLAGS -DWITH_ICONV"
|
||||||
LIBS="$LIBS -liconv"
|
if [ "$link_to_iconv" = "yes" ]; then
|
||||||
if [ "$with_iconv" != "2" ]; then
|
LIBS="$LIBS -liconv"
|
||||||
CFLAGS="$CFLAGS -I$with_iconv/include"
|
if [ "$with_iconv" != "2" ]; then
|
||||||
LIBS="$LIBS -L$with_iconv/lib"
|
CFLAGS="$CFLAGS -I$with_iconv/include"
|
||||||
|
LIBS="$LIBS -L$with_iconv/lib"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$have_broken_iconv" != "no" ]; then
|
if [ "$have_broken_iconv" != "no" ]; then
|
||||||
@ -2297,6 +2299,27 @@ EOF
|
|||||||
log 2 " exit code $ret"
|
log 2 " exit code $ret"
|
||||||
if [ "$ret" = "0" ]; then have_broken_iconv="no"; else have_broken_iconv="yes"; fi
|
if [ "$ret" = "0" ]; then have_broken_iconv="no"; else have_broken_iconv="yes"; fi
|
||||||
log 1 "checking if iconv has non-const inbuf... $have_broken_iconv"
|
log 1 "checking if iconv has non-const inbuf... $have_broken_iconv"
|
||||||
|
|
||||||
|
cat > tmp.iconv.cpp << EOF
|
||||||
|
#include "src/stdafx.h"
|
||||||
|
#include <iconv.h>
|
||||||
|
int main() {
|
||||||
|
static char buf[1024];
|
||||||
|
iconv_t convd = 0;
|
||||||
|
char *inbuf = "";
|
||||||
|
char *outbuf = buf;
|
||||||
|
size_t outlen = 1023;
|
||||||
|
size_t inlen = 0;
|
||||||
|
return iconv(convd, &inbuf, &inlen, &outbuf, &outlen);
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
execute="$cxx_host $CFLAGS tmp.iconv.cpp -o tmp.iconv -DTESTING 2>&1"
|
||||||
|
eval $execute >&/dev/null
|
||||||
|
ret=$?
|
||||||
|
log 2 "executing $execute"
|
||||||
|
log 2 " exit code $ret"
|
||||||
|
if [ "$ret" = "0" ]; then link_to_iconv="no"; else link_to_iconv="yes"; fi
|
||||||
|
log 1 "checking whether to link to iconv... $link_to_iconv"
|
||||||
rm -f tmp.iconv tmp.iconv.cpp
|
rm -f tmp.iconv tmp.iconv.cpp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user