-
Notifications
You must be signed in to change notification settings - Fork 21
/
acinclude.m4
47 lines (45 loc) · 1.08 KB
/
acinclude.m4
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
dnl AC_COMPILE_WARNINGS
dnl
dnl Set the maximum warning verbosity according to compiler used.
dnl Currently supports g++ and gcc.
dnl This macro must be put after AC_PROG_CC and AC_PROG_CXX in
dnl configure.in
dnl
dnl author Loic Dachary <[email protected]>
dnl
AC_DEFUN([AC_COMPILE_WARNINGS],
[AC_MSG_CHECKING([maximum warning verbosity option])
if test -n "$CXX"
then
if test "$GXX" = "yes"
then
ac_compile_warnings_opt='-Wall'
fi
CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt"
ac_compile_warnings_msg="$ac_compile_warnings_opt for C++"
fi
if test -n "$CC"
then
if test "$GCC" = "yes"
then
ac_compile_warnings_opt='-Wall'
fi
CFLAGS="$CFLAGS $ac_compile_warnings_opt"
ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C"
fi
AC_MSG_RESULT($ac_compile_warnings_msg)
unset ac_compile_warnings_msg
unset ac_compile_warnings_opt
])
AC_DEFUN([AC_DEBUG_COMPILE],
[AC_MSG_CHECKING([debug build option])
if test -n "$CXX"
then
CXXFLAGS="$CXXFLAGS -DDEBUG"
fi
if test -n "$CC"
then
CFLAGS="$CFLAGS -DDEBUG"
fi
AC_MSG_RESULT("-DDEBUG for compilation")
])