From: Andrey C. <sku...@us...> - 2006-11-20 12:58:01
|
Update of /cvsroot/eas-dev/eas In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv30411 Modified Files: VERSION configure Log Message: Fix configure for check clip-ui drivers and PAM. By default gtk2 driver is used. Index: VERSION =================================================================== RCS file: /cvsroot/eas-dev/eas/VERSION,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- VERSION 15 Nov 2006 10:37:18 -0000 1.8 +++ VERSION 20 Nov 2006 12:57:55 -0000 1.9 @@ -1 +1 @@ -20061113 +20061116 Index: configure =================================================================== RCS file: /cvsroot/eas-dev/eas/configure,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configure 3 Nov 2006 16:12:06 -0000 1.5 +++ configure 20 Nov 2006 12:57:55 -0000 1.6 @@ -14,9 +14,16 @@ datadir=$prefix/share/eas logdir=$datadir/log dbpath=/var/db/eas +driver= withdoc=YES withl10n=YES +# Required versions +REQUIRED_CLIP_VERSION="1.2.0.0" + +# clip-ui drivers +DRIVERS=( gtk2 gtk ) + for ac_option do # If the previous option needs an argument, assign it. @@ -64,6 +71,11 @@ --dbpath=*) dbpath="$ac_optarg" ;; + --driver) + ac_prev=driver ;; + --driver=*) + driver="$ac_optarg" ;; + --without-doc) withdoc=NO ;; @@ -81,6 +93,7 @@ --datadir=DIR data location: modules, l10n [$datadir] --logdir=DIR location of program messages [$logdir] --dbpath=DIR database default path [$dbpath] + --driver=DRV clip-ui driver name used by default [default=checked] --without-doc build without documentation [default=no] --without-l10n build without localization support [default=no] EOF @@ -158,29 +171,25 @@ exit fi CLIP_version=`$prg --version | sed -n '1p' | tr -d '\n'` -echo "$CLIP_version" 1>&6 - -# Check clip-gtk -echo $ac_n "checking for a clip-gtk library""... $ac_c" 1>&6 -echo "configure:$LINENO: checking for a clip-gtk" >&5 - -prg=$CLIPROOT/lib/libclip-gtk.so -if test ! -f "$prg"; then - echo "Library '$prg' does not found. Configure and install clip-gtk from CLIPDISTRO/cliplibs/clip-gtk directory or appropriate binary package." 2>&6 - exit -fi echo "yes" 1>&6 -# Check clip-gtk2 -echo $ac_n "checking for a clip-gtk2 library""... $ac_c" 1>&6 -echo "configure:$LINENO: checking for a clip-gtk2" >&5 +# Check CLIP version +echo $ac_n "checking for a CLIP version""... $ac_c" 1>&6 +echo "configure:$LINENO: checking for a CLIP version" >&5 -prg=$CLIPROOT/lib/libclip-gtk2.so -if test ! -f "$prg"; then - echo "Library '$prg' does not found. Configure and install clip-gtk2 from CLIPDISTRO/cliplibs/clip-gtk2 directory or appropriate binary package." 2>&6 -# exit -fi -echo "yes" 1>&6 +CLIP_version=`$prg --version | sed -n '1p' | tr -d '\n'` +rv=( `echo "$REQUIRED_CLIP_VERSION" | tr '.' ' '` ) +v=( `echo "$CLIP_version" | tr '.' ' '` ) +# Compare pair of elements in rv and v +i=0 +for vp in ${rv[@]}; do + if test "$vp" -gt "${v[$i]}"; then + echo "< $REQUIRED_CLIP_VERSION. Install newer CLIP version from http://www.itk.ru." 2>&6 + exit + fi + (( i += 1 )) +done +echo "$CLIP_version" 1>&6 # Check clip-ui echo $ac_n "checking for a clip-ui library""... $ac_c" 1>&6 @@ -193,6 +202,34 @@ fi echo "yes" 1>&6 +# Detect drivers +echo $ac_n "checking for clip-ui drivers""... $ac_c" 1>&6 +echo "configure:$LINENO: checking for clip-ui drivers" >&5 +i=0 +for drv in ${DRIVERS[@]}; do + prg="$CLIPROOT/lib/libclip-$drv.so" + if test ! -f "$prg"; then + unset DRIVERS[$i] + if test "$driver" = "$drv"; then + echo "Library '$prg' does not found for specified driver. Select other driver or install library." 2>&6 + exit + fi + fi + (( i += 1 )) +done + +# Check if array is empty +l="${DRIVERS[@]}" +if test -z "$l"; then + echo "There are no available clip-ui drivers. Please, install at least one driver." 2>&6 + exit +fi +echo "$l" 1>&6 + +if test -z "$driver"; then + driver=${DRIVERS[0]} +fi + # Check clip-xml echo $ac_n "checking for a clip-xml library""... $ac_c" 1>&6 echo "configure:$LINENO: checking for a clip-xml" >&5 @@ -252,21 +289,83 @@ # Check programs # -# Check wget -echo $ac_n "checking for wget""... $ac_c" 1>&6 -echo "configure:$LINENO: checking for wget" >&5 +# TODO Check wget +#echo $ac_n "checking for wget""... $ac_c" 1>&6 +#echo "configure:$LINENO: checking for wget" >&5 -prg=`wget --version | head -n 1` -if test -z "$prg"; then - echo "Wget is not installed. Build from http://wget.sunsite.dk/ or install from appropriate binary package." 2>&6 +#prg=`wget --version | head -n 1` +#if test -z "$prg"; then +# echo "Wget is not installed. Build from http://wget.sunsite.dk/ or install from appropriate binary package." 2>&6 +# exit +#fi +#echo "$prg" 1>&6 + +echo $ac_n "checking for PAM""... $ac_c" 1>&6 +echo "configure:$LINENO: checking for PAM" >&5 +PAMLIBS="-lpam -ldl" + +rm -f conftest* +cat >conftest.c <<_ACEOF +#include <security/pam_appl.h> +#define PAM_SERVICE_NAME "easserver" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif + +static struct pam_conv conv = { + NULL +}; + +int main() +{ + pam_handle_t *pamh = NULL; + pam_start( PAM_SERVICE_NAME, 0, &conv, &pamh ); + ; + return 0; +} +_ACEOF + +ac_link="gcc -Wall conftest.c -o conftest $PAMLIBS" +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pam_pam_start=yes +else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.c >&5 + ac_cv_lib_pam_pam_start=no +fi +rm -f conftest* +if test "x$ac_cv_lib_pam_pam_start" = "xyes"; then + echo "yes" 1>&6 +else + echo "PAM library or header does not found. Install PAM library and header." 2>&6 exit fi -echo "$prg" 1>&6 - + if test "$withdoc" = "YES"; then echo $ac_n "checking for docbook2html""... $ac_c" 1>&6 echo "configure:$LINENO: checking for docbook2html" >&5 - prg_version=`docbook2html --version 2>/dev/null | sed -n '1p' | tr -d '\n'` echo "$prg_version" 1>&6 if test -z "$prg_version"; then @@ -300,13 +399,21 @@ echo "" 1>&6 echo "Configuration:" 1>&6 -echo -e " Executables: $bindir" 1>&6 +echo -e " Executables: $bindir" 1>&6 echo -e " Data: $datadir" 1>&6 -echo -e " Logs: $logdir" 1>&6 -echo -e " Databases: $dbpath" 1>&6 +echo -e " Logs: $logdir" 1>&6 +echo -e " Databases: $dbpath" 1>&6 echo "" 1>&6 sedline="s%@SHELL@%$SHELL%" + +# Define variables +def="$def -DEAS_UIDRIVER=\\\"$driver\\\"" +flags="" +if test "$debug" = "YES"; then + flags="$flags -g" +fi + echo "Create Makefile.var..." >&6 echo "configure:$LINENO: Create Makefile.var..." >&5 @@ -314,10 +421,11 @@ echo "#define EASVERSION \"$version\"" > version.ch echo "# Makefile for E/AS custom variables" >Makefile.var -echo "EASBINDIR=$bindir" >>Makefile.var -echo "EASDATADIR=$datadir" >>Makefile.var -echo "EASLOGDIR=$logdir" >>Makefile.var -echo "EASDBPATH=$dbpath" >>Makefile.var - -echo "DOCDIR=$docdir" >>Makefile.var -echo "PODIR=$podir" >>Makefile.var +echo "EASBINDIR=$bindir" >> Makefile.var +echo "EASDATADIR=$datadir" >> Makefile.var +echo "EASLOGDIR=$logdir" >> Makefile.var +echo "EASDBPATH=$dbpath" >> Makefile.var +echo "DOCDIR=$docdir" >> Makefile.var +echo "PODIR=$podir" >> Makefile.var +echo "EASDEF=$def" >> Makefile.var +echo "BUILDFLAGS=$flags" >> Makefile.var |