-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
88 lines (69 loc) · 1.81 KB
/
configure.ac
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
AC_PREREQ([2.65])
AC_INIT([FX2LPTool],[0.0.0])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([1.11 -Wall -Wno-portability no-dist-gzip dist-xz subdir-objects])
# Support silent build rules. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
AM_SILENT_RULES([yes])
dnl If AM_PROG_AR exists, call it, to shut up a libtool warning (and make it more portable, I guess?)
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
dnl libtool
LT_PREREQ([2.2])
LT_INIT([disable-shared])
dnl We're C++
AC_PROG_CXX
AM_PROG_CC_C_O
dnl We want a make install
AC_PROG_INSTALL
dnl --with-werror
AC_ARG_WITH([werror], [AS_HELP_STRING([--with-werror], [Compile with -Werror @<:@default=no@:>@])], [], [with_werror=no])
if test "x$with_werror" = "xyes"; then
WERROR="-Werror -Werror=unused-but-set-variable"
fi
dnl Standard C, C++
AC_C_CONST
AC_HEADER_STDC
dnl Endianness
AC_C_BIGENDIAN()
dnl Special variables of the size of pointers
AC_TYPE_INTPTR_T
AC_TYPE_UINTPTR_T
dnl math library and special float functions
AC_CHECK_LIB([m], [cos])
AC_CHECK_FUNCS([fabs])
AC_CHECK_FUNCS([fmin])
AC_CHECK_FUNCS([fmax])
AC_CHECK_FUNCS([fabsf])
AC_CHECK_FUNCS([fminf])
AC_CHECK_FUNCS([fmaxf])
dnl libusb
PKG_CHECK_MODULES([LIBUSB], [libusb-1.0 >= 1.0.9])
dnl Extra flags
case "$target" in
*darwin*)
FX2LPTOOL_CFLAGS="-DUNIX -DMACOSX"
FX2LPTOOL_LIBS=""
;;
*mingw*)
FX2LPTOOL_CFLAGS=""
FX2LPTOOL_LIBS="-static-libgcc -static-libstdc++"
;;
*)
FX2LPTOOL_CFLAGS="-DUNIX"
FX2LPTOOL_LIBS=""
;;
esac;
AC_SUBST(FX2LPTOOL_CFLAGS)
AC_SUBST(FX2LPTOOL_LIBS)
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)
AC_SUBST(WERROR)
AC_CONFIG_FILES([gitstamp/Makefile])
AC_CONFIG_FILES([src/Makefile])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT