4 AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h)
8 AC_MSG_CHECKING(version of the package)
9 if test -f .version; then
10 VERSION=`cat .version`
11 AC_MSG_RESULT($VERSION)
14 AC_MSG_RESULT(unknown using 0.0.0)
16 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
17 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
18 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
23 AC_DEFINE_UNQUOTED(VERSIONSTR, "${VERSION}")
24 AC_DEFINE_UNQUOTED(VERSIONHI, $VERSIONHI)
25 AC_DEFINE_UNQUOTED(VERSIONLO, $VERSIONLO)
26 AC_DEFINE_UNQUOTED(VERSIONP, $VERSIONP)
31 [ --enable-ucsim compile ucsim frontend],
32 if test $enable_ucsim != "no"; then
38 [ --enable-dlso compile dynamically loadable shared libraries],
39 if test $enable_dlso != "no"; then
44 [ --disable-51 do not compile simulator for MCS51],
45 if test $enable_51 != "no"; then
50 [ --disable-avr do not compile simulator for AVR],
51 if test $enable_avr != "no"; then
56 [ --enable-z80 compile simulator for Z80],
57 if test $enable_z80 != "no"; then
62 [ --enable-hc08 compile simulator for hc08],
63 if test $enable_hc08 != "no"; then
68 [ --enable-xa compile simulator for XA],
69 if test $enable_xa != "no"; then
73 AC_ARG_ENABLE(portmon,
74 [ --enable-serio compile serio GUI tool (needs curses)],
75 if test $enable_serio != "no"; then
79 AC_SUBST(enable_ucsim)
86 AC_SUBST(enable_serio)
88 AC_ARG_ENABLE(statistic,
89 [ --enable-statistic compile statistical features (slower simulation)],
90 if test $enable_statistic != "no"; then
91 enable_statistic="yes"
93 enable_statistic="no")
94 AC_DEFINE_UNQUOTED(STATISTIC, $enable_statistic)
103 dnl AC_LANG_CPLUSPLUS
105 AC_CHECK_PROG(STRIP, strip, strip, :)
108 dnl AC_LIBTOOL_WIN32_DLL
110 AC_SUBST(LIBTOOL_DEPS)
114 # Checking for header files.
115 # ===========================================================================
117 if test -d /stuff/include; then
118 CPPFLAGS="$CPPFLAGS -I/stuff/include"
122 AC_CHECK_HEADERS(getopt.h)
123 AC_CHECK_HEADERS(unistd.h)
124 AC_CHECK_HEADER(sys/socket.h,
125 AC_DEFINE(SOCKET_AVAIL)
126 AC_DEFINE(HAVE_SYS_SOCKET_H)
127 AC_EGREP_HEADER(socklen_t,
129 AC_DEFINE_UNQUOTED(SOCKLEN_T, socklen_t),
130 AC_DEFINE_UNQUOTED(SOCKLEN_T, uint))
132 AC_CHECK_HEADER(dlfcn.h)
135 # This must be after CXXCPP
137 AC_CACHE_CHECK(which header file defines FD_ macros, ucsim_cv_fd,
138 [ucsim_cv_fd="unknown"
140 #include <sys/time.h>
143 #endif], ucsim_cv_fd="<sys/time.h>")
145 #include <sys/types.h>
148 #endif], ucsim_cv_fd="<sys/types.h>")
150 #include <sys/select.h>
153 #endif], ucsim_cv_fd="<sys/types.h>")])
155 AC_DEFINE(FD_HEADER_OK, 0)
156 if echo $ucsim_cv_fd|grep time >/dev/null 2>&1; then
157 AC_DEFINE(FD_NEED_TIME_H, 1)
158 AC_DEFINE(FD_HEADER_OK, 1)
160 AC_DEFINE(FD_NEED_TIME_H, 0)
162 if echo $ucsim_cv_fd|grep types >/dev/null 2>&1; then
163 AC_DEFINE(FD_NEED_TYPES_H, 1)
164 AC_DEFINE(FD_HEADER_OK, 1)
166 AC_DEFINE(FD_NEED_TYPES_H, 0)
168 if echo $ucsim_cv_fd|grep select >/dev/null 2>&1; then
169 AC_DEFINE(FD_NEED_SELECT_H, 1)
170 AC_DEFINE(FD_HEADER_OK, 1)
172 AC_DEFINE(FD_NEED_SELECT_H, 0)
175 AC_DEFINE_UNQUOTED(HEADER_FD, ${ucsim_cv_fd})
178 # Checking for functions/libs
179 # ===========================================================================
180 AC_CHECK_LIB(socket,socket)
181 AC_CHECK_LIB(nsl,xdr_short)
182 AC_CHECK_LIB(dl,dlopen,
189 AC_CHECK_LIB(panel,panel_above,
192 CURSES_LIBS="-lpanel -lcurses"
195 AC_CHECK_LIB(curses,nl,
197 CURSES_LIBS="-lcurses"
204 AC_SUBST(CURSES_LIBS)
207 AC_CHECK_FUNCS(vsnprintf vasprintf)
208 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
209 AC_CHECK_FUNCS(strchr memcpy)
210 dnl AC_CHECK_FUNCS(getline)
211 dnl AC_CHECK_FUNCS(getdelim)
212 AC_CHECK_FUNCS(fgets)
213 AC_CHECK_FUNCS(yylex)
215 AC_CACHE_CHECK(whether scanf knows %a, ucsim_cv_scanf_a,
216 [echo "a b" >conftest.data
224 if ((f= fopen("conftest.data", "r")) == NULL)
226 i= fscanf(f, " %a[a-z] ", &a);
234 ucsim_cv_scanf_a="yes",
235 ucsim_cv_scanf_a="no",
236 ucsim_cv_scanf_a="unknown")
238 if test "$ucsim_cv_scanf_a" = "yes"; then
242 AC_CACHE_CHECK(whether getcwd is GNUish, ucsim_cv_getcwd,
247 if ((getcwd(NULL, 0)) == NULL)
251 ucsim_cv_getcwd="yes",
252 ucsim_cv_getcwd="no",
253 ucsim_cv_getcwd="unknown")
255 if test "$ucsim_cv_getcwd" = "yes"; then
256 AC_DEFINE(GNU_GETCWD)
259 AC_DEFUN(ucsim_ACCEPT_LENGTH_T,
260 [AC_CACHE_CHECK([for type of length pointer parameter of accept],
261 ucsim_cv_accept_length_type,
262 [ac_save_CPPFLAGS="$CPPFLAGS"
263 ucsim_cv_accept_length_type=no
264 for ac_val in int size_t socklen_t; do
265 CPPFLAGS="$ac_save_CPPFLAGS -DACCEPT_SOCKLEN_T=$ac_val"
266 AC_TRY_COMPILE([#include <sys/types.h>
267 #include <sys/socket.h>],
268 [struct sockaddr a; $ac_val len; accept (0, &a, &len);],
269 [ucsim_cv_accept_length_type=$ac_val; break])
271 CPPFLAGS="$ac_save_CPPFLAGS"])
272 if test "$ucsim_cv_accept_length_type" != no; then
273 AC_DEFINE_UNQUOTED(ACCEPT_SOCKLEN_T, $ucsim_cv_accept_length_type,
274 [Define to be the type of length parameter of accept (without the \*').])
280 ucsim_ACCEPT_LENGTH_T
285 # DD_COPT macro checks if the compiler specified as the 1st parameter
286 # supports option specified as the 2nd parameter
287 # For example: DD_COPT(CXX, fPIC)
290 AC_CACHE_CHECK(whether $$1 accepts -$2,ucsim_cv_$1$2,
295 $$1 -v -$2 -c _test_.c 1>&5 2>&5
296 if test "$?" = "0"; then
301 rm -f _test_.* a.out)
305 # Checking characteristics of compilers and other programs
306 # --------------------------------------------------------
308 # Cross compiling overrides
310 if test "$CC" = "i586-mingw32msvc-gcc"; then
316 ac_cv_sizeof_long_long=4
319 if test "$cross_compiling" = "no"
324 if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
329 #echo "CROSS ENDIAN DONE"
332 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,ucsim_cv_MM,
333 echo "#include <stdio.h>" >_test_.c
335 $CXXCPP -v -MM _test_.c 1>&5 2>&5
336 if test "$?" = "0"; then
345 # This is the first time when CFLAGS are set/modified!!
348 if test "$ucsim_cv_CXXggdb" = "yes"; then
349 if test "$CXXFLAGS"x = x ;then
352 CXXFLAGS="$CXXFLAGS -ggdb"
357 if test "$ucsim_cv_CXXpipe" = "yes"; then
358 CXXFLAGS="$CXXFLAGS -pipe"
364 if test "$ucsim_cv_CXXfPIC" = "yes"; then
368 if test "$ucsim_cv_CXXfpic" = "yes"; then
372 if test "$PICOPT"x != "x"; then
375 # If this is Cygwin neither use Position Independant Code
377 # Quick + dirty by Bernhard
379 if $CXX -v 2>&1 | grep -i cygwin 1>&5 2>&5; then
387 if test $SHAREDLIB = "yes" -a $dl_ok = "yes" -a $enable_dlso = "yes"; then
392 # Checks for typedefs, structures, and compiler characteristics.
393 # ===========================================================================
396 if test "$cross_compiling" = "no"; then
397 AC_CHECK_SIZEOF(char)
398 AC_CHECK_SIZEOF(short)
400 AC_CHECK_SIZEOF(long)
401 AC_CHECK_SIZEOF(long long)
403 if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
408 ac_cv_sizeof_long_long=4
417 if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
421 if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
425 if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
429 if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
433 if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
440 AC_MSG_CHECKING(type name for byte)
441 TYPE_BYTE=`type_name 1`
442 AC_MSG_RESULT($TYPE_BYTE)
443 AC_MSG_CHECKING(type name for word)
444 TYPE_WORD=`type_name 2`
445 AC_MSG_RESULT($TYPE_WORD)
446 AC_MSG_CHECKING(type name for dword)
447 TYPE_DWORD=`type_name 4`
448 AC_MSG_RESULT($TYPE_DWORD)
449 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
450 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
451 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
453 if echo $TYPE_DWORD|grep short >/dev/null; then
455 elif echo $TYPE_DWORD|grep long >/dev/null; then
461 if echo $TYPE_WORD|grep short >/dev/null; then M="h"
462 elif echo $TYPE_WORD|grep long >/dev/null; then M="l"
466 AC_DEFINE_UNQUOTED(_A_, "${A}")
467 AC_DEFINE_UNQUOTED(_M_, "${M}")
470 # Generating output files
471 # ===========================================================================
473 AC_OUTPUT(main.mk:main_in.mk
474 packages.mk:packages_in.mk
483 gui.src/serio.src/Makefile
487 #gui.src/portmon.src/Makefile
490 # End of configure/configure.in