-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure.ac
73 lines (59 loc) · 1.62 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
AC_INIT([ols-fwloader],[0.2],[[email protected]])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
AC_LANG_C
AC_PROG_CC
AM_PROG_CC_C_O
# Libtool
LT_INIT
is_win32=no
is_mingw=no
is_darwin=no
case "$host" in
*-mingw32*)
is_win32=yes
is_mingw=yes
AC_DEFINE(IS_MINGW, 1, [1 if building for MinGW.])
AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.])
AC_DEFINE(IS_WIN32, 1, [1 if building for Win32.])
;;
*darwin*)
is_darwin=yes
AC_DEFINE(IS_MINGW, 0, [0 if not building for MinGW.])
AC_DEFINE(IS_DARWIN, 1, [1 if building for Darwin.])
AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
;;
*)
AC_DEFINE(IS_MINGW, 0, [0 if not building for MinGW.])
AC_DEFINE(IS_DARWIN, 0, [0 if not building for Darwin.])
AC_DEFINE(IS_WIN32, 0, [0 if not building for Win32.])
;;
esac
# options
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Enable debugging output]),[enable_debug=$enableval],[enable_debug="no"])
if test x"$enable_debug" = "xyes"
then
CFLAGS="$CFLAGS -Wall DDEBUG -g"
fi
win32_LIBS=""
# for nonwin we need libusb
if test $is_win32 = no; then
# check dependencies
AC_PATH_PROG(PKG_CONFIG, pkg-config)
if test x"$PKG_CONFIG" = x""; then
AC_MSG_ERROR([pkg-config not found.])
fi
PKG_CONFIG_REQUIRES=""
OLS_CHECK_LIBUSB
AC_SUBST(PKG_CONFIG_REQUIRES)
else
win32_LIBS="-lhid -lsetupapi"
fi
AC_SUBST(win32_LIBS)
AM_CONDITIONAL(IS_WIN32, test $is_win32 = yes)
AM_CONDITIONAL(IS_MINGW, test $is_mingw = yes)
AM_CONDITIONAL(IS_DARWIN, test $is_mingw = yes)
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT