-
-
Notifications
You must be signed in to change notification settings - Fork 200
/
configure
executable file
·51 lines (44 loc) · 2.08 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
# Use xml2-config or pkg-config to get the include directories for libxml-2.0
if xml2-config --version >/dev/null 2>&1; then
libxml2_cflags=$(xml2-config --cflags)
libxml2_libs=$(xml2-config --libs)
elif pkg-config --version >/dev/null 2>&1; then
libxml2_cflags=$(pkg-config --cflags libxml-2.0)
libxml2_libs=$(pkg-config --libs --static libxml-2.0)
else
echo "Warning: libxml2 not found. Neither xml2-config nor pkg-config is available."
libxml_unavilable=true
fi
if [ -n "$libxml2_cflags" ]; then
PKG_CFLAGS="$PKG_CFLAGS $libxml2_cflags -DHAVE_LIBXML"
echo "libxml2 include directories: $libxml2_cflags"
else
echo "Warning: libxml2 include directory not found."
libxml_unavilable=true
fi
if [ -n "$libxml2_libs" ]; then
PKG_LIBS="$PKG_LIBS $libxml2_libs"
echo "libxml2 library link flags: $libxml2_libs"
else
echo "Warning: libxml2 library link flags not found."
libxml_unavilable=true
fi
if [ "$libxml_unavilable" = true ]; then
echo "GraphML import will not be available."
fi
OBJECTS='${SOURCES} ${MINIGMPSOURCES}'
if echo '#include <glpk.h>' | `"${R_HOME}/bin/R" CMD config CC` -E $CPPFLAGS - > /dev/null 2>&1; then
echo "Using installed GLPK"
PKG_LIBS="$PKG_LIBS -lglpk"
else
echo "Using vendored GLPK"
PKG_CFLAGS="$PKG_CFLAGS -Ivendor/cigraph/vendor/glpk -Ivendor/cigraph/vendor/glpk/env -Ivendor/cigraph/vendor/glpk/minisat -Ivendor/cigraph/vendor/glpk/misc -Ivendor/cigraph/vendor/glpk/draft -Ivendor/cigraph/vendor/glpk/npp -Ivendor/cigraph/vendor/glpk/api -Ivendor/cigraph/vendor/glpk/mpl -Ivendor/cigraph/vendor/glpk/bflib -Ivendor/cigraph/vendor/glpk/amd -Ivendor/cigraph/vendor/glpk/simplex -Ivendor/cigraph/vendor/glpk/colamd"
OBJECTS=${OBJECTS}' ${GLPKSOURCES}'
fi
echo "# Generated from Makevars.in, do not edit by hand" > src/Makevars.new
sed -e "s|@cflags@|$PKG_CFLAGS|" -e "s|@libs@|$PKG_LIBS|" -e "s|@objects@|${OBJECTS}|" 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