@@ -11,53 +11,35 @@ AC_C_CONST
11
11
AC_C_INLINE
12
12
13
13
build_gifview=maybe
14
- AC_ARG_ENABLE ( gifview ,
15
- [ --disable-gifview do not build gifview, a GIF viewer for X11] ,
16
- if test "x$enableval" != xyes ; then
17
- build_gifview=no
18
- fi )
14
+ AC_ARG_ENABLE ( [ gifview] ,
15
+ [ AS_HELP_STRING ( [ --disable-gifview] , [ do not build gifview X11 viewer] ) ] ,
16
+ [ if test "x$enableval" != xyes; then build_gifview=no; fi] )
19
17
20
18
build_gifdiff=yes
21
- AC_ARG_ENABLE ( gifdiff ,
22
- [ --disable-gifdiff do not build gifdiff, a utility for comparing GIFs] ,
23
- if test "x$enableval" != xyes ; then
24
- build_gifdiff=no
25
- fi )
19
+ AC_ARG_ENABLE ( [ gifdiff] ,
20
+ [ AS_HELP_STRING ( [ --disable-gifdiff] , [ do not build gifdiff comparison utility] ) ] ,
21
+ [ if test "x$enableval" != xyes; then build_gifdiff=no; fi] )
26
22
27
- use_dmalloc=
28
- AC_ARG_ENABLE ( dmalloc ,
29
- [ --enable-dmalloc build with debugging malloc library] ,
30
- if test "x$enableval" = xyes ; then
31
- use_dmalloc=yes
32
- fi )
33
-
34
- AC_ARG_ENABLE ( warnings ,
35
- [ --enable-warnings compile with -W -Wall] ,
36
- if test "x$enableval" = xyes ; then
37
- CC="$CC - W - Wall"
38
- fi )
23
+ AC_ARG_ENABLE ( [ warnings] ,
24
+ [ AS_HELP_STRING ( [ --enable-warnings] , [ compile with -W -Wall] ) ] ,
25
+ [ if test "x$enableval" = xyes; then CC="$CC -W -Wall"; fi] )
39
26
27
+ WERROR=
40
28
AC_ARG_ENABLE ( [ werror] ,
41
- [ --enable-werror compile with -Werror] ,
42
- if test "x$enableval" = xyes ; then
43
- WERROR="-Werror"
44
- fi )
29
+ [ AS_HELP_STRING ( [ --enable-werror] , [ compile with -Werror] ) ] ,
30
+ [ if test "x$enableval" = xyes; then WERROR="-Werror"; fi] )
45
31
AC_SUBST ( [ WERROR] )
46
32
47
- AC_ARG_ENABLE ( all ,
48
- [ --enable-all --enable-gifview --enable-gifdiff --enable-warnings] ,
49
- if test "x$enableval" = xyes ; then
50
- build_gifview=yes
51
- build_gifdiff=yes
52
- CC="$CC - W - Wall"
53
- fi )
33
+ use_dmalloc=
34
+ AC_ARG_ENABLE ( [ dmalloc] ,
35
+ [ AS_HELP_STRING ( [ --enable-dmalloc] , [ build with debugging malloc library] ) ] ,
36
+ [ if test "x$enableval" = xyes; then use_dmalloc=yes; fi] )
54
37
55
38
ungif=
56
- AC_ARG_ENABLE ( ungif ,
57
- [ --enable-ungif build without compression] ,
58
- if test "x$enableval" = xyes ; then
59
- ungif=yes
60
- fi )
39
+ AC_ARG_ENABLE ( [ ungif] ,
40
+ [ AS_HELP_STRING ( [ --enable-ungif] , [ build without LZW compression] ) ] ,
41
+ [ if test "x$enableval" = xyes; then ungif=yes; fi] )
42
+
61
43
62
44
dnl
63
45
dnl Choose programs to build. Always build gifsicle
@@ -69,50 +51,52 @@ OTHERMANS=""
69
51
if test "x$build_gifview" = xyes -o "x$build_gifview" = xmaybe; then
70
52
AC_PATH_XTRA
71
53
if test "x$no_x" = xyes; then
72
- if test "x$build_gifview" = xyes; then
73
- AC_MSG_ERROR ( [
54
+ if test "x$build_gifview" = xyes; then
55
+ AC_MSG_ERROR ( [
74
56
******************************************************************************
75
57
Cannot find X, but you explicitly requested that gifview be built.
76
58
You may need to install an X11 development package to get the X headers,
77
59
supply a '--with-x' option, or simply '--disable-gifview'.] )
78
- else
79
- AC_MSG_WARN ( [ Not compiling gifview since X is not available.] )
80
- build_gifview=no
81
- fi
60
+ else
61
+ AC_MSG_WARN ( [ Not compiling gifview since X is not available.] )
62
+ build_gifview=no
63
+ fi
82
64
else
83
- build_gifview=yes
65
+ build_gifview=yes
84
66
fi
85
67
fi
86
68
87
69
if test "x$build_gifview" = xyes ; then
88
- OTHERPROGRAMS="$OTHERPROGRAMS gifview"'$(EXEEXT)'
89
- OTHERMANS="$OTHERMANS gifview.1"
90
- AC_CACHE_CHECK ( for gettimeofday prototype , ac_cv_gettimeofday ,
91
- [ AC_TRY_COMPILE ( [ #include <time.h>
92
- #include <sys/time.h>] ,
93
- [ gettimeofday((void *)0, (void *)0);] ,
94
- [ AC_TRY_COMPILE ( [ #include <time.h>
95
- #include <sys/time.h>] ,
96
- [ gettimeofday((void *)0);] ,
97
- ac_cv_gettimeofday=0 ,
98
- ac_cv_gettimeofday=2 ) ] ,
99
- ac_cv_gettimeofday=1 ) ] )
100
- AC_DEFINE_UNQUOTED ( GETTIMEOFDAY_PROTO , $ac_cv_gettimeofday , [ Define to the number of arguments to gettimeofday (gifview only).] )
70
+ OTHERPROGRAMS="$OTHERPROGRAMS gifview"'$(EXEEXT)'
71
+ OTHERMANS="$OTHERMANS gifview.1"
72
+ AC_CHECK_HEADERS ( [ time.h sys/time.h] )
73
+ AC_CACHE_CHECK ( [ for gettimeofday prototype] , [ ac_cv_gettimeofday] ,
74
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
75
+ [ [ #include <time.h>
76
+ #include <sys/time.h>] ] ,
77
+ [ [ gettimeofday((void*) 0, (void*) 0)] ] ) ] ,
78
+ [ ac_cv_gettimeofday=2] ,
79
+ [ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
80
+ [ [ #include <time.h>
81
+ #include <sys/time.h>] ] ,
82
+ [ [ gettimeofday((void*) 0)] ] ) ] ,
83
+ [ ac_cv_gettimeofday=1] , [ ac_cv_gettimeofday=0] ) ] ) ] )
84
+ AC_DEFINE_UNQUOTED ( [ GETTIMEOFDAY_PROTO] , [ $ac_cv_gettimeofday] , [ Define to the number of arguments to gettimeofday.] )
101
85
else
102
- AC_DEFINE_UNQUOTED ( X_DISPLAY_MISSING , 1 , [ Define if X is not available.] )
86
+ AC_DEFINE_UNQUOTED ( X_DISPLAY_MISSING , 1 , [ Define if X is not available.] )
103
87
fi
104
88
105
89
if test "x$build_gifdiff" = xyes ; then
106
- OTHERPROGRAMS="$OTHERPROGRAMS gifdiff"'$(EXEEXT)'
107
- OTHERMANS="$OTHERMANS gifdiff.1"
90
+ OTHERPROGRAMS="$OTHERPROGRAMS gifdiff"'$(EXEEXT)'
91
+ OTHERMANS="$OTHERMANS gifdiff.1"
108
92
fi
109
93
110
- AC_SUBST ( OTHERPROGRAMS ) dnl
111
- AC_SUBST ( OTHERMANS ) dnl
94
+ AC_SUBST ( OTHERPROGRAMS )
95
+ AC_SUBST ( OTHERMANS )
112
96
113
97
114
98
dnl
115
- dnl Set up ` ungif' support
99
+ dnl Set up ungif support
116
100
dnl
117
101
118
102
if test "x$ungif" = xyes -o "x$GIFSICLE_UNGIF" = xyes ; then
@@ -138,7 +122,7 @@ AC_REPLACE_FUNCS([strerror])
138
122
AC_CHECK_FUNCS ( [ strtoul mkstemp] )
139
123
AC_SEARCH_LIBS ( [ pow] , [ m] , [ AC_DEFINE ( [ HAVE_POW] , [ 1] , [ Define to 1 if you have the `pow' function.] ) ] )
140
124
141
- AC_CHECK_HEADERS ( [ sys/select.h inttypes.h unistd.h] )
125
+ AC_CHECK_HEADERS ( [ sys/select.h sys/stat.h inttypes.h unistd.h] )
142
126
143
127
144
128
dnl
@@ -166,7 +150,7 @@ elif test "$ac_cv_u_int_t" = yes; then
166
150
AC_DEFINE ( [ HAVE_U_INT_TYPES] , [ 1] , [ Define if you have u_intXX_t types but not uintXX_t types.] )
167
151
fi
168
152
169
- AC_CHECK_TYPES ( [ uintptr_t, int64_t] , [ ] , [ ] ,
153
+ AC_CHECK_TYPES ( [ uintptr_t, int64_t, uint64_t ] , [ ] , [ ] ,
170
154
[ #if HAVE_INTTYPES_H
171
155
# include <inttypes.h>
172
156
#endif
@@ -175,11 +159,88 @@ AC_CHECK_TYPES([uintptr_t, int64_t], [], [],
175
159
#endif
176
160
] )
177
161
162
+ AC_CHECK_SIZEOF ( [ float] )
178
163
AC_CHECK_SIZEOF ( [ unsigned int] )
179
164
AC_CHECK_SIZEOF ( [ unsigned long] )
180
165
AC_CHECK_SIZEOF ( [ void *] )
181
166
182
167
168
+ dnl
169
+ dnl vector types
170
+ dnl
171
+
172
+ AC_MSG_CHECKING ( [ for usable vector_size vector types] )
173
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
174
+ [ AC_INCLUDES_DEFAULT
175
+ [ typedef float float4 __attribute__((vector_size (4 * sizeof(float))));] ] ,
176
+ [ [ float4 a;
177
+ a[ 0] = a[ 1] = a[ 2] = a[ 3] = (float) rand();
178
+ a *= (float) 3;
179
+ printf("%f\n", a[ 0] );] ] ) ] ,
180
+ [ AC_DEFINE ( [ HAVE_VECTOR_SIZE_VECTOR_TYPES] , 1 , [ Define to 1 if `vector_size' vector types are usable.] )
181
+ ac_cv_vector_size_vector_types=yes] , [ ac_cv_vector_size_vector_types=no] )
182
+ AC_MSG_RESULT ( [ $ac_cv_vector_size_vector_types] )
183
+
184
+ AC_MSG_CHECKING ( [ for usable ext_vector_type vector types] )
185
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
186
+ [ AC_INCLUDES_DEFAULT
187
+ [ typedef float float4 __attribute__((ext_vector_type (4)));] ] ,
188
+ [ [ float4 a;
189
+ a[ 0] = a[ 1] = a[ 2] = a[ 3] = (float) rand();
190
+ a *= (float) 3;
191
+ printf("%f\n", a[ 0] );] ] ) ] ,
192
+ [ AC_DEFINE ( [ HAVE_EXT_VECTOR_TYPE_VECTOR_TYPES] , 1 , [ Define to 1 if `ext_vector_type' vector types are usable.] )
193
+ ac_cv_ext_vector_type_vector_types=yes] , [ ac_cv_ext_vector_type_vector_types=no] )
194
+ AC_MSG_RESULT ( [ $ac_cv_ext_vector_type_vector_types] )
195
+
196
+ AC_ARG_ENABLE ( [ simd] ,
197
+ [ AS_HELP_STRING ( [ --disable-simd] , [ do not use SIMD instructions] ) ] ,
198
+ [ ] , [ enable_simd=maybe] )
199
+
200
+ if test $ac_cv_vector_size_vector_types = no -a $ac_cv_ext_vector_type_vector_types = no; then
201
+ if test x$enable_simd = xmaybe; then
202
+ AC_MSG_WARN ( [
203
+ Not using SIMD since your compiler's support for SIMD types is inadequate.
204
+ ] )
205
+ elif test x$enable_simd != xno; then
206
+ AC_MSG_ERROR ( [
207
+ ******************************************************************************
208
+ `--enable-simd' was supplied, but this compiler does not support SIMD types.] )
209
+ fi
210
+ enable_simd=no
211
+ fi
212
+ if test x"$enable_simd" != xno; then
213
+ AC_DEFINE ( [ HAVE_SIMD] , [ 1] , [ Define to 1 if SIMD types should be used.] )
214
+ fi
215
+
216
+
217
+ dnl
218
+ dnl threads
219
+ dnl
220
+
221
+ AC_SEARCH_LIBS ( [ pthread_create] , [ pthread] , [ have_threads=yes] , [ have_threads=no] )
222
+ AC_MSG_CHECKING ( [ for __sync_add_and_fetch] )
223
+ AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM (
224
+ [ AC_INCLUDES_DEFAULT
225
+ extern volatile int x;] ,
226
+ [ [ printf("%d", __sync_add_and_fetch(&x, 1));] ] ) ] ,
227
+ [ AC_DEFINE ( [ HAVE___SYNC_ADD_AND_FETCH] , 1 , [ Define to 1 if you have the `__sync_add_and_fetch' function.] )
228
+ result=yes] , [ result=no] )
229
+ AC_MSG_RESULT ( [ $result] )
230
+
231
+ AC_ARG_ENABLE ( [ threads] ,
232
+ [ AS_HELP_STRING ( [ --disable-threads] , [ do not include multithreading] ) ] ,
233
+ [ ] , [ enable_threads=maybe] )
234
+
235
+ if test "x$have_threads" = xno -a "x$enable_threads" = xyes; then
236
+ AC_MSG_ERROR ( [
237
+ ******************************************************************************
238
+ Threading support is not available on this platform.] )
239
+ elif test "x$have_threads" = xyes -a "x$enable_threads" != xno; then
240
+ AC_DEFINE ( [ ENABLE_THREADS] , [ 1] , [ Define to 1 if multithreading support is available.] )
241
+ fi
242
+
243
+
183
244
dnl
184
245
dnl verbatim portions of the header
185
246
dnl
0 commit comments