X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=configure.in;h=19d4f93c3ecfb066f5fd281b3b053850f3320c1a;hb=60743b3b4cdebbea3600c12d6221d4726e44040b;hp=0b3ba977a80bae7b454602ff5187795f2e6587fe;hpb=603324bef4fbe354a157714e8859d748df89a11f;p=privoxy.git diff --git a/configure.in b/configure.in index 0b3ba977..19d4f93c 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. dnl -dnl $Id: configure.in,v 1.77 2002/09/06 13:23:03 oes Exp $ +dnl $Id: configure.in,v 1.83 2002/10/24 16:32:41 hal9 Exp $ dnl dnl Written by and Copyright (C) 2001, 2002 the SourceForge dnl Privoxy team. http://www.privoxy.org/ @@ -28,6 +28,26 @@ dnl or write to the Free Software Foundation, Inc., 59 dnl Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl dnl $Log: configure.in,v $ +dnl Revision 1.83 2002/10/24 16:32:41 hal9 +dnl echo -n does not work with true /bin/sh. Use AC_MSG_CHECKING for docbook stuff. +dnl +dnl Revision 1.82 2002/09/27 04:24:07 hal9 +dnl Minor change of "! test" to "test -ne" for Solaris. +dnl +dnl Revision 1.81 2002/09/27 00:38:44 hal9 +dnl Some general cleanup of the user/group stuff. Including remove up to ':' to +dnl make Linux (?) compatible with other *nix. Better AC output stuff. +dnl +dnl Revision 1.80 2002/09/26 18:47:46 hal9 +dnl This is most of Al's patch for --with-user and --with-group which tests that +dnl these are valid values, if specified. If not specified, they are left empty. +dnl +dnl Revision 1.79 2002/09/07 02:11:06 hal9 +dnl Remove some testing stuff inadvertantly left in. +dnl +dnl Revision 1.78 2002/09/06 23:18:08 hal9 +dnl Migrate PCRE_H_IN_SUBDIR from 3.0 branch for pcre/pcre.h on RH, etc. +dnl dnl Revision 1.77 2002/09/06 13:23:03 oes dnl Removed non-functional test for gcc support for -pthread dnl @@ -407,14 +427,13 @@ dnl ================================================================= dnl AutoConf Initialization dnl ================================================================= -AC_REVISION($Revision: 1.77 $) +AC_REVISION($Revision: 1.83 $) AC_INIT(src/jcc.c) - if test ! -f src/config.h.in; then echo "You need to run autoheader first. " echo -n "Shall I do this for you now? (y/n) " read answer - if test $answer != "y"; then + if test "$answer" != "y"; then exit 1 else autoheader @@ -471,8 +490,13 @@ AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET +AC_PROG_AWK AC_CHECK_PROG(GDB,gdb,yes,no) +AC_PATH_PROG(BGROUPS,groups,no,/bin:/usr/bin:/usr/local/bin) +AC_PATH_PROG(ID,id,no,/bin:/usr/bin:/usr/local/bin) +AC_SUBST(ID) +AC_SUBST(BGROUPS) dnl ================================================================= dnl debug, gcc and gdb support @@ -507,32 +531,78 @@ AC_ARG_WITH(debug, ] ) +dnl ================================================================= +dnl Check for user and group validity +dnl ================================================================= + +$ID privoxy >/dev/null 2>/dev/null +if test $? -ne 0 ; then + AC_MSG_WARN(There is no user 'privoxy' on this system) +fi +AC_MSG_CHECKING([for user]) AC_ARG_WITH(user, - [ --with-user=privoxy Set user under which privoxy run], + [ --with-user=privoxy Set user under which privoxy will run], [ if test "x$withval" != "xyes"; then - USER=$with_user; + if test $ID = no ; then + AC_MSG_ERROR(There is no 'id' program on this system) + else + AC_MSG_RESULT($with_user) + $ID $with_user 2>/dev/null >/dev/null + if test $? -eq 0 ; then + USER=$with_user; + else + AC_MSG_ERROR(There is no user '$with_user' on this system) + fi + fi else AC_MSG_ERROR(We need a user if you give me this parameter) fi ], [ - USER=privoxy; + if test $ID = no ; then + AC_MSG_ERROR(There is no 'id' programm on this system) + else + AC_MSG_RESULT(none specified) + USER=$with_user + fi ] ) AC_SUBST(USER) +AC_MSG_CHECKING([for group]) AC_ARG_WITH(group, [ --with-group=privoxy Set group for privoxy], - [ + [ if test "x$withval" != "xyes"; then - GROUP=$with_group; + if test $BGROUPS = no ; then + AC_MSG_ERROR(There is no 'groups' program on this system) else + AC_MSG_RESULT($with_group) + $BGROUPS $USER >/dev/null + if test $? -eq 0 ; then + # FIXME: this fails if valid group, but not first group + # listed. + if test "$with_group" != "`$BGROUPS $USER | sed 's/.*: //' 2>/dev/null |$AWK '{print $1}'`" ; then + AC_MSG_ERROR(The given value '$withval' does not match group entry) + else + GROUP=$with_group; + fi + else + AC_MSG_ERROR(There is no group entry for user '$USER') + fi + fi + else AC_MSG_ERROR(We need a group if you give me this parameter) fi ], [ - GROUP=privoxy; + if test $BGROUPS = no ; then + AC_MSG_ERROR(There is no 'groups' programm on this system) + else + AC_MSG_RESULT(none specified) + GROUP=$with_group; + fi ] ) AC_SUBST(GROUP) @@ -1167,7 +1237,9 @@ DKPREFIX=false for i in $DKPREFIXCOPY /usr/share/sgml/docbook/stylesheet/dsssl/modular \ /usr/share/sgml/docbook/dsssl-stylesheets /usr/share/sgml/docbkdsl \ /usr/share/sgml/docbook-dsssl; do - echo -n "checking for $i/html/docbook.dsl..." +dnl echo -n does not fly with /bin/sh. +dnl echo -n "checking for $i/html/docbook.dsl..." + AC_MSG_CHECKING([for $i]) if test -f $i/html/docbook.dsl; then echo "yes" DKPREFIX=$i @@ -1182,7 +1254,8 @@ JADECAT="" dnl where are the catalogs? for i in /usr/share/sgml/CATALOG.docbk30 \ /usr/share/sgml/CATALOG.docbk31; do - echo -n "checking for $i..." +dnl echo -n "checking for $i..." + AC_MSG_CHECKING([for $i]) if test -f $i; then echo "yes" JADECAT="$JADECAT -c $i" @@ -1258,13 +1331,3 @@ AC_SUBST(PTHREAD_LIB) AC_OUTPUT(GNUmakefile doc/source/ldp.dsl doc/source/GNUmakefile) -dnl hb: -echo $prefix -echo $exec_prefix -echo $bindir -echo $sbindir -echo $sysconfdir -echo $datadir -echo $mandir -echo $localstatedir -echo host: $host