File: configure.ac

package info (click to toggle)
admesh 0.98.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: ansic: 2,945; sh: 284; makefile: 54; xml: 18
file content (90 lines) | stat: -rw-r--r-- 2,313 bytes parent folder | download
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
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])

# ====================
# Version informations
# ====================
m4_define([admesh_version_major],[0])
m4_define([admesh_version_minor],[98])
m4_define([admesh_version_micro],[5])
m4_define([admesh_version_suffix],[])
m4_define([admesh_version],[admesh_version_major.admesh_version_minor.admesh_version_micro''admesh_version_suffix])

# =============
# Automake init
# =============
AC_INIT([admesh],[admesh_version])
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz subdir-objects])
AM_SILENT_RULES([yes])
LT_INIT([disable-static pic-only])
AC_LANG([C])

# ===========================
# Find required base packages
# ===========================
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
AC_PROG_SED
AC_PROG_MKDIR_P

# =======================
# Platform specific setup
# =======================

AC_CANONICAL_HOST
case $host_os in
	darwin* )
		DEAD_STRIP="-Wl,-dead_strip"
		;;
	*)
		DEAD_STRIP="-Wl,--gc-sections -Wl,--as-needed"
		;;
esac
AC_SUBST(DEAD_STRIP)

# ================
# Check for cflags
# ================
AC_ARG_ENABLE([werror],
	[AS_HELP_STRING([--enable-werror], [Treat all warnings as errors, useful for development @<:@default=disabled@:>@])],
	[enable_werror="$enableval"],
	[enable_werror=no]
)
AS_IF([test x"$enable_werror" != "xno"], [
	CFLAGS="$CFLAGS -Werror"
	CXXFLAGS="$CXXFLAGS -Werror"
])
AS_IF([test x"$GCC" = xyes], [
	# Be tough with warnings and produce less careless code
	CFLAGS="$CFLAGS -Wall -Wextra -pedantic -Werror=format-security  -Wp,-D_FORTIFY_SOURCE=2"
	CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wshadow -pedantic -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2"
])

# =========
# Find libs
# =========
AC_CHECK_LIB(m, main)

# =====================
# Prepare all .in files
# =====================
AC_CONFIG_FILES([
Makefile
libadmesh.pc
])

AC_OUTPUT

# ==============================================
# Display final informations about configuration
# ==============================================
AC_MSG_NOTICE([
==============================================================================
Build configuration:
	werror:	  ${enable_werror}
==============================================================================
])