forked from igraph/rigraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·27 lines (24 loc) · 932 Bytes
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# Use pkg-config or xml2-config to get the include directory for libxml-2.0
xml2_include_dir=""
if which xml2-config >/dev/null 2>&1; then
xml2_include_dir=$(xml2-config --cflags | sed 's/^-I//')
elif which pkg-config >/dev/null 2>&1; then
xml2_include_dir=$(pkg-config --cflags libxml-2.0 | sed 's/^-I//')
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"
else
echo "Error: libxml2 include directory not found"
exit 1
fi
echo "# Generated from Makevars.in, do not edit by hand" > src/Makevars.new
sed -e "s|@cflags@|$PKG_CFLAGS|" src/Makevars.in >> src/Makevars.new
if [ ! -f src/Makevars ] || (which diff > /dev/null && ! diff -q src/Makevars src/Makevars.new); then
cp -f src/Makevars.new src/Makevars
fi
rm -f src/Makevars.new