forked from pmodels/yaksa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
193 lines (155 loc) · 5.53 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
188
189
190
191
192
193
##
## Copyright (C) by Argonne National Laboratory
## See COPYRIGHT in top-level directory
##
AC_PREREQ(2.63)
m4_include([maint/version.m4])
AC_INIT([yaksa],YAKSA_VERSION_m4)
YAKSA_VERSION=YAKSA_VERSION_m4
AC_SUBST([YAKSA_VERSION])
libyaksa_so_version="libyaksa_so_version_m4"
AC_SUBST([libyaksa_so_version])
# Produce a numeric version assuming the following format:
# Version: [MAJ].[MIN].[REV][EXT][EXT_NUMBER]
# Example: 1.0.7rc1 has
# MAJ = 1
# MIN = 0
# REV = 7
# EXT = rc
# EXT_NUMBER = 1
#
# Converting to numeric version will convert EXT to a format number:
# ALPHA (a) = 0
# BETA (b) = 1
# RC (rc) = 2
# PATCH (p) = 3
# Regular releases are treated as patch 0
#
# Numeric version will have 1 digit for MAJ, 2 digits for MIN,
# 2 digits for REV, 1 digit for EXT and 2 digits for EXT_NUMBER.
if test "${YAKSA_VERSION}" = "unreleased" ; then
YAKSA_NUMVERSION=0
else
changequote(<<,>>)
V1=`expr $YAKSA_VERSION : '\([0-9]*\)\.[0-9]*\.*[0-9]*[a-zA-Z]*[0-9]*'`
V2=`expr $YAKSA_VERSION : '[0-9]*\.\([0-9]*\)\.*[0-9]*[a-zA-Z]*[0-9]*'`
V3=`expr $YAKSA_VERSION : '[0-9]*\.[0-9]*\.*\([0-9]*\)[a-zA-Z]*[0-9]*'`
V4=`expr $YAKSA_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*\([a-zA-Z]*\)[0-9]*'`
V5=`expr $YAKSA_VERSION : '[0-9]*\.[0-9]*\.*[0-9]*[a-zA-Z]*\([0-9]*\)'`
changequote([,])
if test "$V2" -le 9 ; then V2="0$V2" ; fi
if test "$V3" = "" ; then V3="0"; fi
if test "$V3" -le 9 ; then V3="0$V3" ; fi
if test "$V4" = "a" ; then
V4=0
elif test "$V4" = "b" ; then
V4=1
elif test "$V4" = "rc" ; then
V4=2
elif test "$V4" = "" ; then
V4=3
V5=0
elif test "$V4" = "p" ; then
V4=3
fi
if test "$V5" -le 9 ; then V5="0$V5" ; fi
YAKSA_NUMVERSION=`expr $V1$V2$V3$V4$V5 + 0`
fi
AC_SUBST(YAKSA_NUMVERSION)
AC_CONFIG_AUX_DIR(m4)
AC_CONFIG_MACRO_DIR(m4)
dnl ----------------------------------------------------------------------------
dnl setup autotools
dnl ----------------------------------------------------------------------------
AM_INIT_AUTOMAKE([-Wall -Wno-portability-recursive -Werror foreign 1.12.3 subdir-objects])
AM_SILENT_RULES([yes])
PAC_PUSH_FLAG([CFLAGS])
AM_PROG_AS
PAC_POP_FLAG([CFLAGS])
AM_PROG_AR
LT_INIT
AC_PROG_INSTALL
dnl ----------------------------------------------------------------------------
dnl check the compiler and standard headers
dnl ----------------------------------------------------------------------------
dnl disable AC_PROG_CC's annoying default of adding -O2 to the CFLAGS
PAC_PUSH_FLAG([CFLAGS])
AC_PROG_CC
AC_PROG_CC_C99
PAC_POP_FLAG([CFLAGS])
AC_HEADER_STDC
# required pre-Automake-1.14
AM_PROG_CC_C_O
dnl ----------------------------------------------------------------------------
dnl configure options
dnl ----------------------------------------------------------------------------
# strict
PAC_ARG_STRICT
# embedded builds
AC_ARG_ENABLE([embedded],AS_HELP_STRING([--enable-embedded],[enables embedded builds]),,[enable_embedded=no])
AM_CONDITIONAL([EMBEDDED_BUILD], [test x${enable_embedded} = xyes])
# --enable-debug
AC_ARG_ENABLE([g],AS_HELP_STRING([--enable-g],[alias for --enable-debug]),,[enable_g=no])
AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[adds -g to CFLAGS]),,[enable_debug=${enable_g}])
if test "${enable_debug}" != "no" ; then
PAC_APPEND_FLAG([-g],[CFLAGS])
fi
# --enable-fast
AC_ARG_ENABLE([fast],AS_HELP_STRING([--enable-fast=O<opt>],[adds -O<opt> to CFLAGS]),,[enable_fast=yes])
if test "`echo ${enable_fast} | cut -c1`" = "O" ; then
PAC_APPEND_FLAG([-${enable_fast}],[CFLAGS])
elif test "${enable_fast}" != "no" ; then
PAC_APPEND_FLAG([-O2],[CFLAGS])
fi
dnl ----------------------------------------------------------------------------
dnl check the environment and the availability of functions
dnl ----------------------------------------------------------------------------
PAC_C_GNU_ATTRIBUTE
# look for pthreads
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_LIB([pthread],[pthread_key_create],have_pthreads=yes)
if test "$have_pthreads" = "yes" ; then
PAC_PREPEND_FLAG([-lpthread],[LIBS])
else
AC_ERROR([pthreads not found on the system])
fi
# backend devices
supported_backends="seq"
m4_include([src/backend/cuda/subconfigure.m4])
dnl ----------------------------------------------------------------------------
dnl Final setup
dnl ----------------------------------------------------------------------------
dnl ----------------------------------------------------------------------------
dnl config headers
dnl ----------------------------------------------------------------------------
AC_CONFIG_HEADERS([src/frontend/include/yaksa_config.h])
AH_TOP([
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/
#ifndef YAKSA_CONFIG_H_INCLUDED
#define YAKSA_CONFIG_H_INCLUDED
])
AH_BOTTOM([
#endif /* YAKSA_CONFIG_H_INCLUDED */
])
AC_CONFIG_FILES([Makefile
Doxyfile
maint/yaksa.pc
src/frontend/include/yaksa.h
])
AC_OUTPUT
##################################################################
# Display the status of optional modules
##################################################################
cat <<EOF
##################################################################
# Final status of compiled yaksa modules
##################################################################
Backends supported: ${supported_backends}
${backend_info}
##################################################################
# End of yaksa configure
##################################################################
EOF