Browse Source

Add pango build support and improve configure library detection.

v1.x
c-spencer 13 years ago
parent
commit
2140de6b24
  1. 14
      binding.gyp
  2. 11
      configure

14
binding.gyp

@ -2,7 +2,8 @@
'variables': { 'variables': {
'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle
'with_jpeg%': 'false', 'with_jpeg%': 'false',
'with_gif%': 'false' 'with_gif%': 'false',
'with_pango%': 'false'
}, },
'targets': [ 'targets': [
{ {
@ -34,7 +35,18 @@
'libraries': [ 'libraries': [
'-lpixman-1', '-lpixman-1',
'-lcairo' '-lcairo'
]
}],
['with_pango=="true"', {
'defines': [
'HAVE_PANGO'
], ],
'include_dirs': [ # tried to pass through cflags but failed
'<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)'
],
'libraries': [
'<!@(pkg-config pangocairo --libs)'
]
}], }],
['with_jpeg=="true"', { ['with_jpeg=="true"', {
'defines': [ 'defines': [

11
configure

@ -12,9 +12,17 @@ cppflags=
has_lib() { has_lib() {
local lib=$1 local lib=$1
# Try using ldconfig on linux systems
for LINE in `which ldconfig > /dev/null && ldconfig -p 2>/dev/null | grep lib$lib`; do
return 0
done
# Try just checking common library locations
for dir in /lib /usr/lib /usr/local/lib /opt/local/lib; do for dir in /lib /usr/lib /usr/local/lib /opt/local/lib; do
test -d $dir && ls $dir | grep $lib && return 0 test -d $dir && ls $dir | grep $lib && return 0
done done
return 1 return 1
} }
@ -41,7 +49,7 @@ has() {
has_pkg_config() { has_pkg_config() {
local lib=$1 local lib=$1
check $lib check $lib
pkg-config --libs cairo > /dev/null pkg-config --libs $1 > /dev/null 2> /dev/null
if test $? -eq 0; then if test $? -eq 0; then
found $lib found $lib
else else
@ -80,6 +88,7 @@ echo
has gif has gif
has jpeg has jpeg
has_pkg_config cairo has_pkg_config cairo
has_pkg_config pangocairo
echo echo
# TODO: output flags and get npm "install" script working # TODO: output flags and get npm "install" script working

Loading…
Cancel
Save