-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
188 lines (143 loc) · 4.8 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
## ////////////////////////////////////////////////////////////////////////// //
##
## This file is part of the dan-tests project.
## Copyright 2018 Andrea Rigoni Garola <andrea.rigoni@igi.cnr.it>.
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
##
## ////////////////////////////////////////////////////////////////////////// //
dnl Process this file with autoconf to produce a configure script.
dnl AUTOCONF ///////////////////////////////////////////////////////////////////
AC_PREREQ([2.69])
AC_INIT([autoconf-bootstrap], [0.1], [andrea.rgn@gmail.com])
AC_CONFIG_MACRO_DIRS([conf/m4])
AC_CONFIG_AUX_DIR([conf])
dnl AC_CONFIG_SRCDIR([...])
AC_CANONICAL_TARGET
dnl AUTOMAKE ///////////////////////////////////////////////////////////////////
AM_INIT_AUTOMAKE([foreign subdir-objects])
dnl update submodules at first ... (must be cleaned out)
AS_IF([${srcdir}/conf/update_submodules.sh],
[AS_ECHO(["Submodules succesfully updated"])],
[AS_ECHO(["Error updating submodules"])])
dnl AX_KCONFIG /////////////////////////////////////////////////////////////////
dnl see: m4/ax_enable_kconfig.m4
AS_VAR_SET([srcdir],[${srcdir}])
AS_VAR_SET([builddir],[$(pwd)])
AX_KCONFIG([conf/kconfig])
dnl AX_TARGET_SELFHELP /////////////////////////////////////////////////////////
AX_TARGET_SELFHELP
# //////////////////////////////////////////////////////////////////////////// #
# // DOCKER BUILD /////////////////////////////////////////////////////////// #
# //////////////////////////////////////////////////////////////////////////// #
m4_sinclude(conf/kscripts/docker.ac)
AX_DOCKER_BUILD
# //////////////////////////////////////////////////////////////////////////// #
AC_CONFIG_HEADERS([config.h])
dnl RELEASE
AX_IS_RELEASE([always])
AX_CHECK_ENABLE_DEBUG([no],,,,[-g -O2])
# Checks for programs.
AC_PROG_AWK
AC_PROG_MKDIR_P
AC_PROG_LN_S
AC_PROG_SED
AC_PROG_CC
AC_PROG_CXX
AC_CHECK_PROGS([CURL],[curl])
AC_CHECK_PROGS([TAR],[gtar tar])
AC_CHECK_PROGS([UNIQ],[uniq])
AC_CHECK_PROGS([WC],[wc])
AC_PROG_LEX
AC_PROG_YACC
# needed for sh_envsubst
AC_CHECK_PROGS([PERL],[perl])
## LIBTOOL
LT_INIT()
## /////////////////////////////////////////////////////////////////////////////
## // KSCRIPTS ///////////////////////////////////////////////////////////////
## /////////////////////////////////////////////////////////////////////////////
## BUILD_COMMON ##
m4_sinclude(conf/kscripts/build_common.ac)
## TOOLCHAIN ##
m4_sinclude(conf/kscripts/toolchain.ac)
## CODAC ##
m4_sinclude(conf/kscripts/iter_codac.ac)
## QT ##
m4_sinclude(conf/kscripts/qtdesktop.ac)
## NODEJS ##
m4_sinclude(conf/kscripts/nodejs.ac)
## DOXYGEN ##
m4_sinclude(conf/autoconf-doxygen/doxygen.ac)
## EXT_LIBJIT ##
m4_sinclude(conf/kscripts/ext_libjit.ac)
## EXT_LLVM ##
m4_sinclude(conf/kscripts/ext_llvm.ac)
## EXT_CCSTICKERS ##
m4_sinclude(conf/kscripts/ext_ccStickers.ac)
## EXT_JSONRPCC ##
m4_sinclude(conf/kscripts/ext_jsonrpcc.ac)
## EXT_FIO ##
m4_sinclude(conf/kscripts/ext_fio.ac)
## EXT_MDSPLUS ##
m4_sinclude(conf/kscripts/ext_mdsplus.ac)
## EXT ##
AX_KCONFIG_MODULES([EXT],
[libjit],[libjit external sources],
[llvm],[llvm external sources],
[ccStickers],[ccStickers external sources],
[jsonrpcc],[jsonrpcc external sources],
[fio],[fio external sources],
[mdsplus],[mdsplus external sources]
)
AC_SUBST([EXT_MODULES])
AS_VAR_SET([LDFLAGS],[-lrt])
AC_LANG(C)
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
], [dnl
int32_t fd=-1;
fd=shm_open("test", O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO);
if (fd < 0) { return 1; }
shm_unlink("test");
return 0;
])],
[AC_MSG_NOTICE(["SHM open succeded"])
AS_VAR_SET([ENABLE_SHM],[yes])],
[AC_MSG_FAILURE(["SHM open failed"])
AS_VAR_SET([ENABLE_SHM],[no])])
## // GIT IGNORE // ##
AX_GITIGNORE_ADD_PATH([${builddir}])
AX_GITIGNORE_SUBST
## SUBDIRS configure.ac ##
AX_CONFIG_SUBDIRS(
codac/reports
)
AC_CONFIG_FILES( Makefile
codac/Makefile
codac/units/Makefile
codac/tmp/Makefile
codac/tmp/Qt/Makefile
codac/tmp/Qwt_cpuplot/Makefile
codac/tmp/Netlink/Makefile
codac/docker/Makefile
ext/Makefile
node/Makefile
.gitignore )
AC_OUTPUT