4 AC_CONFIG_HEADER(ddconfig.h:ddconfig_in.h)
8 AC_MSG_CHECKING(version of the package)
9 if test -f ${srcdir}/.version; then
10 VERSION=`cat ${srcdir}/.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)
30 # *nix default: "${datadir}/sdcc/doc"
31 AC_ARG_VAR(docdir, documentation installation directory)
32 if test "${docdir}" = ""; then
33 docdir="\${datadir}"/sdcc/doc
38 [ --enable-ucsim compile ucsim frontend],
39 if test $enable_ucsim != "no"; then
45 [ --enable-dlso compile dynamically loadable shared libraries],
46 if test $enable_dlso != "no"; then
51 [ --disable-51 do not compile simulator for MCS51],
52 if test $enable_51 != "no"; then
57 [ --disable-avr do not compile simulator for AVR],
58 if test $enable_avr != "no"; then
63 [ --disable-z80 do not compile simulator for Z80],
64 if test $enable_z80 != "no"; then
69 [ --disable-hc08 do not compile simulator for hc08],
70 if test $enable_hc08 != "no"; then
75 [ --enable-xa compile simulator for XA],
76 if test $enable_xa != "no"; then
80 AC_ARG_ENABLE(portmon,
81 [ --enable-serio compile serio GUI tool (needs curses)],
82 if test $enable_serio != "no"; then
86 AC_SUBST(enable_ucsim)
93 AC_SUBST(enable_serio)
95 AC_ARG_ENABLE(statistic,
96 [ --enable-statistic compile statistical features (slower simulation)],
97 if test $enable_statistic != "no"; then
98 enable_statistic="yes"
100 enable_statistic="no")
101 AC_DEFINE_UNQUOTED(STATISTIC, $enable_statistic)
110 dnl AC_LANG_CPLUSPLUS
112 AC_CHECK_PROG(STRIP, strip, strip, :)
115 dnl AC_LIBTOOL_WIN32_DLL
117 AC_SUBST(LIBTOOL_DEPS)
120 if test ${LEX} = "flex"; then
124 AC_CHECK_PROG(BISON_PLUS_PLUS, bison++, bison++, :)
129 # Checking for header files.
130 # ===========================================================================
132 if test -d /stuff/include; then
133 CPPFLAGS="$CPPFLAGS -I/stuff/include"
137 AC_CHECK_HEADERS(getopt.h)
138 AC_CHECK_HEADERS(unistd.h)
139 AC_CHECK_HEADER(sys/socket.h,
140 AC_DEFINE(SOCKET_AVAIL)
141 AC_DEFINE(HAVE_SYS_SOCKET_H)
142 AC_EGREP_HEADER(socklen_t,
144 AC_DEFINE_UNQUOTED(SOCKLEN_T, socklen_t),
145 AC_DEFINE_UNQUOTED(SOCKLEN_T, uint))
147 AC_CHECK_HEADER(dlfcn.h)
150 # This must be after CXXCPP
152 AC_CACHE_CHECK(which header file defines FD_ macros, ucsim_cv_fd,
153 [ucsim_cv_fd="unknown"
155 #include <sys/time.h>
158 #endif], ucsim_cv_fd="<sys/time.h>")
160 #include <sys/types.h>
163 #endif], ucsim_cv_fd="<sys/types.h>")
165 #include <sys/select.h>
168 #endif], ucsim_cv_fd="<sys/types.h>")])
170 AC_DEFINE(FD_HEADER_OK, 0)
171 if echo $ucsim_cv_fd|grep time >/dev/null 2>&1; then
172 AC_DEFINE(FD_NEED_TIME_H, 1)
173 AC_DEFINE(FD_HEADER_OK, 1)
175 AC_DEFINE(FD_NEED_TIME_H, 0)
177 if echo $ucsim_cv_fd|grep types >/dev/null 2>&1; then
178 AC_DEFINE(FD_NEED_TYPES_H, 1)
179 AC_DEFINE(FD_HEADER_OK, 1)
181 AC_DEFINE(FD_NEED_TYPES_H, 0)
183 if echo $ucsim_cv_fd|grep select >/dev/null 2>&1; then
184 AC_DEFINE(FD_NEED_SELECT_H, 1)
185 AC_DEFINE(FD_HEADER_OK, 1)
187 AC_DEFINE(FD_NEED_SELECT_H, 0)
190 AC_DEFINE_UNQUOTED(HEADER_FD, ${ucsim_cv_fd})
193 # Checking for functions/libs
194 # ===========================================================================
195 AC_CHECK_LIB(socket,socket)
196 AC_CHECK_LIB(nsl,xdr_short)
197 AC_CHECK_LIB(dl,dlopen,
205 #AC_CHECK_LIB(panel,panel_above,
208 #CURSES_LIBS="-lpanel -lcurses"
211 #AC_CHECK_LIB(curses,nl,
213 #CURSES_LIBS="-lcurses"
219 AC_CHECK_LIB(panel,panel_above,
222 CURSES_LIBS="-lpanel",
227 if test $curses_ok != yes; then
228 AC_CHECK_LIB(curses,nl,
230 CURSES_LIBS="-lcurses",
234 if test $curses_ok != yes; then
235 AC_CHECK_LIB(ncurses,nl,
237 CURSES_LIBS="-lncurses",
243 AC_SUBST(CURSES_LIBS)
246 AC_CHECK_FUNCS(vsnprintf)
247 AC_CHECK_FUNCS(vasprintf)
248 AC_CHECK_FUNCS(strlen strcpy strcat strstr strcmp strerror strtok strdup)
249 AC_CHECK_FUNCS(strchr memcpy)
250 dnl AC_CHECK_FUNCS(getline)
251 dnl AC_CHECK_FUNCS(getdelim)
252 AC_CHECK_FUNCS(fgets)
253 AC_CHECK_FUNCS(yylex)
255 AC_CACHE_CHECK(whether scanf knows %a, ucsim_cv_scanf_a,
256 [echo "a b" >conftest.data
264 if ((f= fopen("conftest.data", "r")) == NULL)
266 i= fscanf(f, " %a[a-z] ", &a);
274 ucsim_cv_scanf_a="yes",
275 ucsim_cv_scanf_a="no",
276 ucsim_cv_scanf_a="unknown")
278 if test "$ucsim_cv_scanf_a" = "yes"; then
282 AC_CACHE_CHECK(whether getcwd is GNUish, ucsim_cv_getcwd,
287 if ((getcwd(NULL, 0)) == NULL)
291 ucsim_cv_getcwd="yes",
292 ucsim_cv_getcwd="no",
293 ucsim_cv_getcwd="unknown")
295 if test "$ucsim_cv_getcwd" = "yes"; then
296 AC_DEFINE(GNU_GETCWD)
299 AC_DEFUN(ucsim_ACCEPT_LENGTH_T,
300 [AC_CACHE_CHECK([for type of length pointer parameter of accept],
301 ucsim_cv_accept_length_type,
302 [ac_save_CPPFLAGS="$CPPFLAGS"
303 ucsim_cv_accept_length_type=no
304 for ac_val in int size_t socklen_t; do
305 CPPFLAGS="$ac_save_CPPFLAGS -DACCEPT_SOCKLEN_T=$ac_val"
306 AC_TRY_COMPILE([#include <sys/types.h>
307 #include <sys/socket.h>],
308 [struct sockaddr a; $ac_val len; accept (0, &a, &len);],
309 [ucsim_cv_accept_length_type=$ac_val; break])
311 CPPFLAGS="$ac_save_CPPFLAGS"])
312 if test "$ucsim_cv_accept_length_type" != no; then
313 AC_DEFINE_UNQUOTED(ACCEPT_SOCKLEN_T, $ucsim_cv_accept_length_type,
314 [Define to be the type of length parameter of accept (without the \*').])
320 ucsim_ACCEPT_LENGTH_T
325 # DD_COPT macro checks if the compiler specified as the 1st parameter
326 # supports option specified as the 2nd parameter
327 # For example: DD_COPT(CXX, fPIC)
330 AC_CACHE_CHECK(whether $$1 accepts -$2,ucsim_cv_$1$2,
333 int main(void) {return(0);}
335 $$1 -v -$2 -c _test_.c 1>&5 2>&5
336 if test "$?" = "0"; then
341 rm -f _test_.* a.out)
345 # Checking characteristics of compilers and other programs
346 # --------------------------------------------------------
348 # Cross compiling overrides
350 if test "$CC" = "i586-mingw32msvc-gcc"; then
356 ac_cv_sizeof_long_long=4
359 if test "$cross_compiling" = "no"
364 if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
369 #echo "CROSS ENDIAN DONE"
372 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,ucsim_cv_MM,
373 echo "#include <stdio.h>" >_test_.c
375 $CXXCPP -v -MM _test_.c 1>&5 2>&5
376 if test "$?" = "0"; then
385 # This is the first time when CFLAGS are set/modified!!
389 if test "$ucsim_cv_CXXgstabs" = "yes"; then
391 elif test "$ucsim_cv_CXXggdb" = "yes"; then
396 if test "$CXXFLAGS"x = x ;then
399 CXXFLAGS="$CXXFLAGS $gopt"
403 if test "$ucsim_cv_CXXpipe" = "yes"; then
404 CXXFLAGS="$CXXFLAGS -pipe"
410 if test "$ucsim_cv_CXXfPIC" = "yes"; then
414 if test "$ucsim_cv_CXXfpic" = "yes"; then
418 if test "$PICOPT"x != "x"; then
421 # If this is Cygwin neither use Position Independant Code
423 # Quick + dirty by Bernhard
425 if $CXX -v 2>&1 | grep -i cygwin 1>&5 2>&5; then
433 if test $SHAREDLIB = "yes" -a $dl_ok = "yes" -a $enable_dlso = "yes"; then
438 # Checks for typedefs, structures, and compiler characteristics.
439 # ===========================================================================
442 if test "$cross_compiling" = "no"; then
443 AC_CHECK_SIZEOF(char)
444 AC_CHECK_SIZEOF(short)
446 AC_CHECK_SIZEOF(long)
447 AC_CHECK_SIZEOF(long long)
449 if $CXX -v 2>&1|grep "mingw" >/dev/null 2>&1; then
454 ac_cv_sizeof_long_long=4
463 if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
467 if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
471 if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
475 if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
479 if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
486 AC_MSG_CHECKING(type name for byte)
487 TYPE_BYTE=`type_name 1`
488 AC_MSG_RESULT($TYPE_BYTE)
489 AC_MSG_CHECKING(type name for word)
490 TYPE_WORD=`type_name 2`
491 AC_MSG_RESULT($TYPE_WORD)
492 AC_MSG_CHECKING(type name for dword)
493 TYPE_DWORD=`type_name 4`
494 AC_MSG_RESULT($TYPE_DWORD)
495 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
496 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
497 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
499 if echo $TYPE_DWORD|grep short >/dev/null; then
501 elif echo $TYPE_DWORD|grep long >/dev/null; then
507 if echo $TYPE_WORD|grep short >/dev/null; then M="h"
508 elif echo $TYPE_WORD|grep long >/dev/null; then M="l"
512 AC_DEFINE_UNQUOTED(_A_, "${A}")
513 AC_DEFINE_UNQUOTED(_M_, "${M}")
515 # Generating output files
516 # ===========================================================================
520 packages.mk:packages_in.mk
529 gui.src/serio.src/Makefile
533 #gui.src/portmon.src/Makefile
536 # End of configure/configure.in