forked from sphde/sphde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
155 lines (133 loc) · 3.73 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
# The Automake init of 1.10 requires at least autoconf 2.62
AC_PREREQ([2.69])
#Autoconf versioning is A:C:B
AC_CONFIG_SRCDIR([src/sassim.cpp])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.10 no-define foreign subdir-objects])
AM_MAINTAINER_MODE([disable])
# Update this value for every release: (A:B:C will map to foo.so.(A-C).C.B)
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
SPHDE_SO_VERSION=1:4:0
AC_SUBST(SPHDE_SO_VERSION)
# Debug option
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[Enable debugging information])],
[],
[enable_debug=no])
DEBUG=0
AS_IF([test "x$enable_debug" != xno],
[AC_SUBST([DEBUG], [1])])
if test "x$enable_debug" = "xyes" ; then
CFLAGS="$CFLAGS -D__SOMDebugPrint__ -Dmylockdebug -DcoherenceCheck -D__SASDebugPrint__"
CXXFLAGS="$CXXFLAGS -D__SOMDebugPrint__ -Dmylockdebug -DcoherenceCheck -D__SASDebugPrint__"
fi
AC_ARG_ENABLE([htm],
[AS_HELP_STRING([--enable-htm],
[Enable hardware transactional memory])])
# This directive is to avoid buggy libtool that don't add the -Wl,--no-as-needed
# directive in the correct position of LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--no-as-needed -lrt"
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
LT_INIT
# Tools flags
AC_SUBST([AM_LIBTOOLFLAGS], [--silent])
# Defines host_cpu, host_vendor, and host_os variables.
AC_CANONICAL_HOST
# GCC using -march=i386 does not provide __sync_fetch_and_add_4
# move -march to a high chip level to get the required support
case $host in
x86_64*)
case $LD in
*elf_i386*)
if test "x$GCC" = xyes; then
CFLAGS="$CFLAGS -march=i686"
fi
if test "x$GXX" = xyes; then
CXXFLAGS="$CXXFLAGS -march=i686"
fi
;;
esac
;;
*64*)
;;
*)
AC_MSG_WARN([
*** __BIGREGION__ is not defined.
*** Adjust the address limits in sasconf.h as required.])
;;
esac
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h inttypes.h stddef.h stdint.h stdlib.h string.h sys/param.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT64_T
# Checks for header files.
AC_HEADER_STDC
# Checks for typedefs, structures, and compiler characteristics.
AC_C_VOLATILE
# Checks for library functions.
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_STRERROR_R
AC_FUNC_STRTOD
AC_CHECK_HEADERS([limits.h])
AC_CHECK_FUNCS([clock_gettime ftruncate getcwd getpagesize gettimeofday memset munmap strerror])
AC_CHECK_FUNCS([strtol])
AC_CHECK_FUNCS([strtoul])
# Pthread check (on m4/acx_pthread.m4)
ACX_PTHREAD
# Check for static libc
if test "$enable_static" = yes ; then
SAVE_LDFLAGS="$LDFLAGS"
LDFLAGS="-static $LDFLAGS"
AC_CHECK_LIB([c], [printf], [],
AC_MSG_ERROR([*** No static libc found. Try to install glibc-static or libc6-dev.]))
LDFLAGS="$SAVE_LDFLAGS"
fi
if test "$enable_htm" == yes ; then
AX_CHECK_COMPILE_FLAG([-mhtm],[
CFLAGS="$CFLAGS -mhtm"
CXXFLAGS="$CXXFLAGS -mhtm"
htm=yes],
AC_MSG_ERROR([*** Compiler does not support HTM.])
)
else
AX_CHECK_COMPILE_FLAG([-mno-htm],[
CFLAGS="$CFLAGS -mno-htm"
CXXFLAGS="$CXXFLAGS -mno-htm"],
)
fi
AM_CONDITIONAL([HTM], [test x$htm = xyes])
# Doxygen support
DX_HTML_FEATURE(ON)
DX_MAN_FEATURE(ON)
DX_PDF_FEATURE(OFF)
DX_INIT_DOXYGEN($PACKAGE_NAME, [ \
doc/libsphde-doxygen-sasutil.doxy \
doc/libsphde-doxygen-sph.doxy
])
AC_CONFIG_FILES([
Makefile
examples/Makefile
src/Makefile
])
AC_OUTPUT