diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-02-19 23:31:55 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-02-19 23:33:10 -0800 |
commit | 3f4339b61b3737f6efdd55368488f0a5888e4935 (patch) | |
tree | 7291783e349ad350707bcc167c5631b82c0e8fe8 | |
parent | e6d2a8471b89d1c1d9fd84d14f26f516f5f66238 (diff) | |
download | zlib-3f4339b61b3737f6efdd55368488f0a5888e4935.tar.gz zlib-3f4339b61b3737f6efdd55368488f0a5888e4935.tar.bz2 zlib-3f4339b61b3737f6efdd55368488f0a5888e4935.zip |
Improve the detection of no hidden visibility attribute.
-rwxr-xr-x | configure | 16 | ||||
-rw-r--r-- | gzguts.h | 3 | ||||
-rw-r--r-- | zutil.h | 3 |
3 files changed, 16 insertions, 6 deletions
@@ -136,6 +136,18 @@ else | |||
136 | } | 136 | } |
137 | fi | 137 | fi |
138 | 138 | ||
139 | tryboth() | ||
140 | { | ||
141 | show $* | ||
142 | got=`( $* ) 2>&1` | ||
143 | ret=$? | ||
144 | printf %s "$got" >> configure.log | ||
145 | if test $ret -ne 0; then | ||
146 | return $ret | ||
147 | fi | ||
148 | test "$got" = "" | ||
149 | } | ||
150 | |||
139 | echo >> configure.log | 151 | echo >> configure.log |
140 | 152 | ||
141 | cat > $test.c <<EOF | 153 | cat > $test.c <<EOF |
@@ -626,7 +638,7 @@ fi | |||
626 | if test "$gcc" -eq 1; then | 638 | if test "$gcc" -eq 1; then |
627 | echo >> configure.log | 639 | echo >> configure.log |
628 | cat > $test.c <<EOF | 640 | cat > $test.c <<EOF |
629 | #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) | 641 | #if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0 >= 303) |
630 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | 642 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) |
631 | #else | 643 | #else |
632 | # define ZLIB_INTERNAL | 644 | # define ZLIB_INTERNAL |
@@ -637,7 +649,7 @@ int main() | |||
637 | return 0; | 649 | return 0; |
638 | } | 650 | } |
639 | EOF | 651 | EOF |
640 | if try $CC -c $CFLAGS $test.c; then | 652 | if tryboth $CC -c $CFLAGS $test.c; then |
641 | echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log | 653 | echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log |
642 | else | 654 | else |
643 | CFLAGS="$CFLAGS -DNO_VIZ" | 655 | CFLAGS="$CFLAGS -DNO_VIZ" |
@@ -12,8 +12,7 @@ | |||
12 | # endif | 12 | # endif |
13 | #endif | 13 | #endif |
14 | 14 | ||
15 | #define GCC_VER ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) | 15 | #if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) >= 303 && !defined(NO_VIZ) |
16 | #if ((GCC_VER >= 303 && !defined(__APPLE__)) || GCC_VER >= 400) && !defined(NO_VIZ) | ||
17 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | 16 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) |
18 | #else | 17 | #else |
19 | # define ZLIB_INTERNAL | 18 | # define ZLIB_INTERNAL |
@@ -13,8 +13,7 @@ | |||
13 | #ifndef ZUTIL_H | 13 | #ifndef ZUTIL_H |
14 | #define ZUTIL_H | 14 | #define ZUTIL_H |
15 | 15 | ||
16 | #define GCC_VER ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) | 16 | #if ((__GNUC__-0) * 100 + __GNUC_MINOR__-0) >= 303 && !defined(NO_VIZ) |
17 | #if ((GCC_VER >= 303 && !defined(__APPLE__)) || GCC_VER >= 400) && !defined(NO_VIZ) | ||
18 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | 17 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) |
19 | #else | 18 | #else |
20 | # define ZLIB_INTERNAL | 19 | # define ZLIB_INTERNAL |