-
Notifications
You must be signed in to change notification settings - Fork 26
/
configure.ac
154 lines (131 loc) · 3.88 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
AC_INIT(Event,[1.00])
AC_CONFIG_SRCDIR([configure.ac])
AM_CONDITIONAL(VXWORKS, false)
AM_CONDITIONAL(LINUX, false)
AM_CONDITIONAL(NEWIO, false)
AC_CANONICAL_HOST
AC_CONFIG_AUX_DIR([.])
#CXXFLAGS="-O0 -g"
dnl search for C++ compiler and set default flags
AC_PROG_CXX(cxx CC g++)
case "$host" in
*-*-linux*)
CPPFLAGS="$CPPFLAGS -DLinux"
LT_INIT([disable-static])
AM_CONDITIONAL(LINUX, true)
;;
*-*-osf*)
CPPFLAGS="$CPPFLAGS -DOSF1 -D_BSD"
LIBS="-lm"
LT_INIT([disable-static])
;;
*-*-solaris2.6)
;;
*-*-solaris2.8)
CPPFLAGS="$CPPFLAGS -DSunOS"
dnl Chris: default flags with optimizer screw shared lib
dnl CXXFLAGS="+p -mt -g -xildoff"
CXXFLAGS="$CXXFLAGS +p -mt -fast -xO5"
LIBS="-lm -lc -lsocket -lrt -lnsl -lresolv"
LT_INIT([disable-shared])
;;
powerpc-wrs-vxworks)
AM_CONDITIONAL(VXWORKS, true)
;;
*-*-irix5*)
CPPFLAGS="-DIRIX"
;;
*-*-irix6*)
CPPFLAGS="-DIRIX64"
;;
*-*-cyg*)
CPPFLAGS=" -DNT"
;;
*)
AC_MSG_ERROR([default compiler unknown for this system!])
;;
esac
AM_INIT_AUTOMAKE(Event,1.00)
AC_PROG_INSTALL
dnl no point in suppressing warnings people should
dnl at least see them, so here we go for g++: -Wall
if test $ac_cv_prog_gxx = yes; then
CXXFLAGS="$CXXFLAGS -Wall -Werror -Wno-overloaded-virtual -Wno-class-memaccess -Wno-unused-parameter -Wno-type-limits -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-deprecated-declarations"
fi
case $CXX in
clang++)
CXXFLAGS="$CXXFLAGS -Wno-unknown-warning-option"
;;
esac
AC_HEADER_STDC
AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(setenv)
ROOTGLIBS=`root-config --glibs`
ROOTINC=`root-config --incdir`
AC_SUBST(ROOTGLIBS)
AC_SUBST(ROOTINC)
dnl test for root 6
if test `root-config --version | awk '{print $1=6.?"1":"0"}'` = 1; then
CINTDEFS=" -noIncludePaths -inlineInputHeader "
AC_SUBST(CINTDEFS)
AC_DEFINE(HAVE_ROOT6)
fi
AM_CONDITIONAL([MAKEROOT6],[test `root-config --version | awk '{print $1=6.?"1":"0"}'` = 1])
LZOLIB="-llzo2"
AC_SUBST(LZOLIB)
dnl sorry - we want to find out if the prototype is in the header.
dnl We cannot use AC_CHECK_FUNCS(strptime) because it always returns true
dnl so we try to compile the two lines and see what we get.
dnl With gcc-2.95++ we should get an error and can define the
dnl prototypes ourselves.
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([for strptime])
AC_TRY_COMPILE([#include <time.h>],[
tm newTime;
strptime("12-04-2000", "%A %h %d %H:%M:%S %Y", &newTime);],
have_strptime_prototype=yes, have_strptime_prototype=no)
AC_MSG_RESULT([$have_strptime_prototype])
if test $have_strptime_prototype = yes; then
AC_DEFINE(HAVE_STRPTIME_PROTOTYPE)
fi
AC_LANG_RESTORE
dnl for the message library, we must use a custom check.
dnl there are two distict types of systems, one where
dnl a new streambuf is given to cout as a parameter,
dnl ( cout.rdbuf(x) ), the other by assignment (cout = x)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([whether cout accepts a streambuf arg])
AC_TRY_COMPILE([#include <iostream>],[
std::streambuf *x = std::cout.rdbuf();
std::cout.rdbuf(x);],
rdbuf_accepts_streambuf=yes, rdbuf_accepts_streambuf=no)
AC_MSG_RESULT([$rdbuf_accepts_streambuf])
if test $rdbuf_accepts_streambuf = yes; then
AC_DEFINE(RDBUF_ACCEPTS_STREAMBUF)
fi
AC_LANG_RESTORE
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING([whether we have a new iostream])
AC_TRY_COMPILE([#include <iostream>],[
std::streambuf *x = std::cout.rdbuf();
x->pubsync();],
new_iostream=yes, new_iostream=no)
AC_MSG_RESULT([$new_iostream])
if test $new_iostream = yes; then
AM_CONDITIONAL(NEWIO, true)
fi
AC_LANG_RESTORE
AC_ARG_ENABLE(demos,
[ --enable-demos build demos [default=yes]],
[case "${enableval}" in
yes) demos=true ;;
no) demos=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-demos) ;;
esac],
demos=true)
AM_CONDITIONAL(DEMOS, test "$demos" = true)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT