-
Notifications
You must be signed in to change notification settings - Fork 92
/
configure.ac
105 lines (89 loc) · 2.79 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#
# The ONNC Project
#
# See LICENSE.TXT for details.
##############################################################################
# Autoconf/Automake Initialization
dnl AC_INIT(PKG_NAME, BUILD_VERSION, BUG_REPORTER)
AC_INIT([ONNC],[dev],[[email protected]])
AC_PREREQ(2.59)
AC_CONFIG_SRCDIR([LICENSE.TXT])
AC_CONFIG_AUX_DIR([scripts])
AC_CONFIG_MACRO_DIR([m4])
####################
# Check environments - `host`, `target` and `build`
CHECK_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE([1.9 dist-bzip2 foreign nostdinc subdir-objects])
####################
# Languages
AC_PROG_CC
AC_PROG_CXX
AC_LANG([C++])
AX_CXX_COMPILE_STDCXX_14([noext])
AC_CXX_STL_HASH
AC_PROG_RANLIB
AC_PROG_LEX
AC_PROG_YACC
AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
LT_INIT
####################
# Check for compiler warnings
CHECK_WERROR_FLAGS
CXX_FLAG_CHECK([-Wno-variadic-macros])
####################
# Check for libraries
SETUP_CONFIG_HEADER
AC_CONFIG_HEADER(include/onnc/Config/Config.h)
AC_CONFIG_HEADER(include/onnc/Support/DataTypes.h)
PKG_CHECK_MODULES([PROTOBUF], [protobuf])
AC_SUBST(PROTOBUF_LIBS)
AC_SUBST(PROTOBUF_CFLAGS)
AC_SUBST(PROTOBUF_VERSION)
####################
# Check for types
AC_CHECK_TYPES([int8_t, int16_t, int32_t, int64_t, intptr_t])
AC_CHECK_TYPES([uint8_t, uint16_t, uint32_t, uint64_t, uintptr_t])
AC_CHECK_TYPES([long double, long long, long long int, unsigned long long int])
AC_CHECK_TYPES([off_t, size_t, ssize_t])
AC_TYPE_LONG_DOUBLE_WIDER
####################
# Check for headers
AC_CHECK_HEADERS([sys/time.h])
####################
# Check for functions
AC_SEARCH_LIBS([clock_gettime], [rt], [
AC_DEFINE(HAVE_CLOCK_GETTIME, 1,[Have clock_gettime])
])
AC_CHECK_FUNCS([gettimeofday])
####################
# Check for options
CHECK_PTHREAD
CHECK_SKYPAT
CHECK_ONNX
CHECK_ZLIB
CHECK_ENABLE_OPTION([debug], [no], [ENABLE_DEBUG])
CHECK_ENABLE_OPTION([unittest], [no], [ENABLE_UNITTEST])
CHECK_ENABLE_OPTION([regression], [no], [ENABLE_REGRESSION])
CHECK_ENABLE_OPTION([optimize], [no], [ENABLE_OPTIMIZE])
CHECK_ENABLE_OPTION([clock_gettime], [no], [ENABLE_CLOCK_GETTIME])
CHECK_ENABLE_OPTION([gettimeofday], [yes], [ENABLE_GETTIMEOFDAY])
####################
# Check for variables
SETUP_ONNC_FLAGS
ENUM_ONNC_TARGETS
####################
# OUTPUT
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([include/Makefile])
AC_CONFIG_FILES([include/onnc/Config/Platforms.def])
AC_CONFIG_FILES([include/onnc/Config/Backends.def])
AC_CONFIG_FILES([include/onnc/Config/ONNX.h])
AC_CONFIG_FILES([lib/Makefile])
AC_CONFIG_FILES([tools/Makefile])
AC_CONFIG_FILES([tools/unittests/Makefile])
AC_CONFIG_FILES([tools/onnc/Makefile])
AC_CONFIG_FILES([tools/readonnx/Makefile])
AC_CONFIG_FILES([tools/onnc-jit/Makefile])
AC_CONFIG_FILES([tools/onni/Makefile])
AC_CONFIG_FILES([cmake/ONNCConfig.cmake])
AC_OUTPUT