From nobody@FreeBSD.org  Tue Dec 24 06:54:41 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id F1446C5C
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Dec 2013 06:54:41 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id DC70714A0
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Dec 2013 06:54:41 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBO6sfU6036733
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 24 Dec 2013 06:54:41 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBO6sfqY036727;
	Tue, 24 Dec 2013 06:54:41 GMT
	(envelope-from nobody)
Message-Id: <201312240654.rBO6sfqY036727@oldred.freebsd.org>
Date: Tue, 24 Dec 2013 06:54:41 GMT
From: Erick Turnquist <jhujhiti@adjectivism.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: net/php5-ldap fails to build when LOCALBASE is not /usr/local
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185151
>Category:       ports
>Synopsis:       net/php5-ldap fails to build when LOCALBASE is not /usr/local
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ale
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 24 07:00:00 UTC 2013
>Closed-Date:    Fri Dec 27 10:26:53 UTC 2013
>Last-Modified:  Fri Dec 27 10:30:00 UTC 2013
>Originator:     Erick Turnquist
>Release:        9.1-RELEASE
>Organization:
>Environment:
FreeBSD rhea 9.1-RELEASE-p7 FreeBSD 9.1-RELEASE-p7 #4: Sat Sep 14 03:52:41 UTC 2013     root@rhea:/usr/obj/usr/src/sys/CUSTOM  amd64
>Description:
This was a difficult issue to track down.

I use a non-default LOCALBASE/PREFIX setting (/usr/pkg instead of /usr/local). net/php5-ldap has been failing to build. It turns out that the --with-ldap-sasl configure option can also accept a path and it doesn't respect the --with-ldap path. We can see how this has been working for those users who leave LOCALBASE/PREFIX alone by noticing the default value of SEARCH_DIRS in this snippet from the extension's config.m4:

----

AC_DEFUN([PHP_LDAP_SASL_CHECKS], [
  if test "$1" = "yes"; then
    SEARCH_DIRS="/usr/local /usr"
  else
    SEARCH_DIRS=$1
  fi

  for i in $SEARCH_DIRS; do
    if test -f $i/include/sasl/sasl.h; then
      LDAP_SASL_DIR=$i
      AC_DEFINE(HAVE_LDAP_SASL_SASL_H,1,[ ])
      break
    elif test -f $i/include/sasl.h; then
      LDAP_SASL_DIR=$i
      AC_DEFINE(HAVE_LDAP_SASL_H,1,[ ])
      break
    fi
  done
  
  if test "$LDAP_SASL_DIR"; then
    LDAP_SASL_INCDIR=$LDAP_SASL_DIR/include
    LDAP_SASL_LIBDIR=$LDAP_SASL_DIR/$PHP_LIBDIR
  else
    AC_MSG_ERROR([sasl.h not found!])
  fi

----

A trivial patch is attached to fix this.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- Makefile.ext.orig   2013-12-24 01:33:10.561057965 -0500
+++ Makefile.ext.patched        2013-12-24 01:34:09.068057995 -0500
@@ -160,7 +160,7 @@
 USE_OPENLDAP=  yes
 
 . ifdef(WANT_OPENLDAP_SASL)
-CONFIGURE_ARGS+=--with-ldap-sasl
+CONFIGURE_ARGS+=--with-ldap-sasl=${LOCALBASE}
 . endif
 .endif
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ale 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Tue Dec 24 07:00:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185151 
State-Changed-From-To: open->closed 
State-Changed-By: ale 
State-Changed-When: Fri Dec 27 10:26:40 UTC 2013 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185151 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/185151: commit references a PR
Date: Fri, 27 Dec 2013 10:24:50 +0000 (UTC)

 Author: ale
 Date: Fri Dec 27 10:24:43 2013
 New Revision: 337692
 URL: http://svnweb.freebsd.org/changeset/ports/337692
 
 Log:
   Fix build of ldap module when sasl is enabled and LOCALBASE is not /usr/local.
   
   PR:		ports/185151
   Submitted by:	Erick Turnquist <jhujhiti@adjectivism.org>
 
 Modified:
   head/lang/php5/Makefile.ext
   head/lang/php55/Makefile.ext
 
 Modified: head/lang/php5/Makefile.ext
 ==============================================================================
 --- head/lang/php5/Makefile.ext	Fri Dec 27 10:24:34 2013	(r337691)
 +++ head/lang/php5/Makefile.ext	Fri Dec 27 10:24:43 2013	(r337692)
 @@ -160,7 +160,7 @@ CONFIGURE_ARGS+=--with-ldap=${LOCALBASE}
  USE_OPENLDAP=	yes
  
  . ifdef(WANT_OPENLDAP_SASL)
 -CONFIGURE_ARGS+=--with-ldap-sasl
 +CONFIGURE_ARGS+=--with-ldap-sasl=${LOCALBASE}
  . endif
  .endif
  
 
 Modified: head/lang/php55/Makefile.ext
 ==============================================================================
 --- head/lang/php55/Makefile.ext	Fri Dec 27 10:24:34 2013	(r337691)
 +++ head/lang/php55/Makefile.ext	Fri Dec 27 10:24:43 2013	(r337692)
 @@ -160,7 +160,7 @@ CONFIGURE_ARGS+=--with-ldap=${LOCALBASE}
  USE_OPENLDAP=	yes
  
  . ifdef(WANT_OPENLDAP_SASL)
 -CONFIGURE_ARGS+=--with-ldap-sasl
 +CONFIGURE_ARGS+=--with-ldap-sasl=${LOCALBASE}
  . endif
  .endif
  
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
