From: Art Cancro Date: Wed, 8 Jun 2022 19:26:51 +0000 (-0400) Subject: textclient: test to see whether iconv requires -liconv in ldflags. Now it should... X-Git-Tag: v952~9 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=4011c90f45d639b16aa76d626884bac9d9a587ba textclient: test to see whether iconv requires -liconv in ldflags. Now it should work on both Linux and FreeBSD. I will backport this patch to the production release. --- diff --git a/citadel/bootstrap b/citadel/bootstrap index 8f3373470..3908e948c 100755 --- a/citadel/bootstrap +++ b/citadel/bootstrap @@ -1,8 +1,5 @@ -#!/bin/sh +#!/bin/bash # # run me after checking Citadel out of the source code repository. -echo ... running mk_svn_revision.sh ... -./scripts/mk_svn_revision.sh - -grep '#define REV_LEVEL' citadel.h | sed 's/[^0-9]*//g' >package-version.txt +grep '#define REV_LEVEL' server/citadel.h | sed 's/[^0-9]*//g' >package-version.txt diff --git a/citadel/configure b/citadel/configure index 86fd09822..7d1b524fc 100755 --- a/citadel/configure +++ b/citadel/configure @@ -106,6 +106,7 @@ cc $tempcc -o $tempfile && { } } + # FIXME do a real build id here CFLAGS=${CFLAGS}' -DBUILD_ID=\"unknown\"' diff --git a/citadel/packageversion b/citadel/packageversion deleted file mode 100644 index b8626c4cf..000000000 --- a/citadel/packageversion +++ /dev/null @@ -1 +0,0 @@ -4 diff --git a/textclient/configure b/textclient/configure index d87d078c5..9a7fbec02 100755 --- a/textclient/configure +++ b/textclient/configure @@ -59,7 +59,10 @@ do shift done + +######################################################################## # Set any missing values +######################################################################## [ "$PREFIX" = "" ] && PREFIX=/usr/local [ "$BINDIR" = "" ] && BINDIR=${PREFIX}/bin @@ -67,7 +70,10 @@ done [ "$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.$$ @@ -90,11 +96,46 @@ echo SSL: $SSL 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. + exit 1 + } +} + + +######################################################################## # Output the config.mk +######################################################################## ( echo "CFLAGS := ${CFLAGS}" - echo "LDFLAGS := ${LDFLAGS} -liconv" + echo "LDFLAGS := ${LDFLAGS}" echo "PREFIX := ${PREFIX}" echo "BINDIR := ${BINDIR}" echo "CTDLDIR := ${CTDLDIR}"