Hackfix and re-enable strtoull and wcstoull, see bug #3798.
[sdcc.git] / sdcc / configure.ac
blob391c4dea294ac081c1b681744e9ecc740733a0af
1 #!/bin/sh
3 AC_PREREQ([2.71])
4 AC_INIT
5 AC_CONFIG_SRCDIR([.version])
6 AC_CONFIG_SRCDIR([Makefile.in])
8 # Determine the host and build type.
9 # ===========================================================================
10 AC_CANONICAL_HOST
12 AC_CONFIG_HEADERS([sdccconf.h:sdccconf_in.h sdas/linksrc/asxxxx_config.h])
14 AC_PROG_AWK
16 AC_MSG_CHECKING(version of the package)
17 if test -f ${srcdir}/.version; then
18   { read VERSION; } < ${srcdir}/.version
19   AC_MSG_RESULT($VERSION)
20 elif test -f ../.version; then
21   { read VERSION; } < ../.version
22   AC_MSG_RESULT($VERSION)
23 else
24   VERSION="0.0.0"
25   AC_MSG_RESULT(unknown using 0.0.0)
27 VERSIONHI=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $1}'`
28 VERSIONLO=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $2}'`
29 VERSIONP=`echo $VERSION|$AWK 'BEGIN {FS="."} {print $3}'`
31 AC_SUBST(PACKAGE, [sdcc])
32 AC_SUBST(VERSION)
33 AC_SUBST(VERSIONHI)
34 AC_SUBST(VERSIONLO)
35 AC_SUBST(VERSIONP)
36 AC_DEFINE_UNQUOTED(SDCC_VERSION_LO, ${VERSIONLO}, [XXX])
37 AC_DEFINE_UNQUOTED(SDCC_VERSION_HI, ${VERSIONHI}, [XXX])
38 AC_DEFINE_UNQUOTED(SDCC_VERSION_P, ${VERSIONP}, [XXX])
39 AC_DEFINE_UNQUOTED(SDCC_VERSION_STR, "${VERSION}", [XXX])
40 AC_ARG_PROGRAM
41 sdcc_cv_version=$VERSION
42 sdcc_cv_versionhi=$VERSIONHI
43 sdcc_cv_versionlo=$VERSIONLO
44 sdcc_cv_versionp=$VERSIONP
47 # Required programs
48 # ===========================================================================
49 AC_PROG_CC
50 AC_PROG_CPP
51 AC_PROG_CXX
52 AC_PROG_INSTALL
53 AC_PROG_RANLIB
54 AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, :)
55 AC_CHECK_PROG(STRIP, strip, strip, :)
56 AC_CHECK_PROG(AS, as, as, :)
57 AC_CHECK_PROG(CP, cp, cp, :)
58 AC_CHECK_PROG(AR, ar, ar, :)
59 AC_CHECK_PROG(M4, gm4, gm4, m4)
61 dnl Don't use AC_PROG_LEX
62 dnl LEXLIB is not useful in gcc.
63 AC_CHECK_PROGS(LEX, flex lex, :)
65 dnl Don't use AC_PROG_YACC
66 AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc, :)
68 # 2.7 is just a guess for the minimum version. I know it works with 2.7 (and 3.6 and 3.9), but should test if a lower version is sufficient.
69 AM_PATH_PYTHON([2.7],, [:])
71 AC_DEFUN([SDCC_REQUIRE_PROG],
72 [if test "$1" = ":"; then
73   AC_MSG_ERROR([Cannot find required program $2.])
74  fi
77 SDCC_REQUIRE_PROG($YACC, bison)
78 SDCC_REQUIRE_PROG($LEX, flex)
80 AC_LANG([C])
82 AC_CHECK_HEADERS(endian.h sys/endian.h machine/endian.h sys/isa_defs.h)
83 AC_CHECK_HEADERS(uchar.h)
84 # zlib is not needed by sdcc itself, but by sdcpp and sdbinutils.
85 AC_CHECK_HEADERS(zlib.h,,AC_MSG_ERROR([[zlib library not found (zlib.h).]]))
86 AC_LANG_PUSH([C++])
87 AC_CHECK_HEADERS(treedec/combinations.hpp,,AC_MSG_NOTICE([[treedec library missing, falling back to Thorup.]]))
88 AC_CHECK_HEADERS(gala/graph.h)
89 AC_CHECK_HEADERS(boost/graph/adjacency_list.hpp,,AC_MSG_ERROR([[boost library not found (boost/graph/adjacency_list.hpp).]]))
90 AC_LANG_POP([C++])
92 AC_ARG_WITH([ccache],
93     AS_HELP_STRING([--without-ccache],[do not use ccache even if available]),
94     [], [])
95 case x${with_ccache-yes} in
96     xyes) AC_CHECK_PROG([CCACHE], [ccache], [ccache], []) ;;
97     xno) AC_SUBST([CCACHE], []) ;;
98     *) AC_SUBST([CCACHE], [$with_ccache]) ;;
99 esac
102 # Checking for functions
103 # ===========================================================================
104 AC_CHECK_FUNCS(mkstemp strndup setrlimit backtrace_symbols_fd)
107 # Macro definitions
108 # ===========================================================================
110 # _sdcc_EXECUTE_IFELSE_BODY(COMMAND)
111 # -----------------------
112 # Shell function body for _AC_EXECUTE_IFELSE.
113 m4_define([_sdcc_EXECUTE_IFELSE_BODY],
114 [  AS_LINENO_PUSH([$[]1])
115   AS_IF([_AC_DO_STDERR([$1 $2]) > conftest.out && {
116          test ! -s conftest.err
117        }],
118       [ac_retval=0],
119       [ac_retval=1])
120   AS_LINENO_POP
121 ])# _sdcc_EXECUTE_IFELSE_BODY
123 # sdcc_EXECUTE_IFELSE(COMMAND[ACTION-IF-TRUE], [ACTION-IF-FALSE])
124 # ----------------------------------------------------------------
125 # Try to execute COMMAND.
126 AC_DEFUN([sdcc_EXECUTE_IFELSE],
127 [_$0_BODY($1)
128   AS_IF([test "$ac_retval" = 0],
129     [$2],
130     [$3])
131 rm conftest.err conftest.out
132 ])# sdcc_EXECUTE_IFELSE
134 # Check whether the compiler for the current language is SunPRO.
136 AC_DEFUN([sdcc_IS_SUNPRO],
137 [AC_CACHE_CHECK([whether we are using the SunPRO _AC_LANG compiler],
138   [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro],
139   [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if !defined __SUNPRO_C && !defined __SUNPRO_CC
140        choke me
141 #endif
142 ]])],
143     [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=yes],
144     [sdcc_cv_[]_AC_LANG_ABBREV[]_compiler_sunpro=no])
145 ])])
147 # sdcc_IS_VALID_OPTION macro checks if the current compiler, selected by 
148 # AC_LANG, supports option specified as the 1st parameter. The test fails if
149 # the compiler returns an error or in case something is writeen to stderr.
150 # For example: sdcc_VALID_OPT(-fPIC)
152 AC_DEFUN([sdcc_IS_VALID_OPTION],
153 [arg1=`echo $1 | sed -e"s/^-*//" -e"s/-/_/"`
154 ac_test_[]_AC_LANG_PREFIX[]FLAGS=${[]_AC_LANG_PREFIX[]FLAGS+set}
155 sdcc_save_[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS
156 AC_CACHE_CHECK(whether _AC_LANG accepts $1, sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1,
157   [sdcc_save_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag
158    ac_[]_AC_LANG_ABBREV[]_werror_flag=yes
159    
160    []_AC_LANG_PREFIX[]FLAGS="$1"
161    AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
162      [eval sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1=yes],
163      [eval sdcc_cv_[]_AC_LANG_ABBREV[]_$arg1=no])
164    ac_[]_AC_LANG_ABBREV[]_werror_flag=$sdcc_save_[]_AC_LANG_ABBREV[]_werror_flag])
165    []_AC_LANG_PREFIX[]FLAGS=$sdcc_save_[]_AC_LANG_PREFIX[]FLAGS
168 # This macro expands DIR and assigns it to RET.
169 # If DIR is NONE, then it's replaced by DEFAULT.
171 # Based on AC_DEFINE_DIR
173 # Examples:
175 #  adl_EXPAND(prefix, "/usr/local", expanded_prefix)
177 AC_DEFUN([adl_EXPAND], [
178   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
179   test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
180   ac_expand=[$]$1
181   test "x$ac_expand" = xNONE && ac_expand="[$]$2"
182   ac_expand=`eval echo [$]ac_expand`
183   $3=`eval echo [$]ac_expand`
186 # adl_NORMALIZE_PATH
188 #  - empty paths are changed to '.'
189 #  - trailing slashes are removed
190 #  - repeated slashes are squeezed except a leading doubled slash '//'
191 #    (which might indicate a networked disk on some OS).
194 # REFERENCE_STRING is used to turn '/' into '\' and vice-versa: if
195 # REFERENCE_STRING contains some backslashes, all slashes and backslashes
196 # are turned into backslashes, otherwise they are all turned into slashes.
198 # This makes processing of DOS filenames quite easier, because you can turn a
199 # filename to the Unix notation, make your processing, and turn it back to
200 # original notation.
202 dnl Available from the GNU Autoconf Macro Archive at:
203 dnl http://www.gnu.org/software/ac-archive/htmldoc/normpath.html
205 AC_DEFUN([adl_NORMALIZE_PATH],
206 [case ":[$]$1:" in
207 dnl change empty paths to '.'
208   ::) $1='.' ;;
209 dnl strip trailing slashes
210   :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;;
211   :*:) ;;
212 esac
213 dnl squeze repeated slashes
214 case ifelse($2,,"[$]$1",$2) in
215 dnl if the path contains any backslashes, turn slashes into backslashes
217 dnl Bernhard Held 2003-04-06
218 dnl This was the original line. It does not:
219 dnl - convert the first slash
220 dnl - replace a slash with a double-backslash
221 dnl *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;;
222     *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\\\\\,g
223                                   s,^[[\\/]],\\\\\\\\,'` ;;
225 dnl if the path contains slashes, also turn backslashes into slashes
226  *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;;
227 esac])
230 # adl_COMPUTE_RELATIVE_PATH
232 # PATH_LIST is a space-separated list of colon-separated triplets of the form
233 # 'FROM:TO:RESULT'. This function iterates over these triplets and set $RESULT
234 # to the relative path from $FROM to $TO. Note that $FROM and $TO needs to be
235 # absolute filenames for this macro to success.
237 AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS],
238 [for _lcl_i in $1; do
239   _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'`
240   _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'`
241   _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'`
242   adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from])
243   adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to])
244   _lcl_notation="$_lcl_from$_lcl_to"
245   adl_NORMALIZE_PATH([_lcl_from],['/'])
246   adl_NORMALIZE_PATH([_lcl_to],['/'])
247   adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp])
248   adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"])
249   eval $_lcl_result_var='[$]_lcl_result_tmp'
250 done])
252 ## Note:
253 ## *****
254 ## The following helper macros are too fragile to be used out
255 ## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that
256 ## paths are normalized), that's why I'm keeping them in the same file.
257 ## Still, some of them maybe worth to reuse.
259 dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT)
260 dnl ===========================================
261 dnl Compute the relative path to go from $FROM to $TO and set the value
262 dnl of $RESULT to that value.  This function work on raw filenames
263 dnl (for instead it will considerate /usr//local and /usr/local as
264 dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS
265 dnl instead to have the paths sanitized automatically.
267 dnl For instance:
268 dnl    first_dir=/somewhere/on/my/disk/bin
269 dnl    second_dir=/somewhere/on/another/disk/share
270 dnl    adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second)
271 dnl will set $first_to_second to '../../../another/disk/share'.
272 AC_DEFUN([adl_COMPUTE_RELATIVE_PATH],
273 [adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix])
274 adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel])
275 adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix])
276 $3="[$]_lcl_first_rel[$]_lcl_second_suffix"])
278 dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT)
279 dnl ============================================
280 dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT.
282 dnl For instance:
283 dnl    first_path=/somewhere/on/my/disk/bin
284 dnl    second_path=/somewhere/on/another/disk/share
285 dnl    adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path)
286 dnl will set $common_path to '/somewhere/on'.
287 AC_DEFUN([adl_COMPUTE_COMMON_PATH],
288 [$3=''
289 _lcl_second_prefix_match=''
290 while test "[$]_lcl_second_prefix_match" != 0; do
291   _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"`
292   _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"`
293   if test "[$]_lcl_second_prefix_match" != 0; then
294     if test "[$]_lcl_first_prefix" != "[$]$3"; then
295       $3="[$]_lcl_first_prefix"
296     else
297       _lcl_second_prefix_match=0
298     fi
299   fi
300 done])
302 dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT)
303 dnl ==============================================
304 dnl Substrack $SUBPATH from $PATH, and set the resulting suffix
305 dnl (or the empty string if $SUBPATH is not a subpath of $PATH)
306 dnl to $RESULT.
308 dnl For instace:
309 dnl    first_path=/somewhere/on/my/disk/bin
310 dnl    second_path=/somewhere/on
311 dnl    adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path)
312 dnl will set $common_path to '/my/disk/bin'.
313 AC_DEFUN([adl_COMPUTE_SUFFIX_PATH],
314 [$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`])
316 dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT)
317 dnl ============================================
318 dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that
319 dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../'
320 dnl should be needed to move from $PATH to $SUBPATH) and set the value
321 dnl of $RESULT to that value.  If $SUBPATH is not a subpath of PATH,
322 dnl set $RESULT to the empty string.
324 dnl For instance:
325 dnl    first_path=/somewhere/on/my/disk/bin
326 dnl    second_path=/somewhere/on
327 dnl    adl_COMPUTE_BACK_PATH(first_path, second_path, back_path)
328 dnl will set $back_path to '../../../'.
329 AC_DEFUN([adl_COMPUTE_BACK_PATH],
330 [adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix])
331 $3=''
332 _lcl_tmp='xxx'
333 while test "[$]_lcl_tmp" != ''; do
334   _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"`
335   if test "[$]_lcl_first_suffix" != ''; then
336      _lcl_first_suffix="[$]_lcl_tmp"
337      $3="../[$]$3"
338   fi
339 done])
342 dnl adl_RECURSIVE_EVAL(VALUE, RESULT)
343 dnl =================================
344 dnl Interpolate the VALUE in loop until it does not change,
345 dnl and set the result to $RESULT.
346 dnl WARNING: It is easy to get an infinite loop with some unsane input.
347 AC_DEFUN([adl_RECURSIVE_EVAL],
348 [_lcl_receval="$1"
349 $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
350      test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
351      _lcl_receval_old=''
352      while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
353        _lcl_receval_old="[$]_lcl_receval"
354        eval _lcl_receval="\"[$]_lcl_receval\""
355      done
356      echo "[$]_lcl_receval")`])
358 dnl adl_NORMALIZE_DEFINE_UNQUOTED(var, DEFINE, REFERENCE_STRING)
359 AC_DEFUN([adl_NORMALIZE_DEFINE_UNQUOTED], [
360   ac_ndu=[$]$1
361   adl_NORMALIZE_PATH([ac_ndu], [$]$3)
362   AC_DEFINE_UNQUOTED($2, "${ac_ndu}", [XXX])
365 dnl adl_NORMALIZE_PATH_MSG(input_string, var, dir_separator)
366 dnl ========================================================
367 dnl call adl_NORMALIZE_PATH and format it for the result message
368 AC_DEFUN([adl_NORMALIZE_PATH_MSG], [
369 dnl replace /./ by /
370 $2=`echo "$1" | sed 's,/\./,/,g'`
371 adl_NORMALIZE_PATH([$2], [$3])
372 dnl replace \\ by \
373 $2=`echo "[$]$2" | sed 's,\\\\\\\\,\\\\,g'`
376 AX_CXX_COMPILE_STDCXX_11
378 # Checking characteristics of compilers and other programs
379 # ===========================================================================
380 if test "$ac_cv_c_compiler_gnu" = "yes"; then
381   AC_CACHE_CHECK(whether preprocessor accepts -MM or -M,sdcc_cv_MM,
382   echo "#include <stdio.h>" >_test_.c
383   echo "" >>_test_.c
384   $CPP -v -MM _test_.c 1>&5 2>&5
385   if test "$?" = "0"; then
386     sdcc_cv_MM="-MM"
387   else
388     sdcc_cv_MM="-M"
389   fi
390   rm -f _test_.*)
392   # This is the first time when CFLAGS are set/modified!!
393   sdcc_IS_VALID_OPTION(-ggdb)
394   if test "$sdcc_cv_c_ggdb" = "yes"; then
395     CFLAGS="-ggdb ${CFLAGS}"
396     CXXFLAGS="-ggdb ${CXXFLAGS}"
397   fi
399   sdcc_IS_VALID_OPTION(-pipe)
400   if test "$sdcc_cv_c_pipe" = "yes"; then
401     CFLAGS="-pipe ${CFLAGS}"
402     # Don't use "-pipe" on x86 Solaris g++, since src/z80/ralloc2.cc dies with:
403     # Assembler: ralloc2.cc
404     #         "<stdin>", line 117637 : Internal: Out of symbol table
405     if test `uname` != "SunOS" -o \( `uname` = "SunOS" -a `uname -m` != "i86pc" \); then
406       CXXFLAGS="-pipe ${CXXFLAGS}"
407     fi
408   fi
410   WALL_FLAG="-Wall -Wno-parentheses"
411   MAKEDEP_CXX="$CXX $sdcc_cv_MM"
412   MAKEDEP="$CC $sdcc_cv_MM"
413 else
414   sdcc_IS_SUNPRO
417 AC_SUBST(MAKEDEP)
418 AC_SUBST(MAKEDEP_CXX)
419 AC_SUBST(WALL_FLAG)
421 # Check for c11
422 # -------------------------------------------------------------------------
423 if test "$ac_cv_prog_cc_c11" == "no"; then
424   AC_MSG_ERROR([Could not find C11-capable host compiler.])
427 # Checks for typedefs, structures, and compiler characteristics.
428 # ===========================================================================
430 AC_CHECK_SIZEOF(char)
431 AC_CHECK_SIZEOF(short)
432 AC_CHECK_SIZEOF(int)
433 AC_CHECK_SIZEOF(long)
434 AC_CHECK_SIZEOF(long long)
435 AC_C_CHAR_UNSIGNED
437 type_name()
439   if expr "$ac_cv_sizeof_char" '>=' "$1" >/dev/null; then
440       echo "char"
441     exit
442   fi
443   if expr "$ac_cv_sizeof_short" '>=' "$1" >/dev/null; then
444     echo "short"
445     exit
446   fi
447   if expr "$ac_cv_sizeof_int" '>=' "$1" >/dev/null; then
448     echo "int"
449     exit
450   fi
451   if expr "$ac_cv_sizeof_long" '>=' "$1" >/dev/null; then
452     echo "long"
453     exit
454   fi
455   if expr "$ac_cv_sizeof_long_long" '>=' "$1" >/dev/null; then
456     echo "long long"
457     exit
458   fi
459   echo "long"
462 AC_MSG_CHECKING(type name for byte)
463 TYPE_CHAR=`type_name 1`
464 if test "$ac_cv_c_char_unsigned" = "yes"; then
465   TYPE_BYTE="signed $TYPE_CHAR"
466 else
467   TYPE_BYTE=$TYPE_CHAR
469 AC_MSG_RESULT($TYPE_BYTE)
470 AC_MSG_CHECKING(type name for word)
471 TYPE_WORD=`type_name 2`
472 AC_MSG_RESULT($TYPE_WORD)
473 AC_MSG_CHECKING(type name for dword)
474 TYPE_DWORD=`type_name 4`
475 AC_MSG_RESULT($TYPE_DWORD)
476 AC_MSG_CHECKING(type name for qword)
477 TYPE_QWORD=`type_name 8`
478 AC_MSG_RESULT($TYPE_QWORD)
480 AC_DEFINE_UNQUOTED(TYPE_BYTE,  $TYPE_BYTE,  [XXX])
481 AC_DEFINE_UNQUOTED(TYPE_WORD,  $TYPE_WORD,  [XXX])
482 AC_DEFINE_UNQUOTED(TYPE_DWORD, $TYPE_DWORD, [XXX])
483 AC_DEFINE_UNQUOTED(TYPE_QWORD, $TYPE_QWORD, [XXX])
485 AC_DEFINE_UNQUOTED(TYPE_UBYTE,  unsigned $TYPE_CHAR,  [XXX])
486 AC_DEFINE_UNQUOTED(TYPE_UWORD,  unsigned $TYPE_WORD,  [XXX])
487 AC_DEFINE_UNQUOTED(TYPE_UDWORD, unsigned $TYPE_DWORD, [XXX])
488 AC_DEFINE_UNQUOTED(TYPE_UQWORD, unsigned $TYPE_QWORD, [XXX])
490 case "${host}" in
491   *x86_64*cygwin*)
492     LDFLAGS="$LDFLAGS -Wl,--stack,4194304"
493   ;;
494   *x86_64*mingw*)
495     LDFLAGS="$LDFLAGS -Wl,--stack,4194304"
496   ;;
497 esac
499 # Checking whether byte ordering is bigendian
500 # ===========================================================================
501 AC_C_BIGENDIAN
503 # Set standard installation paths
504 # ===========================================================================
506 # In the Makefiles we need paths with '/' as directory separator, even if
507 # crosscompiling for Win32.
508 # And we want to preserve the macros (e.g. ${prefix}) in the Makefiles.
509 # The variables in the Makefiles are replaced by AC_SUBST()
511 # In sdccconf.h the '/' in paths can be replaced by "\\" (normalized), if
513 # The macros are expanded for the header.
514 # The variables in the header are replaced by AC_*DEFINE*()
515 # sdccconf_h_dir_separator contains a backslash.
516 AC_ARG_VAR([sdccconf_h_dir_separator], [needed in sdccconf.h: either "/" (default) or "\\"])
517 if test "x${sdccconf_h_dir_separator}" = "x"; then
518     sdccconf_h_dir_separator="/"
521 # Makefiles
522 ###########
524 # LIB_TYPE:
525 # *nix default: "RANLIB"
527 AC_ARG_VAR([LIB_TYPE], [library type: LIB, SDCCLIB, AR or RANLIB (default)])
528 if test "${LIB_TYPE}" = ""; then
529     LIB_TYPE="RANLIB"
532 # include_dir_suffix:
533 # *nix default: "sdcc/include"
535 AC_ARG_VAR([inclib_dir_suffix], [appended to datadir to define SDCC's include/lib directory])
536 if test "${inclib_dir_suffix}" = ""; then
537     inclib_dir_suffix="sdcc"
540 AC_ARG_VAR([include_dir_suffix], [appended to datadir to define SDCC's include directory])
541 if test "${include_dir_suffix}" = ""; then
542     include_dir_suffix="${inclib_dir_suffix}/include"
545 AC_ARG_VAR([non_free_inclib_dir_suffix], [appended to datadir to define SDCC's non-free include/lib directory])
546 if test "${non_free_inclib_dir_suffix}" = ""; then
547     non_free_inclib_dir_suffix="sdcc/non-free"
550 # non_free_include_dir_suffix:
551 # *nix default: "sdcc/non-free/include"
553 AC_ARG_VAR([non_free_include_dir_suffix], [appended to datadir to define SDCC's non-free include directory])
554 if test "${non_free_include_dir_suffix}" = ""; then
555     non_free_include_dir_suffix="${non_free_inclib_dir_suffix}/include"
558 # lib_dir_suffix:
559 # *nix default: "sdcc/lib"
560 AC_ARG_VAR([lib_dir_suffix], [appended to datadir to define SDCC's library root directory])
561 if test "${lib_dir_suffix}" = ""; then
562     lib_dir_suffix="${inclib_dir_suffix}/lib"
565 # non_free_lib_dir_suffix:
566 # *nix default: "sdcc/non-free/lib"
567 AC_ARG_VAR([non_free_lib_dir_suffix], [appended to datadir to define SDCC's non-free library root directory])
568 if test "${non_free_lib_dir_suffix}" = ""; then
569     non_free_lib_dir_suffix="${non_free_inclib_dir_suffix}/lib"
572 # docdir:
573 # *nix default: "${datadir}/sdcc/doc"
574 AC_ARG_VAR([docdir], [documentation installation directory])
575 if test "${docdir}" = ""; then
576     docdir="\${datadir}"/sdcc/doc
579 AC_SUBST(EXEEXT)
581 # sdccconf.h
582 ############
584 AC_DEFINE_UNQUOTED(DIR_SEPARATOR_STRING, "${sdccconf_h_dir_separator}", [XXX])
585 AC_DEFINE_UNQUOTED(DIR_SEPARATOR_CHAR, '${sdccconf_h_dir_separator}', [XXX])
587 # prefix:
588 # default: "NONE", ${ac_default_prefix}: "/usr/local"
589 adl_EXPAND(prefix, ac_default_prefix, expanded_prefix)
590 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_prefix, PREFIX, sdccconf_h_dir_separator)
592 # exec_prefix:
593 # default: "${prefix}"
594 adl_EXPAND(exec_prefix, expanded_prefix, expanded_exec_prefix)
595 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_exec_prefix, EXEC_PREFIX, sdccconf_h_dir_separator)
597 # bindir:
598 # default: "${exec_prefix}/bin"
599 adl_EXPAND(bindir, "NONE", expanded_bindir)
600 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_bindir, BINDIR, sdccconf_h_dir_separator)
602 # datadir:
603 # default: "${prefix}/share"
604 adl_EXPAND(datadir, "NONE", expanded_datadir)
605 adl_NORMALIZE_DEFINE_UNQUOTED(expanded_datadir, DATADIR, sdccconf_h_dir_separator)
607 # include/lib suffix
608 norm_inc_dir_suffix=${include_dir_suffix}
609 adl_NORMALIZE_PATH([norm_inc_dir_suffix], [$sdccconf_h_dir_separator])
610 AC_DEFINE_UNQUOTED(INCLUDE_DIR_SUFFIX,
611                    DIR_SEPARATOR_STRING "${norm_inc_dir_suffix}", [XXX])
612 norm_non_free_inc_dir_suffix=${non_free_include_dir_suffix}
613 adl_NORMALIZE_PATH([norm_non_free_inc_dir_suffix], [$sdccconf_h_dir_separator])
614 AC_DEFINE_UNQUOTED(NON_FREE_INCLUDE_DIR_SUFFIX,
615                    DIR_SEPARATOR_STRING "${norm_non_free_inc_dir_suffix}", [XXX])
617 norm_lib_dir_suffix=${lib_dir_suffix}
618 adl_NORMALIZE_PATH([norm_lib_dir_suffix], [$sdccconf_h_dir_separator])
619 AC_DEFINE_UNQUOTED(LIB_DIR_SUFFIX,
620                    DIR_SEPARATOR_STRING "${norm_lib_dir_suffix}", [XXX])
621 norm_non_free_lib_dir_suffix=${non_free_lib_dir_suffix}
622 adl_NORMALIZE_PATH([norm_non_free_lib_dir_suffix], [$sdccconf_h_dir_separator])
623 AC_DEFINE_UNQUOTED(NON_FREE_LIB_DIR_SUFFIX,
624                    DIR_SEPARATOR_STRING "${norm_non_free_lib_dir_suffix}", [XXX])
626 # relative paths
627 adl_COMPUTE_RELATIVE_PATHS([expanded_bindir:expanded_datadir:bin2data_dir])
628 adl_NORMALIZE_PATH(bin2data_dir, [$sdccconf_h_dir_separator])
629 AC_DEFINE_UNQUOTED(BIN2DATA_DIR,
630                    DIR_SEPARATOR_STRING "${bin2data_dir}", [XXX])
632 adl_COMPUTE_RELATIVE_PATHS([expanded_prefix:expanded_bindir:prefix2bin_dir])
633 adl_NORMALIZE_PATH(prefix2bin_dir, [$sdccconf_h_dir_separator])
634 AC_DEFINE_UNQUOTED(PREFIX2BIN_DIR,
635                    DIR_SEPARATOR_STRING "${prefix2bin_dir}", [XXX])
637 adl_COMPUTE_RELATIVE_PATHS([expanded_prefix:expanded_datadir:prefix2data_dir])
638 adl_NORMALIZE_PATH(prefix2data_dir, [$sdccconf_h_dir_separator])
639 if test "${prefix2data_dir}" = "."; then
640     # small optimization for Mingw32; otherwise Borut will complain ;-)
641     AC_DEFINE_UNQUOTED(PREFIX2DATA_DIR, "", [XXX])
642 else
643     AC_DEFINE_UNQUOTED(PREFIX2DATA_DIR,
644                        DIR_SEPARATOR_STRING "${prefix2data_dir}", [XXX])
647 # standard libs
648 AC_DEFINE_UNQUOTED(STD_LIB,       "libsdcc", [XXX])
649 AC_DEFINE_UNQUOTED(STD_INT_LIB,   "libint", [XXX])
650 AC_DEFINE_UNQUOTED(STD_LONG_LIB,  "liblong", [XXX])
651 AC_DEFINE_UNQUOTED(STD_FP_LIB,    "libfloat", [XXX])
652 AC_DEFINE_UNQUOTED(STD_DS390_LIB, "libds390", [XXX])
653 AC_DEFINE_UNQUOTED(STD_DS400_LIB, "libds400", [XXX])
655 # SDCC runtime environment variables
656 sdcc_dir_name="SDCC_HOME"
657 AC_DEFINE_UNQUOTED(SDCC_DIR_NAME, "${sdcc_dir_name}", [XXX])
659 sdcc_include_name="SDCC_INCLUDE"
660 AC_DEFINE_UNQUOTED(SDCC_INCLUDE_NAME, "${sdcc_include_name}", [XXX])
662 sdcc_lib_name="SDCC_LIB"
663 AC_DEFINE_UNQUOTED(SDCC_LIB_NAME, "${sdcc_lib_name}", [XXX])
665 # add include guard and custom stuff to sdccconf.h
666 AH_TOP([#ifndef SDCCCONF_HEADER
667 #define SDCCCONF_HEADER])
668 AH_BOTTOM([#endif /* SDCCCONF_HEADER */])
670 # Port selection helper
671 # ===========================================================================
672 # macro AC_DO_ENABLER()
673 #   $1 used to access enable_$1, e.g. enable_doc
674 #   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. DOC
675 #   $3 help string
676 AC_DEFUN([AC_DO_ENABLER], [
677   AC_ARG_ENABLE($1, AS_HELP_STRING([--enable-$1],[$3]))
679   if test "[$]enable_$1" = "yes"; then
680     OPT_ENABLE_$2=1
681   else
682     OPT_ENABLE_$2=0
683   fi
685   AC_DEFINE_UNQUOTED(OPT_ENABLE_$2, [$]OPT_ENABLE_$2, [XXX])
686   AC_SUBST(OPT_ENABLE_$2)
689 # macro AC_DO_DISABLER()
690 #   $1 used to access disable_$1, e.g. ucsim
691 #   $2 OPT_DISABLE_$2, normally uppercase of $1, e.g. UCSIM
692 #   $3 help string
693 AC_DEFUN([AC_DO_DISABLER], [
694   AC_ARG_ENABLE($1, AS_HELP_STRING([--disable-$1],[$3]))
696   dnl the '-' in 'device-lib' needs special handling,
697   dnl because the variable is 'enable_device_lib'
698   arg1=`echo $1 | sed s/-/_/`
700   if test "`eval echo \\$enable_$arg1`" = "no"; then
701     OPT_DISABLE_$2=1
702   else
703     OPT_DISABLE_$2=0
704   fi
706   AC_DEFINE_UNQUOTED(OPT_DISABLE_$2, [$]OPT_DISABLE_$2, [XXX])
707   AC_SUBST(OPT_DISABLE_$2)
710 # macro AC_DO_PORT($1, $2, $3, $4)
711 #   $1 used to access enable_$2_port, e.g. sm83
712 #   $2 port name in ports.all and ports.build, e.g. z80
713 #   $3 OPT_DISABLE_$3, normally uppercase of $2, e.g. SM83
714 #   $4 help string
715 AC_DEFUN([AC_DO_PORT], [
716   AC_ARG_ENABLE($1-port,
717                 AS_HELP_STRING([--disable-$1-port],[$4]))
719   if test "[$]enable_$1_port" = "no"; then
720     OPT_DISABLE_$3=1
721   else
722     enable_$1_port="yes"
723     OPT_DISABLE_$3=0
724   fi
726   AC_DEFINE_UNQUOTED(OPT_DISABLE_$3, [$]OPT_DISABLE_$3, [XXX])
727   AC_SUBST(OPT_DISABLE_$3)
729   echo $2 >>ports.all
730   if test [$]OPT_DISABLE_$3 = 0; then
731     echo $2 >>ports.build
732   fi
735 # macro AC_DO_PORT_ENABLER($1, $2, $3, $4)
736 #   $1 used to access enable_$2_port, e.g. sm83
737 #   $2 port name in ports.all and ports.build, e.g. z80
738 #   $3 OPT_DISABLE_$3, normally uppercase of $2, e.g. SM83
739 #   $4 help string
740 AC_DEFUN([AC_DO_PORT_ENABLER], [
741   AC_ARG_ENABLE($1-port,
742                 AS_HELP_STRING([--enable-$1-port],[$4]))
744   if test "[$]enable_$1_port" = "yes"; then
745     OPT_DISABLE_$3=0
746   else
747     enable_$1_port="no"
748     OPT_DISABLE_$3=1
749   fi
751   AC_DEFINE_UNQUOTED(OPT_DISABLE_$3, [$]OPT_DISABLE_$3, [XXX])
752   AC_SUBST(OPT_DISABLE_$3)
754   echo $2 >>ports.all
755   if test [$]OPT_DISABLE_$3 = 0; then
756     echo $2 >>ports.build
757   fi
760 # Revision number
761 # ===============
763 dnl Check for Git short SHA to tag version
764 dnl The release package should also keep it on the config.h
765 GIT_REVISION=""
766 SVN_REVISION="unknown"
767 if test -d "${srcdir}/.git"; then
768   GIT_REVISION=$( git log --pretty=format:'%h' -n 1u )
769   echo "Found Git repo... $GIT_REVISION"
770   SVN_REVISION=$( git log -1 | tail -n1 | cut -f2 -d @ | cut -f1 -d" " )
772 AC_SUBST(GIT_REVISION)
773 AC_SUBST(SVN_REVISION)
775 # Now handle the port selection
776 # ===========================================================================
777 rm -f ports.all ports.build
779 # Supported targets
780 AC_DO_PORT(mcs51,    mcs51,  MCS51,    [Excludes the Intel mcs51 port])
781 AC_DO_PORT(z80,      z80,    Z80,      [Excludes the Z80 port])
782 AC_DO_PORT(z180,     z80,    Z180,     [Excludes the Z180 port])
783 AC_DO_PORT(r2k,      z80,    R2K,      [Excludes the Rabbit 2000 port])
784 AC_DO_PORT(r2ka,     z80,    R2KA,     [Excludes the Rabbit 2000A port])
785 AC_DO_PORT(r3ka,     z80,    R3KA,     [Excludes the Rabbit 3000A port])
786 AC_DO_PORT(sm83,     z80,    SM83,     [Excludes the SM83 port])
787 AC_DO_PORT(tlcs90,   z80,    TLCS90,   [Excludes the TLCS-90 port])
788 AC_DO_PORT(ez80_z80, z80,    EZ80_Z80, [Excludes the EZ80-Z80 port])
789 AC_DO_PORT(z80n,     z80,    Z80N,     [Excludes the Z80N port])
790 AC_DO_PORT(r800,     z80,    R800,     [Excludes the R800 port])
791 AC_DO_PORT(ds390,    ds390,  DS390,    [Excludes the DS390 port])
792 AC_DEFINE_UNQUOTED(OPT_DISABLE_TININative, $OPT_DISABLE_DS390, [XXX])
793 AC_DO_PORT(ds400,    ds390,  DS400,    [Excludes the DS400 port])
794 AC_DO_PORT(pic14,    pic14,  PIC14,    [Excludes the PIC14 port])
795 AC_DO_PORT(pic16,    pic16,  PIC16,    [Excludes the PIC16 port])
796 AC_DO_PORT(hc08,     hc08,   HC08,     [Excludes the HC08 port])
797 AC_DO_PORT(s08,      hc08,   S08,      [Excludes the S08 port])
798 AC_DO_PORT(stm8,     stm8,   STM8,     [Excludes the STM8 port])
799 AC_DO_PORT(pdk13,    pdk,    PDK13,    [Excludes the PDK13 port])
800 AC_DO_PORT(pdk14,    pdk,    PDK14,    [Excludes the PDK14 port])
801 AC_DO_PORT(pdk15,    pdk,    PDK15,    [Excludes the PDK15 port])
802 AC_DO_PORT_ENABLER(pdk16,    pdk,    PDK16,    [Includes the PDK16 port])
803 AC_DO_PORT(mos6502,  mos6502,MOS6502,  [Excludes the MOS6502 port])
804 AC_DO_PORT(mos65c02, mos6502,MOS65C02, [Excludes the MOS65C02 port])
805 AC_DO_PORT(f8,       f8,     F8,       [Excludes the F8 port])
807 # Unsupported targets
808 ####AC_DO_PORT_ENABLER(avr,   avr,   AVR,   [Includes the AVR port (disabled by default)])
809 OPT_DISABLE_AVR=1
810 AC_DEFINE_UNQUOTED(OPT_DISABLE_AVR, ${OPT_DISABLE_AVR}, [Define to 1 to disable the AVR port])
811 AC_SUBST(OPT_DISABLE_AVR)
813 AC_DO_DISABLER(ucsim,      UCSIM,      [Disables configuring and building of ucsim])
814 AC_DO_DISABLER(device-lib, DEVICE_LIB, [Disables building device libraries])
815 AC_DO_DISABLER(packihx,    PACKIHX,    [Disables building packihx])
816 AC_DO_DISABLER(sdcpp,      SDCPP,      [Disables building sdcpp])
817 AC_DO_DISABLER(sdcdb,      SDCDB,      [Disables building sdcdb])
818 AC_DO_DISABLER(sdbinutils, SDBINUTILS, [Disables configuring and building of sdbinutils])
819 AC_DO_DISABLER(non-free,   NON_FREE,   [Disables non-free runtime library parts])
821 AC_DO_ENABLER(doc,   DOC,   [Enables building the documentation])
822 AC_CHECK_PROG([LYX],        [lyx],        [lyx],        [:])
823 AC_CHECK_PROG([LATEX2HTML], [latex2html], [latex2html], [:])
824 AC_CHECK_PROG([LATEX],      [latex],      [latex],      [:])
825 AC_CHECK_PROG([DVIPDFM],    [dvipdfm],    [dvipdfm],    [:])
826 AC_CHECK_PROG([PDFLATEX],   [pdflatex],   [pdflatex],   [:])
827 AC_CHECK_PROG([MAKEINDEX],  [makeindex],  [makeindex],  [:])
829 if test $OPT_ENABLE_DOC = 1; then
830   SDCC_REQUIRE_PROG($LYX,        lyx)
831   SDCC_REQUIRE_PROG($LATEX2HTML, latex2html)
832   SDCC_REQUIRE_PROG($LATEX,      latex)
833   SDCC_REQUIRE_PROG($DVIPDFM,    dvipdfm)
834   SDCC_REQUIRE_PROG($MAKEINDEX,  makeindex)
837 AC_DO_ENABLER(libgc, LIBGC, [Use the Bohem memory allocator. Lower runtime footprint.])
838 if test $OPT_ENABLE_LIBGC = 1; then
839   AC_CHECK_LIB(gc, GC_malloc)
840   if test $ac_cv_lib_gc_GC_malloc = no; then
841     AC_MSG_ERROR([Cannot find library libgc with Bohem memory allocator.])
842   fi
845 #remove duplicates
846 uniq ports.all ports
847 mv ports ports.all
848 uniq ports.build ports
849 mv ports ports.build
851 # Generating output files
852 # ===========================================================================
853 test $OPT_DISABLE_SDCPP   = 0 && AC_CONFIG_SUBDIRS(support/cpp)
854 test $OPT_DISABLE_PACKIHX = 0 && AC_CONFIG_SUBDIRS(support/packihx)
855 test $OPT_DISABLE_UCSIM   = 0 && AC_CONFIG_SUBDIRS(sim/ucsim)
856 test $OPT_DISABLE_SDCDB   = 0 && AC_CONFIG_SUBDIRS(debugger/mcs51)
857 test $OPT_DISABLE_SDBINUTILS = 0 && AC_CONFIG_SUBDIRS(support/sdbinutils)
858 AC_CONFIG_FILES([doc/Makefile])
860 ####test $OPT_DISABLE_AVR = 0 && AC_CONFIG_FILES([src/avr/Makefile])
862 if test $OPT_DISABLE_DS390 = 0 || test $OPT_DISABLE_DS400; then
863   AC_CONFIG_FILES([src/ds390/Makefile
864                    sdas/as8xcxxx/Makefile])
865   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/ds390/Makefile
866                                                        device/lib/ds400/Makefile])
869 if test $OPT_DISABLE_HC08 = 0 || test $OPT_DISABLE_S08 = 0; then
870   AC_CONFIG_FILES([src/hc08/Makefile
871                    sdas/as6808/Makefile])
872   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/hc08/Makefile
873                                                        device/lib/s08/Makefile
874                                                        device/lib/s08-stack-auto/Makefile])
877 if test $OPT_DISABLE_MOS6502 = 0 || test $OPT_DISABLE_MOS65C02 = 0; then
878   AC_CONFIG_FILES([src/mos6502/Makefile
879                    sdas/as6500/Makefile])
880   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/mos6502/Makefile
881                                                        device/lib/mos6502-stack-auto/Makefile
882                                                        device/lib/mos65c02/Makefile])
885 if test $OPT_DISABLE_MCS51 = 0; then
886   AC_CONFIG_FILES([src/mcs51/Makefile
887                    sdas/as8051/Makefile])
888   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/mcs51/Makefile
889                                                        device/lib/small/Makefile
890                                                        device/lib/medium/Makefile
891                                                        device/lib/large/Makefile
892                                                        device/lib/huge/Makefile])
895 if test $OPT_DISABLE_PIC14 = 0; then
896   AC_CONFIG_FILES(src/pic14/Makefile)
897   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/lib/pic14)
899 if test $OPT_DISABLE_PIC14 = 0 && test $OPT_DISABLE_NON_FREE = 0; then
900   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/non-free/lib/pic14)
902 if test $OPT_DISABLE_PIC16 = 0; then
903   AC_CONFIG_FILES(src/pic16/Makefile)
904   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/lib/pic16)
906 if test $OPT_DISABLE_PIC16 = 0 && test $OPT_DISABLE_NON_FREE = 0; then
907   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_SUBDIRS(device/non-free/lib/pic16)
910 if test $OPT_DISABLE_Z80 = 0 || test $OPT_DISABLE_Z180 = 0 || test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_R2KA = 0 || test $OPT_DISABLE_R3KA = 0 || test $OPT_DISABLE_SM83 = 0 || test $OPT_DISABLE_TLCS90 = 0 || test $OPT_DISABLE_EZ80_Z80 = 0 || test $OPT_DISABLE_Z80N = 0 || test $OPT_DISABLE_R800 = 0; then
911   AC_CONFIG_FILES([src/z80/Makefile])
914 if test $OPT_DISABLE_Z80 = 0 || test $OPT_DISABLE_Z180 = 0 || test $OPT_DISABLE_EZ80_Z80 = 0 || test $OPT_DISABLE_Z80N = 0 || test $OPT_DISABLE_R800 = 0; then
915   AC_CONFIG_FILES([sdas/asz80/Makefile])
916   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/z80/Makefile
917                                                        device/lib/z180/Makefile
918                                                        device/lib/ez80_z80/Makefile
919                                                        device/lib/z80n/Makefile
920                                                        device/lib/r800/Makefile])
923 if test $OPT_DISABLE_R2K = 0 || test $OPT_DISABLE_R2KA = 0 || test $OPT_DISABLE_R3KA = 0; then
924   AC_CONFIG_FILES([sdas/asrab/Makefile])
925   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/r2k/Makefile
926                                                        device/lib/r2ka/Makefile
927                                                        device/lib/r3ka/Makefile])
930 if test $OPT_DISABLE_TLCS90 = 0; then
931   AC_CONFIG_FILES([sdas/astlcs90/Makefile])
932   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/tlcs90/Makefile])
935 if test $OPT_DISABLE_SM83 = 0; then
936   AC_CONFIG_FILES([sdas/asgb/Makefile])
937   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/sm83/Makefile])
940 if test $OPT_DISABLE_STM8 = 0; then
941   AC_CONFIG_FILES([src/stm8/Makefile
942                    sdas/asstm8/Makefile])
943   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/stm8/Makefile
944                                                        device/lib/stm8-large/Makefile])
947 if test $OPT_DISABLE_PDK13 = 0 || test $OPT_DISABLE_PDK14 = 0 || test $OPT_DISABLE_PDK15 = 0 || test $OPT_DISABLE_PDK16 = 0; then
948   AC_CONFIG_FILES([src/pdk/Makefile])
951 if test $OPT_DISABLE_PDK13 = 0; then
952   AC_CONFIG_FILES([sdas/aspdk13/Makefile])
953   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/pdk13/Makefile])
956 if test $OPT_DISABLE_PDK14 = 0; then
957   AC_CONFIG_FILES([sdas/aspdk14/Makefile])
958   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/pdk14/Makefile])
961 if test $OPT_DISABLE_PDK15 = 0; then
962   AC_CONFIG_FILES([sdas/aspdk15/Makefile])
963   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/pdk15/Makefile
964                                                        device/lib/pdk15-stack-auto/Makefile])
967 if test $OPT_DISABLE_PDK16 = 0; then
968   AC_CONFIG_FILES([sdas/aspdk16/Makefile])
971 if test $OPT_DISABLE_F8 = 0; then
972   AC_CONFIG_FILES([src/f8/Makefile
973                    sdas/asf8/Makefile])
974   test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/f8/Makefile])
977 test $OPT_DISABLE_DEVICE_LIB = 0 && AC_CONFIG_FILES([device/lib/Makefile])
978 test $OPT_DISABLE_DEVICE_LIB = 0 && test $OPT_DISABLE_NON_FREE = 0 && AC_CONFIG_FILES([device/non-free/lib/Makefile])
980 AC_CONFIG_FILES([main.mk:main_in.mk
981 bin/Makefile
982 src/Makefile
983 device/include/Makefile
984 sdas/linksrc/Makefile
985 support/makebin/Makefile
986 support/regression/Makefile
987 support/regression/cases/Makefile
988 support/valdiag/Makefile
989 support/scripts/Makefile
990 support/regression/ports/host/spec.mk:support/regression/ports/host/spec.mk.in
991 Makefile
992 Makefile.common:Makefile.common.in
994 AC_CONFIG_FILES([bin/sdcc], [chmod +x bin/sdcc])
995 AC_CONFIG_FILES([bin/sdcpp], [chmod +x bin/sdcpp])
996 AC_CONFIG_FILES([bin/sdar], [chmod +x bin/sdar])
997 AC_CONFIG_FILES([bin/sdnm], [chmod +x bin/sdnm])
998 AC_CONFIG_FILES([bin/sdranlib], [chmod +x bin/sdranlib])
999 AC_CONFIG_FILES([bin/sdobjcopy], [chmod +x bin/sdobjcopy])
1000 if test $OPT_DISABLE_NON_FREE = 0; then
1001   AC_CONFIG_FILES([device/non-free/include/Makefile])
1003 AC_OUTPUT
1005 # I found no better place
1006 mkdir -p bin
1008 # Prepare result message
1009 # ======================
1011 # In the C-header we need \\ as dir-separator, but in the message only \
1012 dirch=${sdccconf_h_dir_separator}
1013 test ${dirch} = '\\' && dirch='\'
1015 # calc friendly strings
1016 adl_NORMALIZE_PATH_MSG(/${prefix2bin_dir},                         [binPath],  [$dirch])
1017 adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_inc_dir_suffix}, [incPath1], [$dirch])
1018 adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_inc_dir_suffix},    [incPath2], [$dirch])
1019 adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_inc_dir_suffix}, [incPath3], [$dirch])
1020 adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_non_free_inc_dir_suffix}, [nonFreeIncPath1], [$dirch])
1021 adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_non_free_inc_dir_suffix},    [nonFreeIncPath2], [$dirch])
1022 adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_non_free_inc_dir_suffix}, [nonFreeIncPath3], [$dirch])
1024 adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_lib_dir_suffix}, [libPath1], [$dirch])
1025 adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_lib_dir_suffix},    [libPath2], [$dirch])
1026 adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_lib_dir_suffix}, [libPath3], [$dirch])
1027 adl_NORMALIZE_PATH_MSG(/${prefix2data_dir}/${norm_non_free_lib_dir_suffix}, [nonFreeLibPath1], [$dirch])
1028 adl_NORMALIZE_PATH_MSG(/${bin2data_dir}/${norm_non_free_lib_dir_suffix},    [nonFreeLibPath2], [$dirch])
1029 adl_NORMALIZE_PATH_MSG(${expanded_datadir}/${norm_non_free_lib_dir_suffix}, [nonFreeLibPath3], [$dirch])
1031 AC_MSG_RESULT([
1032 sdcc ${VERSION} is now configured for
1034   Build:                ${build}
1035   Host:                 ${host}
1036   Source directory:     ${srcdir}
1037   Yacc:                 ${YACC}
1038   C compiler:           ${CC}
1039   CFLAGS:               ${CFLAGS}
1040   C++ compiler:         ${CXX}
1041   CXXFLAGS:             ${CXXFLAGS}
1042   CPPFLAGS:             ${CPPFLAGS}
1043   LDFLAGS:              ${LDFLAGS}
1044   MAKEDEP:              ${MAKEDEP}
1045   MAKEDEP_CXX:          ${MAKEDEP_CXX}
1047   ENABLED Ports:
1048     ds390               ${enable_ds390_port}
1049     ds400               ${enable_ds400_port}
1050     hc08                ${enable_hc08_port}
1051     s08                 ${enable_s08_port}
1052     mcs51               ${enable_mcs51_port}
1053     pic14               ${enable_pic14_port}
1054     pic16               ${enable_pic16_port}
1055     z80                 ${enable_z80_port}
1056     z180                ${enable_z180_port}
1057     r2k                 ${enable_r2k_port}
1058     r2ka                ${enable_r2ka_port}
1059     r3ka                ${enable_r3ka_port}
1060     sm83                ${enable_sm83_port}
1061     tlcs90              ${enable_tlcs90_port}
1062     ez80_z80            ${enable_ez80_z80_port}
1063     z80n                ${enable_z80n_port}
1064     r800                ${enable_r800_port}
1065     stm8                ${enable_stm8_port}
1066     pdk13               ${enable_pdk13_port}
1067     pdk14               ${enable_pdk14_port}
1068     pdk15               ${enable_pdk15_port}
1069     pdk16               ${enable_pdk16_port}
1070     mos6502             ${enable_mos6502_port}
1071     mos65c02            ${enable_mos65c02_port}
1072     f8                  ${enable_f8_port}
1074   Disable non-free lib: ${OPT_DISABLE_NON_FREE}
1075   Disable packihx:      ${OPT_DISABLE_PACKIHX}
1076   Disable ucsim:        ${OPT_DISABLE_UCSIM}
1077   Disable device lib:   ${OPT_DISABLE_DEVICE_LIB}
1078   Disable sdcpp:        ${OPT_DISABLE_SDCPP}
1079   Disable sdcdb:        ${OPT_DISABLE_SDCDB}
1080   Disable sdbinutil:    ${OPT_DISABLE_SDBINUTILS}
1081   Enable documentation: ${OPT_ENABLE_DOC}
1082   Enable libgc:         ${OPT_ENABLE_LIBGC}
1084   Install paths:
1085     binary files:           ${exec_prefix}
1086     include/library files:  ${datadir}/${inclib_dir_suffix}
1087     include files:          ${datadir}/${include_dir_suffix}
1088     library files:          ${datadir}/${lib_dir_suffix}
1089     non-free files:         ${datadir}/${non_free_inclib_dir_suffix}
1090     non-free include files: ${datadir}/${non_free_include_dir_suffix}
1091     non-free library files: ${datadir}/${non_free_lib_dir_suffix}
1092     documentation:          ${docdir}
1094     prefix:             ${prefix}
1095     datadir:            ${datadir}
1096     datarootdir:        ${datarootdir}
1098   Search paths (incomplete, see manual for all search paths):
1099     binary files:       \$SDCC_HOME${binPath}
1100     include files:      ${incPath1}
1101                         path(argv[[0]])${incPath2}
1102                         ${incPath3}
1103                         ${nonFreeIncPath1}
1104                         path(argv[[0]])${nonFreeIncPath2}
1105                         ${nonFreeIncPath3}
1106     library files:      \$SDCC_HOME${libPath1}${dirch}<model>
1107                         path(argv[[0]])${libPath2}${dirch}<model>
1108                         ${libPath3}${dirch}<model>
1109                         \$SDCC_HOME${nonFreeLibPath1}${dirch}<model>
1110                         path(argv[[0]])${nonFreeLibPath2}${dirch}<model>
1111                         ${nonFreeLibPath3}${dirch}<model>
1113 # End of configure/configure.in