Skip to content

Commit

Permalink
fix: configure manage libxml multiple include paths (#1197)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviator-app[bot] authored Feb 8, 2024
2 parents 790375b + f751ddf commit 46ddc80
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions configure
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#!/bin/sh

# Use pkg-config or xml2-config to get the include directory for libxml-2.0
xml2_include_dir=""
# Use pkg-config or xml2-config to get the include directories for libxml-2.0
xml2_include_paths=""
if which xml2-config >/dev/null 2>&1; then
xml2_include_dir=$(xml2-config --cflags | sed 's/^-I//')
xml2_include_paths=$(xml2-config --cflags)
elif which pkg-config >/dev/null 2>&1; then
xml2_include_dir=$(pkg-config --cflags libxml-2.0 | sed 's/^-I//')
xml2_include_paths=$(pkg-config --cflags libxml-2.0)
else
echo "Error: Neither xml2-config nor pkg-config is available"
exit 1
fi

if [ -n "$xml2_include_dir" ]; then
PKG_CFLAGS="-I\"$xml2_include_dir\""
echo "libxml2 include directory: $xml2_include_dir"
if [ -n "$xml2_include_paths" ]; then
PKG_CFLAGS="$xml2_include_paths"
echo "libxml2 include directories: $xml2_include_paths"
else
echo "Error: libxml2 include directory not found"
exit 1
Expand Down

0 comments on commit 46ddc80

Please sign in to comment.