X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=textclient%2Fconfigure;h=04821c612471752fca075d37dafae2c69b558679;hb=HEAD;hp=f49e7527f21a726ba509bf56a7d1097264ab9ee0;hpb=633eabfc5820a6cc3b3c45793243928d0fa9c099;p=citadel.git diff --git a/textclient/configure b/textclient/configure index f49e7527f..eba03f83d 100755 --- a/textclient/configure +++ b/textclient/configure @@ -6,11 +6,6 @@ # # This program is open source software. Use, duplication, and/or # disclosure are subject to the GNU General Purpose License version 3. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. echo echo @@ -59,15 +54,21 @@ do shift done + +######################################################################## # Set any missing values +######################################################################## [ "$PREFIX" = "" ] && PREFIX=/usr/local [ "$BINDIR" = "" ] && BINDIR=${PREFIX}/bin [ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel -[ "$CFLAGS" = "" ] && CFLAGS='-ggdb' +[ "$CFLAGS" = "" ] && CFLAGS='-Wformat-truncation=0 -ggdb' [ "$LDFLAGS" = "" ] && LDFLAGS='' + +######################################################################## # Test for OpenSSL +######################################################################## [ "$SSL" != "yes" ] && [ "$SSL" != "no" ] && { echo Testing for OpenSSL... tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$ @@ -87,10 +88,49 @@ int main(int argc, char **argv) { echo SSL: $SSL [ "$SSL" = "yes" ] && { CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' - LDFLAGS=${LDFLAGS}' -lssl -lcrypto' + LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' } + +######################################################################## +# Test for iconv +######################################################################## +echo Testing for iconv... +tempfile=`tempfile 2>/dev/null` || tempfile=/tmp/configure.$$ +tempcc=${tempfile}.c +cat >$tempcc < +#include +#include +#include +int main(int argc, char **argv) { + size_t wow = iconv(NULL, NULL, NULL, NULL, NULL); + return(0); +} +! + +cc $tempcc -o $tempfile && { + ICONV='yes' + echo iconv.h is present and requires no additional libraries +} || { + echo Trying again with -liconv... + cc $tempcc -liconv -o $tempfile && { + ICONV='yes' + LDFLAGS=${LDFLAGS}' -liconv' + } || { + echo Citadel Server requires iconv character set conversion. + rm -f $tempfile 2>/dev/null + rm -f $tempcc 2>/dev/null + exit 1 + } +} +rm -f $tempfile 2>/dev/null +rm -f $tempcc 2>/dev/null + + +######################################################################## # Output the config.mk +######################################################################## ( echo "CFLAGS := ${CFLAGS}"