unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* build broken: libxml - i386 vs. X86_64 - configure problem
@ 2010-09-13 14:30 David Reitter
  2010-09-13 14:56 ` Lars Magne Ingebrigtsen
  2010-09-13 17:51 ` Chad Brown
  0 siblings, 2 replies; 11+ messages in thread
From: David Reitter @ 2010-09-13 14:30 UTC (permalink / raw)
  To: Emacs-Devel devel

The libxml bindings or something else related to XML broke the build for me (on a mac), due to the chosen build architecture being 64-bit (chosen by default, and that is correct), but the library being i386:


dr@elin:~/em24.git emacs24$ ./configure --with-ns
...
checking build system type... x86_64-apple-darwin10.4.0
checking host system type... x86_64-apple-darwin10.4.0
...
checking for libxml-2.0 > 2.2.0... yes
checking LIBXML2_CFLAGS... -I/opt/local/include/libxml2 -I/opt/local/include  
checking LIBXML2_LIBS... -L/opt/local/lib -lxml2 -lpthread -lz -liconv -lm  
...


gcc  -prebind -framework AppKit -Xlinker -headerpad -Xlinker 6C8   \
          -o temacs pre-crt0.o dispnew.o frame.o scroll.o xdisp.o menu.o  window.o charset.o coding.o category.o ccl.o character.o chartab.o bidi.o cm.o term.o terminal.o xfaces.o    emacs.o keyboard.o macros.o keymap.o sysdep.o buffer.o filelock.o insdel.o marker.o minibuf.o fileio.o dired.o filemode.o cmds.o casetab.o casefiddle.o indent.o search.o regex.o undo.o alloc.o data.o doc.o editfns.o callint.o eval.o floatfns.o fns.o font.o print.o lread.o syntax.o unexmacosx.o bytecode.o process.o callproc.o region-cache.o sound.o atimer.o doprnt.o strftime.o intervals.o textprop.o composite.o md5.o xml.o   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o fontset.o fringe.o image.o   terminfo.o lastfile.o      mktime.o         -L/opt/local/lib -lxml2 -lpthread -lz -liconv -lm    -lresolv  -lncurses           
ld: warning: in /opt/local/lib/libxml2.dylib, file is not of required architecture
Undefined symbols:
  "_xmlCleanupParser", referenced from:
      _parse_buffer in xml.o
  "_xmlDocGetRootElement", referenced from:
      _parse_buffer in xml.o
  "_xmlReadMemory", referenced from:
      _parse_buffer in xml.o
  "_htmlReadMemory", referenced from:
      _parse_buffer in xml.o
  "_xmlCheckVersion", referenced from:
      _parse_buffer in xml.o
  "_xmlFreeDoc", referenced from:
      _parse_buffer in xml.o
ld: symbol(s) not found

dr@elin:~/em24.git emacs24$ lipo -info /opt/local/lib/libxml2.dylib
Non-fat file: /opt/local/lib/libxml2.dylib is architecture: i386


Would it be possible to fix the configure script to make sure that the library is not only present, but that it can actually be bound?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 14:30 build broken: libxml - i386 vs. X86_64 - configure problem David Reitter
@ 2010-09-13 14:56 ` Lars Magne Ingebrigtsen
  2010-09-13 17:51 ` Chad Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-13 14:56 UTC (permalink / raw)
  To: emacs-devel

David Reitter <david.reitter@gmail.com> writes:

> Would it be possible to fix the configure script to make sure that the
> library is not only present, but that it can actually be bound?

