From 2eb930e601c752ce2dc5b4467bd482ae4fc28c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 27 Oct 2014 23:22:22 +0100 Subject: [PATCH 1/3] configure: Correct the use of AC_ARG_ENABLE() macro Fix the use of AC_ARG_ENABLE() so that --disable-foo configure options are respected. The third and fourth arguments of AC_ARG_ENABLE are respectively ACTION-IF-GIVEN and ACTION-IF-NOT-GIVEN. The former is executed if either --enable-foo or --disable-foo is specified on command line, the latter if neither is. Additionally, the specified value is stored in $enable_foo variable. Therefore, the common practice is to provide null ACTION-IF-GIVEN (and use the value of $enable_foo), and to set a default for $enable_foo in ACTION-IF-NOT-GIVEN. The commit does that, and adjusts the further conditionals to test $enable_foo properly. --- configure.ac | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/configure.ac b/configure.ac index 85145cfc..af1e35cc 100644 --- a/configure.ac +++ b/configure.ac @@ -17,44 +17,44 @@ AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_sy AC_ARG_ENABLE(nopam, AS_HELP_STRING([--enable-nopam], [Build no PAM support (default: no)]), - [nopam=true], [nopam=false]) -AM_CONDITIONAL(SESMAN_NOPAM, [test x$nopam = xtrue]) + [], [enable_nopam=no]) +AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_nopam = xyes]) AC_ARG_ENABLE(kerberos, AS_HELP_STRING([--enable-kerberos], [Build kerberos support (default: no)]), - [kerberos=true], [kerberos=false]) -AM_CONDITIONAL(SESMAN_KERBEROS, [test x$kerberos = xtrue]) + [], [enable_kerberos=no]) +AM_CONDITIONAL(SESMAN_KERBEROS, [test x$enable_kerberos = xyes]) AC_ARG_ENABLE(pamuserpass, AS_HELP_STRING([--enable-pamuserpass], [Build pam userpass support (default: no)]), - [pamuserpass=true], [pamuserpass=false]) -AM_CONDITIONAL(SESMAN_PAMUSERPASS, [test x$pamuserpass = xtrue]) + [], [enable_pamuserpass=no]) +AM_CONDITIONAL(SESMAN_PAMUSERPASS, [test x$enable_pamuserpass = xyes]) AC_ARG_ENABLE(xrdpdebug, AS_HELP_STRING([--enable-xrdpdebug], [Build debug (default: no)]), - [xrdpdebug=true], [xrdpdebug=false]) -AM_CONDITIONAL(XRDP_DEBUG, [test x$xrdpdebug = xtrue]) + [], [enable_xrdpdebug=no]) +AM_CONDITIONAL(XRDP_DEBUG, [test x$enable_xrdpdebug = xyes]) AC_ARG_ENABLE(neutrinordp, AS_HELP_STRING([--enable-neutrinordp], [Build neutrinordp module (default: no)]), - [neutrinordp=true], [neutrinordp=false]) -AM_CONDITIONAL(XRDP_NEUTRINORDP, [test x$neutrinordp = xtrue]) + [], [enable_neutrinordp=no]) +AM_CONDITIONAL(XRDP_NEUTRINORDP, [test x$enable_neutrinordp = xyes]) AC_ARG_ENABLE(jpeg, AS_HELP_STRING([--enable-jpeg], [Build jpeg module (default: no)]), - [jpeg=true], [jpeg=false]) -AM_CONDITIONAL(XRDP_JPEG, [test x$jpeg = xtrue]) + [], [enable_jpeg=no]) +AM_CONDITIONAL(XRDP_JPEG, [test x$enable_jpeg = xyes]) AC_ARG_ENABLE(tjpeg, AS_HELP_STRING([--enable-tjpeg], [Build turbo jpeg module (default: no)]), - [tjpeg=true], [tjpeg=false]) -AM_CONDITIONAL(XRDP_TJPEG, [test x$tjpeg = xtrue]) + [], [enable_tjpeg=no]) +AM_CONDITIONAL(XRDP_TJPEG, [test x$enable_tjpeg = xyes]) AC_ARG_ENABLE(fuse, AS_HELP_STRING([--enable-fuse], [Build fuse(clipboard file / drive redir) (default: no)]), - [fuse=true], [fuse=false]) -AM_CONDITIONAL(XRDP_FUSE, [test x$fuse = xtrue]) + [], [enable_fuse=no]) +AM_CONDITIONAL(XRDP_FUSE, [test x$enable_fuse = xyes]) AC_ARG_ENABLE(xrdpvr, AS_HELP_STRING([--enable-xrdpvr], [Build xrdpvr module (default: no)]), - [xrdpvr=true], [xrdpvr=false]) -AM_CONDITIONAL(XRDP_XRDPVR, [test x$xrdpvr = xtrue]) + [], [enable_xrdpvr=no]) +AM_CONDITIONAL(XRDP_XRDPVR, [test x$enable_xrdpvr = xyes]) AC_ARG_ENABLE(rfxcodec, AS_HELP_STRING([--enable-rfxcodec], [Build using librfxcodec (default: no)]), - [rfxcodec=true], [rfxcodec=false]) -AM_CONDITIONAL(XRDP_RFXCODEC, [test x$rfxcodec = xtrue]) + [], [enable_rfxcodec=no]) +AM_CONDITIONAL(XRDP_RFXCODEC, [test x$enable_rfxcodec = xyes]) AM_CONDITIONAL(GOT_PREFIX, test "x${prefix}" != "xNONE"]) @@ -64,9 +64,9 @@ AC_CHECK_HEADER([openssl/rc4.h], [], [#include ]) # checking if pam should be autodetected. -if test -z "$enable_nopam" +if test "x$enable_nopam" != "xyes" then - if test -z "$enable_kerberos" + if test "x$enable_kerberos" != "xyes" then AC_CHECK_HEADER([security/pam_appl.h], [], [AC_MSG_ERROR([please install libpam0g-dev or pam-devel])]) @@ -86,19 +86,19 @@ fi AS_IF( [test "x$enable_neutrinordp" = "xyes"] , [PKG_CHECK_MODULES(FREERDP, freerdp >= 1.0.0)] ) # checking for libjpeg -if ! test -z "$enable_jpeg" +if test "x$enable_jpeg" = "xyes" then AC_CHECK_HEADER([jpeglib.h], [], [AC_MSG_ERROR([please install libjpeg-dev or libjpeg-devel])]) fi -if ! test -z "$enable_xrdpdebug" +if test "x$enable_xrdpdebug" = "xyes" then CFLAGS="-g -O0" fi # checking for fuse -if ! test -z "$enable_fuse" +if test "x$enable_fuse" = "xyes" then AC_CHECK_HEADER([fuse.h], [], [AC_MSG_ERROR([please install libfuse-dev or fuse-devel])], @@ -106,7 +106,7 @@ then fi # checking for TurboJPEG -if ! test -z "$enable_tjpeg" +if test "x$enable_tjpeg" = "xyes" then if test ! -z "$TURBOJPEG_PATH" then From dba00703605f3dcbbb60099259b490ccc68c9314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 27 Oct 2014 23:32:56 +0100 Subject: [PATCH 2/3] configure: Add --disable-pam and deprecate --enable-nopam Use simple logic for PAM control to avoid confusion and double negations. Keep --enable-nopam deprecated for backwards compatibility. --- configure.ac | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index af1e35cc..6276e1ca 100644 --- a/configure.ac +++ b/configure.ac @@ -15,10 +15,19 @@ if test "x$with_systemdsystemunitdir" != xno; then fi AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ]) +AC_ARG_ENABLE(pam, AS_HELP_STRING([--disable-pam], + [Build PAM support (default: yes)]), + [], [enable_pam=yes]) AC_ARG_ENABLE(nopam, AS_HELP_STRING([--enable-nopam], - [Build no PAM support (default: no)]), - [], [enable_nopam=no]) -AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_nopam = xyes]) + [Build no PAM support (default: no, deprecated)]), + [ + if test "x$enable_nopam" = "xyes" + then + enable_pam=no + AC_MSG_WARN([--enable-nopam option is deprecated. Please use --disable-pam instead.]) + fi + ]) +AM_CONDITIONAL(SESMAN_NOPAM, [test x$enable_pam != xyes]) AC_ARG_ENABLE(kerberos, AS_HELP_STRING([--enable-kerberos], [Build kerberos support (default: no)]), [], [enable_kerberos=no]) @@ -64,7 +73,7 @@ AC_CHECK_HEADER([openssl/rc4.h], [], [#include ]) # checking if pam should be autodetected. -if test "x$enable_nopam" != "xyes" +if test "x$enable_pam" = "xyes" then if test "x$enable_kerberos" != "xyes" then @@ -78,7 +87,7 @@ AC_CHECK_MEMBER([struct in6_addr.s6_addr], [AC_DEFINE(NO_ARPA_INET_H_IP6, 1, [for IPv6])], [#include ]) -if test "x$enable_nopam" = "xyes" +if test "x$enable_pam" != "xyes" then AC_DEFINE([USE_NOPAM],1,[Disable PAM]) fi From b2d324f770c292e64b937c21c1973b179ccefc62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Mon, 27 Oct 2014 23:44:17 +0100 Subject: [PATCH 3/3] configure: Ensure PKG_CONFIG before querying systemd unit path Use PKG_PROG_PKG_CONFIG to ensure that $PKG_CONFIG is set before it is used to query the systemd unit install path. --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 6276e1ca..c5d22ec0 100644 --- a/configure.ac +++ b/configure.ac @@ -7,6 +7,7 @@ AM_INIT_AUTOMAKE([1.6 foreign]) AC_PROG_CC AC_C_CONST AC_PROG_LIBTOOL +PKG_PROG_PKG_CONFIG AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])