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-xa compile simulator for XA],
63 if test $enable_xa != "no"; then
67 AC_ARG_ENABLE(portmon,
68 [ --enable-serio compile serio GUI tool (needs curses)],
69 if test $enable_serio != "no"; then
73 AC_SUBST(enable_ucsim)
79 AC_SUBST(enable_serio)
81 AC_ARG_ENABLE(statistic,
82 [ --enable-statistic compile statistical features (slower simulation)],
83 if test $enable_statistic != "no"; then
84 enable_statistic="yes"
86 enable_statistic="no")
87 AC_DEFINE_UNQUOTED(STATISTIC, $enable_statistic)
98 AC_CHECK_PROG(STRIP, strip, strip, :)
101 dnl AC_LIBTOOL_WIN32_DLL
103 AC_SUBST(LIBTOOL_DEPS)
107 # Checking for header files.
108 # ===========================================================================
110 if test -d /stuff/include; then
111 CPPFLAGS="$CPPFLAGS -I/stuff/include"
115 AC_CHECK_HEADERS(getopt.h)
116 AC_CHECK_HEADERS(unistd.h)
117 AC_CHECK_HEADER(sys/socket.h,
118 AC_DEFINE(SOCKET_AVAIL)
119 AC_DEFINE(HAVE_SYS_SOCKET_H)
120 AC_EGREP_HEADER(socklen_t,
122 AC_DEFINE_UNQUOTED(SOCKLEN_T, socklen_t),
123 AC_DEFINE_UNQUOTED(SOCKLEN_T, uint))
125 AC_CHECK_HEADER(dlfcn.h)
128 # This must be after CXXCPP
130 AC_CACHE_CHECK(which header file defines FD_ macros, ucsim_cv_fd,
131 [ucsim_cv_fd="unknown"
133 #include <sys/time.h>
136 #endif], ucsim_cv_fd="<sys/time.h>")
138 #include <sys/types.h>
141 #endif], ucsim_cv_fd="<sys/types.h>")
143 #include <sys/select.h>
146 #endif], ucsim_cv_fd="<sys/types.h>")])
148 AC_DEFINE(FD_HEADER_OK, 0)
149 if echo $ucsim_cv_fd|grep time >/dev/null 2>&1; then
150 AC_DEFINE(FD_NEED_TIME_H, 1)
151 AC_DEFINE(FD_HEADER_OK, 1)
153 AC_DEFINE(FD_NEED_TIME_H, 0)
155 if echo $ucsim_cv_fd|grep types >/dev/null 2>&1; then
156 AC_DEFINE(FD_NEED_TYPES_H, 1)
157 AC_DEFINE(FD_HEADER_OK, 1)
159 AC_DEFINE(FD_NEED_TYPES_H, 0)
161 if echo $ucsim_cv_fd|grep select >/dev/null 2>&1; then
162 AC_DEFINE(FD_NEED_SELECT_H, 1)
163 AC_DEFINE(FD_HEADER_OK, 1)
165 AC_DEFINE(FD_NEED_SELECT_H, 0)
168 AC_DEFINE_UNQUOTED(HEADER_FD, ${ucsim_cv_fd})
171 # Checking for functions/libs
172 # ===========================================================================
173 AC_CHECK_LIB(socket,socket)
174 AC_CHECK_LIB(nsl,xdr_short)
175 AC_CHECK_LIB(dl,dlopen,
182 AC_CHECK_LIB(panel,panel_above,
185 CURSES_LIBS="-lpanel -lcurses"
188 AC_CHECK_LIB(curses,nl,
190 CURSES_LIBS="-lcurses"
197 AC_SUBST(CURSES_LIBS)
200 AC_CHECK_FUNCS(vsnprintf vasprintf)
201 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
202 AC_CHECK_FUNCS(strchr memcpy)
203 dnl AC_CHECK_FUNCS(getline)
204 dnl AC_CHECK_FUNCS(getdelim)
205 AC_CHECK_FUNCS(fgets)
206 AC_CHECK_FUNCS(yylex)
208 AC_CACHE_CHECK(whether scanf knows %a, ucsim_cv_scanf_a,
209 [echo "a b" >conftest.data
217 if ((f= fopen("conftest.data", "r")) == NULL)
219 i= fscanf(f, " %a[a-z] ", &a);
227 ucsim_cv_scanf_a="yes",
228 ucsim_cv_scanf_a="no",
229 ucsim_cv_scanf_a="unknown")
231 if test "$ucsim_cv_scanf_a" = "yes"; then
235 AC_CACHE_CHECK(whether getcwd is GNUish, ucsim_cv_getcwd,
240 if ((getcwd(NULL, 0)) == NULL)
244 ucsim_cv_getcwd="yes",
245 ucsim_cv_getcwd="no",
246 ucsim_cv_getcwd="unknown")
248 if test "$ucsim_cv_getcwd" = "yes"; then
249 AC_DEFINE(GNU_GETCWD)
252 AC_DEFUN(ucsim_ACCEPT_LENGTH_T,
253 [AC_CACHE_CHECK([for type of length pointer parameter of accept],
254 ucsim_cv_accept_length_type,
255 [ac_save_CPPFLAGS="$CPPFLAGS"
256 ucsim_cv_accept_length_type=no
257 for ac_val in int size_t socklen_t; do
258 CPPFLAGS="$ac_save_CPPFLAGS -DACCEPT_SOCKLEN_T=$ac_val"
259 AC_TRY_COMPILE([#include <sys/types.h>
260 #include <sys/socket.h>],
261 [struct sockaddr a; $ac_val len; accept (0, &a, &len);],
262 [ucsim_cv_accept_length_type=$ac_val; break])
264 CPPFLAGS="$ac_save_CPPFLAGS"])
265 if test "$ucsim_cv_accept_length_type" != no; then
266 AC_DEFINE_UNQUOTED(ACCEPT_SOCKLEN_T, $ucsim_cv_accept_length_type,
267 [Define to be the type of length parameter of accept (without the \*').])
273 ucsim_ACCEPT_LENGTH_T
278 # DD_COPT macro checks if the compiler specified as the 1st parameter
279 # supports option specified as the 2nd parameter
280 # For example: DD_COPT(CXX, fPIC)
283 AC_CACHE_CHECK(whether $$1 accepts -$2,ucsim_cv_$1$2,
288 $$1 -v -$2 -c _test_.c 1>&5 2>&5
289 if test "$?" = "0"; then
294 rm -f _test_.* a.out)
298 # Checking characteristics of compilers and other programs
299 # --------------------------------------------------------
301 # Cross compiling overrides
303 if test "$CC" = "i586-mingw32msvc-gcc"; then
309 ac_cv_sizeof_long_long=4
312 if test "$cross_compiling" = "no"
317 if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
322 #echo "CROSS ENDIAN DONE"
325 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,ucsim_cv_MM,
326 echo "#include <stdio.h>" >_test_.c
328 $CXXCPP -v -MM _test_.c 1>&5 2>&5
329 if test "$?" = "0"; then
338 # This is the first time when CFLAGS are set/modified!!
341 if test "$ucsim_cv_CXXggdb" = "yes"; then
342 if test "$CXXFLAGS"x = x ;then
345 CXXFLAGS="$CXXFLAGS -ggdb"
350 if test "$ucsim_cv_CXXpipe" = "yes"; then
351 CXXFLAGS="$CXXFLAGS -pipe"
357 if test "$ucsim_cv_CXXfPIC" = "yes"; then
361 if test "$ucsim_cv_CXXfpic" = "yes"; then
365 if test "$PICOPT"x != "x"; then
368 # If this is Cygwin neither use Position Independant Code
370 # Quick + dirty by Bernhard
372 if $CXX -v 2>&1 | grep -i cygwin 1>&5 2>&5; then
380 if test $SHAREDLIB = "yes" -a $dl_ok = "yes" -a $enable_dlso = "yes"; then
385 # Checks for typedefs, structures, and compiler characteristics.
386 # ===========================================================================
389 if test "$cross_compiling" = "no"; then
390 AC_CHECK_SIZEOF(char)
391 AC_CHECK_SIZEOF(short)
393 AC_CHECK_SIZEOF(long)
394 AC_CHECK_SIZEOF(long long)
396 if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
401 ac_cv_sizeof_long_long=4
410 if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
414 if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
418 if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
422 if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
426 if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
433 AC_MSG_CHECKING(type name for byte)
434 TYPE_BYTE=`type_name 1`
435 AC_MSG_RESULT($TYPE_BYTE)
436 AC_MSG_CHECKING(type name for word)
437 TYPE_WORD=`type_name 2`
438 AC_MSG_RESULT($TYPE_WORD)
439 AC_MSG_CHECKING(type name for dword)
440 TYPE_DWORD=`type_name 4`
441 AC_MSG_RESULT($TYPE_DWORD)
442 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
443 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
444 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
446 if echo $TYPE_DWORD|grep short >/dev/null; then
448 elif echo $TYPE_DWORD|grep long >/dev/null; then
454 if echo $TYPE_WORD|grep short >/dev/null; then M="h"
455 elif echo $TYPE_WORD|grep long >/dev/null; then M="l"
459 AC_DEFINE_UNQUOTED(_A_, "${A}")
460 AC_DEFINE_UNQUOTED(_M_, "${M}")
463 # Generating output files
464 # ===========================================================================
466 AC_OUTPUT(main.mk:main_in.mk
467 packages.mk:packages_in.mk
475 gui.src/serio.src/Makefile
479 #gui.src/portmon.src/Makefile
482 # End of configure/configure.in