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 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510
|
# Process this file with autoconf to produce a configure script.
AC_INIT(src/ut.cpp)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(quickfix, 1.13.3)
AM_CONFIG_HEADER(config.h)
AM_DISABLE_STATIC
# Checks for programs.
AC_PROG_CXX()
AC_PROG_CC()
# AC_PROG_RANLIB
AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AM_PROG_LEX
########################################
# ALLOCATOR
########################################
AC_ARG_ENABLE(new_allocator,
[ --enable-new_allocator use new_allocator],
[use_new_allocator=$enableval],
use_new_allocator=no
)
if test $use_new_allocator = yes
then
AC_DEFINE(ENABLE_NEW_ALLOCATOR, 1,
Define if you want to use new_allocator)
fi
########################################
# CALLSTACK
########################################
use_callstack=no
AC_ARG_ENABLE(callstack,
[ --enable-callstack display c++ call stack after crashing],
[use_callstack=$enableval],
use_callstack=no
)
if test $use_callstack = yes
then
AC_DEFINE(ENABLE_CALLSTACK, 1,
Define if you want a C++ callstack to be displayed after crashing)
fi
########################################
########################################
# BOOST
########################################
has_boost=false
AC_ARG_WITH(boost,
[ --with-boost=<path> prefix of boost installation. e.g. /usr/local/include/boost-1_33_1],
[if test $withval == "no"
then
has_boost=false
else
has_boost=true
fi],
has_boost=false
)
BOOST_PREFIX=$with_boost
AC_SUBST(BOOST_PREFIX)
if test $has_boost = true
then
BOOST_CFLAGS="-I${BOOST_PREFIX}"
AC_SUBST(BOOST_CFLAGS)
AC_DEFINE(HAVE_BOOST, 1, Define if you have boost framework)
fi
########################################
########################################
# MYSQL
########################################
has_mysql=false
AC_ARG_WITH(mysql,
[ --with-mysql=<path> prefix of MySQL installation. e.g. /usr/local or /usr],
[if test $withval == "no"
then
has_mysql=false
else
has_mysql=true
fi],
has_mysql=false
)
MYSQL_PREFIX=$with_mysql
AC_SUBST(MYSQL_PREFIX)
if test $has_mysql = true
then
MYSQL_CFLAGS="-I${MYSQL_PREFIX}/include/mysql -I${MYSQL_PREFIX}/mysql/include"
AC_SUBST(MYSQL_CFLAGS)
MYSQL_LIBS="-L${MYSQL_PREFIX}/lib/mysql -L${MYSQL_PREFIX}/mysql/lib -lmysqlclient"
AC_SUBST(MYSQL_LIBS)
AC_DEFINE(HAVE_MYSQL, 1, Define if you have sql library (-lmysqlclient))
fi
########################################
########################################
# POSTGRESQL
########################################
has_postgresql=false
AC_ARG_WITH(postgresql,
[ --with-postgresql=<path> prefix of PostgreSQL installation. e.g. /usr/local/pgsql or /usr/pgsql],
[if test $withval == "no"
then
has_postgresql=false
else
has_postgresql=true
fi],
has_postgresql=false
)
POSTGRESQL_PREFIX=$with_postgresql
AC_SUBST(POSTGRESQL_PREFIX)
if test $has_postgresql = true
then
POSTGRESQL_CFLAGS="-I${POSTGRESQL_PREFIX}/include -I${POSTGRESQL_PREFIX}/include/postgresql"
AC_SUBST(POSTGRESQL_CFLAGS)
POSTGRESQL_LIBS="-L${POSTGRESQL_PREFIX}/lib -lpq"
AC_SUBST(POSTGRESQL_LIBS)
AC_DEFINE(HAVE_POSTGRESQL, 1, Define if you have sql library (-lpq))
fi
########################################
########################################
# PYTHON
########################################
has_python=false
AC_ARG_WITH(python,
[ --with-python=<path> directory containing python headers e.g. /usr/local/include/python2.3],
[if test $withval == "no"
then
has_python=false
else
has_python=true
fi],
has_python=false
)
PYTHON_PREFIX=$with_python
AC_SUBST(PYTHON_PREFIX)
if test $has_python = true
then
PYTHON_CFLAGS="-I${PYTHON_PREFIX}"
AC_SUBST(PYTHON_CFLAGS)
PYTHON_SITE_PACKAGES=[`python -c 'from distutils import sysconfig; print sysconfig.get_python_lib()'`]
AC_SUBST(PYTHON_SITE_PACKAGES)
AC_DEFINE(HAVE_PYTHON, 1, Define if you have python)
fi
AM_CONDITIONAL(HAVE_PYTHON, $has_python)
########################################
########################################
# RUBY
########################################
RUBY_PREFIX=[`ruby -e 'require "rbconfig"; print Config::CONFIG["archdir"], "\n"'`]
AC_SUBST(RUBY_PREFIX)
has_ruby=false
AC_ARG_WITH(ruby,
[ --with-ruby],
[if test $withval == "no"
then
has_ruby=false
else
has_ruby=true
fi],
has_ruby=false
)
if test $has_ruby = true
then
RUBY_CFLAGS="-I${RUBY_PREFIX}"
AC_SUBST(RUBY_CFLAGS)
RUBY_SITE_PACKAGES=[`ruby -e 'require "rbconfig"; print Config::CONFIG["libdir"], "\n"'`]
AC_SUBST(RUBY_SITE_PACKAGES)
AC_DEFINE(HAVE_RUBY, 1, Define if you have ruby)
fi
AM_CONDITIONAL(HAVE_RUBY, $has_ruby)
########################################
########################################
# JAVA
########################################
has_java=false
AC_ARG_WITH(java,
[ --with-java will use JAVA_HOME settings to find javac],
[if test $withval == "no"
then
has_java=false
else
has_java=true
fi],
has_java=false
)
if test $has_java = true
then
jarlib=$libdir
AC_SUBST(jarlib)
AC_SUBST(JAVA_CFLAGS)
AC_DEFINE(HAVE_JAVA, 1, Define if you have java)
fi
AM_CONDITIONAL(HAVE_JAVA, $has_java)
########################################
########################################
# STLport
########################################
has_stlport=false
AC_ARG_WITH(stlport,
[ --with-stlport=<path> prefix of stlport installation. e.g. /usr/local or /usr],
[if test $withval == "no"
then
has_stlport=false
else
has_stlport=true
fi],
has_stlport=false
)
STLPORT_PREFIX=$with_stlport
AC_SUBST(STLPORT_PREFIX)
if test $has_stlport = true
then
AC_CHECK_FILE($STLPORT_PREFIX/include/stlport/stdio.h,
[
STLPORT_CFLAGS="-I${STLPORT_PREFIX}/include/stlport -pthread"
STLPORT_LIBS="-L${STLPORT_PREFIX}/lib -lstlport -pthread"
],
[
STLPORT_CFLAGS="-I${STLPORT_PREFIX}/stlport/include"
STLPORT_LIBS="-L${STLPORT_PREFIX}/lib -lstlport_gcc"
] )
AC_SUBST(STLPORT_LIBS)
AC_SUBST(STLPORT_CFLAGS)
AC_DEFINE(HAVE_STLPORT, 1, Define if you have stlport library)
fi
########################################
########################################
# LIBXML
########################################
AM_PATH_XML2('2.0.0', , AC_MSG_ERROR(libxml2 must be installed.))
########################################
# libs
LIBS="$STLPORT_LIBS $XML_LIBS $MYSQL_LIBS $POSTGRESQL_LIBS $LIBS"
# gcc flags
SHAREDFLAGS="-Wall -ansi -Wpointer-arith -Wwrite-strings $BOOST_CFLAGS $STLPORT_CFLAGS $MYSQL_CFLAGS $POSTGRESQL_CFLAGS $XML_CPPFLAGS $XML_CFLAGS $PYTHON_CFLAGS $RUBY_CFLAGS"
CFLAGS="$CFLAGS $SHAREDFLAGS"
AC_SUBST(CFLAGS)
CXXFLAGS="$CXXFLAGS $SHAREDFLAGS"
AC_SUBST(CXXFLAGS)
# Checks for libraries.
AC_CHECK_LIB(c,shutdown,true,AC_CHECK_LIB(socket,shutdown))
AC_CHECK_LIB(c,inet_addr,true,AC_CHECK_LIB(nsl,inet_addr))
AC_CHECK_LIB(c,nanosleep,true,AC_CHECK_LIB(rt,nanosleep))
AC_CHECK_LIB(compat,ftime)
AC_MSG_CHECKING([which threading environment to use])
# each host OS needs special threading flags
case $build_os in
freebsd*|netbsd*)
LIBS="-pthread $LIBS"
AC_MSG_RESULT([-pthread])
;;
linux-*)
AC_MSG_RESULT([-lpthread])
AC_CHECK_LIB(pthread, pthread_create)
;;
solaris*)
AC_MSG_RESULT([-lpthread])
AC_CHECK_LIB(pthread, pthread_create)
;;
*)
# maybe we have a usable libc for other OSes
AC_MSG_RESULT([-lc_r])
AC_CHECK_LIB(c_r, pthread_create)
;;
esac
# Checks for header files.
AC_CHECK_HEADERS(stdio.h)
# Checks for typedefs, structures, and compiler characteristics.
# AC_CHECK_BROKENSOEXCEPT
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING(for STREAMS ioctl)
AC_TRY_COMPILE(
[#include <sys/types.h>
#include <stropts.h>
#include <sys/conf.h>],
[ioctl(1,I_NREAD);],
AC_MSG_RESULT(yes)
AC_DEFINE(USING_STREAMS, 1,
The system supports AT&T STREAMS, presumably standard),
AC_MSG_RESULT(no))
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE(
[#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>],
[socklen_t t = 1;],
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
AC_DEFINE(socklen_t, int,
socklen_t needs to be defined if the system doesn't define it))
AC_MSG_CHECKING(for ftime)
AC_TRY_COMPILE(
[#include <sys/timeb.h>],
[timeb tb;
ftime(&tb)],
has_ftime=true, has_ftime=false)
if test $has_ftime = true
then AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_FTIME, 1, found ftime)
else AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(HAVE_FTIME, $has_ftime)
AC_MSG_CHECKING(for set_terminate in the global namespace)
AC_TRY_COMPILE(
[#include <exception>
void term() {}],
[set_terminate(term);],
set_terminate_is_global=true, set_terminate_is_global=false)
if test $set_terminate_is_global = true
then AC_MSG_RESULT(yes)
else AC_MSG_RESULT(no)
AC_MSG_CHECKING(for set_terminate in the std namespace)
AC_TRY_COMPILE(
[#include <exception>
void term() {}],
[std::set_terminate(term);],
AC_MSG_RESULT(yes)
AC_DEFINE(TERMINATE_IN_STD, 1,
For location of set_terminate),
AC_MSG_RESULT(no)
AC_MSG_ERROR(unable to find set_terminate in std or global namespace))
fi
AC_MSG_CHECKING(for typeinfo in the global namespace)
AC_TRY_COMPILE(
[#include <typeinfo>],
[const typeinfo& ty = typeid(typeinfo);],
typeinfo_is_global=true, typeinfo_is_global=false)
if test $typeinfo_is_global = true
then AC_MSG_RESULT(yes)
else AC_MSG_RESULT(no)
AC_MSG_CHECKING(for typeinfo in the std namespace)
AC_TRY_COMPILE(
[#include <typeinfo>],
[const std::type_info& ty = typeid(std::type_info);],
AC_MSG_RESULT(yes)
AC_DEFINE(TYPEINFO_IN_STD, 1,
Whether or not we are using the new-style typeinfo header),
AC_MSG_RESULT(no)
AC_MSG_ERROR(type_info is required by the test library))
fi
# check for gethostbyname_r
AC_MSG_CHECKING(for gethostbyname_r with input result)
AC_TRY_COMPILE(
[#include <netdb.h>],
[const char* name = "localhost";
hostent host;
char buf[1024];
hostent* host_ptr;
int error;
gethostbyname_r( name, &host, buf, sizeof(buf), &host_ptr, &error );
return 0;],
AC_MSG_RESULT(yes)
AC_DEFINE(GETHOSTBYNAME_R_INPUTS_RESULT, 1,
The system has gethostbyname_r which takes a result as a pass-in param),
AC_MSG_RESULT(no))
# check for boost::pool_allocator
AC_MSG_CHECKING(for boost::pool_allocator)
AC_TRY_COMPILE(
[#include <boost/pool/pool_alloc.hpp>
#include<vector>],
[std::vector<int, boost::pool_allocator<int> > x;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BOOST_POOL_ALLOCATOR, 1,
boost::pool_allocator exists),
AC_MSG_RESULT(no))
# check for boost::fast_pool_allocator
AC_MSG_CHECKING(for boost::fast_pool_allocator)
AC_TRY_COMPILE(
[#include <boost/pool/pool_alloc.hpp>
#include<vector>],
[std::vector<int, boost::fast_pool_allocator<int> > x;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BOOST_FAST_POOL_ALLOCATOR, 1,
boost::fast_pool_allocator exists),
AC_MSG_RESULT(no))
# check for __gnu_cxx::__pool_alloc
AC_MSG_CHECKING(__gnu_cxx::__pool_alloc)
AC_TRY_COMPILE(
[#include <ext/pool_allocator.h>
#include<vector>],
[std::vector<int, __gnu_cxx::__pool_alloc<int> > x;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_POOL_ALLOCATOR, 1,
__gnu_cxx::pool_allocator exists),
AC_MSG_RESULT(no))
# check for __gnu_cxx::__mt_alloc
AC_MSG_CHECKING(__gnu_cxx::__mt_alloc)
AC_TRY_COMPILE(
[#include <ext/mt_allocator.h>
#include<vector>],
[std::vector<int, __gnu_cxx::__mt_alloc<int> > x;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MT_ALLOCATOR, 1,
__gnu_cxx::mt_allocator exists),
AC_MSG_RESULT(no))
# check for __gnu_cxx::bitmap_allocator
AC_MSG_CHECKING(__gnu_cxx::bitmap_allocator)
AC_TRY_COMPILE(
[#include <ext/bitmap_allocator.h>
#include<vector>],
[std::vector<int, __gnu_cxx::bitmap_allocator<int> > x;],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_BITMAP_ALLOCATOR, 1,
__gnu_cxx::bitmap_allocator exists),
AC_MSG_RESULT(no))
AC_DEFINE(_REENTRANT, 1, enable reentrant system calls)
# Checks for library functions.
AC_LANG_RESTORE
AC_CHECK_LIB(iberty, cplus_demangle,
AC_DEFINE(HAVE_CPLUS_DEMANGLE,1,whether or not we have to demangle names)
LIBS="$LIBS -liberty")
# Checks for runtime behavior
AC_MSG_CHECKING(if select modifies timeval parameter)
AC_TRY_RUN(
[
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
int main(int argc, char** argv)
{
struct timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 1;
select(0,0,0,0,&tv);
return tv.tv_usec != 1 ? 0 : 1;
}
],
AC_MSG_RESULT(yes)
AC_DEFINE(SELECT_MODIFIES_TIMEVAL, 1,
select statement decrements timeval parameter if interupted),
AC_MSG_RESULT(no),
AC_MSG_RESULT(unable to determine, assuming no...))
AC_OUTPUT(
quickfix.pc
Makefile
src/Makefile
src/C++/Makefile
src/C++/test/Makefile
src/python/Makefile
src/ruby/Makefile
bin/Makefile
bin/cfg/Makefile
spec/Makefile
test/Makefile
test/atrun/Makefile
test/cfg/Makefile
test/definitions/Makefile
test/definitions/server/Makefile
test/definitions/server/future/Makefile
examples/Makefile
examples/executor/Makefile
examples/executor/C++/Makefile
examples/ordermatch/Makefile
examples/ordermatch/test/Makefile
examples/tradeclient/Makefile
examples/tradeclientgui/Makefile
examples/tradeclientgui/banzai/Makefile
examples/tradeclientgui/banzai/test/Makefile
examples/tradeclientgui/banzai/src/Makefile
examples/tradeclientgui/banzai/src/quickfix/Makefile
examples/tradeclientgui/banzai/src/quickfix/banzai/Makefile
examples/tradeclientgui/banzai/src/quickfix/banzai/ui/Makefile
doc/Makefile
doc/html/Makefile)
|