File: configure.ac

package info (click to toggle)
dsfmt 2.2.3+dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 944 kB
  • sloc: ansic: 4,839; makefile: 94; sh: 17
file content (109 lines) | stat: -rw-r--r-- 3,047 bytes parent folder | download | duplicates (2)
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
AC_PREREQ([2.69])
AC_INIT([dSFMT], [2.2.3])
AC_CONFIG_SRCDIR([dSFMT.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
LT_INIT

AC_PROG_CC_C99
AC_PROG_MAKE_SET
AC_PROG_LN_S

AX_CHECK_COMPILE_FLAG([-Wall],
	[AM_CFLAGS="$AM_CFLAGS -Wall"],
	[],
	[-Werror])

AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes],
	[AM_CFLAGS="$AM_CFLAGS -Wmissing-prototypes"],
	[],
	[-Werror])

AC_MSG_CHECKING([whether to enable debugging assertions])
AC_ARG_ENABLE([debug],
	[AC_HELP_STRING([--enable-debug], [enable debugging assertions @<:@default=no@:>@])],
	[enable_debug=$enableval],
	[enable_debug=no])
AC_MSG_RESULT([$enable_debug])

if test "$enable_debug" != "yes"; then
	AC_DEFINE([NDEBUG], [1], [Define to disable debugging assertions])
fi

AC_MSG_CHECKING([whether to enable optimization flags])
AC_ARG_ENABLE([optimize],
	[AC_HELP_STRING([--enable-optimize], [enable optimization flags @<:@default=yes@:>@])],
	[enable_optimize=$enableval],
	[enable_optimize=yes])
AC_MSG_RESULT([$enable_optimize])

if test "$enable_optimize" = "yes"; then
	AX_CHECK_COMPILE_FLAG([-finline-functions],
		[AM_CFLAGS="$AM_CFLAGS -finline-functions"],
		[],
		[-Werror])

	AX_CHECK_COMPILE_FLAG([-fomit-frame-pointer],
		[AM_CFLAGS="$AM_CFLAGS -fomit-frame-pointer"],
		[],
		[-Werror])

	AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],
		[AM_CFLAGS="$AM_CFLAGS -fno-strict-aliasing"],
		[],
		[-Werror])

	AX_CHECK_COMPILE_FLAG([--param=max-inline-insns-single=1800],
		[AM_CFLAGS="$AM_CFLAGS --param=max-inline-insns-single=1800"],
		[],
		[-Werror])

	AX_CHECK_COMPILE_FLAG([--param=inline-unit-growth=500],
		[AM_CFLAGS="$AM_CFLAGS --param=inline-unit-growth=500"],
		[],
		[-Werror])

	AX_CHECK_COMPILE_FLAG([--param=large-function-growth=900],
		[AM_CFLAGS="$AM_CFLAGS --param=large-function-growth=900"],
		[],
		[-Werror])
fi

AC_MSG_CHECKING([whether to enable SSE2 support])
AC_ARG_ENABLE([sse2],
	[AC_HELP_STRING([--enable-sse2], [enable SSE2 support @<:@default=no@:>@])],
	[enable_sse2=$enableval],
	[enable_sse2=no])
AC_MSG_RESULT([$enable_sse2])

if test "$enable_sse2" = "yes"; then
	AX_CHECK_COMPILE_FLAG([-msse2],
		[AM_CFLAGS="$AM_CFLAGS -msse2"],
		[AC_MSG_ERROR([Need C compiler that supports SSE2])],
		[-Werror])
	AC_DEFINE([HAVE_SSE2], [1], [Define to enable SSE2 support])
fi

AC_MSG_CHECKING([whether to enable AltiVec support])
AC_ARG_ENABLE([altivec],
	[AC_HELP_STRING([--enable-altivec], [enable AltiVec support @<:@default=no@:>@])],
	[enable_altivec=$enableval],
	[enable_altivec=no])
AC_MSG_RESULT([$enable_altivec])

if test "$enable_altivec" = "yes"; then
	AX_CHECK_COMPILE_FLAG([-mabi=altivec -maltivec],
		[AM_CFLAGS="$AM_CFLAGS -mabi=altivec -maltivec"],
		[AX_CHECK_COMPILE_FLAG([-faltivec -maltivec],
			[AM_CFLAGS="$AM_CFLAGS -faltivec -maltivec"],
			[AC_MSG_ERROR([Need C compiler that supports AltiVec])],
			[-Werror])],
		[-Werror])
	AC_DEFINE([HAVE_ALTIVEC], [1], [Define to enable AltiVec support])
fi

AC_SUBST([LIB_VERSION], [1:0:0])
AC_SUBST([AM_CFLAGS])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT