-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
95 lines (80 loc) · 2.11 KB
/
configure.in
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(steel, 0.1.5.2, [email protected])
AC_CONFIG_SRCDIR([src/Ast.h])
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER( config.h )
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AM_INIT_AUTOMAKE( steel, 0.1.5.2)
# AM_MAINTAINER_MODE
# Checks for libraries.
# Check for debug or release
AC_ARG_ENABLE(debug,[--enable-debug enables debug build],
[debugmode=$enableval],
[debugmode=false]
)
AC_ARG_ENABLE(mutex,[--enable-mutex enables thread-safe build],
[mutexmode=$enableval],
[mutexmode=true]
)
AC_ARG_ENABLE(efence,[--enable-efence enables electric fence build],
[efencemode=$enableval],
[efencemode=false]
)
CFLAGS="$CFLAGS -Werror=return-type"
if test "$debugmode" != false
then
CFLAGS="-g -O0 -DDEBUG"
CPPFLAGS="$CFLAGS"
CXXFLAGS="$CFLAGS"
AC_MSG_RESULT(debug on)
else
CFLAGS="-DNDEBUG -O3"
CPPFLAGS="$CFLAGS"
CXXFLAGS="$CFLAGS"
AC_MSG_RESULT(debug off)
fi
if test "$mutexmode" != false
then
CPPFLAGS="$CPPFLAGS -DUSE_STEEL_MUTEX=1"
CXXFLAGS="$CXXFLAGS -DUSE_STEEL_MUTEX=1"
# AC_CHECK_LIB(pthread,main,[LIBS="$LIBS -lpthread"])
AC_MSG_RESULT(mutex on)
else
CPPFLAGS="$CPPFLAGS -DUSE_STEEL_MUTEX=0"
CXXFLAGS="$CXXFLAGS -DUSE_STEEL_MUTEX=0"
AC_MSG_RESULT(mutex off)
fi
if test "$efencemode" != false
then
AC_CHECK_LIB(efence,main,[LIBS="$LIBS -lefence"])
AC_MSG_RESULT(efence on)
else
AC_MSG_RESULT(efence off)
fi
AC_ARG_ENABLE(gprof,
[ --enable-gprof enable profiling with gprof],
gprof=$enableval,gprof=no)
if test "$gprof" != no
then
CFLAGS="-pg $CFLAGS"
CPPFLAGS="-pg $CPPFLAGS"
CXXFLAGS="-pg $CXXFLAGS"
AC_CHECK_LIB(gmon, main,[LIBS="$LIBS -lgmon"])
AC_MSG_RESULT(gprof enabled)
else
AC_MSG_RESULT(gprof off)
fi
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
# Checks for library functions.
AC_OUTPUT(Makefile \
src/Makefile
)