"Fossies" - the Fresh Open Source Software Archive

Member "cgiwrap-4.1/configure.in" (16 Jun 2008, 38683 Bytes) of package /linux/www/old/cgiwrap-4.1.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 dnl Process this file with autoconf to produce a configure script
    2 AC_PREREQ(2.5)
    3 AC_INIT(cgiwrap.h)
    4 AC_CONFIG_AUX_DIR(.)
    5 AC_CANONICAL_SYSTEM
    6 AC_CONFIG_HEADER(config.h)
    7 
    8 VERSION="4.1"
    9 AC_SUBST(VERSION)
   10 
   11 AC_PROG_CC
   12 AC_PROG_MAKE_SET
   13 
   14 
   15 dnl
   16 dnl Path to perl for unsupported stuff
   17 dnl
   18 AC_ARG_WITH( perl, 
   19 	[  --with-perl=PATH]
   20 	[  path to perl executable to use], 
   21 	[
   22 		AC_MSG_CHECKING(for perl)
   23 		if test "x$withval" != x; then
   24 			PATH_PROG_PERL="$withval"
   25 			AC_MSG_RESULT($withval)
   26 		else
   27 			AC_MSG_RESULT(not found)
   28 		fi
   29 	],
   30 	[
   31 		AC_PATH_PROG(PATH_PROG_PERL, perl, no)
   32 	])
   33 
   34 dnl
   35 dnl Check for REDIRECT_URL when building SCRIPT_NAME
   36 dnl
   37 AC_MSG_CHECKING(for use-redirect-url)
   38 AC_ARG_WITH( use-redirect-url,
   39 	[  --with-use-redirect-url]
   40 	[  use REDIRECT_URL in building SCRIPT_NAME if available],
   41 	[
   42 		if test "x$withval" != xno; then
   43 			AC_DEFINE(CONF_USE_REDIRECT_URL, [], [use REDIRECT_URL in building SCRIPT_NAME if available])
   44 			AC_MSG_RESULT([enabled])
   45 		else
   46 			AC_MSG_RESULT([disabled])
   47 		fi
   48 	],
   49 	[
   50 		AC_MSG_RESULT([disabled])
   51 	])
   52 
   53 
   54 dnl
   55 dnl Set SCRIPT_NAME to SCRIPT_URL
   56 dnl
   57 AC_MSG_CHECKING(for whether to use SCRIPT_URL to build SCRIPT_NAME)
   58 AC_ARG_WITH( use-script-url,
   59         [  --with-use-script-url]
   60         [  use SCRIPT_URL to build SCRIPT_NAME],
   61         [
   62                 if test "x$withval" != xno; then
   63                         AC_DEFINE(CONF_USE_SCRIPT_URL, [], [use SCRIPT_URL to build SCRIPT_NAME])
   64                         AC_MSG_RESULT([enabled])
   65                 else
   66                         AC_MSG_RESULT([disabled])
   67                 fi
   68         ],
   69         [
   70                 AC_MSG_RESULT([disabled])
   71         ])
   72 
   73 
   74 AC_MSG_CHECKING(for require-redirect-url)
   75 AC_ARG_WITH( require-redirect-url,
   76 	[  --with-require-redirect-url]
   77 	[  require REDIRECT_URL in environment, to force use of Action/Handlers],
   78 	[
   79 		if test "x$withval" != xno; then
   80 			AC_DEFINE(CONF_REQUIRE_REDIRECT_URL, [], [require REDIRECT_URL in environment])
   81 			AC_MSG_RESULT([enabled])
   82 		else
   83 			AC_MSG_RESULT([disabled])
   84 		fi
   85 	],
   86 	[
   87 		AC_MSG_RESULT([disabled])
   88 	])
   89 
   90 dnl
   91 dnl Avoid information disclosure in error messages
   92 dnl
   93 AC_MSG_CHECKING(for quiet-errors)
   94 AC_ARG_WITH( quiet-errors,
   95 	[  --with-quiet-errors]
   96 	[  avoid releasing internal information in error messages],
   97 	[
   98 		if test "x$withval" != xno; then
   99 			AC_DEFINE(CONF_QUIET_ERRORS, [], [avoid release of information])
  100 			AC_MSG_RESULT([enabled])
  101 		else
  102 			AC_MSG_RESULT([disabled])
  103 		fi
  104 	],
  105 	[
  106 		AC_MSG_RESULT([disabled])
  107 	])
  108 
  109 dnl
  110 dnl Allow cgiwrap specific vhost override - for use with wildcard vhosts
  111 dnl
  112 AC_MSG_CHECKING(for vhost-override)
  113 AC_ARG_WITH( vhost-override,
  114 	[  --with-vhost-override]
  115 	[  allow overriding HTTP_HOST with CGIWRAP_AUTH_VHOST],
  116 	[
  117 		if test "x$withval" != xno; then
  118 			AC_DEFINE(CONF_VHOST_OVERRIDE, [], [CGIWRAP_AUTH_VHOST overrides HTTP_HOST])
  119 			AC_MSG_RESULT([enabled])
  120 		else
  121 			AC_MSG_RESULT([disabled])
  122 		fi
  123 	],
  124 	[
  125 		AC_MSG_RESULT([disabled])
  126 	])
  127 
  128 dnl
  129 dnl Allow specifying CGIWRAP_REQUIRE_USER=userid in environment
  130 dnl
  131 AC_MSG_CHECKING(for env-require-user)
  132 AC_ARG_WITH( env-require-user,
  133 	[  --with-env-require-user]
  134 	[  allow specifying CGIWRAP_REQUIRE_USER in env to restrict to specific userid],
  135 	[
  136 		if test "x$withval" != xno; then
  137 			AC_DEFINE(CONF_ENV_REQUIRE_USER, [], [CGIWRAP_REQUIRE_USER in env to restrict user])
  138 			AC_MSG_RESULT([enabled])
  139 		else
  140 			AC_MSG_RESULT([disabled])
  141 		fi
  142 	],
  143 	[
  144 		AC_MSG_RESULT([disabled])
  145 	])
  146 
  147 dnl     
  148 dnl Block SVN paths for execution
  149 dnl 
  150 AC_MSG_CHECKING(for block-svn-paths)
  151 AC_ARG_WITH( block-svn-paths,
  152     [  --with-block-svn-paths]
  153     [  prevent execution of any script in a .svn dir],
  154     [
  155         if test "x$withval" != xno; then
  156             AC_DEFINE(CONF_BLOCK_SVN_PATHS, [], [block execution of .svn paths])
  157             AC_MSG_RESULT([enabled])
  158         else
  159             AC_MSG_RESULT([disabled])
  160         fi
  161     ],
  162     [
  163         AC_MSG_RESULT([disabled])
  164     ])
  165 
  166 dnl     
  167 dnl Block CVS paths for execution
  168 dnl 
  169 AC_MSG_CHECKING(for block-cvs-paths)
  170 AC_ARG_WITH( block-cvs-paths,
  171     [  --with-block-cvs-paths]
  172     [  prevent execution of any script in a CVS dir],
  173     [
  174         if test "x$withval" != xno; then
  175             AC_DEFINE(CONF_BLOCK_CVS_PATHS, [], [block execution of CVS paths])
  176             AC_MSG_RESULT([enabled])
  177         else
  178             AC_MSG_RESULT([disabled])
  179         fi
  180     ],
  181     [
  182         AC_MSG_RESULT([disabled])
  183     ])
  184 
  185 	
  186 dnl
  187 dnl Path to php for interpreter support
  188 dnl
  189 AC_ARG_WITH( php, 
  190 	[  --with-php=PATH]
  191 	[  path to php executable to use], 
  192 	[
  193 		AC_MSG_CHECKING(for php)
  194 		if test "x$withval" != x; then
  195 			PATH_PROG_PHP="$withval"
  196 			AC_DEFINE_UNQUOTED(PATH_PROG_PHP,"$withval", [php path])
  197 			AC_MSG_RESULT($withval)
  198 		else
  199 			AC_MSG_RESULT(not found)
  200 		fi
  201 	],
  202 	[
  203 		AC_PATH_PROG(PATH_PROG_PHP, php, no)
  204 		if test "x${PATH_PROG_PHP}" != "xno"; then
  205 			AC_DEFINE_UNQUOTED(PATH_PROG_PHP,"${PATH_PROG_PHP}", [path to php executable to use])
  206 		fi
  207 	])
  208 
  209 
  210 dnl
  211 dnl Path to eruby for interpreter support
  212 dnl
  213 AC_ARG_WITH( eruby, 
  214 	[  --with-eruby=PATH]
  215 	[  path to eRuby interpreter to use], 
  216 	[
  217 		AC_MSG_CHECKING(for eRuby interpreter)
  218 		if test "x$withval" != x; then
  219 			PATH_PROG_ERUBY="$withval"
  220 			AC_DEFINE_UNQUOTED(PATH_PROG_ERUBY,"$withval", [embedded ruby path])
  221 			AC_MSG_RESULT($withval)
  222 		else
  223 			AC_MSG_RESULT(not found)
  224 		fi
  225 	],
  226 	[
  227 		AC_PATH_PROGS(PATH_PROG_ERUBY, [eruby erb], no)
  228 		if test "x${PATH_PROG_ERUBY}" != "xno"; then
  229 			AC_DEFINE_UNQUOTED(PATH_PROG_ERUBY,"${PATH_PROG_ERUBY}", [path to eRuby executable to use])
  230 		fi
  231 	])
  232 
  233 dnl
  234 dnl Path to asp for interpreter support
  235 dnl
  236 AC_ARG_WITH( asp, 
  237 	[  --with-asp=PATH]
  238 	[  path to asp interpreter to use], 
  239 	[
  240 		AC_MSG_CHECKING(for asp interpreter)
  241 		if test "x$withval" != x; then
  242 			PATH_PROG_ASP="$withval"
  243 			AC_DEFINE_UNQUOTED(PATH_PROG_ASP,"$withval", [asp interpreter path])
  244 			AC_MSG_RESULT($withval)
  245 		else
  246 			AC_MSG_RESULT(not found)
  247 		fi
  248 	],
  249 	[
  250 		AC_PATH_PROG(PATH_PROG_ASP, asp-perl, no)
  251 		if test "x${PATH_PROG_ASP}" != "xno"; then
  252 			AC_DEFINE_UNQUOTED(PATH_PROG_ASP,"${PATH_PROG_ASP}", [path to asp executable to use])
  253 		fi
  254 	])
  255 
  256 
  257 dnl
  258 dnl Charset to use for error/text responses
  259 dnl
  260 charset="iso-8859-1"
  261 AC_MSG_CHECKING(for charset)
  262 AC_ARG_WITH( charset, 
  263 	[  --with-charset=charset]
  264 	[  charset to output in content-type header for cgiwrap output], 
  265 	[
  266 		if test "x$withval" != x; then
  267 			charset="$withval"
  268 		fi
  269 	],
  270 	[
  271 		true
  272 	])
  273 AC_MSG_RESULT($charset)
  274 AC_DEFINE_UNQUOTED(HTTP_CHARSET,"$charset", [charset])
  275 
  276 
  277 
  278 
  279 dnl
  280 dnl Check needed library functions
  281 dnl
  282 AC_CHECK_FUNC(sigset,		[AC_DEFINE(HAS_SIGSET, 		[], [has sigset library function])])
  283 AC_CHECK_FUNC(initgroups, 	[AC_DEFINE(HAS_INITGROUPS, 	[], [has initgroups library function])])
  284 AC_CHECK_FUNC(setgroups, 	[AC_DEFINE(HAS_SETGROUPS, 	[], [has setgroups library function])])
  285 AC_CHECK_FUNC(getgroups, 	[AC_DEFINE(HAS_GETGROUPS, 	[], [has getgroups library function])])
  286 AC_CHECK_FUNC(setgid, 		[AC_DEFINE(HAS_SETGID, 		[], [has setgid library function])])
  287 AC_CHECK_FUNC(setuid, 		[AC_DEFINE(HAS_SETUID, 		[], [has setuid library function])])
  288 AC_CHECK_FUNC(setegid, 		[AC_DEFINE(HAS_SETEGID, 	[], [has setegid library function])])
  289 AC_CHECK_FUNC(seteuid, 		[AC_DEFINE(HAS_SETEUID, 	[], [has seteuid library function])])
  290 AC_CHECK_FUNC(setrgid, 		[AC_DEFINE(HAS_SETRGID, 	[], [has setrgid library function])])
  291 AC_CHECK_FUNC(setruid, 		[AC_DEFINE(HAS_SETRUID, 	[], [has setruid library function])])
  292 AC_CHECK_FUNC(setregid, 	[AC_DEFINE(HAS_SETREGID, 	[], [has setregid library function])])
  293 AC_CHECK_FUNC(setreuid, 	[AC_DEFINE(HAS_SETREUID, 	[], [has setreuid library function])])
  294 AC_CHECK_FUNC(setresgid, 	[AC_DEFINE(HAS_SETRESGID, 	[], [has setresgid library function])])
  295 AC_CHECK_FUNC(setresuid, 	[AC_DEFINE(HAS_SETRESUID, 	[], [has setresuid library function])])
  296 AC_CHECK_FUNC(perror, 		[AC_DEFINE(HAS_PERROR, 		[], [has perror library function])])
  297 AC_CHECK_FUNC(strerror, 	[AC_DEFINE(HAS_STRERROR, 	[], [has strerror library function])])
  298 AC_CHECK_FUNC(strdup, 		[AC_DEFINE(HAS_STRDUP, 		[], [has strdup library function])])
  299 AC_CHECK_FUNC(syslog, 		[AC_DEFINE(HAS_SYSLOG, 		[], [has syslog library function])])
  300 AC_CHECK_FUNC(setrlimit, 	[AC_DEFINE(HAS_SETRLIMIT, 	[], [has setrlimit library function])])
  301 AC_CHECK_FUNC(putenv, 		[AC_DEFINE(HAS_PUTENV, 		[], [has putenv library function])])
  302 AC_CHECK_FUNC(unsetenv, 	[AC_DEFINE(HAS_UNSETENV, 	[], [has unsetenv library function])])
  303 AC_CHECK_FUNC(wait3, 		[AC_DEFINE(HAS_WAIT3, 		[], [has wait3 library function])])
  304 AC_CHECK_FUNC(innetgr, 		[AC_DEFINE(HAS_INNETGR, 	[], [has innetgr library function])])
  305 
  306 dnl
  307 dnl Information options
  308 dnl
  309 AC_MSG_CHECKING(for chroot prefix)
  310 AC_ARG_WITH( chroot,
  311         [  --with-chroot=PATH]
  312         [  define prefix to chroot to before execution ]
  313         [  DO NOT USE THIS unless you have read the cgiwrap chroot ]
  314 	[  documentation and have set up the requisite structure ],
  315         [
  316                 if test "x$withval" = xyes; then
  317                         AC_MSG_RESULT([disabled, must specify value])
  318                 elif test "x$withval" = xno; then
  319                         AC_MSG_RESULT([disabled, must specify value])
  320                 elif test "x$withval" = x; then
  321                         AC_MSG_RESULT([disabled, must specify value])
  322                 else
  323                         AC_MSG_RESULT($withval)
  324                         AC_DEFINE_UNQUOTED(CONF_CHROOT_PREFIX,"$withval", [chroot prefix])
  325                 fi
  326         ],
  327         [
  328                 AC_MSG_RESULT([disabled])
  329         ])
  330 
  331 dnl
  332 dnl Information options
  333 dnl
  334 AC_MSG_CHECKING(for local contact name)
  335 AC_ARG_WITH( local-contact-name, 
  336 	[  --with-local-contact-name=NAME]
  337 	[  define name of local contact], 
  338 	[ 
  339 		if test "x$withval" = xyes; then
  340 			AC_MSG_RESULT([disabled, must specify value])
  341 		elif test "x$withval" = xno; then
  342 			AC_MSG_RESULT([disabled, must specify value])
  343 		elif test "x$withval" = x; then
  344 			AC_MSG_RESULT([disabled, must specify value])
  345 		else
  346 			AC_MSG_RESULT($withval)
  347 			AC_DEFINE_UNQUOTED(CONF_LOCAL_CONTACT_NAME,"$withval", [local contact])
  348 			AC_DEFINE(CONF_LOCAL_INFO_ENABLED, [], [local info enabled])
  349 		fi
  350 	],
  351 	[ 
  352 		AC_MSG_RESULT([disabled])
  353 	])
  354 
  355 AC_MSG_CHECKING(for local contact email)
  356 AC_ARG_WITH( local-contact-email, 
  357 	[  --with-local-contact-email=ADDRESS]
  358 	[  define email address of local contact], 
  359 	[ 
  360 		if test "x$withval" = xyes; then
  361 			AC_MSG_RESULT([disabled, must specify value])
  362 		elif test "x$withval" = xno; then
  363 			AC_MSG_RESULT([disabled, must specify value])
  364 		elif test "x$withval" = x; then
  365 			AC_MSG_RESULT([disabled, must specify value])
  366 		else
  367 			AC_MSG_RESULT($withval)
  368 			AC_DEFINE_UNQUOTED(CONF_LOCAL_CONTACT_EMAIL,"$withval", [local contact email])
  369 			AC_DEFINE(CONF_LOCAL_INFO_ENABLED, [], [local info enabled])
  370 		fi
  371 	],
  372 	[ 
  373 		AC_MSG_RESULT([disabled])
  374 	])
  375 
  376 AC_MSG_CHECKING(for local contact phone)
  377 AC_ARG_WITH( local-contact-phone, 
  378 	[  --with-local-contact-phone=PHONE]
  379 	[  define phone number of local contact], 
  380 	[ 
  381 		if test "x$withval" = xyes; then
  382 			AC_MSG_RESULT([disabled, must specify value])
  383 		elif test "x$withval" = xno; then
  384 			AC_MSG_RESULT([disabled, must specify value])
  385 		elif test "x$withval" = x; then
  386 			AC_MSG_RESULT([disabled, must specify value])
  387 		else
  388 			AC_MSG_RESULT($withval)
  389 			AC_DEFINE_UNQUOTED(CONF_LOCAL_CONTACT_PHONE,"$withval", [local contact phone])
  390 			AC_DEFINE(CONF_LOCAL_INFO_ENABLED, [], [local info enabled])
  391 		fi
  392 	],
  393 	[ 
  394 		AC_MSG_RESULT([disabled])
  395 	])
  396 
  397 AC_MSG_CHECKING(for local contact url)
  398 AC_ARG_WITH( local-contact-url, 
  399 	[  --with-local-contact-url=URL]
  400 	[  define url of local contact], 
  401 	[ 
  402 		if test "x$withval" = xyes; then
  403 			AC_MSG_RESULT([disabled, must specify value])
  404 		elif test "x$withval" = xno; then
  405 			AC_MSG_RESULT([disabled, must specify value])
  406 		elif test "x$withval" = x; then
  407 			AC_MSG_RESULT([disabled, must specify value])
  408 		else
  409 			AC_MSG_RESULT($withval)
  410 			AC_DEFINE_UNQUOTED(CONF_LOCAL_CONTACT_URL,"$withval", [local contact url])
  411 			AC_DEFINE(CONF_LOCAL_INFO_ENABLED, [], [local info enabled])
  412 		fi
  413 	],
  414 	[ 
  415 		AC_MSG_RESULT([disabled])
  416 	])
  417 
  418 AC_MSG_CHECKING(for local site url)
  419 AC_ARG_WITH( local-site-url, 
  420 	[  --with-local-site-url=URL]
  421 	[  define url of local site], 
  422 	[ 
  423 		if test "x$withval" = xyes; then
  424 			AC_MSG_RESULT([disabled, must specify value])
  425 		elif test "x$withval" = xno; then
  426 			AC_MSG_RESULT([disabled, must specify value])
  427 		elif test "x$withval" = x; then
  428 			AC_MSG_RESULT([disabled, must specify value])
  429 		else
  430 			AC_MSG_RESULT($withval)
  431 			AC_DEFINE_UNQUOTED(CONF_LOCAL_SITE_URL,"$withval", [local site url])
  432 			AC_DEFINE(CONF_LOCAL_INFO_ENABLED, [], [local info enabled])
  433 		fi
  434 	],
  435 	[ 
  436 		AC_MSG_RESULT([disabled])
  437 	])
  438 
  439 AC_MSG_CHECKING(for local cgiwrap docs)
  440 AC_ARG_WITH( local-doc-url, 
  441 	[  --with-local-doc-url=URL]
  442 	[  define url of local cgiwrap documentation], 
  443 	[ 
  444 		if test "x$withval" = xyes; then
  445 			AC_MSG_RESULT([disabled, must specify value])
  446 		elif test "x$withval" = xno; then
  447 			AC_MSG_RESULT([disabled, must specify value])
  448 		elif test "x$withval" = x; then
  449 			AC_MSG_RESULT([disabled, must specify value])
  450 		else
  451 			AC_MSG_RESULT($withval)
  452 			AC_DEFINE_UNQUOTED(CONF_LOCAL_DOC_URL,"$withval", [local doc url])
  453 			AC_DEFINE(CONF_LOCAL_INFO_ENABLED, [], [local info enabled])
  454 		fi
  455 	],
  456 	[ 
  457 		AC_MSG_RESULT([disabled])
  458 	])
  459 
  460 
  461 dnl
  462 dnl Debugging option
  463 dnl
  464 AC_MSG_CHECKING(for with-wall)
  465 AC_ARG_WITH( wall, 
  466 	[  --with-wall]
  467 	[  enable -Wall option on compile],
  468 	[
  469 		if test "x$withval" = xno; then
  470 			AC_MSG_RESULT(disabled)
  471 			withval=
  472 		else
  473 			AC_MSG_RESULT(enabled)
  474 			withval="-Wall"
  475 		fi
  476 
  477 		GCC_WALL_OPT="$withval"	
  478 	],
  479 	[
  480 		AC_MSG_RESULT(disabled)
  481 		GCC_WALL_OPT=""
  482 	])
  483 AC_SUBST(GCC_WALL_OPT)
  484 
  485 dnl
  486 dnl Installation group
  487 dnl
  488 AC_MSG_CHECKING(for installation group)
  489 AC_ARG_WITH( install-group, 
  490 	[  --with-install-group=GROUP  (root)]
  491 	[  group to install cgiwrap as],
  492 	[
  493 		if test "x$withval" = xyes; then
  494 			withval=root
  495 		fi
  496 		if test "x$withval" = xno; then
  497 			withval=root
  498 		fi
  499 		if test "x$withval" = x; then
  500 			withval=root
  501 		fi
  502 
  503 		INSTALLGROUP="$withval"
  504 	],
  505 	[
  506 		withval=root
  507 		INSTALLGROUP="$withval"
  508 	])
  509 AC_MSG_RESULT($withval)
  510 AC_SUBST(INSTALLGROUP)
  511 
  512 AC_MSG_CHECKING(for installation directory)
  513 AC_ARG_WITH( install-dir, 
  514 	[  --with-install-dir=PATH]
  515 	[  path to installation directory],
  516 	[
  517 		if test "x$withval" != x; then
  518 			INSTALLDIR="$withval"
  519 			DOINSTALL=""
  520 			if test "x${PATH_PROG_PHP}" != "xno"; then
  521 				DOINSTALLPHP=""
  522 			else
  523 				DOINSTALLPHP="#"
  524 			fi
  525 			AC_MSG_RESULT($withval)
  526 		else
  527 			AC_MSG_RESULT(not found)
  528 			DOINSTALL="#"
  529 			DOINSTALLPHP="#"
  530 		fi
  531 	],
  532 	[
  533 		AC_MSG_RESULT([not found])
  534 		DOINSTALL="#"
  535 		DOINSTALLPHP="#"
  536 	])
  537 AC_SUBST(INSTALLDIR)
  538 AC_SUBST(DOINSTALL)
  539 AC_SUBST(DOINSTALLPHP)
  540 
  541 AC_MSG_CHECKING(for whether to disable cgiwrapd)
  542 AC_ARG_WITH( cgiwrapd,
  543 	[ --with-cgiwrapd]
  544 	[ disable installation of cgiwrapd ],
  545 	[
  546 		AC_MSG_RESULT([enabled])
  547 		DOINSTALLCGIWRAPD=""
  548 	],
  549 	[
  550 		AC_MSG_RESULT([disabled])
  551 		DOINSTALLCGIWRAPD="#"
  552 	])
  553 AC_SUBST(DOINSTALLCGIWRAPD)
  554 
  555 AC_MSG_CHECKING(for whether to disable nph-cgiwrap)
  556 AC_ARG_WITH( nph,
  557 	[ --without-nph]
  558 	[ disable installation of nph-cgiwrap ],
  559 	[
  560 		AC_MSG_RESULT([disabled])
  561 		DOINSTALLNPH="#"
  562 	],
  563 	[
  564 		AC_MSG_RESULT([enabled])
  565 		DOINSTALLNPH=""
  566 	])
  567 AC_SUBST(DOINSTALLNPH)
  568 
  569 
  570 AC_MSG_CHECKING(for path to cgi scripts)
  571 AC_ARG_WITH( cgi-dir, 
  572 	[  --with-cgi-dir=PATH  (public_html/cgi-bin)]
  573 	[  path relative to home dir for cgi scripts], 
  574 	[
  575 		if test "x$withval" != xno; then
  576 			AC_DEFINE_UNQUOTED(CONF_CGIDIR, "$withval", [cgi dir relative to user home dir])
  577 			AC_MSG_RESULT($withval)
  578 		else
  579 			AC_MSG_ERROR([must be defined])
  580 		fi
  581 	],
  582 	[
  583 		AC_MSG_RESULT([public_html/cgi-bin])
  584 		AC_DEFINE_UNQUOTED(CONF_CGIDIR,"public_html/cgi-bin", [cgi dir relative to user home dir])
  585 	])
  586 
  587 
  588 dnl
  589 dnl Checking for what server userid cgiwrap will run as
  590 dnl
  591 AC_MSG_CHECKING(for httpd-user)
  592 AC_ARG_WITH( httpd-user, 
  593 	[  --with-httpd-user=USER  (http)]
  594 	[  define what userid the web server is running as], 
  595 	[ 
  596 		if test "x$withval" = xyes; then
  597 			withval=http
  598 		fi
  599 		if test "x$withval" = xno; then
  600 			withval=http
  601 		fi
  602 		if test "x$withval" = x; then
  603 			withval=http
  604 		fi
  605 		AC_DEFINE_UNQUOTED(CONF_HTTPD_USER, "$withval", [user httpd executing as])
  606 	],
  607 	[ 
  608 		AC_DEFINE_UNQUOTED(CONF_HTTPD_USER, "$withval", [user httpd executing as])
  609 		withval=http
  610 	])
  611 AC_MSG_RESULT([server running as "$withval"])
  612 
  613 dnl
  614 dnl Checking for whether to have a multiuser cgi dir
  615 dnl
  616 AC_MSG_CHECKING(for multiuser-cgi-dir)
  617 AC_ARG_WITH( multiuser-cgi-dir, 
  618 	[  --with-multiuser-cgi-dir=PATH  (disabled)]
  619 	[  define a central shared cgi directory that acts as a fallback ]
  620 	[  directory to search if the cgi script is not found in the user's ]
  621 	[  own cgi directory. This can be dangerous if not used properly. ],
  622 	[ 
  623 		if test "x$withval" = xyes; then
  624 			AC_MSG_RESULT([must specify path, disabled.])
  625 		elif test "x$withval" = xno; then
  626 			AC_MSG_RESULT([must specify path, disabled.])
  627 		elif test "x$withval" = x; then
  628 			AC_MSG_RESULT([must specify path, disabled.])
  629 		else
  630 			AC_MSG_RESULT([$withval])
  631 			AC_DEFINE_UNQUOTED(CONF_MULTIUSER_CGI_DIR, "$withval", [support a shared multi-user cgi directory])
  632 		fi
  633 	],
  634 	[ 
  635 		AC_MSG_RESULT([disabled.])
  636 	])
  637 
  638 dnl
  639 dnl Checking for what server userid cgiwrap will run as
  640 dnl
  641 AC_MSG_CHECKING(for check-httpd-user)
  642 AC_ARG_WITH( check-httpd-user, 
  643 	[  --without-check-httpd-user]
  644 	[  don't check to make sure cgiwrap is being run by server userid], 
  645 	[
  646 		AC_MSG_RESULT([disabled, server userid will be checked])
  647 		INSTALLMODE=4750
  648 	],
  649 	[
  650 		AC_DEFINE(CONF_CHECK_HTTPD_USER, [], [check executing user - very important])
  651 		AC_MSG_RESULT([enabled, be sure to restrict permissions])
  652 		INSTALLMODE=4755
  653 	])
  654 AC_SUBST(INSTALLMODE)
  655 
  656 dnl
  657 dnl Use fork/wait3 to get rusage info 
  658 dnl
  659 dnl AC_FUNC_WAIT3
  660 dnl don't use the above, it fails on sol26
  661 AC_MSG_CHECKING(for report-rusage)
  662 AC_ARG_WITH( report-rusage, 
  663 	[  --with-report-rusage]
  664 	[  report rusage and return status of cgi script after execution], 
  665 	[
  666 		if test "x$withval" != xno; then
  667 			AC_DEFINE(CONF_REPORT_RUSAGE, [], [report rusage after script terminates])
  668 			AC_MSG_RESULT([enabled, rusage and return code will be logged])
  669 		else
  670 			AC_MSG_RESULT([disabled, rusage and return code will not be logged])
  671 		fi
  672 	],
  673 	[
  674 		AC_MSG_RESULT([disabled, rusage and return code will not be logged])
  675 	])
  676 
  677 dnl
  678 dnl Check for php filename, and pass to php interpreter directly
  679 dnl
  680 AC_MSG_CHECKING(for php-interpreter support)
  681 AC_ARG_WITH( php-interpreter, 
  682 	[  --with-php-interpreter]
  683 	[  pass script to php interpreter if filename matches], 
  684 	[
  685 		if test "x$withval" != xno; then
  686 			AC_DEFINE(CONF_PHP_INTERPRETER, [], [pass script to php interpreter if suffix])
  687 			AC_MSG_RESULT([enabled, php will be handled specially])
  688 		else
  689 			AC_MSG_RESULT([disabled, no special handling for php scripts])
  690 		fi
  691 	],
  692 	[
  693 		AC_MSG_RESULT([disabled, no special handling for php scripts])
  694 	])
  695 
  696 AC_MSG_CHECKING(for whether to enable special support on non-executable files only)
  697 AC_ARG_WITH( php-nonexec-only, 
  698 	[  --with-php-nonexec-only]
  699 	[  pass script to php interpreter only if not executable, otherwise use #! line ], 
  700 	[
  701 		if test "x$withval" != xno; then
  702 			AC_DEFINE(CONF_PHP_NONEXEC_ONLY, [], [pass script to php interpreter only if nonexecutable file])
  703 			AC_MSG_RESULT([enabled if php enabled, php will be handled specially only for nonexecutable files])
  704 		else
  705 			AC_MSG_RESULT([disabled, all php scripts handled the same if php enabled])
  706 		fi
  707 	],
  708 	[
  709 		AC_MSG_RESULT([disabled, all php scripts handled the same if php enabled])
  710 	])
  711 
  712 AC_MSG_CHECKING(for whether to install separate php-cgiwrap wrapper)
  713 AC_ARG_WITH( php-cgiwrap, 
  714 	[  --with-php-cgiwrap]
  715 	[  install separate php-cgiwrap executable ], 
  716 	[
  717 		if test "x$withval" != xno; then
  718 			AC_MSG_RESULT([enabled])
  719 		else
  720 			DOINSTALLPHP="#"
  721 			AC_MSG_RESULT([disabled]);
  722 		fi
  723 	],
  724 	[
  725 		DOINSTALLPHP="#"
  726 		AC_MSG_RESULT([disabled]);
  727 	])
  728 AC_SUBST(DOINSTALLPHP)
  729 
  730 
  731 
  732 dnl
  733 dnl Check for rhtml filename, and pass to eruby interpreter directly
  734 dnl
  735 AC_MSG_CHECKING(for eruby-interpreter support)
  736 AC_ARG_WITH( eruby-interpreter, 
  737 	[  --with-eruby-interpreter]
  738 	[  pass script to eRuby interpreter if filename matches], 
  739 	[
  740 		if test "x$withval" != xno; then
  741 			AC_DEFINE(CONF_ERUBY_INTERPRETER, [], [pass script to eRuby interpreter if suffix])
  742 			AC_MSG_RESULT([enabled, rhtml will be handled specially])
  743 		else
  744 			AC_MSG_RESULT([disabled, no special handling for rhtml files])
  745 		fi
  746 	],
  747 	[
  748 		AC_MSG_RESULT([disabled, no special handling for rhtml files])
  749 	])
  750 
  751 dnl
  752 dnl Check for asp filename, and pass to php interpreter directly
  753 dnl
  754 AC_MSG_CHECKING(for asp-interpreter support)
  755 AC_ARG_WITH( asp-interpreter, 
  756 	[  --with-asp-interpreter]
  757 	[  pass script to asp interpreter if filename matches], 
  758 	[
  759 		if test "x$withval" != xno; then
  760 			AC_DEFINE(CONF_ASP_INTERPRETER, [], [pass script to asp interpreter if suffix])
  761 			AC_MSG_RESULT([enabled, asp will be handled specially])
  762 		else
  763 			AC_MSG_RESULT([disabled, no special handling for asp scripts])
  764 		fi
  765 	],
  766 	[
  767 		AC_MSG_RESULT([disabled, no special handling for asp scripts])
  768 	])
  769 
  770 AC_MSG_CHECKING(for whether to enable special support on non-executable files only)
  771 AC_ARG_WITH( asp-nonexec-only, 
  772 	[  --with-asp-nonexec-only]
  773 	[  pass script to asp interpreter only if not executable, otherwise use #! line ], 
  774 	[
  775 		if test "x$withval" != xno; then
  776 			AC_DEFINE(CONF_ASP_NONEXEC_ONLY, [], [pass script to asp interpreter only if nonexecutable file])
  777 			AC_MSG_RESULT([enabled if asp enabled, asp will be handled specially only for nonexecutable files])
  778 		else
  779 			AC_MSG_RESULT([disabled, all asp scripts handled the same if asp enabled])
  780 		fi
  781 	],
  782 	[
  783 		AC_MSG_RESULT([disabled, all asp scripts handled the same if asp enabled])
  784 	])
  785 
  786 
  787 
  788 dnl
  789 dnl Enable/disable check for special characters in the script path
  790 dnl Disabling this turns off the !isprint and isspace checks in the
  791 dnl CheckPath routine. Thanks to Cobalt for pointing out that this
  792 dnl would break japanese compatability. 
  793 dnl
  794 AC_MSG_CHECKING(for strict-names)
  795 AC_ARG_WITH( strict-names,
  796 	[  --without-strict-names]
  797 	[  disable check for !isprint() and isspace() in script path],
  798 	[
  799 		if test "x$withval" != xno; then
  800 			AC_DEFINE(CONF_STRICT_NAMES, [], [check for nonprintables in script path])
  801 			AC_MSG_RESULT([enabled, script must be all alphanumeric])
  802 		else
  803 			AC_MSG_RESULT([disabled, script name not checked])
  804 		fi
  805 	],
  806 	[
  807 		AC_DEFINE(CONF_STRICT_NAMES, [], [check for nonprintables in script path])
  808 		AC_MSG_RESULT([enabled, script name must be all alphanumeric])
  809 	])
  810 
  811 dnl
  812 dnl Various cgi-script permission checks
  813 dnl The DEFINE is in the 'not-found' section of the macro
  814 dnl
  815 AC_MSG_CHECKING(for check-owner)
  816 AC_ARG_WITH( check-owner, 
  817 	[  --without-check-owner]
  818 	[  disable check for matching owner],
  819 	[
  820 		if test "x$withval" != xno; then
  821 			AC_DEFINE(CONF_CHECK_SCRUID, [], [check script uid])
  822 			AC_MSG_RESULT([enabled, owner of script must match])
  823 		else
  824 			AC_MSG_RESULT([disabled, owner of script can be different])
  825 		fi
  826 	],
  827 	[
  828 		AC_DEFINE(CONF_CHECK_SCRUID, [], [check script uid])
  829 		AC_MSG_RESULT([enabled, owner of script must match])
  830 	])
  831 
  832 AC_MSG_CHECKING(for check-group)
  833 AC_ARG_WITH( check-group, 
  834 	[  --without-check-group]
  835 	[  disable check for matching group],
  836 	[
  837 		if test "x$withval" != xno; then
  838 			AC_DEFINE(CONF_CHECK_SCRGID, [], [check script gid])
  839 			AC_MSG_RESULT([enabled, group of script must match])
  840 		else
  841 			AC_MSG_RESULT([disabled, group of script can be different])
  842 		fi
  843 	],
  844 	[
  845 		AC_DEFINE(CONF_CHECK_SCRGID, [], [check script gid])
  846 		AC_MSG_RESULT([enabled, group of script must match])
  847 	])
  848 
  849 AC_MSG_CHECKING(for check-setuid)
  850 AC_ARG_WITH( check-setuid, 
  851 	[  --without-check-setuid]
  852 	[  disable check for setuid script],
  853 	[
  854 		if test "x$withval" != xno; then
  855 			AC_DEFINE(CONF_CHECK_SCRSUID, [], [check script is suid])
  856 			AC_MSG_RESULT([enabled, script cannot be setuid])
  857 		else
  858 			AC_MSG_RESULT([disabled, script can be setuid])
  859 		fi
  860 	],
  861 	[
  862 		AC_MSG_RESULT([enabled, script cannot be setuid])
  863 		AC_DEFINE(CONF_CHECK_SCRSUID, [], [check script is suid])		
  864 	])
  865 
  866 AC_MSG_CHECKING(for check-setgid)
  867 AC_ARG_WITH( check-setgid, 
  868 	[  --without-check-setgid]
  869 	[  disable check for setgid script],
  870 	[
  871 		if test "x$withval" != xno; then
  872 			AC_DEFINE(CONF_CHECK_SCRSGID, [], [check script is sgid])
  873 			AC_MSG_RESULT([enabled, script cannot be setuid])
  874 		else
  875 			AC_MSG_RESULT([disabled, script can be setgid])
  876 		fi
  877 	],
  878 	[
  879 		AC_MSG_RESULT([enabled, script cannot be setgid])
  880 		AC_DEFINE(CONF_CHECK_SCRSGID, [], [check script is sgid])		
  881 	])
  882 
  883 AC_MSG_CHECKING(for check-group-writable)
  884 AC_ARG_WITH( check-group-writable, 
  885 	[  --without-check-group-writable]
  886 	[  disable check for group writable script],
  887 	[
  888 		if test "x$withval" != xno; then
  889 			AC_DEFINE(CONF_CHECK_SCRGWRITE, [], [check script is group writable])
  890 			AC_MSG_RESULT([enabled, script cannot be group writable])
  891 		else
  892 			AC_MSG_RESULT([disabled, script can be group writable])
  893 		fi
  894 	],
  895 	[
  896 		AC_DEFINE(CONF_CHECK_SCRGWRITE, [], [check script is group writable])
  897 		AC_MSG_RESULT([enabled, script cannot be group writable])
  898 	])
  899 
  900 AC_MSG_CHECKING(for check-world-writable)
  901 AC_ARG_WITH( check-world-writable, 
  902 	[  --without-check-world-writable]
  903 	[  disable check for world writable script],
  904 	[
  905 		if test "x$withval" != xno; then
  906 			AC_DEFINE(CONF_CHECK_SCROWRITE, [], [check script is world writable])
  907 			AC_MSG_RESULT([enabled, script cannot be world writable])
  908 		else
  909 			AC_MSG_RESULT([disabled, script can be world writable])
  910 		fi
  911 	],
  912 	[
  913 		AC_DEFINE(CONF_CHECK_SCROWRITE, [], [check script is world writable])
  914 		AC_MSG_RESULT([enabled, script cannot be world writable])
  915 	])
  916 
  917 AC_MSG_CHECKING(for check-symlink)
  918 AC_ARG_WITH( check-symlink,
  919 	[  --without-check-symlink]
  920 	[  disable check for symlinked script],
  921 	[
  922 		if test "x$withval" != xno; then
  923 			AC_DEFINE(CONF_CHECK_SYMLINK, [], [check if script is symlink])
  924 			AC_MSG_RESULT([enabled, script cannot be a symlink])
  925 		else
  926 			AC_MSG_RESULT([disabled, script can be a symlink])
  927 		fi
  928 	],
  929 	[
  930 		AC_MSG_RESULT([enabled, script cannot be a symlink])
  931 		AC_DEFINE(CONF_CHECK_SYMLINK, [], [check if script is symlink])
  932 	])
  933 
  934 dnl
  935 dnl Check for minimum uid
  936 dnl
  937 AC_MSG_CHECKING(for minimum uid)
  938 AC_ARG_WITH( minimum-uid, 
  939 	[  --with-minimum-uid=UID  (10)]
  940 	[  minimum uid to allow script execution], 
  941 	[
  942 		if test "x$withval" != xno; then
  943 			AC_DEFINE_UNQUOTED(CONF_MINIMUM_UID, $withval, [check for minimum script uid])
  944 			AC_MSG_RESULT($withval)
  945 		else
  946 			AC_MSG_RESULT([disabled])
  947 		fi
  948 	],
  949 	[
  950 		AC_MSG_RESULT([10])
  951 		AC_DEFINE_UNQUOTED(CONF_MINIMUM_UID,10,[check for minimum script uid])
  952 	])
  953 
  954 dnl
  955 dnl Check for minimum gid
  956 dnl
  957 AC_MSG_CHECKING([for minimum gid (primary and auxilliary)])
  958 AC_ARG_WITH( minimum-gid, 
  959 	[  --with-minimum-gid=GID  (not checked)]
  960 	[  minimum gid to allow script execution], 
  961 	[
  962 		if test "x$withval" != xno; then
  963 			AC_DEFINE_UNQUOTED(CONF_MINIMUM_GID, $withval, [check for minimum script gid])
  964 			AC_MSG_RESULT($withval)
  965 		else
  966 			AC_MSG_RESULT([disabled])
  967 		fi
  968 	],
  969 	[
  970 		AC_MSG_RESULT([disabled])
  971 	])
  972 
  973 
  974 dnl
  975 dnl Options for logging script execution
  976 dnl
  977 AC_MSG_CHECKING(for logging-syslog)
  978 AC_ARG_WITH( logging-syslog,
  979 	[  --with-logging-syslog=LABEL]
  980 	[  enable logging script execution to syslog],
  981 	[
  982 		if test "x$withval" != xno; then
  983 			AC_DEFINE(CONF_LOG_USESYSLOG, [], [use syslog for logging])
  984 			AC_DEFINE_UNQUOTED(CONF_LOG_LABEL, "$withval", [syslog log label])
  985 			AC_MSG_RESULT([enabled, label is '${withval}'])
  986 		else
  987 			AC_MSG_RESULT([disabled])
  988 		fi
  989 	],
  990 	[
  991 		AC_MSG_RESULT([disabled])
  992 	])
  993 
  994 AC_MSG_CHECKING(for logging-file)
  995 AC_ARG_WITH( logging-file,
  996 	[  --with-logging-file=FILE  (/usr/adm/cgiwrap.log)]
  997 	[  enable logging script execution to file],
  998 	[
  999 		if test "x$withval" = x; then
 1000 			withval="/usr/adm/cgiwrap.log"
 1001 		fi
 1002 
 1003 		if test "x$withval" != xno; then
 1004 			AC_DEFINE(CONF_LOG_USEFILE, [], [use logfile for logging])
 1005 			AC_DEFINE_UNQUOTED(CONF_LOG_LOGFILE, "$withval", [logfile path])
 1006 			AC_MSG_RESULT([enabled, logging to file '${withval}'])
 1007 		else
 1008 			AC_MSG_RESULT(disabled)
 1009 		fi
 1010 	],
 1011 	[
 1012 		AC_MSG_RESULT(disabled)
 1013 	])
 1014 
 1015 
 1016 dnl
 1017 dnl Option to not allow scripts in subdirectories
 1018 dnl
 1019 AC_MSG_CHECKING(for script-subdirs)
 1020 AC_ARG_WITH( script-subdirs,
 1021 	[  --without-script-subdirs]
 1022 	[  prevent users from storing scripts in subdirs],
 1023 	[
 1024 		if test "x$withval" != xno; then
 1025 			AC_DEFINE(CONF_SUBDIRS, [], [allow scripts in subdirs])
 1026 			AC_MSG_RESULT([enabled, scripts allowed in subdirectories])
 1027 		else
 1028 			AC_MSG_RESULT([disabled, scripts not allowed in subdirectories])
 1029 		fi
 1030 	],
 1031 	[
 1032 		AC_DEFINE(CONF_SUBDIRS, [], [allow scripts in subdirs])
 1033 		AC_MSG_RESULT([enabled, scripts allowed in subdirectories])
 1034 	])
 1035 
 1036 
 1037 dnl
 1038 dnl Option to not redirect the stderr output
 1039 dnl
 1040 AC_MSG_CHECKING(for redirect-stderr)
 1041 AC_ARG_WITH( redirect-stderr,
 1042 	[  --without-redirect-stderr]
 1043 	[  don't redirect stderr to stdout in scripts],
 1044 	[
 1045 		if test "x$withval" != xno; then
 1046 			AC_DEFINE(CONF_REDIR_STDERR, [], [redirect stderr on script execution])
 1047 			AC_MSG_RESULT([enabled, stderr output will go to stdout])
 1048 		else
 1049 			AC_MSG_RESULT([disabled, server will get stderr output])
 1050 		fi
 1051 	],
 1052 	[
 1053 		AC_DEFINE(CONF_REDIR_STDERR, [], [redirect stderr on script execution])
 1054 		AC_MSG_RESULT([enabled, stderr output will go to stdout])
 1055 	])
 1056 
 1057 
 1058 dnl
 1059 dnl Options for clearing/setting a user's auxilliary (/etc/groups) groups
 1060 dnl
 1061 AC_MSG_CHECKING(for initgroups)
 1062 AC_ARG_WITH( initgroups,
 1063 	[  --without-initgroups]
 1064 	[  disable use of initgroups() to clear non-userid auxilliary groups],
 1065 	[
 1066 		if test "x$withval" != xno; then
 1067 			AC_DEFINE(CONF_INITGROUPS, [], [call initgroups])
 1068 			AC_MSG_RESULT([enabled, aux groups will be cleared])
 1069 		else
 1070 			AC_MSG_RESULT([disabled, aux groups will not be cleared])
 1071 		fi
 1072 	],
 1073 	[
 1074 		AC_DEFINE(CONF_INITGROUPS, [], [call initgroups])
 1075 		AC_MSG_RESULT([enabled, aux groups will be cleared])
 1076 	])
 1077 
 1078 AC_MSG_CHECKING(for setgroups)
 1079 AC_ARG_WITH( setgroups,
 1080 	[  --without-setgroups]
 1081 	[  disable use of setgroups() to add userid's auxilliary groups],
 1082 	[
 1083 		if test "x$withval" != xno; then
 1084 			AC_DEFINE(CONF_SETGROUPS, [], [call setgroups])
 1085 			AC_MSG_RESULT([enabled, aux groups will be set])
 1086 		else
 1087 			AC_MSG_RESULT([disabled, aux groups will not be set])
 1088 		fi
 1089 	],
 1090 	[
 1091 		AC_DEFINE(CONF_SETGROUPS, [], [call setgroups])
 1092 		AC_MSG_RESULT([enabled, aux groups will be set])
 1093 	])
 1094 
 1095 
 1096 dnl
 1097 dnl Option for enabling and specifying the user dir rewrite file
 1098 dnl
 1099 AC_MSG_CHECKING(for user directory rewrite)
 1100 AC_ARG_WITH( rewrite,
 1101 	[  --with-rewrite=FILE]
 1102 	[  use a file to rewrite user directories],
 1103 	[
 1104 		if test "x$withval" != xno; then
 1105 			AC_DEFINE_UNQUOTED(CONF_USERDIRFILE, "$withval", [check user homedir rewrite file])
 1106 			AC_MSG_RESULT([enabled, rewrite file is "$withval"])
 1107 		else
 1108 			AC_MSG_RESULT([disabled, no rewrite file will be used])
 1109 		fi
 1110 	],
 1111 	[
 1112 		AC_MSG_RESULT([disabled, no rewrite file will be used])
 1113 	])
 1114 
 1115 dnl
 1116 dnl Environment variable definitions
 1117 dnl
 1118 dnl CGIWRAP_SETENV(path,PATH,STRING,[search path])
 1119 
 1120 AC_DEFUN(CGIWRAP_SETENV,[
 1121 	AC_MSG_CHECKING(for setenv-$1)
 1122 	AC_ARG_WITH( setenv-$1,
 1123 	[  --with-setenv-$1=$3]
 1124         [  set $2 environment variable to $3],
 1125 	[
 1126 		if test "x$withval" = xyes; then
 1127 			AC_MSG_RESULT([no value specified])
 1128 		elif test "x$withval" = x; then
 1129 			AC_MSG_RESULT([no value specified])
 1130 		elif test "x$withval" = xno; then
 1131 			AC_MSG_RESULT([disabled])
 1132 		else
 1133 			AC_DEFINE(CONF_SETENV_ANY, [], [some setenvs are defined])
 1134 			AC_DEFINE_UNQUOTED(CONF_SETENV_$2, "$withval", [setenv for $2 to $withval])
 1135 			AC_MSG_RESULT([enabled, set to ("$withval")])
 1136 		fi
 1137 	],
 1138 	[
 1139 		AC_MSG_RESULT([disabled])
 1140 	])
 1141 ])
 1142 
 1143 CGIWRAP_SETENV(ld_library_path,LD_LIBRARY_PATH,STRING,[lib search path])
 1144 CGIWRAP_SETENV(path,PATH,STRING,[search path])
 1145 CGIWRAP_SETENV(tz,TZ,STRING,[time zone])
 1146 
 1147 dnl
 1148 dnl Resource limits for those who want to use them
 1149 dnl
 1150 dnl CGIWRAP_RLIMIT(cpu,CPU,SECONDS,[cpu seconds],10,[cpu usage])
 1151 
 1152 AC_DEFUN(CGIWRAP_RLIMIT,[
 1153 	AC_MSG_CHECKING(for limit rlimit-$1)
 1154 	AC_ARG_WITH( rlimit-$1,
 1155 	[  --with-rlimit-$1=$3  ($5)]
 1156         [  limit $6 with setrlimit],
 1157 	[
 1158 		if test "x$withval" = xyes; then
 1159 			withval=$5
 1160 		fi
 1161 		if test "x$withval" = x; then
 1162 			withval=$5
 1163 		fi
 1164 		if test "x$withval" != xno; then
 1165 			AC_DEFINE(CONF_USE_RLIMIT_ANY, [], [any rlimits are set])
 1166 			AC_DEFINE_UNQUOTED(CONF_USE_RLIMIT_$2, $withval, [set rlimit for $2 to $4])
 1167 			AC_MSG_RESULT(["$withval" $4])
 1168 		else
 1169 			AC_MSG_RESULT([none])
 1170 		fi
 1171 	],
 1172 	[
 1173 		AC_MSG_RESULT([none])
 1174 	])
 1175 ])
 1176 
 1177 CGIWRAP_RLIMIT(cpu,CPU,SECONDS,[cpu seconds],10,[cpu time])
 1178 CGIWRAP_RLIMIT(vmem,VMEM,BYTES,[bytes],2500000,[total virtual memory])
 1179 CGIWRAP_RLIMIT(as,AS,BYTES,[bytes],2500000,[total available memory])
 1180 CGIWRAP_RLIMIT(fsize,FSIZE,BYTES,[bytes],2500000,[writable file size])
 1181 CGIWRAP_RLIMIT(data,DATA,BYTES,[bytes],2500000,[data segment size])
 1182 CGIWRAP_RLIMIT(stack,STACK,BYTES,[bytes],2500000,[stack segment size])
 1183 CGIWRAP_RLIMIT(core,CORE,BYTES,[bytes],2500000,[core file size])
 1184 CGIWRAP_RLIMIT(rss,RSS,BYTES,[bytes],2500000,[resident set size])
 1185 CGIWRAP_RLIMIT(nproc,NPROC,COUNT,[processes],32,[number of processes])
 1186 CGIWRAP_RLIMIT(nofile,NOFILE,COUNT,[files],32,[number of open files])
 1187 CGIWRAP_RLIMIT(memlock,MEMLOCK,BYTES,[bytes],2500000,[lockable memory])
 1188 
 1189 dnl
 1190 dnl Check for php filename, and pass to php interpreter directly
 1191 dnl
 1192 AC_MSG_CHECKING(for soft-rlimit-only support)
 1193 AC_ARG_WITH( soft-rlimit-only,
 1194         [  --with-soft-rlimit-only]
 1195         [  set soft rlimits only],
 1196         [
 1197                 if test "x$withval" != xno; then
 1198                         AC_DEFINE(CONF_SOFT_RLIMIT_ONLY, [], [will only set soft resource limits])
 1199                         AC_MSG_RESULT([will only set soft resource limits])
 1200                 else
 1201                         AC_MSG_RESULT([will set both hard and soft resource limits])
 1202                 fi
 1203         ],
 1204         [
 1205                 AC_MSG_RESULT([will set both hard and soft resource limits])
 1206         ])
 1207 
 1208 
 1209 dnl
 1210 dnl Options for access control files
 1211 dnl
 1212 
 1213 AC_MSG_CHECKING(for allow-file)
 1214 AC_ARG_WITH( allow-file,
 1215 	[  --with-allow-file=FILE  (/usr/adm/cgiwrap.allow)]
 1216 	[  limit cgiwrap usage],
 1217 	[
 1218 		if test "x$withval" = x; then
 1219 			withval="/usr/adm/cgiwrap.allow"
 1220 		fi
 1221 		if test "x$withval" != xno; then
 1222 			AC_DEFINE_UNQUOTED(CONF_ALLOWFILE, "$withval", [user allow config file])
 1223 			AC_MSG_RESULT([enabled, file is "$withval"])
 1224 		else
 1225 			AC_MSG_RESULT([disabled])
 1226 		fi
 1227 	],
 1228 	[
 1229 		AC_MSG_RESULT([disabled])
 1230 	])
 1231 
 1232 AC_MSG_CHECKING(for deny-file)
 1233 AC_ARG_WITH( deny-file,
 1234 	[  --with-deny-file=FILE  (/usr/adm/cgiwrap.deny)]
 1235 	[  limit cgiwrap usage],
 1236 	[
 1237 		if test "x$withval" = x; then
 1238 			withval="/usr/adm/cgiwrap.deny"
 1239 		fi
 1240 		if test "x$withval" != xno; then
 1241 			AC_DEFINE_UNQUOTED(CONF_DENYFILE, "$withval", [user deny config file])
 1242 			AC_MSG_RESULT([enabled, file is "$withval"])
 1243 		else
 1244 			AC_MSG_RESULT([disabled])
 1245 		fi
 1246 	],
 1247 	[
 1248 		AC_MSG_RESULT([disabled])
 1249 	])
 1250 
 1251 
 1252 dnl
 1253 dnl Options for access control files
 1254 dnl
 1255 
 1256 AC_MSG_CHECKING(for allow-deny-netgroups)
 1257 AC_ARG_WITH( allow-deny-netgroups,
 1258 	[  --with-allow-deny-netgroups  (disabled)]
 1259 	[  limit cgiwrap usage based on netgroup membership],
 1260 	[
 1261 		if test "x$withval" = x; then
 1262 			AC_MSG_RESULT([disabled])
 1263 		elif test "x$withval" != xno; then
 1264 			AC_DEFINE(CONF_ALLOWDENY_NETGROUPS, [], [enabled checking netgroup syntax in allow/deny files])
 1265 			AC_MSG_RESULT([enabled])
 1266 		else
 1267 			AC_MSG_RESULT([disabled])
 1268 		fi
 1269 	],
 1270 	[
 1271 		AC_MSG_RESULT([disabled])
 1272 	])
 1273 
 1274 AC_MSG_CHECKING(for vhost-allow-dir)
 1275 AC_ARG_WITH( vhost-allow-dir,
 1276 	[  --with-vhost-allow-dir=FILE  (disabled)]
 1277 	[  limit cgiwrap usage on vhosts],
 1278 	[
 1279 		if test "x$withval" = x; then
 1280 			AC_MSG_RESULT([disabled])
 1281 		elif test "x$withval" != xno; then
 1282 			AC_DEFINE_UNQUOTED(CONF_VHOST_ALLOWDIR, "$withval", [dir for vhost allow files])
 1283 			AC_MSG_RESULT([enabled, dir is "$withval"])
 1284 		else
 1285 			AC_MSG_RESULT([disabled])
 1286 		fi
 1287 	],
 1288 	[
 1289 		AC_MSG_RESULT([disabled])
 1290 	])
 1291 
 1292 AC_MSG_CHECKING(for vhost-deny-dir)
 1293 AC_ARG_WITH( vhost-deny-dir,
 1294 	[  --with-vhost-deny-dir=FILE  (disabled)]
 1295 	[  limit cgiwrap usage on vhosts],
 1296 	[
 1297 		if test "x$withval" = x; then
 1298 			AC_MSG_RESULT([disabled])
 1299 		elif test "x$withval" != xno; then
 1300 			AC_DEFINE_UNQUOTED(CONF_VHOST_DENYDIR, "$withval", [dir for vhost deny files])
 1301 			AC_MSG_RESULT([enabled, dir is "$withval"])
 1302 		else
 1303 			AC_MSG_RESULT([disabled])
 1304 		fi
 1305 	],
 1306 	[
 1307 		AC_MSG_RESULT([disabled])
 1308 	])
 1309 
 1310 AC_MSG_CHECKING(for host checking)
 1311 AC_ARG_WITH( host-checking,
 1312 	[  --with-host-checking]
 1313 	[  allow specifying hosts in allow/deny files],
 1314 	[
 1315 		if test "x$withval" != xno; then
 1316 			AC_DEFINE(CONF_CHECKHOST, [], [check host in allow/deny files])
 1317 			AC_MSG_RESULT([enabled])
 1318 		else
 1319 			AC_MSG_RESULT([disabled])
 1320 		fi
 1321 	],
 1322 	[
 1323 		AC_MSG_RESULT([disabled])
 1324 	])
 1325 
 1326 AC_MSG_CHECKING(for shell checking)
 1327 AC_ARG_WITH( check-shell,
 1328 	[  --with-check-shell]
 1329 	[  user shell must be in system shells list ],
 1330 	[
 1331 		GETUSERSHELL=""
 1332 		if test "x$withval" != xno; then
 1333 			AC_DEFINE(CONF_CHECKSHELL, [], [check shell against /etc/shells])
 1334 			AC_MSG_RESULT([enabled])
 1335 			AC_CHECK_FUNC(getusershell, , [GETUSERSHELL="getusershell.o"])
 1336 			AC_MSG_CHECKING(for OS specific getusershell support)
 1337 			os_specific_msg="none needed"
 1338 			case $target_os in
 1339 			aix* )	
 1340 				LIBS="$LIBS -ls"
 1341 				os_specific_msg="-ls"
 1342 				;;
 1343 			esac
 1344 			AC_MSG_RESULT([$os_specific_msg])
 1345 		else
 1346 			AC_MSG_RESULT([disabled])
 1347 		fi
 1348 	],
 1349 	[
 1350 		GETUSERSHELL=""
 1351 		AC_MSG_RESULT([disabled])
 1352 	])
 1353 AC_SUBST(GETUSERSHELL)
 1354 
 1355 dnl
 1356 dnl Options for AFS PAG support
 1357 dnl
 1358 AC_MSG_CHECKING([for afs setpag() support])
 1359 AC_ARG_WITH( afs,
 1360 	[  --with-afs=DIR  (/usr/afsws)]
 1361 	[  enable afs setpag() support],
 1362 	[
 1363 		if test "x$withval" = xno; then
 1364 			AC_MSG_RESULT([disabled])
 1365 		else
 1366 			if test "x$withval" = x; then
 1367 				withval="/usr/afsws"
 1368 			fi
 1369 			if test "x$withval" = xyes; then
 1370 				withval="/usr/afsws"
 1371 			fi
 1372 			AFSDIR="$withval"
 1373 			AFSLDFLAGS="-L${AFSDIR}/lib -L${AFSDIR}/lib/afs"
 1374 			AFSLIBS="-lsys -lrx -llwp ${AFSDIR}/lib/afs/util.a"
 1375 			AC_DEFINE(CONF_AFS_SETPAG, [], [set AFS pag])
 1376 			AC_MSG_RESULT([enabled, afs dir is "$withval"])
 1377 		fi
 1378 	],
 1379 	[
 1380 		AC_MSG_RESULT([disabled])
 1381 	])
 1382 
 1383 dnl
 1384 dnl Special lib requirements for AFS
 1385 dnl
 1386 if test "x$AFSDIR" != x; then
 1387 	AC_MSG_CHECKING(for extra requirements for AFS support)
 1388 	os_specific_msg="none needed"
 1389 	case $target_os in
 1390 		hpux* )	
 1391 			EXTRA_AFS_LIBS="-lBSD"
 1392 			AFSLIBS="$AFSLIBS $EXTRA_AFS_LIBS"
 1393 			os_specific_msg="$EXTRA_AFS_LIBS"
 1394 		;;
 1395 		*solaris*)
 1396 			EXTRA_AFS_LIBS="-lnsl -lsocket -L/usr/ucblib -lucb"
 1397 			AFSLIBS="$AFSLIBS $EXTRA_AFS_LIBS"
 1398 			os_specific_msg="$EXTRA_AFS_LIBS"
 1399 		;;
 1400 	esac
 1401 	AC_MSG_RESULT([$os_specific_msg])
 1402 fi
 1403 
 1404 AC_SUBST(AFSDIR)
 1405 AC_SUBST(AFSLDFLAGS)
 1406 AC_SUBST(AFSLIBS)
 1407 
 1408 AC_HEADER_STDC
 1409 AC_CHECK_HEADERS(limits.h stdlib.h pwd.h string.h strings.h)
 1410 AC_CHECK_HEADERS(sys/resource.h sys/types.h sys/time.h unistd.h)
 1411 AC_CHECK_HEADERS(syslog.h fcntl.h sys/stat.h signal.h ctype.h grp.h)
 1412 AC_CHECK_HEADERS(errno.h sys/errno.h sys/wait.h time.h sys/signal.h)
 1413 
 1414 AC_OUTPUT(Makefile unsup/loganalyze.pl)