|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24183 Configure fails on Mac OS X --with-pdflib (pdflib >= 4.0.3)
Submitted: 2003-06-14 07:56 UTC Modified: 2003-07-11 08:08 UTC
From: php_public at macfreek dot nl Assigned: kalowsky (profile)
Status: Closed Package: PDF related
PHP Version: 4.3.2 OS: Mac OS X (10.2.6)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 - 6 = ?
Subscribe to this entry?

 [2003-06-14 07:56 UTC] php_public at macfreek dot nl

Starting with pdflib 4.0.3, pdflib needs to be linked 
with Carbon support on Mac OS X.

When configuring PHP, PHP will try to compile and link 
a test program testing the PDF_show_boxed() function. 
However, this test program will not link because the 
Carbon libs are not included.

Therefor, PHP can't be ./configure'd on Mac OS X if --
with-pdflib is specified.

See reproduce code & expected result for details and 

Reproduce code:
Details from config.log:
From config.log

configure:61608: checking for PDF_show_boxed in -lpdf
configure:61627: gcc -o conftest -g -O2  -no-cpp-
          -L/sw/lib -L/sw/lib -L/usr/local/lib -L/usr/
local/lib conftest.c -lpdf  -lz -ltiff -lpng -ljpeg -
lpanel -lncurses -lldap -llber -lpam -lintl -lt1 -
lfreetype -lpng -lz -ljpeg -lxsltbreakpoint -lxml2 -
lxslt -lz -lgdbm -lcurl -lbz2 -lz -lssl -lcrypto -lm  -
lcurl -lz -ldl -lz -lxml2 -lz -liconv -lm 1>&5
ld: Undefined symbols:
configure: failed program was:
#line 61616 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PDF_show_boxed();

int main() {
; return 0; }

Expected result:
This can be fixed by adding these flags to the 
configure script:

LDFLAGS="-framework CoreServices -framework 

Of course, you should only do that on Mac OS X!

I have made a quick dirty workaround by just adding the 
above to the $LIBS variable, and now ./configure works 
as expected.

Actual result:
See config.log details above


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-07 11:02 UTC] p dot citti at aressy dot com

I have exactly the same issue...
But could you tell me exactly where in the 
file, I have to add the flags?

I try several places without success...

Tanh you!
 [2003-07-07 13:32 UTC]
You can get around this by not hacking the configure script and using the environment variables CCFLAGS and LDFLAGS respectively.  Just set them, run configure etc and it should be added.

In the mean time I agree that this should be done automagically, and as such I'll assign this to myself.  
 [2003-07-07 14:04 UTC]
Can you please try the following patch applied to CVS HEAD?  It should work with PHP v4.3 code as well, but the line numbers are probably different.  I am not able to check if the include path is a default value on all installs or not yet.  

Index: config.m4
RCS file: /repository/php-src/ext/pdf/config.m4,v
retrieving revision 1.36
diff -r1.36 config.m4
>       if test "$platform" = "Darwin"; then
>          PHP_ADD_FRAMEWORK(CoreServices)
>          PHP_ADD_FRAMEWORK(ApplicationServices)
>          PHP_ADD_INCLUDE("/Developer/Headers/FlatCarbon")
>       fi

 [2003-07-07 16:17 UTC] php_public at macfreek dot nl

Added the new lines after the comment "The main PDFlib 
configure" in ext/pdf/config.m4
Then, I run:
autoconf > configure
./configure --with-pdflib

However, this still fails for me. I'm rather sure I do 
something Silly [tm], but currently, I'm moving to a 
new house this week, so I don't have time to check 
details. Sorry about that.
 [2003-07-07 19:16 UTC]
It should be something like this instead:

case $host_alias in

 [2003-07-08 09:11 UTC] p dot citti at aressy dot com

Thank you guys! I have been succesfull with your help.
To compile PHP 4.3.2 with pdflib there was 2 problems:

1-You have to had this line in the config.nice

LDFLAGS='-framework Carbon' \
JUST before this one:

'./configure' \

2-You have to change the file hp-src/ext/pdf/
config.m4 and add after the comment "The main PDFlib 

case $host_alias in

(thanks all of you for that!)

3-Then do:
autoconf > configure
then make, and sudo make install
 [2003-07-08 09:16 UTC]
So I guess there needs to be one extra PHP_ADD_FRAMEWORK 
line to not need that LDFLAGS to be set:

case $host_alias in

(I can't really test this, I have no macosx.. :)

 [2003-07-08 12:38 UTC]
I am more curious why all these frameworks are being required, to link in an external library.  My testing at home hasn't worked yet
 [2003-07-11 08:08 UTC]
Well after looking through the Makefiles for PDFlib I'm pretty sure only CoreServices and ApplicationServices are needed (that is all that is referenced by their Makefiles).  Committing patch for the two Frameworks only.

If it still doesn't work, please reopen.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jun 18 03:01:31 2024 UTC