-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
112 lines (102 loc) · 3.89 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
dnl Process this file with autoconf to produce a configure script
dnl ----------------------------------------------------------------------
dnl C++ Class library
dnl (C) 1995 Lassi A. Tuura (<Lassi.Tuura@hut.fi>)
dnl ----------------------------------------------------------------------
AC_REVISION(1.6)dnl
AC_INIT([classlib], [3.1.0], [lat@iki.fi])
AC_CONFIG_HEADER(classlib/sysapi/config.h)
AC_CONFIG_SRCDIR(classlib/sysapi/system.h)
AC_CONFIG_AUX_DIR(cfg)
AC_CONFIG_MACRO_DIR(cfg)
dnl ----------------------------------------------------------------------
dnl Automake and libtool
AM_INIT_AUTOMAKE([1.6 foreign dist-bzip2 subdir-objects no-define no-installinfo no-installman])
AM_MAINTAINER_MODE
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
dnl ----------------------------------------------------------------------
dnl (FIXME!) Configure windows build requirements: W2K or later
dnl Select large file support unconditionally.
CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0502 -D_FILE_OFFSET_BITS=64"
CPPFLAGS="$CPPFLAGS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
dnl ----------------------------------------------------------------------
dnl Checks for programs
AM_PROG_CC_C_O
AC_PROG_CXX
AC_PROG_CXXCPP
if test $ac_compiler_gnu = yes; then
for opt in -ansi -pedantic -W -Wall -Wno-long-long -Werror; do
case " $CXXFLAGS " in
*" $opt "* ) ;;
* ) CXXFLAGS=${CXXFLAGS+"$CXXFLAGS "}"$opt" ;;
esac
done
fi
dnl ----------------------------------------------------------------------
dnl Figure out system-specific extra libraries we need
AC_LANG_C
AC_SUBST(EXTRA)
AC_CHECK_FUNCS(gethostbyname socket clock_gettime dlopen)
if test $ac_cv_func_socket = no; then
# `socket' is not in the default libraries. Look for it elsewhere.
for lib in bsd socket inet; do
AC_CHECK_LIB($lib, socket, [EXTRA="$EXTRA -l$lib"; break])
done
fi
if test $ac_cv_func_gethostbyname = no; then
# `gethostname' is not in the default libraries. Look for it elsewhere.
for lib in resolv bsd socket inet nsl; do
AC_CHECK_LIB($lib, gethostbyname, [EXTRA="$EXTRA -l$lib"; break])
done
fi
if test $ac_cv_func_clock_gettime = no; then
AC_CHECK_LIB(rt, clock_gettime, [EXTRA="$EXTRA -lrt"])
fi
if test $ac_cv_func_dlopen = no; then
AC_CHECK_LIB(dl, dlopen, [EXTRA="$EXTRA -ldl"])
fi
AC_CHECK_LIB(pmapi,pm_cycles, [EXTRA="$EXTRA -lpmapi"])
AC_CHECK_LIB(xlf90, xl__trbk, [EXTRA="$EXTRA -lxlf90"])
AC_CHECK_HEADERS(dlfcn.h)
if test $ac_cv_header_dlfcn_h = yes; then
AC_DEFINE_UNQUOTED(CLASSLIB_HAVE_DLFCN_H)
fi
dnl ----------------------------------------------------------------------
dnl Resource information: symbols for program memory layout
for lat_sym in __bss_start __data_start _edata _end _etext; do
lat_sym_def=`echo $lat_sym | tr "[[a-z]]" "[[A-Z]]" | sed 's/^_*//'`
AC_MSG_CHECKING(for $lat_sym)
AC_CACHE_VAL(lat_cv_have_$lat_sym,
[AC_TRY_LINK([#include <stdio.h>],
[extern char $lat_sym[];printf("%x", $lat_sym);],
[eval lat_cv_have_$lat_sym=yes],
[eval lat_cv_have_$lat_sym=no])])
eval lat_result=\$lat_cv_have_$lat_sym
AC_MSG_RESULT($lat_result)
if test $lat_result = yes; then
AC_DEFINE_UNQUOTED(CLASSLIB_HAVE_SYM_$lat_sym_def)
fi
done
dnl ----------------------------------------------------------------------
dnl Set debugging flags
AC_SUBST(NDEBUG)
AC_SUBST(NLOG)
AC_ARG_ENABLE(debugging,[ --disable-debugging No validation],
[test "$enableval" = "no" && NDEBUG="-DNDEBUG"])
AC_ARG_ENABLE(logging, [ --disable-logging No logging],
[test "$enableval" = "no" && NLOG="-DNLOG"])
dnl ----------------------------------------------------------------------
dnl External libraries we can use
LAT_EXT_ZLIB
LAT_EXT_BZ2LIB
LAT_EXT_PCRE
LAT_EXT_OPENSSL
LAT_EXT_LZO
LAT_EXT_LZMA
LAT_EXT_RX
dnl ----------------------------------------------------------------------
dnl Stage out
mkdir -p test/iobase test/iotools test/utils test/zip src \
{.deps/,}ext/rfc1321 {.deps/,}ext/rfc3174
AC_OUTPUT(Makefile)