#4153 Few fixes in configure script
Merged 4 years ago by pbrezina. Opened 4 years ago by lslebodn.
SSSD/ lslebodn/sssd config_fixes  into  master

file modified
+11 -1
@@ -465,7 +465,17 @@ 

      [sss_cv_attribute_fallthrough],

      [AC_COMPILE_IFELSE(

           [AC_LANG_SOURCE(

-              [ __attribute__ ((fallthrough)); ])

+              [ void test_fun(int arg) {

+                    switch (arg) {

+                    case 1:

+                    __attribute__ ((fallthrough));

+                    case 2: ++arg;

+                            break;

+                    default: --arg;

+                             break;

+                    }

+                }

+              ])

           ],[

               sss_cv_attribute_fallthrough=yes

               sss_cv_attribute_fallthrough_val="__attribute__ ((fallthrough))"

file modified
+3 -3
@@ -122,9 +122,9 @@ 

      AC_DEFINE_UNQUOTED(SMB_IDMAP_INTERFACE_VERSION, $idmap_version,

                         [Detected version of Samba's idmap plugin interface])

  

-     samba_major_version=`echo -e '#include <samba/version.h>\nSAMBA_VERSION_MAJOR' | $CPP $SMBCLIENT_CFLAGS -P -`

-     samba_minor_version=`echo -e '#include <samba/version.h>\nSAMBA_VERSION_MINOR' | $CPP $SMBCLIENT_CFLAGS -P -`

-     samba_release_version=`echo -e '#include <samba/version.h>\nSAMBA_VERSION_RELEASE' | $CPP $SMBCLIENT_CFLAGS -P -`

+     samba_major_version=`printf '#include <samba/version.h>\nSAMBA_VERSION_MAJOR' | $CPP $SMBCLIENT_CFLAGS -P -`

+     samba_minor_version=`printf '#include <samba/version.h>\nSAMBA_VERSION_MINOR' | $CPP $SMBCLIENT_CFLAGS -P -`

+     samba_release_version=`printf '#include <samba/version.h>\nSAMBA_VERSION_RELEASE' | $CPP $SMBCLIENT_CFLAGS -P -`

      AC_MSG_NOTICE([Samba version: $samba_major_version $samba_minor_version $samba_release_version])

      if test $samba_major_version -ge 4 -a $samba_minor_version -ge 8 ; then

          AC_DEFINE_UNQUOTED(SMB_IDMAP_DOMAIN_HAS_DOM_SID, 1,

  • Fix detection of attribute fallthrough
      configure:27218: checking whether compiler supports __attribute__((fallthrough))
      configure:27228: gcc -c -Werror  conftest.c >&5
      conftest.c:185:2: error: 'fallthrough' attribute at top level [-Werror=attributes]
        185 |  __attribute__ ((fallthrough));
            |  ^~~~~~~~~~~~~
      cc1: all warnings being treated as errors
  • Fix detection of samba version for idmap plugin

The parameter -e is not standard parameter for echo builtin.
And therefore needn't be implemented in some shells.

e.g.

      sh$ /bin/dash -c 'echo -e "#include <samba/version.h>\nSAMBA_VERSION_MAJOR"'
      -e #include <samba/version.h>
      SAMBA_VERSION_MAJOR

And it caused failures in configure

      checking Samba's idmap plugin interface version... idmap test result is: 6
      configure: Samba's idmap interface version: 6
      configure: Samba version: -e #include <samba/version.h>
      SAMBA_VERSION_MAJOR -e #include <samba/version.h>
      SAMBA_VERSION_MINOR -e #include <samba/version.h>
      SAMBA_VERSION_RELEASE
      /home/build/sssd/configure: 21832: test: #include: unexpected operator
      configure: Samba's struct idmap_domain does not have dom_sid member

rebased onto 4ebfc00

4 years ago

Metadata Update from @pbrezina:
- Request assigned

4 years ago

Thank you. I wanted to write similar patch for rawhide. It detects the attribute correctly now.

Ack.

Commit a483bfa fixes this pull-request

Pull-Request has been merged by pbrezina

4 years ago

Commit c3b98b2 fixes this pull-request

Pull-Request has been merged by pbrezina

4 years ago
  • master
    • c3b98b2 - CONFIGURE: Fix detection of samba version for idmap plugin
    • a483bfa - CONFIGURE: Fix detection of attribute fallthrough