]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - configure.ac
69a995024b864991e9b130d700e7e8c9fe24f6ab
[sigrok-firmware-fx2lafw.git] / configure.ac
1 ##
2 ## This file is part of the fx2lafw project.
3 ##
4 ## Copyright (C) 2013 Uwe Hermann <uwe@hermann-uwe.de>
5 ##
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## This program is distributed in the hope that it will be useful,
12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19 ##
20
21 # We require at least autoconf 2.63 (AC_INIT format changed there).
22 AC_PREREQ([2.63])
23
24 AC_INIT([sigrok-firmware-fx2lafw], [0.1.1],
25         [sigrok-devel@lists.sourceforge.net],
26         [sigrok-firmware-fx2lafw], [http://www.sigrok.org])
27 AC_CONFIG_HEADER([config.h])
28 AC_CONFIG_MACRO_DIR([autostuff])
29 AC_CONFIG_AUX_DIR([autostuff])
30
31 # We require at least automake 1.11 (needed for 'silent rules').
32 AM_INIT_AUTOMAKE([1.11 -Wall -Werror check-news])
33 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
34
35 AC_PROG_INSTALL
36 AC_PROG_LN_S
37
38 # On Fedora, all sdcc tools have an 'sdcc-' prefix in the filename.
39 AC_CHECK_PROGS([SDCC], [sdcc sdcc-sdcc])
40 if test "x$SDCC" == "x"; then
41         AC_MSG_ERROR([cannot find sdcc.])
42 fi
43 AC_CHECK_PROGS([SDCCLIB], [sdcclib sdcc-sdcclib])
44 if test "x$SDCCLIB" == "x"; then
45         AC_MSG_ERROR([cannot find sdcclib.])
46 fi
47 AC_CHECK_PROGS([OBJCOPY], [objcopy])
48 AC_CHECK_PROGS([MAKEBIN], [makebin sdcc-makebin])
49 if test "x$OBJCOPY" == "x" && test "x$MAKEBIN" == "x"; then
50         AC_MSG_ERROR([cannot find objcopy or makebin.])
51 fi
52
53 AM_CONDITIONAL([FOUND_OBJCOPY], [test "x$OBJCOPY" != "x"])
54 AM_CONDITIONAL([FOUND_MAKEBIN], [test "x$MAKEBIN" != "x"])
55 AM_COND_IF([FOUND_OBJCOPY], [AC_SUBST(FOUND_OBJCOPY, "yes")])
56 AM_COND_IF([FOUND_MAKEBIN], [AC_SUBST(FOUND_MAKEBIN, "yes")])
57
58 # The sdcc 8051 assembler binary has/had different names:
59 # Newer sdcc, Debian / Ubuntu: sdas8051
60 # Newer sdcc, Fedora: sdcc-sdas8051
61 # Older sdcc: asx8051
62 AC_CHECK_PROGS([SDAS8051], [sdas8051 sdcc-sdas8051 asx8051])
63 if test "x$SDAS8051" == "x"; then
64         AC_MSG_ERROR([cannot find sdas8051.])
65 fi
66
67 AC_SUBST(SDCC_FLAGS, "--code-size 0x1c00 --xram-size 0x0200 --xram-loc 0x1c00 -Wl\"-b DSCR_AREA=0x1e00\" -Wl\"-b INT2JT=0x1f00\"")
68 AC_SUBST(FIRMWARE_DIR, "$datadir/sigrok-firmware")
69 AC_SUBST(MAKEFLAGS, '--no-print-directory')
70
71 AC_CONFIG_FILES([Makefile
72                  include/Makefile
73                  fx2lib/Makefile
74                  fx2lib/include/Makefile
75                  fx2lib/lib/Makefile
76                  fx2lib/lib/interrupts/Makefile
77                  hw/Makefile
78                  hw/braintechnology-usb-lps/Makefile
79                  hw/cwav-usbeeax/Makefile
80                  hw/cwav-usbeedx/Makefile
81                  hw/cwav-usbeesx/Makefile
82                  hw/cypress-fx2/Makefile
83                  hw/saleae-logic/Makefile
84                 ])
85
86 AC_OUTPUT
87