Permalink
Browse files

Tidy up build files and util script.

  • Loading branch information...
1 parent 50ab677 commit 8e9defcb79ac776a6846d1f3c429309414efae0f @c-spencer c-spencer committed Aug 9, 2012
Showing with 3 additions and 99 deletions.
  1. +3 −3 binding.gyp
  2. +0 −94 configure
  3. +0 −2 src/CanvasRenderingContext2d.cc
  4. 0 { → util}/has_lib.sh
View
@@ -9,9 +9,9 @@
}
}, { # 'OS!="win"'
'variables': {
- 'with_jpeg%': '<!(./has_lib.sh jpeg)',
- 'with_gif%': '<!(./has_lib.sh gif)',
- 'with_pango%': '<!(./has_lib.sh pangocairo)'
+ 'with_jpeg%': '<!(./util/has_lib.sh jpeg)',
+ 'with_gif%': '<!(./util/has_lib.sh gif)',
+ 'with_pango%': '<!(./util/has_lib.sh pangocairo)'
}
}]
],
View
@@ -1,94 +0,0 @@
-#!/usr/bin/env bash
-
-#
-# Build flags
-#
-
-cppflags=
-
-#
-# Check for <lib>
-#
-
-has_lib() {
- 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
- test -d $dir && ls $dir | grep $lib && return 0
- done
-
- return 1
-}
-
-#
-# Check for <lib> and append to cppflags
-#
-
-has() {
- local lib=$1
- check $lib
- has_lib $lib > /dev/null
- if test $? -eq 0; then
- found $lib
- cppflags="$cppflags --with-$lib"
- else
- missing $lib
- fi
-}
-
-#
-# Check pkg-config for <lib>
-#
-
-has_pkg_config() {
- local lib=$1
- check $lib
- pkg-config --libs $1 > /dev/null 2> /dev/null
- if test $? -eq 0; then
- found $lib
- else
- missing $lib
- exit 1
- fi
-}
-
-#
-# Output check
-#
-
-check() {
- printf " \e[90mcheck %s\e[m" $1
-}
-
-#
-# Output found
-#
-
-found() {
- printf "\r \e[32m✔ found \e[90m%s\e[m\n" $1
-}
-
-#
-# Output missing
-#
-
-missing() {
- printf "\r \e[31m✖ cannot find \e[90m%s\e[m\n" $1
-}
-
-# DO IT
-
-echo
-has gif
-has jpeg
-has_pkg_config cairo
-has_pkg_config pangocairo
-echo
-
-# TODO: output flags and get npm "install" script working
@@ -54,7 +54,6 @@ enum {
void state_assign_fontFamily(canvas_state_t *state, const char *str) {
free(state->fontFamily);
state->fontFamily = strndup(str, 100);
- strcpy(state->fontFamily, str);
}
#endif
@@ -204,7 +203,6 @@ Context2d::saveState() {
memcpy(states[stateno], state, sizeof(canvas_state_t));
#if HAVE_PANGO
states[stateno]->fontFamily = strndup(state->fontFamily, 100);
- strcpy(states[stateno]->fontFamily, state->fontFamily);
#endif
state = states[stateno];
}
File renamed without changes.

0 comments on commit 8e9defc

Please sign in to comment.