"Fossies" - the Fresh Open Source Software Archive

Member "scponly-20110526/configure.in" (20 Nov 2010, 12149 Bytes) of package /linux/privat/old/scponly-20110526.tgz:


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. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.in": 4.8_vs_20110526.

    1 dnl Process this file with autoconf to produce a configure script.
    2 
    3 dnl stupid hack to properly parse $PATH for /bin
    4 dnl if this breaks your configure, delete it
    5 dnl all it does is append the first dir to the end
    6 dnl first_part=`echo $PATH | cut -f1 -d\:`
    7 dnl export PATH=$PATH:$first_part
    8 PATH="$PATH:/usr/local/bin"
    9 
   10 dnl
   11 dnl Say what we are:
   12 AC_INIT(scponly, 4.8, joe@sublimation.org)                                                                      
   13 
   14 dnl AC_CONFIG_SRCDIR([helper.c])
   15 AC_CONFIG_HEADER([config.h])
   16 
   17 AC_CANONICAL_HOST
   18 
   19 # this temp_os is a brutal hack until i look into the proper way to do this. ie- rtfm
   20 temp_os=`echo $host_os | cut -c-7`
   21 if test "$temp_os" = solaris; then
   22 	AC_DEFINE(UNIX_COMPAT)
   23 fi
   24 temp_os=`echo $host_os | cut -c-4`
   25 if test "$temp_os" = irix;  then
   26 	AC_DEFINE(IRIX_COMPAT)
   27 fi
   28 temp_os=`echo $host_os | cut -c-3`
   29 if test "$temp_os" = aix; then
   30 	AC_DEFINE(UNIX_COMPAT)
   31 fi
   32 
   33 AC_DEFINE(HOST_OS,$host_os)
   34 
   35 dnl Checks for programs.
   36 AC_PROG_CC
   37 AC_PROG_INSTALL
   38 AC_PROG_LN_S
   39 AC_PATH_PROG(PROG_CUT, cut)
   40 AC_PATH_PROG(PROG_GREP, grep)
   41 AC_PATH_PROG(PROG_SORT, sort)
   42 AC_PATH_PROG(PROG_LDD, ldd)
   43 AC_PATH_PROG(PROG_USERADD, useradd)
   44 AC_PATH_PROG(PROG_CHOWN, chown)
   45 AC_PATH_PROG(PROG_CHMOD, chmod)
   46 AC_PATH_PROG(PROG_DIRNAME, dirname)
   47 AC_PATH_PROG(PROG_ID, id)
   48 AC_PATH_PROG(PROG_PW, pw)
   49 AC_PATH_PROG(PROG_RM, rm)
   50 AC_PATH_PROG(PROG_PWD_MKDB, pwd_mkdb)
   51 
   52 dnl Features wanted for this installation:
   53 dnl Command-line args to ./configure
   54 dnl Call options "--disable-foo" if they default to on,
   55 dnl call them "--enable-foo" otherwise.
   56 
   57 AC_ARG_ENABLE([restrictive-names],
   58       AC_HELP_STRING([--disable-restrictive-names], [disable restrictive filename checks]),
   59       [
   60               if test "x$enableval" != "xno"; then
   61                       AC_DEFINE([RESTRICTIVE_FILENAMES])
   62               fi
   63       ],[
   64 dnl           Default clause. This one defaults to on.
   65               AC_DEFINE([RESTRICTIVE_FILENAMES])
   66       ])
   67 
   68 AC_ARG_ENABLE([wildcards],
   69       AC_HELP_STRING([--disable-wildcards], [disable wildcard processing]),
   70       [
   71 dnl           Did they say anything, including an explicit --enable-wildcards?
   72               if test "x$enableval" != "xno"; then
   73                       AC_DEFINE([ENABLE_WILDCARDS])
   74               fi
   75       ],[
   76 dnl           Default clause. This one defaults to on.
   77               AC_DEFINE([ENABLE_WILDCARDS])
   78       ])
   79 
   80 AC_ARG_ENABLE([gftp-compat],
   81       AC_HELP_STRING([--disable-gftp-compat], [disable gftp compatibility]),
   82       [
   83               if test "x$enableval" != "xno"; then
   84                       AC_DEFINE([GFTP_COMPAT])
   85               fi
   86       ],[
   87               AC_DEFINE([GFTP_COMPAT])
   88       ])
   89 
   90 AC_ARG_WITH([sftp-server],
   91       AC_HELP_STRING([--with-sftp-server], [path to sftp-server binary [defaults to on+guessed]]),
   92       [
   93               if test "x$withval" != "xno"; then
   94 dnl                   --without-sftp-server is a perfectly good
   95 dnl                   way of requesting that sftp compatability *not*
   96 dnl                   be present.
   97                       scponly_explicit_sftpserver_path=$withval
   98                       dnl  TODO: should test viability...
   99                       AC_DEFINE([ENABLE_SFTP])
  100                       scponly_sftp_compat=1
  101               fi
  102       ],[
  103               AC_DEFINE([ENABLE_SFTP])
  104               scponly_sftp_compat=1
  105       ])
  106 
  107 AC_ARG_ENABLE([winscp-compat],
  108       AC_HELP_STRING([--enable-winscp-compat], [enable winscp (and scp) compatibility]),
  109       [
  110               if test "x$enableval" != "xno"; then
  111                       scponly_scp_compat=1
  112                       AC_DEFINE([ENABLE_SCP2])
  113                       AC_DEFINE([WINSCP_COMPAT])
  114               fi
  115       ],[
  116               echo -n      dnl  Defaults to off, must be turned on explicitly
  117       ])
  118 
  119 AC_ARG_WITH([default-chdir],
  120 	AC_HELP_STRING([--with-default-chdir=DIR], [cd to this directory after authentication (only for interactive logins)]),
  121 		[
  122 			AC_DEFINE([ENABLE_DEFAULT_CHDIR])
  123 			AC_DEFINE_UNQUOTED([DEFAULT_CHDIR], ["$withval"]) 
  124 		],[
  125 			echo -n      dnl  Defaults to off, must be turned on explicitly
  126 		])
  127 
  128 AC_ARG_ENABLE([unison-compat],
  129       AC_HELP_STRING([--enable-unison-compat], [enable unison compatibility]),
  130       [
  131               if test "x$enableval" != "xno"; then
  132                       AC_DEFINE([UNISON_COMPAT])
  133               fi
  134       ],[
  135               echo -n      dnl  Defaults to off, must be turned on explicitly
  136       ])
  137 		
  138 AC_ARG_ENABLE([scp-compat],
  139       AC_HELP_STRING([--enable-scp-compat], [enable scp compatibility]),
  140       [
  141               if test "x$enableval" != "xno"; then
  142 					AC_DEFINE([ENABLE_SCP2])
  143 					scponly_scp_compat=1
  144               fi
  145       ],[
  146               echo -n      dnl  Defaults to off, must be turned on explicitly
  147       ])
  148 
  149 AC_ARG_ENABLE([rsync-compat],
  150       AC_HELP_STRING([--enable-rsync-compat], [enable rsync compatibility]),
  151       [
  152               if test "x$enableval" != "xno"; then
  153                       AC_DEFINE([RSYNC_COMPAT])
  154               fi
  155       ],[
  156               echo -n      dnl  Defaults to off, must be turned on explicitly
  157       ])
  158 
  159 AC_ARG_ENABLE([chrooted-binary],
  160       AC_HELP_STRING([--enable-chrooted-binary], [install chrooted binary 'scponlyc']),
  161       [
  162               if test "x$enableval" != "xno"; then
  163                       AC_SUBST([CHROOTED_NAME], [scponlyc])
  164                       AC_DEFINE([CHROOTED_NAME], ["scponlyc"])
  165               fi
  166       ],[
  167               echo -n
  168       ])
  169 
  170 AC_ARG_ENABLE([chroot-checkdir],
  171       AC_HELP_STRING([--disable-chroot-checkdir], [disable checking chroot dir ownership]),
  172       [
  173               if test "x$enableval" != "xno"; then
  174                       AC_DEFINE([CHROOT_CHECKDIR])
  175               fi
  176       ],[
  177 dnl           Default clause. This one defaults to on.
  178               AC_DEFINE([CHROOT_CHECKDIR])
  179       ])
  180 
  181 AC_ARG_ENABLE([svn-compat],
  182       AC_HELP_STRING([--enable-svn-compat], [enable subversion SCS cli compatibility]),
  183       [
  184               if test "x$enableval" != "xno"; then
  185                       AC_DEFINE([SVN_COMPAT])
  186               fi
  187       ],[
  188               echo -n      dnl  Defaults to off, must be turned on explicitly
  189       ])
  190 
  191 AC_ARG_ENABLE([svnserv-compat],
  192       AC_HELP_STRING([--enable-svnserv-compat], [enable subversion SCS svnserve compatibility]),
  193       [
  194               if test "x$enableval" != "xno"; then
  195                       AC_DEFINE([SVNSERV_COMPAT])
  196               fi
  197       ],[
  198               echo -n      dnl  Defaults to off, must be turned on explicitly
  199       ])
  200 
  201 AC_ARG_ENABLE([passwd-compat],
  202       AC_HELP_STRING([--enable-passwd-compat], [enable passwd compatibility]),
  203       [
  204               if test "x$enableval" != "xno"; then
  205                       AC_DEFINE([PASSWD_COMPAT])
  206               fi
  207       ],[
  208               echo -n      dnl  Defaults to off, must be turned on explicitly
  209       ])
  210 
  211 AC_ARG_ENABLE([quota-compat],
  212       AC_HELP_STRING([--enable-quota-compat], [enable quota compatibility]),
  213       [
  214               if test "x$enableval" != "xno"; then
  215                       AC_DEFINE([QUOTA_COMPAT])
  216               fi
  217       ],[
  218               echo -n      dnl  Defaults to off, must be turned on explicitly
  219       ])
  220 
  221 if test "x$scponly_scp_compat" != "x"; then
  222 	AC_MSG_NOTICE([enabling core WinSCP and Vanilla SCP binaries...])
  223 	SCPONLY_PATH_PROG_DEFINE([PROG_SFTP_SERVER], [sftp-server],[/usr/lib:/usr/lib64:/usr/libexec:/usr/libexec/openssh:/usr/lib/ssh:/usr/lib64/ssh:/usr/local/libexec:/usr/lib/misc:/usr/lib/openssh])
  224 	SCPONLY_PATH_PROG_DEFINE([PROG_LS],    [ls],    [/bin:/usr/bin:/sbin:/usr/sbin])
  225 	SCPONLY_PATH_PROG_DEFINE([PROG_SCP],   [scp],   [/bin:/usr/bin:/sbin:/usr/sbin])
  226 	SCPONLY_PATH_PROG_DEFINE([PROG_RM],    [rm],    [/bin:/usr/bin:/sbin:/usr/sbin])
  227 	SCPONLY_PATH_PROG_DEFINE([PROG_LN],    [ln],    [/bin:/usr/bin:/sbin:/usr/sbin])
  228 	SCPONLY_PATH_PROG_DEFINE([PROG_MV],    [mv],    [/bin:/usr/bin:/sbin:/usr/sbin])
  229 	SCPONLY_PATH_PROG_DEFINE([PROG_CHMOD], [chmod], [/bin:/usr/bin:/sbin:/usr/sbin])
  230 	SCPONLY_PATH_PROG_DEFINE([PROG_CHOWN], [chown], [/bin:/usr/bin:/sbin:/usr/sbin])
  231 	SCPONLY_PATH_PROG_DEFINE([PROG_CHGRP], [chgrp], [/bin:/usr/bin:/sbin:/usr/sbin])
  232 	SCPONLY_PATH_PROG_DEFINE([PROG_MKDIR], [mkdir], [/bin:/usr/bin:/sbin:/usr/sbin])
  233 	SCPONLY_PATH_PROG_DEFINE([PROG_RMDIR], [rmdir], [/bin:/usr/bin:/sbin:/usr/sbin])
  234 fi
  235 
  236 dnl Check for binaries required by the WinSCP compatibility mode
  237 dnl winscp-compat conditionals:
  238 if test "x$enable_winscp_compat" != "xno"; then
  239     AC_MSG_NOTICE([enabling WinSCP compatability...])
  240 	SCPONLY_PATH_PROG_DEFINE([PROG_PWD],    [pwd],    [/bin:/usr/bin:/sbin:/usr/sbin])
  241 	SCPONLY_PATH_PROG_DEFINE([PROG_GROUPS], [groups], [/bin:/usr/bin:/sbin:/usr/sbin])
  242 	SCPONLY_PATH_PROG_DEFINE([PROG_ID], 	[id],     [/bin:/usr/bin:/sbin:/usr/sbin])
  243 	SCPONLY_PATH_PROG_DEFINE([PROG_ECHO],   [echo],   [/bin:/usr/bin:/sbin:/usr/sbin])
  244 fi
  245 
  246 # unison-compat conditionals:
  247 if test "x$enable_unison_compat" != "x" && test "x$enable_unison_compat" != "xno"; then
  248 	AC_MSG_WARN([read the SECURITY document before enabling unison compatibility])
  249 	AC_MSG_NOTICE([enabling unison compatability...])
  250 	SCPONLY_PATH_PROG_DEFINE([PROG_UNISON],   [unison], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin])
  251 fi	
  252 
  253 # rsync-compat conditionals:
  254 if test "x$enable_rsync_compat" != "x" && test "x$enable_rsync_compat" != "xno"; then
  255 	AC_MSG_WARN([read the SECURITY document before enabling rsync compatibility])
  256 	AC_MSG_NOTICE([enabling rsync compatability...])
  257 	SCPONLY_PATH_PROG_DEFINE([PROG_RSYNC],   [rsync], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin])
  258 fi	
  259 
  260 dnl Find the svnserve and svn binaries
  261 if test "x$enable_svnserv_compat" != "x" && test "x$enable_svnserv_compat" != "xno"; then
  262 	AC_MSG_WARN([read the SECURITY document before enabling svnserv compatibility])
  263 	AC_MSG_NOTICE([enabling svnserv compatibility...])
  264 	SCPONLY_PATH_PROG_DEFINE([PROG_SVNSERV], [svnserve], [/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin])
  265 fi
  266 
  267 if test "x$enable_svn_compat" != "x" && test "x$enable_svn_compat" != "xno"; then
  268 	AC_MSG_WARN([read the SECURITY document before enabling svn compatibility])
  269 	AC_MSG_NOTICE([enabling subversion compatability...])
  270 	SCPONLY_PATH_PROG_DEFINE([PROG_SVN],   [svn],   [/bin:/usr/bin:/usr/local/bin:/usr/local/bin])
  271 fi
  272 
  273 if test "x$enable_passwd_compat" != "x" && test "x$enable_passwd_compat" != "xno"; then
  274 	AC_MSG_NOTICE([enabling passwd compatability...])
  275 	SCPONLY_PATH_PROG_DEFINE([PROG_PASSWD],   [passwd],   [/bin:/usr/bin:/sbin:/usr/sbin])
  276 fi
  277 
  278 if test "x$enable_quota_compat" != "x" && test "x$enable_quota_compat" != "xno"; then
  279 	AC_MSG_NOTICE([enabling quota compatability...])
  280 	SCPONLY_PATH_PROG_DEFINE([PROG_QUOTA],   [quota],   [/bin:/usr/bin:/sbin:/usr/sbin])
  281 fi
  282 
  283 dnl with-sftp-server conditionals:
  284 if test "x$scponly_sftp_compat" != "x"; then
  285   AC_MSG_NOTICE([enabling SFTP compatability...])
  286   if test "x$scponly_explicit_sftpserver_path" = "x"; then
  287       dnl Informed guess:
  288       SCPONLY_PATH_PROG_DEFINE([PROG_SFTP_SERVER], [sftp-server],
  289        [/usr/lib:/usr/lib/ssh:/usr/libexec/openssh:/usr/libexec:/usr/local/libexec])
  290       dnl Debian uses /usr/lib
  291       dnl Red Hat uses /usr/libexec/openssh
  292       dnl Many a *BSD uses $PATH itself (which is implicit + checked 1st)
  293       dnl Lupe says FreeBSD wants /usr/[local]/libexec
  294       dnl I've seen it in /usr/lib/ssh under Mandrake 8.1
  295   else
  296       dnl Do what SCPONLY_PATH_PROG_DEFINE does:
  297       echo checking for sftp-server... $scponly_explicit_sftpserver_path
  298       AC_DEFINE_UNQUOTED([PROG_SFTP_SERVER], ["$scponly_explicit_sftpserver_path"])
  299       scponly_PROG_SFTP_SERVER=$scponly_explicit_sftpserver_path
  300   fi
  301 fi
  302 
  303 dnl Checks for libraries.
  304 dnl Checks for header files.
  305 AC_HEADER_STDC
  306 AC_CHECK_HEADERS([stdlib.h string.h syslog.h unistd.h wordexp.h glob.h libgen.h getopt.h])
  307 
  308 dnl Checks for typedefs, structures, and compiler characteristics.
  309 AC_C_CONST
  310 AC_C_INLINE
  311 
  312 dnl Checks for library functions.
  313 AC_FUNC_ALLOCA
  314 AC_CHECK_FUNCS([malloc atexit bzero strchr strerror glob wordexp strspn basename getopt])
  315 
  316 AC_CHECK_DECL(optreset,
  317  AC_DEFINE([HAVE_OPTRESET],[1],[have optreset]),,
  318  [#include <getopt.h>] )
  319 
  320 dnl AC_CONFIG_FILES([Makefile])
  321 AC_OUTPUT([Makefile setup_chroot.sh])