Sure.  I'm now checking in a test for linkability, too.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 14:30 build broken: libxml - i386 vs. X86_64 - configure problem David Reitter
  2010-09-13 14:56 ` Lars Magne Ingebrigtsen
@ 2010-09-13 17:51 ` Chad Brown
  2010-09-13 18:06   ` David Reitter
  1 sibling, 1 reply; 11+ messages in thread
From: Chad Brown @ 2010-09-13 17:51 UTC (permalink / raw)
  To: David Reitter; +Cc: Emacs-Devel devel


On Sep 13, 2010, at 7:30 AM, David Reitter wrote:

> The libxml bindings or something else related to XML broke the build for me (on a mac), due to the chosen build architecture being 64-bit (chosen by default, and that is correct), but the library being i386:
> 
> dr@elin:~/em24.git emacs24$ lipo -info /opt/local/lib/libxml2.dylib
> Non-fat file: /opt/local/lib/libxml2.dylib is architecture: i386


Do you not have an libxml2 in /usr/lib?

; lipo -info /usr/lib/libxml2.dylib 
Architectures in the fat file: /usr/lib/libxml2.dylib are: x86_64 i386 ppc7400 

It looks like you've shadowed a useable library with something from Fink or MacPorts, at a guess.  Perhaps setting PKG_CONFIG_PATH to something with /usr/lib/pkgconfig early will help?

*Chad


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 17:51 ` Chad Brown
@ 2010-09-13 18:06   ` David Reitter
  2010-09-13 18:08     ` Lars Magne Ingebrigtsen
  2010-09-13 20:23     ` Andreas Schwab
  0 siblings, 2 replies; 11+ messages in thread
From: David Reitter @ 2010-09-13 18:06 UTC (permalink / raw)
  To: Chad Brown, Lars Magne Ingebrigtsen; +Cc: Emacs-Devel devel


On Sep 13, 2010, at 1:51 PM, Chad Brown wrote:
> 
> Do you not have an libxml2 in /usr/lib?
> 
> ; lipo -info /usr/lib/libxml2.dylib 
> Architectures in the fat file: /usr/lib/libxml2.dylib are: x86_64 i386 ppc7400 

Yes, I have the same, and yes, it appears shadowed.


> It looks like you've shadowed a useable library with something from Fink or MacPorts, at a guess.  Perhaps setting PKG_CONFIG_PATH to something with /usr/lib/pkgconfig early will help?

PKG_CONFIG is indeed /opt/local/bin/pkg-config in my config.status.

Err, this is not the right way:

./configure --with-pkg-config-prog=/usr/lib/pkgconfig/
checking for pkg-config... (cached) /usr/lib/pkgconfig
./configure: line 11131: /usr/lib/pkgconfig: is a directory
*** Your version of pkg-config is too old. You need version 0.9.0 or newer.
*** See http://www.freedesktop.org/software/pkgconfig

I don't have another pkg-config binary than the one provided by macports.

PS.: Lars, consider updating "configure" in the branch after the change to "configure.in"


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 18:06   ` David Reitter
@ 2010-09-13 18:08     ` Lars Magne Ingebrigtsen
  2010-09-13 18:34       ` David Reitter
  2010-09-13 20:23     ` Andreas Schwab
  1 sibling, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-13 18:08 UTC (permalink / raw)
  To: emacs-devel

David Reitter <david.reitter@gmail.com> writes:

> PS.: Lars, consider updating "configure" in the branch after the
> change to "configure.in"

The change to "configure" was checked in at the same time as the
"configure.in" change was.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 18:08     ` Lars Magne Ingebrigtsen
@ 2010-09-13 18:34       ` David Reitter
  2010-09-13 18:40         ` Lars Magne Ingebrigtsen
  2010-09-13 18:48         ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 11+ messages in thread
From: David Reitter @ 2010-09-13 18:34 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

On Sep 13, 2010, at 2:08 PM, Lars Magne Ingebrigtsen wrote:
> 
> The change to "configure" was checked in at the same time as the
> "configure.in" change was.

You're right, it was.  I went by the commit log only and then thought that I couldn't get it to work because I had to regenerate configure.

So, it is still not working for me:

checking for pkg-config... (cached) /opt/local/bin/pkg-config
checking for libxml-2.0 > 2.2.0... yes
checking LIBXML2_CFLAGS... -I/opt/local/include/libxml2 -I/opt/local/include  
checking LIBXML2_LIBS... -L/opt/local/lib -lxml2 -lpthread -lz -liconv -lm  
checking for htmlReadMemory in -lxml2... yes


Debugging this a bit, your check for htmlReadMemory  calls

$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5

which is, at the time

gcc -o conftest -g -O2     conftest.c -lxml2   

So I think this one will catch the library in /usr/lib, because the -L is missing.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 18:34       ` David Reitter
@ 2010-09-13 18:40         ` Lars Magne Ingebrigtsen
  2010-09-13 18:48         ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-13 18:40 UTC (permalink / raw)
  To: David Reitter; +Cc: emacs-devel

David Reitter <david.reitter@gmail.com> writes:

> checking for pkg-config... (cached) /opt/local/bin/pkg-config
> checking for libxml-2.0 > 2.2.0... yes
> checking LIBXML2_CFLAGS... -I/opt/local/include/libxml2 -I/opt/local/include  
> checking LIBXML2_LIBS... -L/opt/local/lib -lxml2 -lpthread -lz -liconv -lm  
> checking for htmlReadMemory in -lxml2... yes

