Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#9442 closed Bug Report (fixed)

configure libxml2 with pkg-config

Reported by: Lawrence Rust <lvr@…> Owned by: robertm
Priority: minor Milestone: 0.25
Component: MythTV - configure script Version: Master Head
Severity: medium Keywords: libxml2 windows configure
Cc: Ticket locked: no

Description

commit f6a46a055568da1bdf789464a428b7384524b561 added a configure time check for libxml2 (used by libmythbluray) which is enabled by default and has a hardcoded default include path. This requires cross compiling systems (Linux->Windows) without target libxml2 to be aware of the configure script version and disable libxml2. A more elegant solution would be to use pkg-config:

if [ enabled libxml2 ]; then
  if [ pkg-config --exists libxml-2.0 ]; then
    libxml2_path_default=`pkg-config --cflags libxml-2.0`
  else
    disable libxml2
  fi
fi

Attachments (1)

configure.diff (1.0 KB) - added by Lawrence Rust <lvr@…> 13 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by robertm

Owner: changed from Janne Grunau to robertm
Status: newassigned

Lawrence,

Thanks. Please attach as a patch/diff and I'll take care of it.

Changed 13 years ago by Lawrence Rust <lvr@…>

Attachment: configure.diff added

comment:2 Changed 13 years ago by Lawrence Rust <lvr@…>

Patch attached.

Also included is a small patch to detect Intel i3 & i5 CPUs and select core2 optimisation when --cpu=host is specified.

comment:3 Changed 13 years ago by robertm

Hi Lawrence,

Go ahead and open a separate ticket for the unrelated processor patch, please, as Janne will need to okay that one.

Thanks.

comment:4 Changed 13 years ago by Lawrence Rust <lvr@…>

OK, but an afterthought.

---    if pkg-config --exists libxml-2.0 ; then
+++    if which pkg-config >/dev/null 2>&1 && pkg-config --exists libxml-2.0 ; then

comment:5 Changed 13 years ago by Lawrence Rust <lvr@…>

Just found a minor problem. The output of pkg-config has a trailing space which is passed onto gcc as an include path and so gcc fails to find the xml headers. Need to massage the output to remove the trailing space:

+ libxml2_path=pkg-config --cflags-only-I libxml-2.0|sed -n "s/-I\([^ ]*\) *$/\1/p"

comment:6 Changed 13 years ago by robertm

Milestone: unknown0.25
Resolution: Fixed
Status: assignedclosed

Fixed in 52c9e68.

comment:7 Changed 13 years ago by Robert McNamara

Resolution: Fixedfixed

Update configure script to use pkg-config to check for libxml2.

Patch from Lawrence Rust, I opted not to use a later amendment that had some syntax errors (and we presume that pkg-config is there and working elsewhere in configure anyway).

Fixes #9442.

Changeset: 52c9e684583f4b2cd15693572e48e37d3c70887a

Note: See TracTickets for help on using tickets.