1 --- vanilla-20071026/configure 2007-10-26 01:46:59.000000000 -0400
2 +++ scummvm-20071026/configure 2007-10-27 02:08:06.000000000 -0400
7 +for datatype in int short char long unknown; do
8 cat <<EOF >tmp_find_type_with_size.cpp
10 -int main(int argc, char **argv)
12 - int size = argv[1][0] - '0';
13 - if (size == sizeof(int))
15 - else if (size == sizeof(short))
17 - else if (size == sizeof(char))
19 - else if (size == sizeof(long))
22 - printf("unknown\n");
26 +typedef $datatype ac__type_sizeof_;
28 + static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) == $1)];
33 -if eval "$CXX $CXXFLAGS -o tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp"; then
34 - datatype=`./tmp_find_type_with_size $1`
35 +if ! $CXX $CXXFLAGS -o tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp 2>/dev/null; then
36 if test "$datatype" = "unknown"; then
37 echo "couldn't find data type with $1 bytes"
45 rm -f tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp
52 - guessed_host=`$_srcdir/config.guess`
53 - _host_cpu=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
54 - _host_os=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
55 - _host_vendor=`echo $guessed_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
56 + if test -z "$_host"; then
57 + _host=`$_srcdir/config.guess`
59 + _host=`$_srcdir/config.sub $_host`
61 + _host_cpu=`echo $_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
62 + _host_os=`echo $_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
63 + _host_vendor=`echo $_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
69 echo_n "Looking for C++ compiler... "
70 if test -n "$_host"; then
71 - compilers="$CXX $_host_cpu-$_host_os-g++ $_host_cpu-$_host_os-c++"
72 + compilers="$CXX $_host_cpu-$_host_os-g++ $_host_cpu-$_host_os-c++ $_host-g++ $_host-c++"
74 compilers="$CXX g++ c++"
77 add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
78 add_to_config_mk_if_no $_build_scalers 'DISABLE_SCALERS = 1'
81 +# Check for endianness
83 +echo_n "Checking endianness... "
84 +cat <<EOF >tmp_endianness_check.cpp
85 +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
86 +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
87 +void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; }
88 +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
89 +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
90 +void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; }
91 +int main() { _ascii (); _ebcdic (); return 0; }
93 +$CXX $CXXFLAGS -c -o tmp_endianness_check.o tmp_endianness_check.cpp
94 +if grep BIGenDianSyS tmp_endianness_check.o >/dev/null; then
100 +rm -f tmp_endianness_check.o tmp_endianness_check.cpp
103 +# Determine data type sizes
104 +# TODO: proper error checking
105 +# TODO: Actually, we should check individually for both signed & unsigned
106 +# data types - there are systems on which the size of an unsigned int
107 +# differs from that of a signed int!
108 +# However, so far we haven't encountered one of those, so we can live with
109 +# the limited check for now.
111 +echo_n "Type with 1 byte... "
112 +type_1_byte=`find_type_with_size 1`
115 +echo_n "Type with 2 bytes... "
116 +type_2_byte=`find_type_with_size 2`
119 +echo_n "Type with 4 bytes... "
120 +type_4_byte=`find_type_with_size 4`
124 +# Check whether we can use x86 asm routines
126 +echo_n "Running on x86... "
128 + i386|i486|i586|i686)
138 +# Determine build settings
140 +# TODO - also add an command line option to override this?!?
141 +echo_n "Checking hosttype... "
144 + linux* | uclinux* | openbsd* | freebsd* | netbsd* | bsd* | sunos* | hpux* | beos*)
145 + DEFINES="$DEFINES -DUNIX"
148 + DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
151 + DEFINES="$DEFINES -DUNIX -DIRIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
156 + DEFINES="$DEFINES -DUNIX -DMACOSX"
157 + LIBS="$LIBS -framework QuickTime -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
160 + DEFINES="$DEFINES -DWIN32"
161 + LIBS="$LIBS -lmingw32 -lwinmm"
162 + OBJS="$OBJS scummvmico.o"
165 + DEFINES="$DEFINES -mno-cygwin -DWIN32"
166 + LIBS="$LIBS -mno-cygwin -lmingw32 -lwinmm"
167 + OBJS="$OBJS scummvmico.o"
170 + DEFINES="$DEFINES -DUNIX"
173 + DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
175 + # given this is a shell script assume some type of unix
177 + echo "WARNING: could not establish system type, assuming unix like"
178 + DEFINES="$DEFINES -DUNIX"
182 if test -n "$_host"; then
183 # Cross-compiling mode - add your target here if needed
186 add_line_to_config_mk 'USE_ARM_SOUND_ASM = 1'
187 add_line_to_config_mk 'USE_ARM_SMUSH_ASM = 1'
193 echo "Cross-compiling to $_host, forcing endianness, alignment and type sizes"
194 DEFINES="$DEFINES -DUNIX -DGP2X -DUSE_ARM_SOUND_ASM -DUSE_ARM_SMUSH_ASM"
195 @@ -813,97 +913,12 @@
196 OBJS="$OBJS scummvmico.o"
199 - echo "Cross-compiling to unknown target $_host, please add your target to configure."
201 + echo "Continuing with auto-detected values ... if you have problems, please add your target to configure."
207 - # Determine build settings
209 - # TODO - also add an command line option to override this?!?
210 - echo_n "Checking hosttype... "
213 - linux* | openbsd* | freebsd* | netbsd* | bsd* | sunos* | hpux* | beos*)
214 - DEFINES="$DEFINES -DUNIX"
217 - DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
220 - DEFINES="$DEFINES -DUNIX -DIRIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
225 - DEFINES="$DEFINES -DUNIX -DMACOSX"
226 - LIBS="$LIBS -framework QuickTime -framework AudioUnit -framework AudioToolbox -framework Carbon -framework CoreMIDI"
229 - DEFINES="$DEFINES -DWIN32"
230 - LIBS="$LIBS -lmingw32 -lwinmm"
231 - OBJS="$OBJS scummvmico.o"
234 - DEFINES="$DEFINES -mno-cygwin -DWIN32"
235 - LIBS="$LIBS -mno-cygwin -lmingw32 -lwinmm"
236 - OBJS="$OBJS scummvmico.o"
239 - DEFINES="$DEFINES -DUNIX"
242 - DEFINES="$DEFINES -DUNIX -DSYSTEM_NOT_SUPPORTING_D_TYPE"
244 - # given this is a shell script assume some type of unix
246 - echo "WARNING: could not establish system type, assuming unix like"
247 - DEFINES="$DEFINES -DUNIX"
252 - # Check for endianness
254 - echo_n "Checking endianness... "
255 - cat <<EOF >tmp_endianness_check.cpp
258 -int main(int argc, char **argv)
260 - unsigned int data = 0x01234567;
261 - char *ptr = (char *)&data;
262 - if (ptr[0] == 0x01 && ptr[1] == 0x23 && ptr[2] == 0x45 && ptr[3] == 0x67)
264 - else if (ptr[3] == 0x01 && ptr[2] == 0x23 && ptr[1] == 0x45 && ptr[0] == 0x67)
265 - printf("little\n");
267 - printf("unknown\n");
271 - $CXX $CXXFLAGS -o tmp_endianness_check$EXEEXT tmp_endianness_check.cpp
272 - _endian=`./tmp_endianness_check`
274 - rm -f tmp_endianness_check$EXEEXT tmp_endianness_check.cpp
277 - # Check whether we can use x86 asm routines
279 - echo_n "Running on x86... "
281 - i386|i486|i586|i686)
291 # Check whether memory alignment is required
293 echo_n "Alignment required... "
297 echo "$_need_memalign"
300 - # Determine data type sizes
301 - # TODO: proper error checking
302 - # TODO: Actually, we should check individually for both signed & unsigned
303 - # data types - there are systems on which the size of an unsigned int
304 - # differs from that of a signed int!
305 - # However, so far we haven't encountered one of those, so we can live with
306 - # the limited check for now.
308 - echo_n "Type with 1 byte... "
309 - type_1_byte=`find_type_with_size 1`
310 - echo "$type_1_byte"
312 - echo_n "Type with 2 bytes... "
313 - type_2_byte=`find_type_with_size 2`
314 - echo "$type_2_byte"
316 - echo_n "Type with 4 bytes... "
317 - type_4_byte=`find_type_with_size 4`
318 - echo "$type_4_byte"