From: Todd C. Miller Date: Fri, 21 Mar 2003 01:28:41 +0000 (+0000) Subject: --with-skey and --with-opie now take an option directory argument X-Git-Tag: SUDO_1_6_7~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7759a8b07281b6f2ca377e2283af2e8c50946b9;p=sudo --with-skey and --with-opie now take an option directory argument This obsoletes a --with-csops hack (/tools/cs/skey) Also remove the remaining direct uses of "echo" --- diff --git a/INSTALL b/INSTALL index 3be8803f6..afaff9c76 100644 --- a/INSTALL +++ b/INSTALL @@ -135,11 +135,15 @@ Special features/options: --with-csops Add CSOps standard options. You probably aren't interested in this. - --with-skey - Enable S/Key OTP (One Time Password) support. - - --with-opie - Enable NRL OPIE OTP (One Time Password) support. + --with-skey[=DIR] + Enable S/Key OTP (One Time Password) support. If specified, + DIR should contain include and lib directories with skey.h + and libskey.a respectively. + + --with-opie[=DIR] + Enable NRL OPIE OTP (One Time Password) support. If specified, + DIR should contain include and lib directories with opie.h + and libopie.a respectively. --with-SecurID[=DIR] Enable SecurID support. If specified, DIR is directory containing diff --git a/configure.in b/configure.in index 458b8f327..ab3a7028b 100644 --- a/configure.in +++ b/configure.in @@ -238,9 +238,10 @@ AC_ARG_WITH(passwd, [ --without-passwd don't use passwd/shadow file for ;; esac]) -AC_ARG_WITH(skey, [ --with-skey enable S/Key support ], +AC_ARG_WITH(skey, [ --with-skey[=DIR] enable S/Key support ], [case $with_skey in - yes) if test -n "$with_opie"; then + no) with_skey="";; + *) if test -n "$with_opie"; then AC_MSG_ERROR(["cannot use both S/Key and OPIE"]) fi AC_DEFINE(HAVE_SKEY, 1, [Define if you use S/Key.]) @@ -248,14 +249,12 @@ AC_ARG_WITH(skey, [ --with-skey enable S/Key support ], AC_MSG_RESULT(yes) AUTH_OBJS="${AUTH_OBJS} rfc1938.o" ;; - no) ;; - *) AC_MSG_WARN([Ignoring unknown argument to --with-skey: $with_skey]) - ;; esac]) -AC_ARG_WITH(opie, [ --with-opie enable OPIE support ], +AC_ARG_WITH(opie, [ --with-opie[=DIR] enable OPIE support ], [case $with_opie in - yes) if test -n "$with_skey"; then + no) with_opie="";; + *) if test -n "$with_skey"; then AC_MSG_ERROR(["cannot use both S/Key and OPIE"]) fi AC_DEFINE(HAVE_OPIE, 1, [Define if you use NRL OPIE.]) @@ -263,9 +262,6 @@ AC_ARG_WITH(opie, [ --with-opie enable OPIE support ], AC_MSG_RESULT(yes) AUTH_OBJS="${AUTH_OBJS} rfc1938.o" ;; - no) ;; - *) AC_MSG_WARN([Ignoring unknown argument to --with-opie: $with_opie]) - ;; esac]) AC_ARG_WITH(long-otp-prompt, [ --with-long-otp-prompt use a two line OTP (skey/opie) prompt], @@ -1514,12 +1510,12 @@ test -n "$mansectform" || mansectform=5 dnl dnl Add in any libpaths or libraries specified via configure dnl -if test -n ${with_libpath}; then +if test -n "$with_libpath"; then for i in ${with_libpath}; do SUDO_APPEND_LIBPATH(LDFLAGS, [$i]) done fi -if test -n ${with_libraries}; then +if test -n "$with_libraries"; then for i in ${with_libraries}; do case $i in -l*) ;; @@ -1795,7 +1791,7 @@ if test "$with_AFS" = "yes"; then fi done if test -z "$FOUND_AFSLIBDIR"; then - echo 'Unable to locate AFS libraries, you will have to edit the Makefile and add -L/path/to/afs/libs to SUDO_LDFLAGS or rerun configure with the --with-libpath options.' + AC_MSG_WARN([Unable to locate AFS libraries, you will have to edit the Makefile and add -L/path/to/afs/libs to SUDO_LDFLAGS or rerun configure with the --with-libpath options.]) fi # Order is important here. Note that we build AFS_LIBS from right to left @@ -1822,7 +1818,7 @@ if test "$with_AFS" = "yes"; then done if test -z "$FOUND_AFSLIBDIR"; then - echo 'Unable to locate AFS include dir, you may have to edit the Makefile and add -I/path/to/afs/includes to CPPFLAGS or rerun configure with the --with-incpath options.' + AC_MSG_WARN([Unable to locate AFS include dir, you may have to edit the Makefile and add -I/path/to/afs/includes to CPPFLAGS or rerun configure with the --with-incpath options.]) fi fi @@ -1838,35 +1834,64 @@ fi dnl dnl extra S/Key lib and includes dnl -if test "$with_skey" = "yes"; then - SUDO_LIBS="${SUDO_LIBS} -lskey" - if test -f /usr/include/skey.h -a -f /usr/lib/libskey.a; then - : - elif test -f /usr/local/include/skey.h; then - CPPFLAGS="${CPPFLAGS} -I/usr/local/include" - SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [/usr/local/lib]) - elif test "$with_csops" = "yes" -a -f /tools/cs/skey/include/skey.h -a -f /tools/cs/skey/lib/libskey.a; then - CPPFLAGS="${CPPFLAGS} -I/tools/cs/skey/include" - SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [/tools/cs/skey/lib]) +if test -n "$with_skey"; then + O_LDFLAGS="$LDFLAGS" + if test "$with_skey" != "yes"; then + CPPFLAGS="${CPPFLAGS} -I${with_skey}/include" + SUDO_APPEND_LIBPATH(LDFLAGS, [${with_skey}/lib]) + SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_skey}/lib]) + AC_PREPROC_IFELSE([#include ], [found=yes], [found=no]) else - echo 'Unable to locate libskey.a and/or skey.h, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS and/or -I/path/to/skey.h to CPPFLAGS' + found=no + O_CPPFLAGS="$CPPFLAGS" + for dir in "" "/usr/local" "/usr/contrib"; do + test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include" + AC_PREPROC_IFELSE([#include ], [found=yes; break], ) + done + if test "$found" = "no" -o -z "$dir"; then + CPPFLAGS="$O_CPPFLAGS" + else + SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib]) + SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${dir}/lib]) + fi fi + if test "$found" = "no"; then + AC_MSG_WARN([Unable to locate skey.h, you will have to edit the Makefile and add -I/path/to/skey/includes to CPPFLAGS]) + fi + AC_CHECK_LIB(skey, main, , [AC_MSG_WARN([Unable to locate libskey.a, you will have to edit the Makefile and add -L/path/to/skey/lib to SUDO_LDFLAGS])]) AC_CHECK_LIB(skey, skeyaccess, AC_DEFINE(HAVE_SKEYACCESS, 1, [Define if your S/Key library has skeyaccess().])) + LDFLAGS="$O_LDFLAGS" fi dnl dnl extra OPIE lib and includes dnl -if test "$with_opie" = "yes"; then - SUDO_LIBS="${SUDO_LIBS} -lopie" - if test -f /usr/include/opie.h -a -f /usr/lib/libopie.a; then - : - elif test -f /usr/local/include/opie.h; then - CPPFLAGS="${CPPFLAGS} -I/usr/local/include" - SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [/usr/local/lib]) +if test -n "$with_opie"; then + O_LDFLAGS="$LDFLAGS" + if test "$with_opie" != "yes"; then + CPPFLAGS="${CPPFLAGS} -I${with_opie}/include" + SUDO_APPEND_LIBPATH(LDFLAGS, [${with_opie}/lib]) + SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${with_opie}/lib]) + AC_PREPROC_IFELSE([#include ], [found=yes], [found=no]) else - echo 'Unable to locate libopie.a and/or opie.h, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDO_LDFLAGS and/or -I/path/to/opie.h to CPPFLAGS' + found=no + O_CPPFLAGS="$CPPFLAGS" + for dir in "" "/usr/local" "/usr/contrib"; do + test -n "$dir" && CPPFLAGS="$O_CPPFLAGS -I${dir}/include" + AC_PREPROC_IFELSE([#include ], [found=yes; break], ) + done + if test "$found" = "no" -o -z "$dir"; then + CPPFLAGS="$O_CPPFLAGS" + else + SUDO_APPEND_LIBPATH(LDFLAGS, [${dir}/lib]) + SUDO_APPEND_LIBPATH(SUDO_LDFLAGS, [${dir}/lib]) + fi fi + if test "$found" = "no"; then + AC_MSG_WARN([Unable to locate opie.h, you will have to edit the Makefile and add -I/path/to/opie/includes to CPPFLAGS]) + fi + AC_CHECK_LIB(opie, main, , [AC_MSG_WARN([Unable to locate libopie.a, you will have to edit the Makefile and add -L/path/to/opie/lib to SUDO_LDFLAGS])]) + LDFLAGS="$O_LDFLAGS" fi dnl @@ -1974,13 +1999,11 @@ dnl dnl Spew any text the user needs to know about dnl if test "$with_pam" = "yes"; then - echo "" case $host in *-*-linux*) - echo "You will need to customize sample.pam and install it as /etc/pam.d/sudo" + AC_MSG_NOTICE([You will need to customize sample.pam and install it as /etc/pam.d/sudo]) ;; esac - echo "" fi dnl