1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
#
# configure.in - input script to autoconf to
# configure directory
#
# This file is part of the GNU PIC Library.
#
# Originally written by
# Vangelis Rokas <vrokas@otenet.gr>
#
# Adopted for the SDCC/pic14 library by
# Raphael Neider <rneider AT web.de>
#
# Added libc and DEBUG/NOOPTS/EXPERIMENTAL conditionals by
# Gonzalo Pérez de Olaguer Córdoba <salo@gpoc.es>
#
# $Id: configure.ac 11276 2019-06-12 20:56:32Z spth $
#
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT([pic14lib], [0.1], [tecodev AT users sourceforge net])
AM_INIT_AUTOMAKE([foreign subdir-objects no-dependencies])
AC_CONFIG_SRCDIR([libsdcc/idata.c])
AC_CONFIG_HEADER([config.h])
# SDCC setup
case $srcdir in
[\\/]*|?:[\\/]*) abs_srcdir="$srcdir";
;;
*) abs_srcdir="$ac_pwd/$srcdir";
;;
esac
case $ac_top_build_prefix in
[\\/]*|?:[\\/]*)
abs_top_builddir="$ac_top_build_prefix";
;;
*) abs_top_builddir="$ac_pwd/$ac_top_build_prefix";
;;
esac
libdir=$libdir/pic14
# Checks for programs.
# The default architectures (regular and enhanced cores) can be selected at
# configure time by setting the environment variables ARCH and/or EARCH to
# the desired device (16fxxx).
AC_SUBST(ARCH, [${ARCH:-16f877}])
# Previous default setting for EARCH was 16f1934, but gpsim doesn't support it.
# It should be used the device with larger ROM and RAM sizes.
AC_SUBST(EARCH, [${EARCH:-16f1788}])
# We cannot use AC_PROG_CC(sdcc) as sdcc might not be built at configure-time...
AC_SUBST(CC, [\'$abs_top_builddir/../../../bin/sdcc\'])
AC_PATH_PROG(CCAS, gpasm, :)
AC_PATH_PROG(LD, gplink, :)
AC_PATH_PROG(AR, gplib, :)
case ":$CCAS:$LD:$AR:" in
*:::*)
AC_MSG_ERROR([gputils (gpasm, gplink, and gplib) are required but not found.
Either install gputils or reconfigure with --disable-pic14-port and --disable-pic16-port.])
;;
esac;
mCCAS="$CCAS"
mLD="$LD"
AC_SUBST(CFLAGS, [""])
AC_SUBST(CCASFLAGS, [""])
AC_SUBST(LDFLAGS, ["-m -l -w"])
AC_SUBST(ARFLAGS, ["-c"])
AC_SUBST(CCAS, [\'$CCAS\'])
AC_SUBST(LD, [\'$LD\'])
AC_SUBST(AR, [\'$AR\'])
# $RANLIB is called by the autotools but not provided nor required
AC_SUBST(RANLIB, [:])
AC_SUBST(OBJEXT, [o])
_AM_DEPENDENCIES(CC)
_AM_DEPENDENCIES(CCAS)
AC_MSG_CHECKING([whether gputils support enhanced cores])
# Check support for enhanced pic cores.
ENABLE_ENHANCED_PICS="no"
CHECK=".checkdevices/check"
mkdir -p .checkdevices
printf ' include "p%s.inc"\n END\n' "${EARCH}" > "${CHECK}.asm"
if "$mCCAS" -p${EARCH} -o "${CHECK}.o" -c "${CHECK}.asm" >/dev/null 2>&1 && "$mLD" "${CHECK}.o" >/dev/null 2>&1; then
ENABLE_ENHANCED_PICS="yes"
fi;
AC_MSG_RESULT([$ENABLE_ENHANCED_PICS])
AM_CONDITIONAL([ENABLE_ENHANCED_PICS], [ test x$ENABLE_ENHANCED_PICS = xyes ])
AC_MSG_CHECKING([wheter gputils support the extended instruction set])
ENABLE_EXTENDED_INSTRUCTIONS="no"
printf ' include "p%s.inc"\n CODE\n ADDFSR FSR0, 4\n MOVIW FSR0++\n END\n' "${EARCH}" > "${CHECK}.asm"
if "$mCCAS" -p${EARCH} -o "${CHECK}.o" -c "${CHECK}.asm" >/dev/null 2>&1 && "$mLD" "${CHECK}.o" >/dev/null 2>&1; then
ENABLE_EXTENDED_INSTRUCTIONS="yes"
fi;
AC_MSG_RESULT([$ENABLE_EXTENDED_INSTRUCTIONS])
AM_CONDITIONAL([ENABLE_EXTENDED_INSTRUCTIONS], [ test x$ENABLE_EXTENDED_INSTRUCTIONS = xyes ])
# default values for the following conditions
: ${DEBUG:=0}
: ${NOOPTS:=0}
: ${EXPERIMENTAL:=0}
# generate debug info during the build process
AM_CONDITIONAL([ENABLE_DEBUG], [ test x$DEBUG = x1 ])
# build libraries with optimizations disabled
AM_CONDITIONAL([ENABLE_NOOPTS], [ test x$NOOPTS = x1 ])
# build libraries with experimental code enabled
AM_CONDITIONAL([ENABLE_EXPERIMENTAL], [ test x$EXPERIMENTAL = x1 ])
# Checks for libraries.
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile
libsdcc/enhanced/Makefile
libsdcc/enhanced-no-xinst/Makefile
libsdcc/regular/Makefile
libc/Makefile
libm/Makefile])
AC_OUTPUT
|