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