Imported Upstream version 2.9.0
[debian/cc1111] / sim / ucsim / configure.in
1 #!/bin/sh
2
3 AC_PREREQ(2.60)
4 AC_INIT(.version)
5 AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h)
6
7 AC_PROG_AWK
8
9 AC_MSG_CHECKING(version of the package)
10 if test -f ${srcdir}/.version; then
11   { read VERSION; } < ${srcdir}/.version
12   AC_MSG_RESULT($VERSION)
13 else
14   VERSION="0.0.0"
15   AC_MSG_RESULT(unknown using 0.0.0)
16 fi
17 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
18 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
19 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
20 AC_SUBST(VERSION)
21 AC_SUBST(VERSIONHI)
22 AC_SUBST(VERSIONLO)
23 AC_SUBST(VERSIONP)
24 AC_DEFINE_UNQUOTED(VERSIONSTR, "${VERSION}")
25 AC_DEFINE_UNQUOTED(VERSIONHI, $VERSIONHI)
26 AC_DEFINE_UNQUOTED(VERSIONLO, $VERSIONLO)
27 AC_DEFINE_UNQUOTED(VERSIONP, $VERSIONP)
28
29 # Some options
30 #==============
31 # *nix default: "${datadir}/sdcc/doc"
32 AC_ARG_VAR(docdir, documentation installation directory)
33 if test "${docdir}" = ""; then
34     docdir="\${datadir}"/sdcc/doc
35 fi
36 AC_SUBST(docdir)
37
38 AC_ARG_ENABLE(ucsim,
39 [  --enable-ucsim          compile ucsim frontend],
40 if test $enable_ucsim != "no"; then
41     enable_ucsim="yes"
42 fi,
43 #default
44 enable_ucsim="no")
45 AC_ARG_ENABLE(dlso,
46 [  --enable-dlso           compile dynamically loadable shared libraries],
47 if test $enable_dlso != "no"; then
48     enable_dlso="yes"
49 fi,
50 enable_dlso="no")
51 AC_ARG_ENABLE(51,
52 [  --disable-51            do not compile simulator for MCS51],
53 if test $enable_51 != "no"; then
54     enable_51="yes"
55 fi,
56 enable_51="yes")
57 AC_ARG_ENABLE(avr,
58 [  --disable-avr           do not compile simulator for AVR],
59 if test $enable_avr != "no"; then
60     enable_avr="yes"
61 fi,
62 enable_avr="yes")
63 AC_ARG_ENABLE(z80,
64 [  --disable-z80           do not compile simulator for Z80],
65 if test $enable_z80 != "no"; then
66     enable_z80="yes"
67 fi,
68 enable_z80="yes")
69 AC_ARG_ENABLE(hc08,
70 [  --disable-hc08          do not compile simulator for hc08],
71 if test $enable_hc08 != "no"; then
72     enable_hc08="yes"
73 fi,
74 enable_hc08="yes")
75 AC_ARG_ENABLE(xa,
76 [  --enable-xa             compile simulator for XA],
77 if test $enable_xa != "no"; then
78     enable_xa="yes"
79 fi,
80 enable_xa="no")
81 AC_ARG_ENABLE(portmon,
82 [  --enable-serio          compile serio GUI tool (needs curses)],
83 if test $enable_serio != "no"; then
84     enable_serio="yes"
85 fi,
86 enable_serio="no")
87 AC_SUBST(enable_ucsim)
88 AC_SUBST(enable_dlso)
89 AC_SUBST(enable_51)
90 AC_SUBST(enable_avr)
91 AC_SUBST(enable_z80)
92 AC_SUBST(enable_hc08)
93 AC_SUBST(enable_xa)
94 AC_SUBST(enable_serio)
95
96 AC_ARG_ENABLE(statistic,
97 [  --enable-statistic      compile statistical features (slower simulation)],
98 if test $enable_statistic != "no"; then
99    enable_statistic="yes"
100 fi,
101 enable_statistic="no")
102 AC_DEFINE_UNQUOTED(STATISTIC, $enable_statistic)
103
104
105 # Required programs
106 #-------------------
107 AC_PROG_CXX
108 AC_PROG_CXXCPP
109 AC_PROG_INSTALL
110 AC_PROG_RANLIB
111 dnl AC_LANG_CPLUSPLUS
112
113 AC_CHECK_PROG(STRIP, strip, strip, :)
114
115 AC_LIBTOOL_DLOPEN
116 dnl AC_LIBTOOL_WIN32_DLL
117 AC_PROG_LIBTOOL
118 AC_SUBST(LIBTOOL_DEPS)
119
120 AC_PROG_LEX
121 if test ${LEX} = "flex"; then
122         AC_DEFINE(HAVE_FLEX)
123 fi
124 AC_PROG_YACC
125 AC_CHECK_PROG(BISON_PLUS_PLUS, bison++, bison++, :)
126
127
128 AC_LANG_CPLUSPLUS
129
130 # Checking for header files.
131 # ===========================================================================
132
133 if test -d /stuff/include; then
134   CPPFLAGS="$CPPFLAGS -I/stuff/include"
135 fi
136
137 AC_HEADER_STDC
138 AC_CHECK_HEADERS(getopt.h unistd.h termios.h)
139
140 AC_CHECK_HEADER(curses.h,
141   AC_DEFINE(HAVE_CURSES_H)
142   curses_h_ok=yes,
143   curses_h_ok=no
144 )
145
146 ucsim_cv_socket="unknown"
147 AC_CHECK_HEADER(sys/socket.h,
148   AC_DEFINE(HAVE_SYS_SOCKET_H)
149   AC_DEFINE(SOCKET_AVAIL)
150   AC_DEFINE_UNQUOTED(UCSOCKET_T, int)
151   ucsim_cv_socket="<sys/socket.h>"
152 )
153
154 WINSOCK_AVAIL=0
155 if test $ucsim_cv_socket = unknown; then
156   AC_CHECK_HEADER(winsock2.h,
157     AC_DEFINE(HAVE_WINSOCK2_H)
158     AC_DEFINE(SOCKET_AVAIL)
159     AC_DEFINE_UNQUOTED(UCSOCKET_T, SOCKET)
160     ucsim_cv_socket="<winsock2.h>"
161     WINSOCK_AVAIL=1
162   )
163 fi
164 AC_SUBST(WINSOCK_AVAIL)
165
166 if test $ucsim_cv_socket != unknown; then
167   AC_EGREP_HEADER(socklen_t,
168     $ucsim_cv_socket,
169     AC_DEFINE_UNQUOTED(SOCKLEN_T, socklen_t),
170     AC_DEFINE_UNQUOTED(SOCKLEN_T, uint))
171 fi
172 AC_DEFINE_UNQUOTED(HEADER_SOCKET, ${ucsim_cv_socket})
173
174 AC_CHECK_HEADER(dlfcn.h)
175 AC_HEADER_DIRENT
176
177 # This must be after CXXCPP
178
179 AC_CACHE_CHECK(which header file defines FD_ macros, ucsim_cv_fd,
180 [ucsim_cv_fd="unknown"
181 AC_EGREP_CPP(yes, [
182 #include <winsock2.h>
183 #ifdef FD_ZERO
184 yes
185 #endif], ucsim_cv_fd="<winsock2.h>")
186 AC_EGREP_CPP(yes, [
187 #include <sys/time.h>
188 #ifdef FD_ZERO
189 yes
190 #endif], ucsim_cv_fd="<sys/time.h>")
191 AC_EGREP_CPP(yes, [
192 #include <sys/types.h>
193 #ifdef FD_ZERO
194 yes
195 #endif], ucsim_cv_fd="<sys/types.h>")
196 AC_EGREP_CPP(yes, [
197 #include <sys/select.h>
198 #ifdef FD_ZERO
199 yes
200 #endif], ucsim_cv_fd="<sys/select.h>")])
201
202 ucsim_cv_header_ok=0
203 if echo $ucsim_cv_fd|grep time >/dev/null 2>&1; then
204 AC_DEFINE(FD_NEED_TIME_H, 1)
205 ucsim_cv_header_ok=1
206 else
207 AC_DEFINE(FD_NEED_TIME_H, 0)
208 fi
209 if echo $ucsim_cv_fd|grep types >/dev/null 2>&1; then
210 AC_DEFINE(FD_NEED_TYPES_H, 1)
211 ucsim_cv_header_ok=1
212 else
213 AC_DEFINE(FD_NEED_TYPES_H, 0)
214 fi
215 if echo $ucsim_cv_fd|grep select >/dev/null 2>&1; then
216 AC_DEFINE(FD_NEED_SELECT_H, 1)
217 ucsim_cv_header_ok=1
218 else
219 AC_DEFINE(FD_NEED_SELECT_H, 0)
220 fi
221 if echo $ucsim_cv_fd|grep winsock2 >/dev/null 2>&1; then
222 AC_DEFINE(FD_NEED_WINSOCK2_H, 1)
223 ucsim_cv_header_ok=1
224 else
225 AC_DEFINE(FD_NEED_WINSOCK2_H, 0)
226 fi
227
228 AC_DEFINE_UNQUOTED(FD_HEADER_OK, ${ucsim_cv_header_ok})
229 AC_DEFINE_UNQUOTED(HEADER_FD, ${ucsim_cv_fd})
230
231
232 # Checking for functions/libs
233 # ===========================================================================
234 if echo $ucsim_cv_socket|grep winsock2 >/dev/null 2>&1; then
235   LIBS="-lws2_32 $LIBS"
236 else
237   AC_CHECK_LIB(socket,socket)
238   AC_CHECK_LIB(nsl,xdr_short)
239 fi
240
241 AC_CHECK_LIB(dl,dlopen,
242 dl_ok="yes"
243 DL="-ldl",
244 dl_ok="no"
245 DL="")
246 AC_SUBST(dl_ok)
247 AC_SUBST(DL)
248
249 #AC_CHECK_LIB(panel,panel_above,
250 #panel_ok="yes"
251 #curses_ok="yes"
252 #CURSES_LIBS="-lpanel -lcurses"
253 #,
254 #panel_ok="no"
255 #AC_CHECK_LIB(curses,nl,
256 #curses_ok="yes"
257 #CURSES_LIBS="-lcurses"
258 #,
259 #curses_ok="no")
260 #,
261 #-lcurses)
262
263 if test $curses_h_ok != yes; then
264   panel_ok="no"
265   curses_ok="no"
266 else
267   AC_CHECK_LIB(panel,panel_above,
268     panel_ok="yes"
269     curses_ok="yes"
270     CURSES_LIBS="-lpanel",
271     panel_ok="no"
272     curses_ok="no"
273   )
274
275   if test $curses_ok != yes; then
276     AC_CHECK_LIB(curses,nl,
277       curses_ok="yes"
278       CURSES_LIBS="-lcurses",
279       curses_ok="no")
280   fi
281
282   if test $curses_ok != yes; then
283     AC_CHECK_LIB(ncurses,nl,
284       curses_ok="yes"
285       CURSES_LIBS="-lncurses",
286       curses_ok="no")
287   fi
288 fi
289
290 AC_SUBST(panel_ok)
291 AC_SUBST(curses_ok)
292 AC_SUBST(CURSES_LIBS)
293
294 AC_FUNC_VPRINTF
295 AC_CHECK_FUNCS(vsnprintf)
296 AC_CHECK_FUNCS(_vsnprintf)
297 AC_CHECK_FUNCS(vasprintf)
298 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
299 AC_CHECK_FUNCS(strchr memcpy)
300 dnl AC_CHECK_FUNCS(getline)
301 dnl AC_CHECK_FUNCS(getdelim)
302 AC_CHECK_FUNCS(fgets)
303 AC_CHECK_FUNCS(yylex)
304
305 AC_CACHE_CHECK(whether scanf knows %a, ucsim_cv_scanf_a,
306 [echo "a b" >conftest.data
307 AC_TRY_RUN([
308 #include <stdio.h>
309 void main(void)
310 {
311   FILE *f;
312   char *a;
313   int  i;
314   if ((f= fopen("conftest.data", "r")) == NULL)
315     exit(1);
316   i= fscanf(f, " %a[a-z] ", &a);
317   fclose(f);
318   if (i == 0)
319     exit(2);
320   if (i == 1)
321     exit(0);
322   exit(3);
323 }],
324 ucsim_cv_scanf_a="yes",
325 ucsim_cv_scanf_a="no",
326 ucsim_cv_scanf_a="unknown")
327 ])
328 if test "$ucsim_cv_scanf_a" = "yes"; then
329   AC_DEFINE(SCANF_A)
330 fi
331
332 AC_CACHE_CHECK(whether getcwd is GNUish, ucsim_cv_getcwd,
333 [AC_TRY_RUN([
334 #include <unistd.h>
335 void main(void)
336 {
337   if ((getcwd(NULL, 0)) == NULL)
338     exit(1);
339   exit(0);
340 }],
341 ucsim_cv_getcwd="yes",
342 ucsim_cv_getcwd="no",
343 ucsim_cv_getcwd="unknown")
344 ])
345 if test "$ucsim_cv_getcwd" = "yes"; then
346   AC_DEFINE(GNU_GETCWD)
347 fi
348
349 AC_DEFUN(ucsim_ACCEPT_LENGTH_T,
350  [AC_CACHE_CHECK([for type of length pointer parameter of accept],
351    ucsim_cv_accept_length_type,
352    [ac_save_CPPFLAGS="$CPPFLAGS"
353     ucsim_cv_accept_length_type=no
354     for ac_val in int size_t socklen_t; do
355       CPPFLAGS="$ac_save_CPPFLAGS -DACCEPT_SOCKLEN_T=$ac_val"
356       AC_TRY_COMPILE([#include <sys/types.h>
357 #include ${ucsim_cv_socket}],
358         [struct sockaddr a; $ac_val len; accept (0, &a, &len);],
359         [ucsim_cv_accept_length_type=$ac_val; break])
360     done
361     CPPFLAGS="$ac_save_CPPFLAGS"])
362   if test "$ucsim_cv_accept_length_type" != no; then
363     AC_DEFINE_UNQUOTED(ACCEPT_SOCKLEN_T, $ucsim_cv_accept_length_type,
364       [Define to be the type of length parameter of accept (without the \*').])
365   fi
366  ]
367 )
368 #'
369
370 ucsim_ACCEPT_LENGTH_T
371
372 # Macro definitions
373 ###################
374
375 # DD_COPT macro checks if the compiler specified as the 1st parameter
376 # supports option specified as the 2nd parameter
377 # For example: DD_COPT(CXX, fPIC)
378
379 AC_DEFUN(DD_COPT, [
380 AC_CACHE_CHECK(whether $$1 accepts -$2,ucsim_cv_$1$2,
381 cat >_test_.c <<EOF
382 int main(void) {return(0);}
383 EOF
384 $$1 -v -$2 -c _test_.c 1>&5 2>&5
385 if test "$?" = "0"; then
386   ucsim_cv_$1$2="yes"
387 else
388   ucsim_cv_$1$2="no"
389 fi
390 rm -f _test_.* a.out)
391 ])
392
393 # DD_COPT_NO_IGNORE macro checks if the compiler specified as the
394 # 1st parameter supports and doesn't ignore option specified as the
395 # 2nd parameter
396 # For example: DD_COPT_NO_IGNORE(CXX, fPIC)
397
398 AC_DEFUN(DD_COPT_NO_IGNORE, [
399 AC_CACHE_CHECK(whether $$1 accepts and doesn't ignore -$2,ucsim_cv_$1$2,
400 cat >_test_.c <<EOF
401 int main(void) {return(0);}
402 EOF
403 ucsim_cv_$1$2=$($$1 -v -$2 -c _test_.c 2>&1 1>&5)
404 if test "$?" = "0"; then
405   expr "$ucsim_cv_$1$2" : '.*'-$2'.*ignored' 1>&5 2>&5
406   if test "$?" = "0"; then
407     ucsim_cv_$1$2="no"
408   else
409     ucsim_cv_$1$2="yes"
410   fi
411 else
412   ucsim_cv_$1$2="no"
413 fi
414 rm -f _test_.* a.out)
415 ])
416
417
418 # Checking characteristics of compilers and other programs
419 # --------------------------------------------------------
420
421 # Cross compiling overrides
422 # FIXME
423 if test "$CC" = "i586-mingw32msvc-gcc"; then
424   ac_cv_c_bigendian=no
425   ac_cv_sizeof_char=1
426   ac_cv_sizeof_short=2
427   ac_cv_sizeof_int=4
428   ac_cv_sizeof_long=4
429   ac_cv_sizeof_long_long=4
430 fi
431
432 # SDCC_BUILD_BIGENDIAN ([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN])
433 # -------------------------------------------------------------------------
434 AC_DEFUN([SDCC_BUILD_BIGENDIAN],
435 [AC_CACHE_CHECK(whether host machine byte ordering is bigendian, sdcc_cv_build_bigendian,
436 [# See if sys/param.h defines the BYTE_ORDER macro.
437 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
438 #include <sys/param.h>
439 ],
440 [#if  ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
441         && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
442  bogus endian macros
443 #endif
444 ])],
445 [# It does; now see whether it defined to BIG_ENDIAN or not.
446 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
447 #include <sys/param.h>
448 ], [#if BYTE_ORDER != BIG_ENDIAN
449  not big endian
450 #endif
451 ])], [sdcc_cv_build_bigendian=yes], [sdcc_cv_build_bigendian=no])],
452 [# It does not; compile a test program.
453 AC_RUN_IFELSE(
454 [AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[
455   /* Are we little or big endian?  From Harbison&Steele.  */
456   union
457   {
458     long int l;
459     char c[sizeof (long int)];
460   } u;
461   u.l = 1;
462   return u.c[sizeof (long int) - 1] == 1;
463 ]])],
464               [sdcc_cv_build_bigendian=no],
465               [sdcc_cv_build_bigendian=yes],
466 [# try to guess the endianness by grepping values into an object file
467   sdcc_cv_build_bigendian=unknown
468   AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
469 [[short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
470 short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
471 void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
472 short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
473 short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
474 void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }]],
475 [[ _ascii (); _ebcdic (); ]])],
476 [if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
477   sdcc_cv_build_bigendian=yes
478 fi
479 if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
480   if test "$sdcc_cv_build_bigendian" = unknown; then
481     sdcc_cv_build_bigendian=no
482   else
483     # finding both strings is unlikely to happen, but who knows?
484     sdcc_cv_build_bigendian=unknown
485   fi
486 fi])])])])
487 case $sdcc_cv_build_bigendian in
488   yes)
489     m4_default([$1],
490       [AC_DEFINE([BUILD_WORDS_BIGENDIAN], 1,
491         [Define to 1 if your processor stores words with the most significant
492          byte first (like Motorola and SPARC, unlike Intel and VAX).])]) ;;
493   no)
494     $2 ;;
495   *)
496     m4_default([$3],
497       [AC_MSG_ERROR([unknown endianness
498 presetting sdcc_cv_build_bigendian=no (or yes) will help])]) ;;
499 esac
500 ])# SDCC_BUILD_BIGENDIAN
501
502 SDCC_BUILD_BIGENDIAN
503
504 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,ucsim_cv_MM,
505 echo "#include <stdio.h>" >_test_.c
506 echo "" >>_test_.c
507 $CXXCPP -v -MM _test_.c 1>&5 2>&5
508 if test "$?" = "0"; then
509   ucsim_cv_MM="-MM"
510 else
511   ucsim_cv_MM="-M"
512 fi
513 rm -f _test_.*)
514 M_OR_MM=$ucsim_cv_MM
515 AC_SUBST(M_OR_MM)
516
517 # This is the first time when CFLAGS are set/modified!!
518
519 DD_COPT(CXX, ggdb)
520 DD_COPT(CXX, gstabs)
521 if test "$ucsim_cv_CXXgstabs" = "yes"; then
522    gopt="-gstabs+ -g3"
523 elif test "$ucsim_cv_CXXggdb" = "yes"; then
524      gopt="-ggdb -g3"
525 else
526      gopt="-g"
527 fi
528 if test "$CXXFLAGS"x = x ;then
529         CXXFLAGS="$gopt"
530 else
531         CXXFLAGS="$CXXFLAGS $gopt"
532 fi
533
534 DD_COPT(CXX, pipe)
535 if test "$ucsim_cv_CXXpipe" = "yes"; then
536   CXXFLAGS="$CXXFLAGS -pipe"
537 fi
538
539 PICOPT=""
540 SHAREDLIB="no"
541 DD_COPT_NO_IGNORE(CXX, fPIC)
542 if test "$ucsim_cv_CXXfPIC" = "yes"; then
543     PICOPT="-fPIC"
544 else
545     DD_COPT_NO_IGNORE(CXX, fpic)
546     if test "$ucsim_cv_CXXfpic" = "yes"; then
547         PICOPT="-fpic"
548     fi
549 fi
550 if test "$PICOPT"x != "x"; then
551     SHAREDLIB="yes"
552 fi
553 AC_SUBST(SHAREDLIB)
554 AC_SUBST(PICOPT)
555
556 dlso_ok="no"
557 if test $SHAREDLIB = "yes" -a $dl_ok = "yes" -a $enable_dlso = "yes"; then
558     dlso_ok="yes"
559 fi
560 AC_SUBST(dlso_ok)
561
562 # Checks for typedefs, structures, and compiler characteristics.
563 # ===========================================================================
564
565 AC_TYPE_SIGNAL
566 if test "$cross_compiling" = "no"; then
567 AC_CHECK_SIZEOF(char)
568 AC_CHECK_SIZEOF(short)
569 AC_CHECK_SIZEOF(int)
570 AC_CHECK_SIZEOF(long)
571 AC_CHECK_SIZEOF(long long)
572 else
573     if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
574         ac_cv_sizeof_char=1
575         ac_cv_sizeof_short=2
576         ac_cv_sizeof_int=4
577         ac_cv_sizeof_long=4
578         ac_cv_sizeof_long_long=4
579     else
580         : # FIXME
581     fi
582 #echo
583 fi
584
585 type_name()
586 {
587     if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
588         echo "char"
589         exit
590     fi
591     if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
592         echo "short"
593         exit
594     fi
595     if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
596         echo "int"
597         exit
598     fi
599     if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
600         echo "long"
601         exit
602     fi
603     if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
604         echo "long long"
605         exit
606     fi
607     echo "long long"
608 }
609
610 AC_MSG_CHECKING(type name for byte)
611 TYPE_BYTE=`type_name 1`
612 AC_MSG_RESULT($TYPE_BYTE)
613 AC_MSG_CHECKING(type name for word)
614 TYPE_WORD=`type_name 2`
615 AC_MSG_RESULT($TYPE_WORD)
616 AC_MSG_CHECKING(type name for dword)
617 TYPE_DWORD=`type_name 4`
618 AC_MSG_RESULT($TYPE_DWORD)
619 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
620 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
621 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
622
623 if echo $TYPE_DWORD|grep short >/dev/null; then
624     A="h"
625 elif echo $TYPE_DWORD|grep long >/dev/null; then
626     A="l"
627 else
628     A=""
629 fi
630
631 if echo $TYPE_WORD|grep short >/dev/null; then M="h"
632 elif echo $TYPE_WORD|grep long >/dev/null; then M="l"
633 else M=""
634 fi
635
636 AC_DEFINE_UNQUOTED(_A_, "${A}")
637 AC_DEFINE_UNQUOTED(_M_, "${M}")
638
639 # Generating output files
640 # ===========================================================================
641
642 AC_OUTPUT(Makefile
643 main.mk:main_in.mk
644 packages.mk:packages_in.mk
645 sim.src/Makefile
646 cmd.src/Makefile
647 s51.src/Makefile
648 avr.src/Makefile
649 z80.src/Makefile
650 hc08.src/Makefile
651 xa.src/Makefile
652 gui.src/Makefile
653 gui.src/serio.src/Makefile
654 doc/Makefile
655 )
656
657 #gui.src/portmon.src/Makefile
658
659
660 # End of configure/configure.in