* device/lib/pic16/bootstrap.sh: avoid symlinks
[fw/sdcc] / device / lib / pic16 / configure.ac
1 #                                               -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ(2.61)
5 AC_INIT([pic16lib], [0.3], [tecodev AT users sourceforge net])
6 AM_INIT_AUTOMAKE
7 AC_CONFIG_SRCDIR([debug/gstack/gstack.c])
8 AC_CONFIG_HEADER([config.h])
9
10
11 # SDCC setup
12 case $srcdir in
13     [\\/]*|?:[\\/]*) abs_srcdir="$srcdir";
14         ;;
15     *) abs_srcdir="$ac_pwd/$srcdir";
16         ;;
17 esac
18 case $ac_top_build_prefix in
19     [\\/]*|?:[\\/]*)
20         abs_top_builddir="$ac_top_build_prefix";
21         ;;
22     *) abs_top_builddir="$ac_pwd/$ac_top_build_prefix";
23         ;;
24 esac
25
26 libdir=$libdir/pic16
27
28 AC_SUBST([USE_FLOATS], ["-DUSE_FLOATS=0"])
29 AC_ARG_ENABLE(
30     [floats],
31     AS_HELP_STRING([--enable-floats], [Enable output of float-values via printf().]),
32     [if test "yes" = $enableval; then USE_FLOATS="-DUSE_FLOATS=1"; fi]
33 )
34
35 # Checks for programs.
36
37 # The default architecture can be selected at configure time by setting the
38 # environment variable ARCH to the desired device (18fxxx).
39 AC_SUBST(ARCH, [${ARCH:-18f452}])
40
41 # We cannot use AC_PROG_CC(sdcc) as sdcc might not be built at configure-time...
42 AC_SUBST(CC, [\'$abs_top_builddir/../../../bin/sdcc\'])
43 AC_SUBST(CFLAGS, ["-mpic16 -p$ARCH"])
44 AC_PATH_PROG(CCAS, gpasm, :)
45 AC_SUBST(CCAS, [\'$CCAS\'])
46 AC_SUBST(CCASFLAGS, ["-p$ARCH"])
47 AC_PATH_PROG(LD, gplink, :)
48 AC_SUBST(LD, [\'$LD\'])
49 AC_PATH_PROG(AR, gplib, :)
50 AC_SUBST(AR, [\'$AR\'])
51 AC_SUBST(ARFLAGS, [-c])
52
53 # $RANLIB is called by the autotools but not provided nor required
54 AC_SUBST(RANLIB, [:])
55 AC_SUBST(OBJEXT, [o])
56
57 _AM_DEPENDENCIES(CC)
58 _AM_DEPENDENCIES(CCAS)
59
60 # Checks for libraries.
61
62 # Checks for header files.
63
64 # Checks for typedefs, structures, and compiler characteristics.
65
66 # Checks for library functions.
67
68 case "$CCAS:$LD:$AR" in
69     *::*)
70         AC_MSG_ERROR([gputils (gpasm, gplink, and gplib) are required but not found.])
71         ;;
72 esac
73
74 AC_CONFIG_FILES([Makefile
75                  debug/Makefile
76                  libc/Makefile
77                  libdev/Makefile
78                  libio/Makefile
79                  libm/Makefile
80                  libsdcc/Makefile
81                  startup/Makefile])
82 AC_OUTPUT
83