diff options
author | Damien Miller <djm@mindrot.org> | 2016-08-16 14:47:34 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2016-08-16 14:47:34 +1000 |
commit | a1cc637e7e11778eb727559634a6ef1c19c619f6 (patch) | |
tree | 671dff9d5026c58a01956c53032a1375a044ee55 /configure.ac | |
parent | 8bd81e1596ab1bab355146cb65e82fb96ade3b23 (diff) |
add a --with-login-program configure argument
Saves messing around with LOGIN_PROGRAM env var, which come
packaging environments make hard to do during configure phase.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 1f1941a1..959826fe 100644 --- a/configure.ac +++ b/configure.ac @@ -80,15 +80,27 @@ if test -z "$AR" ; then fi # Use LOGIN_PROGRAM from environment if possible -if test ! -z "$LOGIN_PROGRAM" ; then - AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM"], - [If your header files don't define LOGIN_PROGRAM, - then use this (detected) from environment and PATH]) +login_program=$LOGIN_PROGRAM +# Allow override on command-line +AC_ARG_WITH([login-program], + [ --with-login-program=path Specify login program name ], + [ + if test "x$withval" != "xno" && \ + test "x$withval" != "xyes" ; then + login_program=$withval + fi + ] +) +# If no login_program specified then find one using the path. +if test ! -z "$login_program" ; then + AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$login_program"], + [login program to use if system headers lack LOGIN_PROGRAM]) else # Search for login AC_PATH_PROG([LOGIN_PROGRAM_FALLBACK], [login]) if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then - AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], ["$LOGIN_PROGRAM_FALLBACK"]) + AC_DEFINE_UNQUOTED([LOGIN_PROGRAM_FALLBACK], + ["$LOGIN_PROGRAM_FALLBACK"]) fi fi |