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