-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
87 lines (65 loc) · 1.86 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
# -*- Autoconf -*-
#===== Initialisation =====
AC_PREREQ([2.59])
AC_INIT([c_dev_utils], [1.0], [[email protected]])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([cval/cval.cc])
AC_CONFIG_SRCDIR([cerror/cerror.c])
AC_CONFIG_SRCDIR([cdatetime/cdatetime.c])
AC_CONFIG_HEADERS([config.h])
#===== Checks for programs =====
AC_PROG_CXX
AC_PROG_RANLIB
AC_PROG_INSTALL
# Checks for libraries.
#===== Checks for header files =====
AC_CHECK_HEADERS([stdlib.h string.h])
# Checks for library functions.
AC_CHECK_FUNCS([memset exit])
#===== Custom checks =====
# Check we can statically link
my_save_cflags="$CFLAGS"
CFLAGS=-static
AC_MSG_CHECKING([whether can build using -static])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[XX_STATIC=-static],
[AC_MSG_RESULT([no])]
)
AM_CONDITIONAL([BUILDSTATIC], [test x$TEST64 = xtrue])
CFLAGS="$my_save_cflags"
# Allow the variable XX_STATIC to be using the Makefile.am
AC_SUBST([XX_STATIC])
# Check we can compile & link 64 bit
my_save_cflags="$CFLAGS"
CFLAGS=-m64
AC_MSG_CHECKING([whether can build using -m64])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[TEST64=true],
[AC_MSG_RESULT([no])]
[TEST64=false]
)
AM_CONDITIONAL([BUILD64], [test x$TEST64 = xtrue])
CFLAGS="$my_save_cflags"
# Check we can compile & link 32 bit
my_save_cflags="$CFLAGS"
CFLAGS=-m32
AC_MSG_CHECKING([whether can build using -m32])
AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
[AC_MSG_RESULT([yes])]
[TEST32=true],
[AC_MSG_RESULT([no (g++-multilib installed?)])]
[TEST32=false]
)
AM_CONDITIONAL([BUILD32], [test x$TEST32 = xtrue])
CFLAGS="$my_save_cflags"
#===== Generation =====
AC_CONFIG_FILES([Makefile
cval/Makefile
cdatetime/Makefile
cerror/Makefile
chex/Makefile])
# Trigger the generation of our makefiles
AC_OUTPUT