5 AC_CONFIG_SRCDIR([Makefile.in])
6 AC_CONFIG_HEADER(sdccconf.h:sdccconf_in.h)
10 AC_MSG_CHECKING(version of the package)
11 if test -f ${srcdir}/.version; then
12 VERSION=`cat ${srcdir}/.version`
13 elif test -f ../.version; then
14 VERSION=`cat ../.version`
18 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
19 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
20 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
22 AC_MSG_RESULT(${VERSION})
27 AC_DEFINE_UNQUOTED(SDCC_VERSION_LO, ${VERSIONLO})
28 AC_DEFINE_UNQUOTED(SDCC_VERSION_HI, ${VERSIONHI})
29 AC_DEFINE_UNQUOTED(SDCC_VERSION_P, ${VERSIONP})
30 AC_DEFINE_UNQUOTED(SDCC_VERSION_STR, "${VERSION}")
32 sdcc_cv_version=$VERSION
33 sdcc_cv_versionhi=$VERSIONHI
34 sdcc_cv_versionlo=$VERSIONLO
35 sdcc_cv_versionp=$VERSIONP
39 # ===========================================================================
47 AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, :)
48 AC_CHECK_PROG(STRIP, strip, strip, :)
49 AC_CHECK_PROG(AS, as, as, :)
50 AC_CHECK_PROG(CP, cp, cp, :)
52 AC_DEFUN(SDCC_REQUIRE_PROG,
53 [if test "$1" = ":"; then
54 AC_MSG_ERROR([Cannot find required program $2.])
58 SDCC_REQUIRE_PROG($YACC, bison)
59 SDCC_REQUIRE_PROG($LEX, lex)
64 # Checking for header files.
65 # ===========================================================================
66 AC_CHECK_HEADERS(sys/socket.h)
69 # Checking for functions/libs
70 # ===========================================================================
71 AC_CHECK_LIB(socket,socket)
72 AC_CHECK_LIB(nsl,xdr_short)
75 # Checking for functions
76 # ===========================================================================
77 AC_CHECK_FUNCS(strerror)
78 AC_CHECK_FUNCS(vsnprintf snprintf vsprintf mkstemp)
82 # ===========================================================================
84 # adl_DD_COPT macro checks if the compiler specified as the 1st parameter
85 # supports option specified as the 2nd parameter
86 # For example: DD_CPORT(CXX, fPIC)
88 AC_DEFUN(adl_DD_COPT, [
89 AC_CACHE_CHECK(whether $$1 accepts -$2,sdcc_cv_$1$2,
94 $$1 -v -$2 -c _test_.c 1>&5 2>&5
95 if test "$?" = "0"; then
100 rm -f _test_.* a.out)
103 # This macro expands DIR and assigns it to RET.
104 # If DIR is NONE, then it's replaced by DEFAULT.
106 # Based on AC_DEFINE_DIR
110 # adl_EXPAND(prefix, "/usr/local", expanded_prefix)
112 AC_DEFUN([adl_EXPAND], [
113 test "x$prefix" = xNONE && prefix="$ac_default_prefix"
114 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
116 test "x$ac_expand" = xNONE && ac_expand="[$]$2"
117 ac_expand=`eval echo [$]ac_expand`
118 $3=`eval echo [$]ac_expand`
123 # - empty paths are changed to '.'
124 # - trailing slashes are removed
125 # - repeated slashes are squeezed except a leading doubled slash '//'
126 # (which might indicate a networked disk on some OS).
129 # REFERENCE_STRING is used to turn '/' into '\' and vice-versa: if
130 # REFERENCE_STRING contains some backslashes, all slashes and backslashes
131 # are turned into backslashes, otherwise they are all turned into slashes.
133 # This makes processing of DOS filenames quite easier, because you can turn a
134 # filename to the Unix notation, make your processing, and turn it back to
137 dnl Available from the GNU Autoconf Macro Archive at:
138 dnl http://www.gnu.org/software/ac-archive/htmldoc/normpath.html
140 AC_DEFUN([adl_NORMALIZE_PATH],
142 dnl change empty paths to '.'
144 dnl strip trailing slashes
145 :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
148 dnl squeze repeated slashes
149 case ifelse($2,,"[$]$1",$2) in
150 dnl if the path contains any backslashes, turn slashes into backslashes
152 dnl Bernhard Held 2003-04-06
153 dnl This was the original line. It does not:
154 dnl - convert the first slash
155 dnl - replace a slash with a double-backslash
156 dnl *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
157 *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\\\\\,g
158 s,^[[\\/]],\\\\\\\\,'` ;;
160 dnl if the path contains slashes, also turn backslashes into slashes
161 *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
165 # adl_COMPUTE_RELATIVE_PATH
167 # PATH_LIST is a space-separated list of colon-separated triplets of the form
168 # 'FROM:TO:RESULT'. This function iterates over these triplets and set $RESULT
169 # to the relative path from $FROM to $TO. Note that $FROM and $TO needs to be
170 # absolute filenames for this macro to success.
172 AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS],
173 [for _lcl_i in $1; do
174 _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'`
175 _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'`
176 _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'`
177 adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from])
178 adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to])
179 _lcl_notation="$_lcl_from$_lcl_to"
180 adl_NORMALIZE_PATH([_lcl_from],['/'])
181 adl_NORMALIZE_PATH([_lcl_to],['/'])
182 adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp])
183 adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"])
184 eval $_lcl_result_var='[$]_lcl_result_tmp'
189 ## The following helper macros are too fragile to be used out
190 ## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that
191 ## paths are normalized), that's why I'm keeping them in the same file.
192 ## Still, some of them maybe worth to reuse.
194 dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT)
195 dnl ===========================================
196 dnl Compute the relative path to go from $FROM to $TO and set the value
197 dnl of $RESULT to that value. This function work on raw filenames
198 dnl (for instead it will considerate /usr//local and /usr/local as
199 dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS
200 dnl instead to have the paths sanitized automatically.
203 dnl first_dir=/somewhere/on/my/disk/bin
204 dnl second_dir=/somewhere/on/another/disk/share
205 dnl adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second)
206 dnl will set $first_to_second to '../../../another/disk/share'.
207 AC_DEFUN([adl_COMPUTE_RELATIVE_PATH],
208 [adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix])
209 adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel])
210 adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix])
211 $3="[$]_lcl_first_rel[$]_lcl_second_suffix"])
213 dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT)
214 dnl ============================================
215 dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT.
218 dnl first_path=/somewhere/on/my/disk/bin
219 dnl second_path=/somewhere/on/another/disk/share
220 dnl adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path)
221 dnl will set $common_path to '/somewhere/on'.
222 AC_DEFUN([adl_COMPUTE_COMMON_PATH],
224 _lcl_second_prefix_match=''
225 while test "[$]_lcl_second_prefix_match" != 0; do
226 _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"`
227 _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"`
228 if test "[$]_lcl_second_prefix_match" != 0; then
229 if test "[$]_lcl_first_prefix" != "[$]$3"; then
230 $3="[$]_lcl_first_prefix"
232 _lcl_second_prefix_match=0
237 dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT)
238 dnl ==============================================
239 dnl Substrack $SUBPATH from $PATH, and set the resulting suffix
240 dnl (or the empty string if $SUBPATH is not a subpath of $PATH)
244 dnl first_path=/somewhere/on/my/disk/bin
245 dnl second_path=/somewhere/on
246 dnl adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path)
247 dnl will set $common_path to '/my/disk/bin'.
248 AC_DEFUN([adl_COMPUTE_SUFFIX_PATH],
249 [$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`])
251 dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT)
252 dnl ============================================
253 dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that
254 dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../'
255 dnl should be needed to move from $PATH to $SUBPATH) and set the value
256 dnl of $RESULT to that value. If $SUBPATH is not a subpath of PATH,
257 dnl set $RESULT to the empty string.
260 dnl first_path=/somewhere/on/my/disk/bin
261 dnl second_path=/somewhere/on
262 dnl adl_COMPUTE_BACK_PATH(first_path, second_path, back_path)
263 dnl will set $back_path to '../../../'.
264 AC_DEFUN([adl_COMPUTE_BACK_PATH],
265 [adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix])
268 while test "[$]_lcl_tmp" != ''; do
269 _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"`
270 if test "[$]_lcl_first_suffix" != ''; then
271 _lcl_first_suffix="[$]_lcl_tmp"
277 dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
278 dnl =================================
279 dnl Interpolate the VALUE in loop until it does not change,
280 dnl and set the result to $RESULT.
281 dnl WARNING: It is easy to get an infinite loop with some unsane input.
282 AC_DEFUN([adl_RECURSIVE_EVAL],
284 $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
285 test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
287 while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
288 _lcl_receval_old="[$]_lcl_receval"
289 eval _lcl_receval="\"[$]_lcl_receval\""
291 echo "[$]_lcl_receval")`])
293 dnl adl_NORMALIZE_DEFINE_UNQUOTED(var, DEFINE, REFERENCE_STRING)
294 AC_DEFUN([adl_NORMALIZE_DEFINE_UNQUOTED], [
296 adl_NORMALIZE_PATH([ac_ndu], [$]$3)
297 AC_DEFINE_UNQUOTED($2, "${ac_ndu}")
300 dnl adl_NORMALIZE_PATH_MSG(input_string, var, dir_separator)
301 dnl ========================================================
302 dnl call adl_NORMALIZE_PATH and format it for the result message
303 AC_DEFUN([adl_NORMALIZE_PATH_MSG], [
305 $2=`echo "$1" | sed 's,/\./,/,g'`
306 adl_NORMALIZE_PATH([$2], [$3])
308 $2=`echo "[$]$2" | sed 's,\\\\\\\\,\\\\,g'`
312 # Checking characteristics of compilers and other programs
313 # ===========================================================================
314 AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,sdcc_cv_MM,
315 echo "#include <stdio.h>" >_test_.c
317 $CPP -v -MM _test_.c 1>&5 2>&5
318 if test "$?" = "0"; then
327 # This is the first time when CFLAGS are set/modified!!
328 adl_DD_COPT(CC, ggdb)
329 if test "$sdcc_cv_CCggdb" = "yes"; then
330 CFLAGS="-ggdb ${CFLAGS}"
333 adl_DD_COPT(CC, pipe)
334 if test "$sdcc_cv_CCpipe" = "yes"; then
335 CFLAGS="-pipe $CFLAGS"
339 # Checks for typedefs, structures, and compiler characteristics.
340 # ===========================================================================
343 AC_CHECK_SIZEOF(char)
344 AC_CHECK_SIZEOF(short)
346 AC_CHECK_SIZEOF(long)
351 if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
355 if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
359 if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
363 if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
370 AC_MSG_CHECKING(type name for byte)
371 TYPE_CHAR=`type_name 1`
372 if test "$ac_cv_c_char_unsigned" = "yes"; then
373 TYPE_BYTE="signed $TYPE_CHAR"
377 AC_MSG_RESULT($TYPE_BYTE)
378 AC_MSG_CHECKING(type name for word)
379 TYPE_WORD=`type_name 2`
380 AC_MSG_RESULT($TYPE_WORD)
381 AC_MSG_CHECKING(type name for dword)
382 TYPE_DWORD=`type_name 4`
383 AC_MSG_RESULT($TYPE_DWORD)
385 AC_DEFINE_UNQUOTED(TYPE_BYTE, $TYPE_BYTE)
386 AC_DEFINE_UNQUOTED(TYPE_WORD, $TYPE_WORD)
387 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD)
389 AC_DEFINE_UNQUOTED(TYPE_UBYTE, unsigned $TYPE_CHAR)
390 AC_DEFINE_UNQUOTED(TYPE_UWORD, unsigned $TYPE_WORD)
391 AC_DEFINE_UNQUOTED(TYPE_UDWORD, unsigned $TYPE_DWORD)
395 # Set standard installation paths
396 # ===========================================================================
398 # In the Makefiles we need paths with '/' as directory separator, even if
399 # crosscompiling for Win32.
400 # And we want to preserve the macros (e.g. ${prefix}) in the Makefiles.
401 # The variables in the Makefiles are replaced by AC_SUBST()
403 # In sdccconf.h the '/' in paths can be replaced by "\\" (normalized), if
405 # The macros are expanded for the header.
406 # The variables in the header are replaced by AC_*DEFINE*()
407 # sdccconf_h_dir_separator contains a backslash.
408 AC_ARG_VAR(sdccconf_h_dir_separator, needed in sdccconf.h: either "/" (default) or "\\")
409 if test "x${sdccconf_h_dir_separator}" = "x"; then
410 sdccconf_h_dir_separator="/"
416 # include_dir_suffix:
417 # *nix default: "sdcc/include"
419 AC_ARG_VAR(include_dir_suffix, appended to datadir to define SDCC's include directory)
420 if test "${include_dir_suffix}" = ""; then
421 include_dir_suffix="sdcc/include"
423 AC_SUBST(include_dir_suffix)
426 # *nix default: "sdcc/lib"
427 AC_ARG_VAR(lib_dir_suffix, appended to datadir to define SDCC's library root directory)
428 if test "${lib_dir_suffix}" = ""; then
429 lib_dir_suffix="sdcc/lib"
431 AC_SUBST(lib_dir_suffix)
434 # *nix default: "${datadir}/sdcc/doc"
435 AC_ARG_VAR(docdir, documentation installation directory)
436 if test "${docdir}" = ""; then
437 docdir="\${datadir}"/sdcc/doc
446 AC_DEFINE_UNQUOTED(DIR_SEPARATOR_STRING, "${sdccconf_h_dir_separator}")
447 AC_DEFINE_UNQUOTED(DIR_SEPARATOR_CHAR , '${sdccconf_h_dir_separator}')
450 # default: "NONE", ${ac_default_prefix}: "/usr/local"
451 adl_EXPAND(prefix, ac_default_prefix, expanded_prefix)
452 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_prefix, PREFIX, sdccconf_h_dir_separator)
455 # default: "${prefix}"
456 adl_EXPAND(exec_prefix, expanded_prefix, expanded_exec_prefix)
457 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_exec_prefix, EXEC_PREFIX, sdccconf_h_dir_separator)
460 # default: "${exec_prefix}/bin"
461 adl_EXPAND(bindir, "NONE", expanded_bindir)
462 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_bindir, BINDIR, sdccconf_h_dir_separator)
465 # default: "${prefix}/share"
466 adl_EXPAND(datadir, "NONE", expanded_datadir)
467 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_datadir, DATADIR, sdccconf_h_dir_separator)
470 norm_inc_dir_suffix=${include_dir_suffix}
471 adl_NORMALIZE_PATH([norm_inc_dir_suffix], [$sdccconf_h_dir_separator])
472 AC_DEFINE_UNQUOTED(INCLUDE_DIR_SUFFIX,
473 DIR_SEPARATOR_STRING "${norm_inc_dir_suffix}")
474 norm_lib_dir_suffix=${lib_dir_suffix}
475 adl_NORMALIZE_PATH([norm_lib_dir_suffix], [$sdccconf_h_dir_separator])
476 AC_DEFINE_UNQUOTED(LIB_DIR_SUFFIX,
477 DIR_SEPARATOR_STRING "${norm_lib_dir_suffix}")
480 adl_COMPUTE_RELATIVE_PATHS([expanded_bindir:expanded_datadir:bin2data_dir])
481 adl_NORMALIZE_PATH(bin2data_dir, [$sdccconf_h_dir_separator])
482 AC_DEFINE_UNQUOTED(BIN2DATA_DIR,
483 DIR_SEPARATOR_STRING "${bin2data_dir}")
485 adl_COMPUTE_RELATIVE_PATHS([expanded_prefix:expanded_bindir:prefix2bin_dir])
486 adl_NORMALIZE_PATH(prefix2bin_dir, [$sdccconf_h_dir_separator])
487 AC_DEFINE_UNQUOTED(PREFIX2BIN_DIR,
488 DIR_SEPARATOR_STRING "${prefix2bin_dir}")
490 adl_COMPUTE_RELATIVE_PATHS([expanded_prefix:expanded_datadir:prefix2data_dir])
491 adl_NORMALIZE_PATH(prefix2data_dir, [$sdccconf_h_dir_separator])
492 if test "${prefix2data_dir}" = "."; then
493 # small optimization for Mingw32; otherwise Borut will complain ;-)
494 AC_DEFINE_UNQUOTED(PREFIX2DATA_DIR, "")
496 AC_DEFINE_UNQUOTED(PREFIX2DATA_DIR,
497 DIR_SEPARATOR_STRING "${prefix2data_dir}")
501 AC_DEFINE_UNQUOTED(STD_LIB, "libsdcc")
502 AC_DEFINE_UNQUOTED(STD_INT_LIB, "libint")
503 AC_DEFINE_UNQUOTED(STD_LONG_LIB, "liblong")
504 AC_DEFINE_UNQUOTED(STD_FP_LIB, "libfloat")
505 AC_DEFINE_UNQUOTED(STD_DS390_LIB, "libds390")
506 AC_DEFINE_UNQUOTED(STD_DS400_LIB, "libds400")
507 AC_DEFINE_UNQUOTED(STD_XA51_LIB, "libxa51")
509 # SDCC runtime environment variables
510 sdcc_dir_name="SDCC_HOME"
511 AC_DEFINE_UNQUOTED(SDCC_DIR_NAME, "${sdcc_dir_name}")
513 sdcc_include_name="SDCC_INCLUDE"
514 AC_DEFINE_UNQUOTED(SDCC_INCLUDE_NAME, "${sdcc_include_name}")
516 sdcc_lib_name="SDCC_LIB"
517 AC_DEFINE_UNQUOTED(SDCC_LIB_NAME, "${sdcc_lib_name}")
519 # Port selection helper
520 # ===========================================================================
521 # macro AC_DO_ENABLER()
522 # $1 used to access enable_$1, e.g. enable-doc
523 # $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
525 AC_DEFUN([AC_DO_ENABLER], [
526 AC_ARG_ENABLE($1, AC_HELP_STRING([--enable-$1], $3))
528 if test "[$]enable_$1" = "yes"; then
534 AC_DEFINE_UNQUOTED(OPT_ENABLE_$2, [$]OPT_ENABLE_$2)
535 AC_SUBST(OPT_ENABLE_$2)
538 # macro AC_DO_DISABLER()
539 # $1 used to access disable_$1, e.g. ucsim
540 # $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. UCSIM
542 AC_DEFUN([AC_DO_DISABLER], [
543 AC_ARG_ENABLE($1, AC_HELP_STRING([--disable-$1], $3))
545 dnl the '-' in 'device-lib' needs special handling,
546 dnl because the variable is 'enable_device_lib'
547 arg1=`echo $1 | sed s/-/_/`
549 if test "`eval echo \\$enable_$arg1`" = "no"; then
555 AC_DEFINE_UNQUOTED(OPT_DISABLE_$2, [$]OPT_DISABLE_$2)
556 AC_SUBST(OPT_DISABLE_$2)
559 # macro AC_DO_PORT($1, $2, $3, $4)
560 # $1 used to access enable_$2_port, e.g. gbz80
561 # $2 port name in ports.all and ports.build, e.g. z80
562 # $3 OPT_DISABLE_$3, normally uppercase of $2, e.g. GBZ80
564 AC_DEFUN([AC_DO_PORT], [
565 AC_ARG_ENABLE($1-port,
566 AC_HELP_STRING([--disable-$1-port], $4))
568 if test "[$]enable_$1_port" = "no"; then
575 AC_DEFINE_UNQUOTED(OPT_DISABLE_$3, [$]OPT_DISABLE_$3)
576 AC_SUBST(OPT_DISABLE_$3)
579 if test [$]OPT_DISABLE_$3 = 0; then
580 echo $2 >>ports.build
584 # Now handle the port selection
585 # ===========================================================================
586 rm -f ports.all ports.build
587 AC_DO_PORT(mcs51, mcs51, MCS51, [Excludes the Intel mcs51 port])
588 AC_DO_PORT(gbz80, z80, GBZ80, [Excludes the Gameboy gbz80 port])
589 AC_DO_PORT(z80, z80, Z80, [Excludes the z80 port])
590 AC_DO_PORT(avr, avr, AVR, [Excludes the AVR port])
591 AC_DO_PORT(ds390, ds390, DS390, [Excludes the DS390 port])
592 AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, $OPT_DISABLE_DS390)
593 AC_DO_PORT(ds400, ds400, DS400, [Excludes the DS400 port])
594 AC_DO_PORT(pic, pic, PIC, [Excludes the PIC port])
595 AC_DO_PORT(pic16, pic16, PIC16, [Excludes the PIC16 port])
596 AC_DO_PORT(xa51, xa51, XA51, [Excludes the XA51 port])
597 AC_DO_PORT(hc08, hc08, HC08, [Excludes the HC08 port])
599 AC_DO_DISABLER(ucsim, UCSIM, [Disables configuring and building of ucsim])
600 AC_DO_DISABLER(device-lib, DEVICE_LIB, [Disables building device libraries])
601 AC_DO_DISABLER(packihx, PACKIHX, [Disables building packihx])
602 AC_DO_DISABLER(sdcpp, SDCPP, [Disables building sdcpp])
604 AC_DO_ENABLER(doc, DOC, [Enables building the documentation])
605 if test $OPT_ENABLE_DOC = 1; then
606 AC_CHECK_PROG(LYX, lyx, lyx, :)
607 # AC_CHECK_PROG(LATEX, latex, latex, :)
608 AC_CHECK_PROG(LATEX2HTML, latex2html, latex2html, :)
609 AC_CHECK_PROG(PDFLATEX, pdflatex, pdflatex, :)
610 AC_CHECK_PROG(PDFOPT, pdfopt, pdfopt, :)
611 # AC_CHECK_PROG(DVIPDF, dvipdf, dvipdf, :)
612 # AC_CHECK_PROG(DVIPS, dvips, dvips, :)
613 AC_CHECK_PROG(MAKEINDEX, makeindex, makeindex, :)
615 SDCC_REQUIRE_PROG($LYX, lyx)
616 # SDCC_REQUIRE_PROG($LATEX, latex)
617 SDCC_REQUIRE_PROG($LATEX2HTML, latex2html)
618 SDCC_REQUIRE_PROG($PDFLATEX, pdflatex)
619 SDCC_REQUIRE_PROG($PDFOPT, pdfopt)
620 # SDCC_REQUIRE_PROG($DVIPDF, dvipdf)
621 # SDCC_REQUIRE_PROG($DVIPS, dvips)
622 SDCC_REQUIRE_PROG($MAKEINDEX, makeindex)
625 AC_DO_ENABLER(libgc, LIBGC, [Use the Bohem memory allocator. Lower runtime footprint.])
626 if test $OPT_ENABLE_LIBGC = 1; then
627 AC_CHECK_LIB(gc, GC_malloc)
628 if test $ac_cv_lib_gc_GC_malloc = no; then
629 AC_MSG_ERROR([Cannot find library libgc with Bohem memory allocator.])
636 uniq ports.build ports
639 # Generating output files
640 # ===========================================================================
641 test $OPT_DISABLE_SDCPP = 0 && AC_CONFIG_SUBDIRS(support/cpp2)
642 test $OPT_DISABLE_PACKIHX = 0 && AC_CONFIG_SUBDIRS(support/packihx)
643 test $OPT_DISABLE_UCSIM = 0 && AC_CONFIG_SUBDIRS(sim/ucsim)
644 AC_CONFIG_FILES([doc/Makefile])
646 test $OPT_DISABLE_AVR = 0 && AC_CONFIG_FILES([src/avr/Makefile])
648 if test $OPT_DISABLE_DS390 = 0; then
649 AC_CONFIG_FILES([src/ds390/Makefile])
650 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/ds390/Makefile])
653 if test $OPT_DISABLE_DS400 = 0; then
654 AC_CONFIG_FILES([src/ds400/Makefile])
655 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/ds400/Makefile])
658 if test $OPT_DISABLE_HC08 = 0; then
659 AC_CONFIG_FILES([src/hc08/Makefile
661 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/hc08/Makefile])
664 if test $OPT_DISABLE_MCS51 = 0; then
665 AC_CONFIG_FILES([src/mcs51/Makefile
667 debugger/mcs51/Makefile])
668 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/mcs51/Makefile
669 device/lib/small/Makefile
670 device/lib/medium/Makefile
671 device/lib/large/Makefile])
674 if test $OPT_DISABLE_PIC = 0; then
675 AC_CONFIG_FILES(src/pic/Makefile)
676 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/lib/pic)
678 if test $OPT_DISABLE_PIC16 = 0; then
679 AC_CONFIG_FILES(src/pic16/Makefile)
680 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/lib/pic16)
683 test $OPT_DISABLE_XA51 = 0 && AC_CONFIG_FILES([src/xa51/Makefile])
685 if test $OPT_DISABLE_Z80 = 0; then
686 AC_CONFIG_FILES([src/z80/Makefile
691 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/z80/Makefile
692 device/lib/gbz80/Makefile])
695 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/Makefile])
697 AC_CONFIG_FILES([main.mk:main_in.mk
699 device/include/Makefile
700 support/librarian/Makefile
701 support/makebin/Makefile
702 support/regression/Makefile
703 support/valdiag/Makefile
705 Makefile.common:Makefile.common.in
709 # I found no better place
712 # Prepare result message
713 # ======================
715 # In the C-header we need \\ as dir-separator, but in the message only \
716 dirch=${sdccconf_h_dir_separator}
717 test ${dirch} = '\\' && dirch='\'
719 # calc friendly strings
720 adl_NORMALIZE_PATH_MSG(/${prefix2bin_dir}, [binPath], [$dirch])
721 adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_inc_dir_suffix}, [incPath1], [$dirch])
722 adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_inc_dir_suffix}, [incPath2], [$dirch])
723 adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_inc_dir_suffix}, [incPath3], [$dirch])
724 adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_lib_dir_suffix}, [libPath1], [$dirch])
725 adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_lib_dir_suffix}, [libPath2], [$dirch])
726 adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_lib_dir_suffix}, [libPath3], [$dirch])
729 sdcc ${VERSION} is now configured for
731 Build: ${build_alias}
733 Source directory: ${srcdir}
738 avr ${enable_avr_port}
739 ds390 ${enable_ds390_port}
740 ds400 ${enable_ds400_port}
741 gbz80 ${enable_gbz80_port}
742 hc08 ${enable_hc08_port}
743 pic ${enable_pic_port}
744 pic16 ${enable_pic16_port}
745 xa51 ${enable_xa51_port}
746 z80 ${enable_z80_port}
748 Disable packihx: ${OPT_DISABLE_PACKIHX}
749 Disable ucsim: ${OPT_DISABLE_UCSIM}
750 Disable device lib: ${OPT_DISABLE_DEVICE_LIB}
751 Disable sdcpp: ${OPT_DISABLE_SDCPP}
752 Enable documentation: ${OPT_ENABLE_DOC}
753 Enable libgc: ${OPT_ENABLE_LIBGC}
756 binary files: ${exec_prefix}
757 include files: ${datadir}/${include_dir_suffix}
758 library files: ${datadir}/${lib_dir_suffix}
759 documentation: ${docdir}
764 Search paths (incomplete, see manual for all search paths):
765 binary files: \$SDCC_HOME${binPath}
766 include files: ${incPath1}
767 path(argv[[0]])${incPath2}
769 library files: \$SDCC_HOME${libPath1}${dirch}<model>
770 path(argv[[0]])${libPath2}${dirch}<model>
771 ${libPath3}${dirch}<model>
773 # End of configure/configure.in