Bug 182927

Summary: LDFLAGS missing in databases/php53-sqlite3
Product: Ports & Packages Reporter: birger.schacht
Component: Individual Port(s)Assignee: Florian Smeets <flo>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description birger.schacht 2013-10-12 16:30:00 UTC
The configure script of php53-sqlite3 is figuring out options by compiling c  snipplets and testing for options of the sqlite library. For example:

(from work/php-5.3.27/ext/sqlite3/config.log:)

configure:4663: checking for sqlite3_load_extension in -lsqlite3
configure:4688: cc -o conftest -O2 -pipe -fno-strict-aliasing   conftest.c -lsqlite3   >&5
/usr/bin/ld: cannot find -lsqlite3
configure:4688: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""  
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| /* Override any GCC internal prototype to avoid an error.
|    Use char because int might match the return type of a GCC
|    builtin and then its argument prototype would still apply.  */
| #ifdef __cplusplus
| extern "C"
| #endif
| char sqlite3_load_extension ();
| int
| main ()
| {
| return sqlite3_load_extension ();
|   ;
|   return 0;
| }
configure:4697: result: no


The result of these tests is always negative, because the sqlite3 shared library isn't found (which is installed)

Fix: 

add
LDFLAGS+=       -L${LOCALBASE}/lib
to the lang/php53/Makefile.ext in the sqlite3 block:

.if ${PHP_MODNAME} == "sqlite3"
USE_SQLITE=     yes
CONFIGURE_ARGS+=--with-sqlite3=${LOCALBASE}
LDFLAGS+=       -L${LOCALBASE}/lib
.endif

so the c snipplets can be compiled and deliver the correct options:

configure:4663: checking for sqlite3_load_extension in -lsqlite3
configure:4688: cc -o conftest -O2 -pipe -fno-strict-aliasing   -L/usr/local/lib conftest.c -lsqlite3   >&5
configure:4688: $? = 0
configure:4697: result: yes
How-To-Repeat: compile php53-sqlite3
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-10-12 16:30:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->flo

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-11-02 00:56:31 UTC
Author: flo
Date: Sat Nov  2 00:56:23 2013
New Revision: 332437
URL: http://svnweb.freebsd.org/changeset/ports/332437

Log:
  Add LDFLAGS to the sqlite3 section, otherwise configure cannot properly
  detect whether sqlite3 was built with sqlite3_load_extension or not.
  
  PR:		ports/182927
  Submitted by:	Birger Schacht <birger.schacht@tuwien.ac.at>

Modified:
  head/lang/php53/Makefile.ext

Modified: head/lang/php53/Makefile.ext
==============================================================================
--- head/lang/php53/Makefile.ext	Sat Nov  2 00:51:49 2013	(r332436)
+++ head/lang/php53/Makefile.ext	Sat Nov  2 00:56:23 2013	(r332437)
@@ -372,6 +372,7 @@ UTF8_DESC=	UTF-8 support
 .if ${PHP_MODNAME} == "sqlite3"
 USE_SQLITE=	yes
 CONFIGURE_ARGS+=--with-sqlite3=${LOCALBASE}
+LDFLAGS+=	-L${LOCALBASE}/lib
 .endif
 
 .if ${PHP_MODNAME} == "sybase_ct"
_______________________________________________
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"
Comment 3 Florian Smeets freebsd_committer freebsd_triage 2013-11-02 00:56:47 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 4 birger.schacht 2014-10-03 08:58:39 UTC
hi,

this problem also exists in php5.4, php5.5 and php5.6.
the LDFLAGS should be added in any of these Makefile.exts in the sqlite3 block.

thanks,
birger
Comment 5 Florian Smeets freebsd_committer freebsd_triage 2015-06-07 21:05:42 UTC
php53 is no more...