diff --git a/package/sudo/sudo.mk b/package/sudo/sudo.mk index 0fcd740203..56f83eac9a 100644 --- a/package/sudo/sudo.mk +++ b/package/sudo/sudo.mk @@ -40,6 +40,13 @@ endif ifeq ($(BR2_PACKAGE_OPENLDAP),y) SUDO_DEPENDENCIES += openldap SUDO_CONF_OPTS += --with-ldap +# If we are building sudo statically and openldap was linked with openssl, then +# when we link sudo with openldap we need to specify the openssl libs, otherwise +# it will fail with "undefined reference" errors. +ifeq ($(BR2_STATIC_LIBS)$(BR2_PACKAGE_OPENSSL),yy) +SUDO_DEPENDENCIES += host-pkgconf +SUDO_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libssl libcrypto`" +endif else SUDO_CONF_OPTS += --without-ldap endif