[...]

> gcc -o conftest -g -O2     conftest.c -lxml2   
>
> So I think this one will catch the library in /usr/lib, because the -L
> is missing.

Ah, right.  It needs to add the LIBXML2_LIBS to the AC_CHECK_LIBS
incantation somehow.  I'll see whether I can figure out how to do
that... 

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 18:34       ` David Reitter
  2010-09-13 18:40         ` Lars Magne Ingebrigtsen
@ 2010-09-13 18:48         ` Lars Magne Ingebrigtsen
  2010-09-13 19:31           ` David Reitter
  1 sibling, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-13 18:48 UTC (permalink / raw)
  To: David Reitter; +Cc: emacs-devel

David Reitter <david.reitter@gmail.com> writes:

> gcc -o conftest -g -O2     conftest.c -lxml2   

Does the following patch fix it for you?

=== modified file 'configure.in'
*** configure.in	2010-09-13 14:58:48 +0000
--- configure.in	2010-09-13 18:45:28 +0000
***************
*** 2541,2546 ****
--- 2541,2547 ----
    ### I'm not sure what the version number should be, so I just guessed.
    PKG_CHECK_MODULES(LIBXML2, libxml-2.0 > 2.2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
    if test "${HAVE_LIBXML2}" = "yes"; then
+     LIBS="$LIBXML2_LIBS $LIBS"
      AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
      if test "${HAVE_LIBXML2}" = "yes"; then
        AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).])


Emacs devel people, is that the correct incantation to add the LIBS
discovered by the PKG_CHECK_MODULES magic?        

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 18:48         ` Lars Magne Ingebrigtsen
@ 2010-09-13 19:31           ` David Reitter
  2010-09-13 19:47             ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: David Reitter @ 2010-09-13 19:31 UTC (permalink / raw)
  To: Lars Magne Ingebrigtsen; +Cc: emacs-devel

On Sep 13, 2010, at 2:48 PM, Lars Magne Ingebrigtsen wrote:
> 
> Does the following patch fix it for you?
> 
> +     LIBS="$LIBXML2_LIBS $LIBS"
>      

Yes, this works.

Of course, the consequence is that your support for the XML library isn't included, even though I have a perfectly appropriate XML library in /usr/lib.  But perhaps this is the fair consequence of having an inappropriate library lurking around (that said, it is a perfectly fine library, being i386 and all... just not 64-bit...)






^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 19:31           ` David Reitter
@ 2010-09-13 19:47             ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 2010-09-13 19:47 UTC (permalink / raw)
  To: emacs-devel

David Reitter <david.reitter@gmail.com> writes:

>> Does the following patch fix it for you?
>> 
>> +     LIBS="$LIBXML2_LIBS $LIBS"
>
> Yes, this works.

Ok; I'll commit it.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: build broken: libxml - i386 vs. X86_64 - configure problem
  2010-09-13 18:06   ` David Reitter
  2010-09-13 18:08     ` Lars Magne Ingebrigtsen
@ 2010-09-13 20:23     ` Andreas Schwab
  1 sibling, 0 replies; 11+ messages in thread
From: Andreas Schwab @ 2010-09-13 20:23 UTC (permalink / raw)
  To: David Reitter; +Cc: Lars Magne Ingebrigtsen, Chad Brown, Emacs-Devel devel

David Reitter <david.reitter@gmail.com> writes:

> Err, this is not the right way:
>
> ./configure --with-pkg-config-prog=/usr/lib/pkgconfig/

You want to pass PKG_CONFIG_PATH=/usr/lib/pkgconfig.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-09-13 20:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-13 14:30 build broken: libxml - i386 vs. X86_64 - configure problem David Reitter
2010-09-13 14:56 ` Lars Magne Ingebrigtsen
2010-09-13 17:51 ` Chad Brown
2010-09-13 18:06   ` David Reitter
2010-09-13 18:08     ` Lars Magne Ingebrigtsen
2010-09-13 18:34       ` David Reitter
2010-09-13 18:40         ` Lars Magne Ingebrigtsen
2010-09-13 18:48         ` Lars Magne Ingebrigtsen
2010-09-13 19:31           ` David Reitter
2010-09-13 19:47             ` Lars Magne Ingebrigtsen
2010-09-13 20:23     ` Andreas Schwab

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).