1 # Check for sdcc support. -*- Autoconf -*-
3 # Copyright 2004 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3, or (at your option)
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Boston, MA
23 AC_CHECK_PROG(XCC, sdcc, sdcc -mmcs51 --no-xinit-opt,no)
24 AC_CHECK_PROG(XAS, asx8051, asx8051 -plosgff,no)
26 if test "$XCC" = "no" -o "$XAS" = "no" ; then
27 AC_MSG_RESULT([USRP requires sdcc. sdcc not found. See http://sdcc.sf.net])
32 sdcc_version=`sdcc --version 2>&1 | \
33 sed 's/\(SDCC.* \)\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)\( .*$\)/\2/'`
35 AC_MSG_CHECKING([sdcc_version "$sdcc_version"])
37 sdcc_major_version=`echo $sdcc_version | \
38 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
39 sdcc_minor_version=`echo $sdcc_version | \
40 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
41 sdcc_micro_version=`echo $sdcc_version | \
42 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
44 sdcc_major_min=`echo $sdcc_version_min | \
45 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
46 sdcc_minor_min=`echo $sdcc_version_min | \
47 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
48 sdcc_micro_min=`echo $sdcc_version_min | \
49 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
51 sdcc_version_proper=`expr \
52 "$sdcc_major_version" \> "$sdcc_major_min" \| \
53 "$sdcc_major_version" \= "$sdcc_major_min" \& \
54 "$sdcc_minor_version" \> "$sdcc_minor_min" \| \
55 "$sdcc_major_version" \= "$sdcc_major_min" \& \
56 "$sdcc_minor_version" \= "$sdcc_minor_min" \& \
57 "$sdcc_micro_version" \>= "$sdcc_micro_min" `
59 if test "$sdcc_version_proper" = "1" ; then
60 AC_MSG_RESULT([$sdcc_major_version.$sdcc_minor_version.$sdcc_micro_version])
63 AC_MSG_RESULT([USRP requires sdcc >= $sdcc_version_min. sdcc not found. See http://sdcc.sf.net])
70 if test $sdccok = yes; then
71 ifelse([$2], , :, [$2])
73 ifelse([$3], , :, [$3])