Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build improvements #203

Merged
merged 2 commits into from
Aug 14, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/init.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,9 +51,16 @@ init (Handle<Object> target) {
} }
target->Set(String::New("jpegVersion"), String::New(jpeg_version)); target->Set(String::New("jpegVersion"), String::New(jpeg_version));
#endif #endif

#ifdef HAVE_GIF #ifdef HAVE_GIF
#ifndef GIF_LIB_VERSION
char gif_version[10];
snprintf(gif_version, 10, "%d.%d.%d", GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE);
target->Set(String::New("gifVersion"), String::New(gif_version));
#else
target->Set(String::New("gifVersion"), String::New(GIF_LIB_VERSION)); target->Set(String::New("gifVersion"), String::New(GIF_LIB_VERSION));
#endif #endif
#endif
} }


NODE_MODULE(canvas,init); NODE_MODULE(canvas,init);
6 changes: 3 additions & 3 deletions util/has_lib.sh
Original file line number Original file line Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
has_lib() { has_lib() {
local regex="lib$1.+(so|dylib)(?!\.)" local regex="lib$1.+(so|dylib)$"


# Try using ldconfig on linux systems # Try using ldconfig on linux systems
for LINE in `which ldconfig > /dev/null && ldconfig -p 2>/dev/null | grep -P $regex`; do for LINE in `which ldconfig > /dev/null && ldconfig -p 2>/dev/null | grep -E $regex`; do
return 0 return 0
done done


# Try just checking common library locations # 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 -P $regex && return 0 test -d $dir && ls $dir | grep -E $regex && return 0
done done


return 1 return 1
Expand Down