diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac | 712 |
1 files changed, 356 insertions, 356 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac index c3c3d81..12293b0 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac +++ b/libraries/irrlicht-1.8/source/Irrlicht/jpeglib/configure.ac | |||
@@ -1,356 +1,356 @@ | |||
1 | # IJG auto-configuration source file. | 1 | # IJG auto-configuration source file. |
2 | # Process this file with autoconf to produce a configure script. | 2 | # Process this file with autoconf to produce a configure script. |
3 | 3 | ||
4 | # | 4 | # |
5 | # Configure script for IJG libjpeg | 5 | # Configure script for IJG libjpeg |
6 | # | 6 | # |
7 | 7 | ||
8 | AC_INIT([libjpeg], [8.4.0]) | 8 | AC_INIT([libjpeg], [8.4.0]) |
9 | 9 | ||
10 | # Directory where autotools helper scripts lives. | 10 | # Directory where autotools helper scripts lives. |
11 | AC_CONFIG_AUX_DIR([.]) | 11 | AC_CONFIG_AUX_DIR([.]) |
12 | 12 | ||
13 | # Generate configuration headers. | 13 | # Generate configuration headers. |
14 | AC_CONFIG_HEADERS([jconfig.h:jconfig.cfg]) | 14 | AC_CONFIG_HEADERS([jconfig.h:jconfig.cfg]) |
15 | 15 | ||
16 | # Hack: disable autoheader so that it doesn't overwrite our cfg template. | 16 | # Hack: disable autoheader so that it doesn't overwrite our cfg template. |
17 | AUTOHEADER="echo autoheader ignored" | 17 | AUTOHEADER="echo autoheader ignored" |
18 | 18 | ||
19 | # Check system type | 19 | # Check system type |
20 | AC_CANONICAL_TARGET | 20 | AC_CANONICAL_TARGET |
21 | 21 | ||
22 | # Initialize Automake | 22 | # Initialize Automake |
23 | # Don't require all the GNU mandated files | 23 | # Don't require all the GNU mandated files |
24 | AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete ansi2knr no-dist foreign]) | 24 | AM_INIT_AUTOMAKE([-Wall -Werror -Wno-obsolete ansi2knr no-dist foreign]) |
25 | 25 | ||
26 | # Make --enable-silent-rules the default. | 26 | # Make --enable-silent-rules the default. |
27 | # To get verbose build output you may configure | 27 | # To get verbose build output you may configure |
28 | # with --disable-silent-rules or use "make V=1". | 28 | # with --disable-silent-rules or use "make V=1". |
29 | AM_SILENT_RULES([yes]) | 29 | AM_SILENT_RULES([yes]) |
30 | 30 | ||
31 | # This is required when using the de-ANSI-fication feature. | 31 | # This is required when using the de-ANSI-fication feature. |
32 | AM_C_PROTOTYPES | 32 | AM_C_PROTOTYPES |
33 | 33 | ||
34 | # Add configure option --enable-maintainer-mode which enables | 34 | # Add configure option --enable-maintainer-mode which enables |
35 | # dependency checking and generation useful to package maintainers. | 35 | # dependency checking and generation useful to package maintainers. |
36 | # This is made an option to avoid confusing end users. | 36 | # This is made an option to avoid confusing end users. |
37 | AM_MAINTAINER_MODE | 37 | AM_MAINTAINER_MODE |
38 | 38 | ||
39 | # Check for programs | 39 | # Check for programs |
40 | AC_PROG_CC | 40 | AC_PROG_CC |
41 | AC_PROG_CC_STDC | 41 | AC_PROG_CC_STDC |
42 | AC_PROG_CPP | 42 | AC_PROG_CPP |
43 | AC_PROG_INSTALL | 43 | AC_PROG_INSTALL |
44 | AC_PROG_MAKE_SET | 44 | AC_PROG_MAKE_SET |
45 | AC_PROG_LN_S | 45 | AC_PROG_LN_S |
46 | 46 | ||
47 | # Check if LD supports linker scripts, | 47 | # Check if LD supports linker scripts, |
48 | # and define automake conditional HAVE_LD_VERSION_SCRIPT if so. | 48 | # and define automake conditional HAVE_LD_VERSION_SCRIPT if so. |
49 | AC_ARG_ENABLE([ld-version-script], | 49 | AC_ARG_ENABLE([ld-version-script], |
50 | AS_HELP_STRING([--enable-ld-version-script], | 50 | AS_HELP_STRING([--enable-ld-version-script], |
51 | [enable linker version script (default is enabled when possible)]), | 51 | [enable linker version script (default is enabled when possible)]), |
52 | [have_ld_version_script=$enableval], []) | 52 | [have_ld_version_script=$enableval], []) |
53 | if test -z "$have_ld_version_script"; then | 53 | if test -z "$have_ld_version_script"; then |
54 | AC_MSG_CHECKING([if LD -Wl,--version-script works]) | 54 | AC_MSG_CHECKING([if LD -Wl,--version-script works]) |
55 | save_LDFLAGS="$LDFLAGS" | 55 | save_LDFLAGS="$LDFLAGS" |
56 | LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" | 56 | LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" |
57 | cat > conftest.map <<EOF | 57 | cat > conftest.map <<EOF |
58 | VERS_1 { | 58 | VERS_1 { |
59 | global: sym; | 59 | global: sym; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | VERS_2 { | 62 | VERS_2 { |
63 | global: sym; | 63 | global: sym; |
64 | } VERS_1; | 64 | } VERS_1; |
65 | EOF | 65 | EOF |
66 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], | 66 | AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], |
67 | [have_ld_version_script=yes], [have_ld_version_script=no]) | 67 | [have_ld_version_script=yes], [have_ld_version_script=no]) |
68 | rm -f conftest.map | 68 | rm -f conftest.map |
69 | LDFLAGS="$save_LDFLAGS" | 69 | LDFLAGS="$save_LDFLAGS" |
70 | AC_MSG_RESULT($have_ld_version_script) | 70 | AC_MSG_RESULT($have_ld_version_script) |
71 | fi | 71 | fi |
72 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") | 72 | AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$have_ld_version_script" = "yes") |
73 | 73 | ||
74 | # See if compiler supports prototypes. | 74 | # See if compiler supports prototypes. |
75 | AC_MSG_CHECKING([for function prototypes]) | 75 | AC_MSG_CHECKING([for function prototypes]) |
76 | AC_CACHE_VAL([ijg_cv_have_prototypes], | 76 | AC_CACHE_VAL([ijg_cv_have_prototypes], |
77 | [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | 77 | [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
78 | int testfunction (int arg1, int * arg2); /* check prototypes */ | 78 | int testfunction (int arg1, int * arg2); /* check prototypes */ |
79 | struct methods_struct { /* check method-pointer declarations */ | 79 | struct methods_struct { /* check method-pointer declarations */ |
80 | int (*error_exit) (char *msgtext); | 80 | int (*error_exit) (char *msgtext); |
81 | int (*trace_message) (char *msgtext); | 81 | int (*trace_message) (char *msgtext); |
82 | int (*another_method) (void); | 82 | int (*another_method) (void); |
83 | }; | 83 | }; |
84 | int testfunction (int arg1, int * arg2) /* check definitions */ | 84 | int testfunction (int arg1, int * arg2) /* check definitions */ |
85 | { return arg2[arg1]; } | 85 | { return arg2[arg1]; } |
86 | int test2function (void) /* check void arg list */ | 86 | int test2function (void) /* check void arg list */ |
87 | { return 0; } | 87 | { return 0; } |
88 | ]])], | 88 | ]])], |
89 | [ijg_cv_have_prototypes=yes], | 89 | [ijg_cv_have_prototypes=yes], |
90 | [ijg_cv_have_prototypes=no])]) | 90 | [ijg_cv_have_prototypes=no])]) |
91 | AC_MSG_RESULT([$ijg_cv_have_prototypes]) | 91 | AC_MSG_RESULT([$ijg_cv_have_prototypes]) |
92 | if test $ijg_cv_have_prototypes = yes; then | 92 | if test $ijg_cv_have_prototypes = yes; then |
93 | AC_DEFINE([HAVE_PROTOTYPES],[1],[Compiler supports function prototypes.]) | 93 | AC_DEFINE([HAVE_PROTOTYPES],[1],[Compiler supports function prototypes.]) |
94 | else | 94 | else |
95 | AC_MSG_WARN([Your compiler does not seem to know about function prototypes. | 95 | AC_MSG_WARN([Your compiler does not seem to know about function prototypes. |
96 | Perhaps it needs a special switch to enable ANSI C mode. | 96 | Perhaps it needs a special switch to enable ANSI C mode. |
97 | If so, we recommend running configure like this: | 97 | If so, we recommend running configure like this: |
98 | ./configure CC='cc -switch' | 98 | ./configure CC='cc -switch' |
99 | where -switch is the proper switch.]) | 99 | where -switch is the proper switch.]) |
100 | fi | 100 | fi |
101 | 101 | ||
102 | # Check header files | 102 | # Check header files |
103 | AC_CHECK_HEADERS([stddef.h stdlib.h locale.h]) | 103 | AC_CHECK_HEADERS([stddef.h stdlib.h locale.h]) |
104 | AC_CHECK_HEADER([string.h], [], | 104 | AC_CHECK_HEADER([string.h], [], |
105 | [AC_DEFINE([NEED_BSD_STRINGS], [1], | 105 | [AC_DEFINE([NEED_BSD_STRINGS], [1], |
106 | [Compiler has <strings.h> rather than standard <string.h>.])]) | 106 | [Compiler has <strings.h> rather than standard <string.h>.])]) |
107 | 107 | ||
108 | # See whether type size_t is defined in any ANSI-standard places; | 108 | # See whether type size_t is defined in any ANSI-standard places; |
109 | # if not, perhaps it is defined in <sys/types.h>. | 109 | # if not, perhaps it is defined in <sys/types.h>. |
110 | AC_MSG_CHECKING([for size_t]) | 110 | AC_MSG_CHECKING([for size_t]) |
111 | AC_TRY_COMPILE([ | 111 | AC_TRY_COMPILE([ |
112 | #ifdef HAVE_STDDEF_H | 112 | #ifdef HAVE_STDDEF_H |
113 | #include <stddef.h> | 113 | #include <stddef.h> |
114 | #endif | 114 | #endif |
115 | #ifdef HAVE_STDLIB_H | 115 | #ifdef HAVE_STDLIB_H |
116 | #include <stdlib.h> | 116 | #include <stdlib.h> |
117 | #endif | 117 | #endif |
118 | #include <stdio.h> | 118 | #include <stdio.h> |
119 | #ifdef NEED_BSD_STRINGS | 119 | #ifdef NEED_BSD_STRINGS |
120 | #include <strings.h> | 120 | #include <strings.h> |
121 | #else | 121 | #else |
122 | #include <string.h> | 122 | #include <string.h> |
123 | #endif | 123 | #endif |
124 | typedef size_t my_size_t; | 124 | typedef size_t my_size_t; |
125 | ], | 125 | ], |
126 | [ my_size_t foovar; ], | 126 | [ my_size_t foovar; ], |
127 | [ijg_size_t_ok=yes], | 127 | [ijg_size_t_ok=yes], |
128 | [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"]) | 128 | [ijg_size_t_ok="not ANSI, perhaps it is in sys/types.h"]) |
129 | AC_MSG_RESULT([$ijg_size_t_ok]) | 129 | AC_MSG_RESULT([$ijg_size_t_ok]) |
130 | if test "$ijg_size_t_ok" != yes; then | 130 | if test "$ijg_size_t_ok" != yes; then |
131 | AC_CHECK_HEADER([sys/types.h], | 131 | AC_CHECK_HEADER([sys/types.h], |
132 | [AC_DEFINE([NEED_SYS_TYPES_H], [1], | 132 | [AC_DEFINE([NEED_SYS_TYPES_H], [1], |
133 | [Need to include <sys/types.h> in order to obtain size_t.]) | 133 | [Need to include <sys/types.h> in order to obtain size_t.]) |
134 | AC_EGREP_CPP([size_t], [#include <sys/types.h>], | 134 | AC_EGREP_CPP([size_t], [#include <sys/types.h>], |
135 | [ijg_size_t_ok="size_t is in sys/types.h"], | 135 | [ijg_size_t_ok="size_t is in sys/types.h"], |
136 | [ijg_size_t_ok=no])], | 136 | [ijg_size_t_ok=no])], |
137 | [ijg_size_t_ok=no]) | 137 | [ijg_size_t_ok=no]) |
138 | AC_MSG_RESULT([$ijg_size_t_ok]) | 138 | AC_MSG_RESULT([$ijg_size_t_ok]) |
139 | if test "$ijg_size_t_ok" = no; then | 139 | if test "$ijg_size_t_ok" = no; then |
140 | AC_MSG_WARN([Type size_t is not defined in any of the usual places. | 140 | AC_MSG_WARN([Type size_t is not defined in any of the usual places. |
141 | Try putting '"typedef unsigned int size_t;"' in jconfig.h.]) | 141 | Try putting '"typedef unsigned int size_t;"' in jconfig.h.]) |
142 | fi | 142 | fi |
143 | fi | 143 | fi |
144 | 144 | ||
145 | # Check compiler characteristics | 145 | # Check compiler characteristics |
146 | AC_MSG_CHECKING([for type unsigned char]) | 146 | AC_MSG_CHECKING([for type unsigned char]) |
147 | AC_TRY_COMPILE([], [ unsigned char un_char; ], | 147 | AC_TRY_COMPILE([], [ unsigned char un_char; ], |
148 | [AC_MSG_RESULT(yes) | 148 | [AC_MSG_RESULT(yes) |
149 | AC_DEFINE([HAVE_UNSIGNED_CHAR], [1], | 149 | AC_DEFINE([HAVE_UNSIGNED_CHAR], [1], |
150 | [Compiler supports 'unsigned char'.])], | 150 | [Compiler supports 'unsigned char'.])], |
151 | [AC_MSG_RESULT(no)]) | 151 | [AC_MSG_RESULT(no)]) |
152 | 152 | ||
153 | AC_MSG_CHECKING([for type unsigned short]) | 153 | AC_MSG_CHECKING([for type unsigned short]) |
154 | AC_TRY_COMPILE([], [ unsigned short un_short; ], | 154 | AC_TRY_COMPILE([], [ unsigned short un_short; ], |
155 | [AC_MSG_RESULT(yes) | 155 | [AC_MSG_RESULT(yes) |
156 | AC_DEFINE([HAVE_UNSIGNED_SHORT], [1], | 156 | AC_DEFINE([HAVE_UNSIGNED_SHORT], [1], |
157 | [Compiler supports 'unsigned short'.])], | 157 | [Compiler supports 'unsigned short'.])], |
158 | [AC_MSG_RESULT(no)]) | 158 | [AC_MSG_RESULT(no)]) |
159 | 159 | ||
160 | AC_MSG_CHECKING([for type void]) | 160 | AC_MSG_CHECKING([for type void]) |
161 | AC_TRY_COMPILE([ | 161 | AC_TRY_COMPILE([ |
162 | /* Caution: a C++ compiler will insist on valid prototypes */ | 162 | /* Caution: a C++ compiler will insist on valid prototypes */ |
163 | typedef void * void_ptr; /* check void * */ | 163 | typedef void * void_ptr; /* check void * */ |
164 | #ifdef HAVE_PROTOTYPES /* check ptr to function returning void */ | 164 | #ifdef HAVE_PROTOTYPES /* check ptr to function returning void */ |
165 | typedef void (*void_func) (int a, int b); | 165 | typedef void (*void_func) (int a, int b); |
166 | #else | 166 | #else |
167 | typedef void (*void_func) (); | 167 | typedef void (*void_func) (); |
168 | #endif | 168 | #endif |
169 | 169 | ||
170 | #ifdef HAVE_PROTOTYPES /* check void function result */ | 170 | #ifdef HAVE_PROTOTYPES /* check void function result */ |
171 | void test3function (void_ptr arg1, void_func arg2) | 171 | void test3function (void_ptr arg1, void_func arg2) |
172 | #else | 172 | #else |
173 | void test3function (arg1, arg2) | 173 | void test3function (arg1, arg2) |
174 | void_ptr arg1; | 174 | void_ptr arg1; |
175 | void_func arg2; | 175 | void_func arg2; |
176 | #endif | 176 | #endif |
177 | { | 177 | { |
178 | char * locptr = (char *) arg1; /* check casting to and from void * */ | 178 | char * locptr = (char *) arg1; /* check casting to and from void * */ |
179 | arg1 = (void *) locptr; | 179 | arg1 = (void *) locptr; |
180 | (*arg2) (1, 2); /* check call of fcn returning void */ | 180 | (*arg2) (1, 2); /* check call of fcn returning void */ |
181 | } | 181 | } |
182 | ], [ ], | 182 | ], [ ], |
183 | [AC_MSG_RESULT(yes)], | 183 | [AC_MSG_RESULT(yes)], |
184 | [AC_MSG_RESULT(no) | 184 | [AC_MSG_RESULT(no) |
185 | AC_DEFINE([void], [char], | 185 | AC_DEFINE([void], [char], |
186 | [Define 'void' as 'char' for archaic compilers | 186 | [Define 'void' as 'char' for archaic compilers |
187 | that don't understand it.])]) | 187 | that don't understand it.])]) |
188 | AC_C_CONST | 188 | AC_C_CONST |
189 | 189 | ||
190 | # Check for non-broken inline under various spellings | 190 | # Check for non-broken inline under various spellings |
191 | AC_MSG_CHECKING([for inline]) | 191 | AC_MSG_CHECKING([for inline]) |
192 | ijg_cv_inline="" | 192 | ijg_cv_inline="" |
193 | AC_TRY_COMPILE([], [} __inline__ int foo() { return 0; } | 193 | AC_TRY_COMPILE([], [} __inline__ int foo() { return 0; } |
194 | int bar() { return foo();], ijg_cv_inline="__inline__", | 194 | int bar() { return foo();], ijg_cv_inline="__inline__", |
195 | [AC_TRY_COMPILE(, [} __inline int foo() { return 0; } | 195 | [AC_TRY_COMPILE(, [} __inline int foo() { return 0; } |
196 | int bar() { return foo();], ijg_cv_inline="__inline", | 196 | int bar() { return foo();], ijg_cv_inline="__inline", |
197 | [AC_TRY_COMPILE(, [} inline int foo() { return 0; } | 197 | [AC_TRY_COMPILE(, [} inline int foo() { return 0; } |
198 | int bar() { return foo();], ijg_cv_inline="inline")])]) | 198 | int bar() { return foo();], ijg_cv_inline="inline")])]) |
199 | AC_MSG_RESULT($ijg_cv_inline) | 199 | AC_MSG_RESULT($ijg_cv_inline) |
200 | AC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline], | 200 | AC_DEFINE_UNQUOTED([INLINE], [$ijg_cv_inline], |
201 | [How to obtain function inlining.]) | 201 | [How to obtain function inlining.]) |
202 | 202 | ||
203 | # We cannot check for bogus warnings, but at least we can check for errors | 203 | # We cannot check for bogus warnings, but at least we can check for errors |
204 | AC_MSG_CHECKING([for broken incomplete types]) | 204 | AC_MSG_CHECKING([for broken incomplete types]) |
205 | AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], | 205 | AC_TRY_COMPILE([ typedef struct undefined_structure * undef_struct_ptr; ], |
206 | [], | 206 | [], |
207 | [AC_MSG_RESULT(ok)], | 207 | [AC_MSG_RESULT(ok)], |
208 | [AC_MSG_RESULT(broken) | 208 | [AC_MSG_RESULT(broken) |
209 | AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1], | 209 | AC_DEFINE([INCOMPLETE_TYPES_BROKEN], [1], |
210 | [Compiler does not support pointers to unspecified | 210 | [Compiler does not support pointers to unspecified |
211 | structures.])]) | 211 | structures.])]) |
212 | 212 | ||
213 | # Test whether global names are unique to at least 15 chars | 213 | # Test whether global names are unique to at least 15 chars |
214 | AC_MSG_CHECKING([for short external names]) | 214 | AC_MSG_CHECKING([for short external names]) |
215 | AC_TRY_LINK([ | 215 | AC_TRY_LINK([ |
216 | int possibly_duplicate_function () { return 0; } | 216 | int possibly_duplicate_function () { return 0; } |
217 | int possibly_dupli_function () { return 1; } | 217 | int possibly_dupli_function () { return 1; } |
218 | ], [], | 218 | ], [], |
219 | [AC_MSG_RESULT(ok)], | 219 | [AC_MSG_RESULT(ok)], |
220 | [AC_MSG_RESULT(short) | 220 | [AC_MSG_RESULT(short) |
221 | AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1], | 221 | AC_DEFINE([NEED_SHORT_EXTERNAL_NAMES], [1], |
222 | [Linker requires that global names be unique in | 222 | [Linker requires that global names be unique in |
223 | first 15 characters.])]) | 223 | first 15 characters.])]) |
224 | 224 | ||
225 | # Run-time checks | 225 | # Run-time checks |
226 | AC_MSG_CHECKING([to see if char is signed]) | 226 | AC_MSG_CHECKING([to see if char is signed]) |
227 | AC_TRY_RUN([ | 227 | AC_TRY_RUN([ |
228 | #ifdef HAVE_PROTOTYPES | 228 | #ifdef HAVE_PROTOTYPES |
229 | int is_char_signed (int arg) | 229 | int is_char_signed (int arg) |
230 | #else | 230 | #else |
231 | int is_char_signed (arg) | 231 | int is_char_signed (arg) |
232 | int arg; | 232 | int arg; |
233 | #endif | 233 | #endif |
234 | { | 234 | { |
235 | if (arg == 189) { /* expected result for unsigned char */ | 235 | if (arg == 189) { /* expected result for unsigned char */ |
236 | return 0; /* type char is unsigned */ | 236 | return 0; /* type char is unsigned */ |
237 | } | 237 | } |
238 | else if (arg != -67) { /* expected result for signed char */ | 238 | else if (arg != -67) { /* expected result for signed char */ |
239 | printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n"); | 239 | printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n"); |
240 | printf("I fear the JPEG software will not work at all.\n\n"); | 240 | printf("I fear the JPEG software will not work at all.\n\n"); |
241 | } | 241 | } |
242 | return 1; /* assume char is signed otherwise */ | 242 | return 1; /* assume char is signed otherwise */ |
243 | } | 243 | } |
244 | char signed_char_check = (char) (-67); | 244 | char signed_char_check = (char) (-67); |
245 | int main() { | 245 | int main() { |
246 | exit(is_char_signed((int) signed_char_check)); | 246 | exit(is_char_signed((int) signed_char_check)); |
247 | }], [AC_MSG_RESULT(no) | 247 | }], [AC_MSG_RESULT(no) |
248 | AC_DEFINE([CHAR_IS_UNSIGNED], [1], | 248 | AC_DEFINE([CHAR_IS_UNSIGNED], [1], |
249 | [Characters are unsigned])], | 249 | [Characters are unsigned])], |
250 | [AC_MSG_RESULT(yes)], | 250 | [AC_MSG_RESULT(yes)], |
251 | [AC_MSG_WARN([Assuming that char is signed on target machine. | 251 | [AC_MSG_WARN([Assuming that char is signed on target machine. |
252 | If it is unsigned, this will be a little bit inefficient.]) | 252 | If it is unsigned, this will be a little bit inefficient.]) |
253 | ]) | 253 | ]) |
254 | 254 | ||
255 | AC_MSG_CHECKING([to see if right shift is signed]) | 255 | AC_MSG_CHECKING([to see if right shift is signed]) |
256 | AC_TRY_RUN([ | 256 | AC_TRY_RUN([ |
257 | #ifdef HAVE_PROTOTYPES | 257 | #ifdef HAVE_PROTOTYPES |
258 | int is_shifting_signed (long arg) | 258 | int is_shifting_signed (long arg) |
259 | #else | 259 | #else |
260 | int is_shifting_signed (arg) | 260 | int is_shifting_signed (arg) |
261 | long arg; | 261 | long arg; |
262 | #endif | 262 | #endif |
263 | /* See whether right-shift on a long is signed or not. */ | 263 | /* See whether right-shift on a long is signed or not. */ |
264 | { | 264 | { |
265 | long res = arg >> 4; | 265 | long res = arg >> 4; |
266 | 266 | ||
267 | if (res == -0x7F7E80CL) { /* expected result for signed shift */ | 267 | if (res == -0x7F7E80CL) { /* expected result for signed shift */ |
268 | return 1; /* right shift is signed */ | 268 | return 1; /* right shift is signed */ |
269 | } | 269 | } |
270 | /* see if unsigned-shift hack will fix it. */ | 270 | /* see if unsigned-shift hack will fix it. */ |
271 | /* we can't just test exact value since it depends on width of long... */ | 271 | /* we can't just test exact value since it depends on width of long... */ |
272 | res |= (~0L) << (32-4); | 272 | res |= (~0L) << (32-4); |
273 | if (res == -0x7F7E80CL) { /* expected result now? */ | 273 | if (res == -0x7F7E80CL) { /* expected result now? */ |
274 | return 0; /* right shift is unsigned */ | 274 | return 0; /* right shift is unsigned */ |
275 | } | 275 | } |
276 | printf("Right shift isn't acting as I expect it to.\n"); | 276 | printf("Right shift isn't acting as I expect it to.\n"); |
277 | printf("I fear the JPEG software will not work at all.\n\n"); | 277 | printf("I fear the JPEG software will not work at all.\n\n"); |
278 | return 0; /* try it with unsigned anyway */ | 278 | return 0; /* try it with unsigned anyway */ |
279 | } | 279 | } |
280 | int main() { | 280 | int main() { |
281 | exit(is_shifting_signed(-0x7F7E80B1L)); | 281 | exit(is_shifting_signed(-0x7F7E80B1L)); |
282 | }], | 282 | }], |
283 | [AC_MSG_RESULT(no) | 283 | [AC_MSG_RESULT(no) |
284 | AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1], | 284 | AC_DEFINE([RIGHT_SHIFT_IS_UNSIGNED], [1], |
285 | [Broken compiler shifts signed values as an unsigned shift.])], | 285 | [Broken compiler shifts signed values as an unsigned shift.])], |
286 | [AC_MSG_RESULT(yes)], | 286 | [AC_MSG_RESULT(yes)], |
287 | [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)]) | 287 | [AC_MSG_RESULT(Assuming that right shift is signed on target machine.)]) |
288 | 288 | ||
289 | AC_MSG_CHECKING([to see if fopen accepts b spec]) | 289 | AC_MSG_CHECKING([to see if fopen accepts b spec]) |
290 | AC_TRY_RUN([ | 290 | AC_TRY_RUN([ |
291 | #include <stdio.h> | 291 | #include <stdio.h> |
292 | int main() { | 292 | int main() { |
293 | if (fopen("conftestdata", "wb") != NULL) | 293 | if (fopen("conftestdata", "wb") != NULL) |
294 | exit(0); | 294 | exit(0); |
295 | exit(1); | 295 | exit(1); |
296 | }], | 296 | }], |
297 | [AC_MSG_RESULT(yes)], | 297 | [AC_MSG_RESULT(yes)], |
298 | [AC_MSG_RESULT(no) | 298 | [AC_MSG_RESULT(no) |
299 | AC_DEFINE([DONT_USE_B_MODE], [1], | 299 | AC_DEFINE([DONT_USE_B_MODE], [1], |
300 | [Don't open files in binary mode.])], | 300 | [Don't open files in binary mode.])], |
301 | [AC_MSG_RESULT(Assuming that it does.)]) | 301 | [AC_MSG_RESULT(Assuming that it does.)]) |
302 | 302 | ||
303 | # Configure libtool | 303 | # Configure libtool |
304 | AC_LIBTOOL_WIN32_DLL | 304 | AC_LIBTOOL_WIN32_DLL |
305 | AC_PROG_LIBTOOL | 305 | AC_PROG_LIBTOOL |
306 | 306 | ||
307 | # Select memory manager depending on user input. | 307 | # Select memory manager depending on user input. |
308 | # If no "-enable-maxmem", use jmemnobs | 308 | # If no "-enable-maxmem", use jmemnobs |
309 | MEMORYMGR='jmemnobs' | 309 | MEMORYMGR='jmemnobs' |
310 | MAXMEM="no" | 310 | MAXMEM="no" |
311 | AC_ARG_ENABLE([maxmem], | 311 | AC_ARG_ENABLE([maxmem], |
312 | [ --enable-maxmem[=N] enable use of temp files, set max mem usage to N MB], | 312 | [ --enable-maxmem[=N] enable use of temp files, set max mem usage to N MB], |
313 | [MAXMEM="$enableval"]) | 313 | [MAXMEM="$enableval"]) |
314 | dnl [# support --with-maxmem for backwards compatibility with IJG V5.] | 314 | dnl [# support --with-maxmem for backwards compatibility with IJG V5.] |
315 | dnl AC_ARG_WITH(maxmem, , MAXMEM="$withval") | 315 | dnl AC_ARG_WITH(maxmem, , MAXMEM="$withval") |
316 | if test "x$MAXMEM" = xyes; then | 316 | if test "x$MAXMEM" = xyes; then |
317 | MAXMEM=1 | 317 | MAXMEM=1 |
318 | fi | 318 | fi |
319 | if test "x$MAXMEM" != xno; then | 319 | if test "x$MAXMEM" != xno; then |
320 | if test -n "`echo $MAXMEM | sed 's/[[0-9]]//g'`"; then | 320 | if test -n "`echo $MAXMEM | sed 's/[[0-9]]//g'`"; then |
321 | AC_MSG_ERROR(non-numeric argument to --enable-maxmem) | 321 | AC_MSG_ERROR(non-numeric argument to --enable-maxmem) |
322 | fi | 322 | fi |
323 | DEFAULTMAXMEM=`expr $MAXMEM \* 1048576` | 323 | DEFAULTMAXMEM=`expr $MAXMEM \* 1048576` |
324 | AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}], | 324 | AC_DEFINE_UNQUOTED([DEFAULT_MAX_MEM], [${DEFAULTMAXMEM}], |
325 | [Maximum data space library will allocate.]) | 325 | [Maximum data space library will allocate.]) |
326 | AC_MSG_CHECKING([for 'tmpfile()']) | 326 | AC_MSG_CHECKING([for 'tmpfile()']) |
327 | AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ], | 327 | AC_TRY_LINK([#include <stdio.h>], [ FILE * tfile = tmpfile(); ], |
328 | [AC_MSG_RESULT(yes) | 328 | [AC_MSG_RESULT(yes) |
329 | MEMORYMGR='jmemansi'], | 329 | MEMORYMGR='jmemansi'], |
330 | [AC_MSG_RESULT(no) | 330 | [AC_MSG_RESULT(no) |
331 | dnl if tmpfile is not present, must use jmemname. | 331 | dnl if tmpfile is not present, must use jmemname. |
332 | MEMORYMGR='jmemname' | 332 | MEMORYMGR='jmemname' |
333 | 333 | ||
334 | # Test for the need to remove temporary files using a signal handler | 334 | # Test for the need to remove temporary files using a signal handler |
335 | # (for cjpeg/djpeg) | 335 | # (for cjpeg/djpeg) |
336 | AC_DEFINE([NEED_SIGNAL_CATCHER], [1], | 336 | AC_DEFINE([NEED_SIGNAL_CATCHER], [1], |
337 | [Need signal handler to clean up temporary files.]) | 337 | [Need signal handler to clean up temporary files.]) |
338 | AC_MSG_CHECKING([for 'mktemp()']) | 338 | AC_MSG_CHECKING([for 'mktemp()']) |
339 | AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ], | 339 | AC_TRY_LINK([], [ char fname[80]; mktemp(fname); ], |
340 | [AC_MSG_RESULT(yes)], | 340 | [AC_MSG_RESULT(yes)], |
341 | [AC_MSG_RESULT(no) | 341 | [AC_MSG_RESULT(no) |
342 | AC_DEFINE([NO_MKTEMP], [1], | 342 | AC_DEFINE([NO_MKTEMP], [1], |
343 | [The mktemp() function is not available.])])]) | 343 | [The mktemp() function is not available.])])]) |
344 | fi | 344 | fi |
345 | AC_SUBST([MEMORYMGR]) | 345 | AC_SUBST([MEMORYMGR]) |
346 | 346 | ||
347 | # Extract the library version IDs from jpeglib.h. | 347 | # Extract the library version IDs from jpeglib.h. |
348 | AC_MSG_CHECKING([libjpeg version number]) | 348 | AC_MSG_CHECKING([libjpeg version number]) |
349 | [major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` | 349 | [major=`sed -ne 's/^#define JPEG_LIB_VERSION_MAJOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h` |
350 | minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`] | 350 | minor=`sed -ne 's/^#define JPEG_LIB_VERSION_MINOR *\([0-9][0-9]*\).*$/\1/p' $srcdir/jpeglib.h`] |
351 | AC_SUBST([JPEG_LIB_VERSION], | 351 | AC_SUBST([JPEG_LIB_VERSION], |
352 | [`expr $major + $minor`:0:$minor]) | 352 | [`expr $major + $minor`:0:$minor]) |
353 | AC_MSG_RESULT([$JPEG_LIB_VERSION]) | 353 | AC_MSG_RESULT([$JPEG_LIB_VERSION]) |
354 | 354 | ||
355 | AC_CONFIG_FILES([Makefile]) | 355 | AC_CONFIG_FILES([Makefile]) |
356 | AC_OUTPUT | 356 | AC_OUTPUT |