forked from mitlm/mitlm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
74 lines (57 loc) · 1.69 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
dnl Process this file with autoconf to produce a configure script.
dnl AC_INIT(package, version, bug-report-address)
AC_INIT([MIT Language Modeling Toolkit], 0.4.2, [[email protected]], mitlm)
dnl This file (configure.ac) revision.
AC_REVISION([$Revision$])
dnl The base directory (srcdir) must contain configure.ac.
AC_CONFIG_SRCDIR(configure.ac)
dnl Use ./ to store scripts and files used by configure.
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AM_MAINTAINER_MODE
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_F77
AC_F77_LIBRARY_LDFLAGS
AC_F77_DUMMY_MAIN
AC_F77_WRAPPERS
AM_PROG_AR
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
dnl Checks for header files.
AC_CHECK_HEADERS(string.h math.h)
AC_HEADER_STDC
AX_CXX_HEADER_TR1_UNORDERED_MAP
AX_CXX_COMPILE_STDCXX_11(noext, optional)
dnl Checks for types.
dnl Checks for structures.
dnl Checks for compiler characteristics.
AC_C_INLINE
AM_PROG_CC_C_O
AC_DEFUN([AX_CHECK_BUILTIN], [
AC_CACHE_CHECK([wheter we have $1], [ac_cv_have_$1],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])],
[ac_cv_have_$1=yes], [ac_cv_have_$1=no])])
if test $ac_cv_have_$1 = yes; then
AC_DEFINE(AS_TR_CPP([HAVE_$1]), [1], [wheter we have $1])
fi
])
AX_CHECK_BUILTIN([__builtin_clzl], [[unsigned long x = 1;]],
[[int main(void) { return __builtin_clzll(x) == (sizeof(int)*8 - 1) ? 0 : 1; }
]])
AX_CHECK_BUILTIN([X86_ASM], [[
#define bool int
#define HAVE_X86_ASM 1
#include "src/util/BitOps.h"
unsigned long x = 2;
]],
[[int main(void) { return find_last_bit_set(2)-2 ; }
]])
dnl Checks for system services.
dnl Output.
AC_CONFIG_FILES([
Makefile
])
AC_CONFIG_FILES([tests/test1.test], [chmod +x tests/test1.test])
AC_OUTPUT([])