Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Build improvements #203

Merged
merged 2 commits into from

2 participants

@lpinca

Fix incompatible grep usage that was breaking building on OS X.
Check whether GIF_LIB_VERSION is defined, otherwise use the new macros.

lpinca added some commits
@lpinca lpinca Fix auto-detection of optional libraries for OS X
The OS X version of grep doesn't support -P (--perl-regexp). It was breaking the building.
Solved by slightly changing the RegExp and using -E (--extended-regexp).
19bcf35
@lpinca lpinca Fix cases where GIF_LIB_VERSION is not defined
Versions up to 4.1.6 of GIFLIB defined a GIF_LIB_VERSION macro that was string-valued.
Versions after 4.1.6 define integer-valued GIFLIB_MAJOR, GIFLIB_MINOR, and GIFLIB_RELEASE macros for the three components of the version.

Check for GIF_LIB_VERSION, otherwise use the new macros.
25234db
@tj tj merged commit c546847 into Automattic:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 14, 2012
  1. @lpinca

    Fix auto-detection of optional libraries for OS X

    lpinca authored
    The OS X version of grep doesn't support -P (--perl-regexp). It was breaking the building.
    Solved by slightly changing the RegExp and using -E (--extended-regexp).
  2. @lpinca

    Fix cases where GIF_LIB_VERSION is not defined

    lpinca authored
    Versions up to 4.1.6 of GIFLIB defined a GIF_LIB_VERSION macro that was string-valued.
    Versions after 4.1.6 define integer-valued GIFLIB_MAJOR, GIFLIB_MINOR, and GIFLIB_RELEASE macros for the three components of the version.
    
    Check for GIF_LIB_VERSION, otherwise use the new macros.
This page is out of date. Refresh to see the latest.
Showing with 10 additions and 3 deletions.
  1. +7 −0 src/init.cc
  2. +3 −3 util/has_lib.sh
View
7 src/init.cc
@@ -51,9 +51,16 @@ init (Handle<Object> target) {
}
target->Set(String::New("jpegVersion"), String::New(jpeg_version));
#endif
+
#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));
#endif
+#endif
}
NODE_MODULE(canvas,init);
View
6 util/has_lib.sh
@@ -1,15 +1,15 @@
#!/usr/bin/env bash
has_lib() {
- local regex="lib$1.+(so|dylib)(?!\.)"
+ local regex="lib$1.+(so|dylib)$"
# 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
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 -P $regex && return 0
+ test -d $dir && ls $dir | grep -E $regex && return 0
done
return 1
Something went wrong with that request. Please try again.