blob: e6d5f36a9f94c371cc26accbf447e9f5d13ba922 (
plain) (
blame)
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
|
dnl ######################################################################
dnl @synopsis NTP_HARDEN([SCRIPTSDIRPATH])
dnl Build (compile/link) hardening information:
dnl - NTP_HARD_CFLAGS
dnl - NTP_HARD_CPPFLAGS
dnl - NTP_HARD_LDFLAGS
AC_DEFUN([NTP_HARDEN], [
AC_MSG_CHECKING([for compile/link hardening flags])
AC_ARG_WITH(
[locfile],
[AS_HELP_STRING(
[--with-locfile=XXX],
[os-specific or "legacy"]
)],
[],
[with_locfile=no]
)
( \
SENTINEL_DIR="$PWD" && \
cd $srcdir/$1 && \
case "$with_locfile" in \
yes|no|'') \
scripts/genHardFlags -d "$SENTINEL_DIR" \
;; \
*) \
scripts/genHardFlags -d "$SENTINEL_DIR" -f "$with_locfile" \
;; \
esac \
) > genHardFlags.i 2> genHardFlags.err
. ./genHardFlags.i
case "$GENHARDFLAG" in
OK)
AC_MSG_RESULT([in file $GENHARDFLAGFILE])
rm genHardFlags.err genHardFlags.i
;;
*)
AC_MSG_RESULT([failed.])
AC_MSG_ERROR([Problem with genHardFlags!])
;;
esac
AC_SUBST([NTP_HARD_CFLAGS])
AC_SUBST([NTP_HARD_CPPFLAGS])
AC_SUBST([NTP_HARD_LDFLAGS])
])dnl
dnl ======================================================================
|