summaryrefslogtreecommitdiff
path: root/device/lib/pic16/configure.ac
blob: 3966c114e17c8b1d4e15d7945dbacfc82f5f7737 (plain) (blame)
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.60)
AC_INIT([pic16lib], [0.3], [tecodev AT users sourceforge net])
#AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_SRCDIR([debug/gstack/gstack.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/pic16

AC_SUBST([USE_FLOATS], ["-DUSE_FLOATS=0"])
AC_ARG_ENABLE(
    [floats],
    AS_HELP_STRING([--enable-floats], [Enable output of float-values via printf().]),
    [if test "yes" = $enableval; then USE_FLOATS="-DUSE_FLOATS=1"; fi]
)

# Checks for programs.

# The default architecture can be selected at configure time by setting the
# environment variable ARCH to the desired device (18fxxx).
AC_SUBST(ARCH, [${ARCH:-18f452}])

# 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, ["-mpic16 -p$ARCH"])
AC_SUBST(CCASFLAGS, ["-p$ARCH"])
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)

LIBDEV="${srcdir}/../../non-free/lib/pic16/libdev"
m4_include([../../non-free/lib/pic16/supported-devices.ac])
m4_include([../../non-free/lib/pic16/processors.ac])

# Checks for libraries.

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile
                 debug/Makefile
                 libc/Makefile
                 libio/Makefile
                 libm/Makefile
                 libsdcc/Makefile
                 startup/Makefile])
AC_OUTPUT