~ci-train-bot/unity-settings-daemon/unity-settings-daemon-ubuntu-disco-3643

1 by William Jon McCann
Initial checkin. Previously lived in gdm module.
1
dnl EXTRA_COMPILE_WARNINGS
2
dnl Turn on many useful compiler warnings
3
dnl For now, only works on GCC
4
AC_DEFUN([EXTRA_COMPILE_WARNINGS],[
5
    dnl ******************************
6
    dnl More compiler warnings
7
    dnl ******************************
8
9
    AC_ARG_ENABLE(compile-warnings,
10
                  AC_HELP_STRING([--enable-compile-warnings=@<:@no/minimum/yes/maximum/error@:>@],
11
                                 [Turn on compiler warnings]),,
12
                  [enable_compile_warnings="m4_default([$1],[yes])"])
13
14
    warnCFLAGS=
15
    if test "x$GCC" != xyes; then
16
	enable_compile_warnings=no
17
    fi
18
19
    warning_flags=
20
    realsave_CFLAGS="$CFLAGS"
21
22
    case "$enable_compile_warnings" in
23
    no)
24
	warning_flags=
25
	;;
26
    minimum)
27
	warning_flags="-Wall"
28
	;;
29
    yes)
30
	warning_flags="-Wall -Wmissing-prototypes"
31
	;;
32
    maximum|error)
33
	warning_flags="-Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith"
34
	CFLAGS="$warning_flags $CFLAGS"
35
	for option in -Wno-sign-compare; do
36
		SAVE_CFLAGS="$CFLAGS"
37
		CFLAGS="$CFLAGS $option"
38
		AC_MSG_CHECKING([whether gcc understands $option])
39
		AC_TRY_COMPILE([], [],
40
			has_option=yes,
41
			has_option=no,)
42
		CFLAGS="$SAVE_CFLAGS"
43
		AC_MSG_RESULT($has_option)
44
		if test $has_option = yes; then
45
		  warning_flags="$warning_flags $option"
46
		fi
47
		unset has_option
48
		unset SAVE_CFLAGS
49
	done
50
	unset option
51
	if test "$enable_compile_warnings" = "error" ; then
52
	    warning_flags="$warning_flags -Werror"
53
	fi
54
	;;
55
    *)
56
	AC_MSG_ERROR(Unknown argument '$enable_compile_warnings' to --enable-compile-warnings)
57
	;;
58
    esac
59
    CFLAGS="$realsave_CFLAGS"
60
    AC_MSG_CHECKING(what warning flags to pass to the C compiler)
61
    AC_MSG_RESULT($warning_flags)
62
63
    AC_ARG_ENABLE(iso-c,
64
                  AC_HELP_STRING([--enable-iso-c],
65
                                 [Try to warn if code is not ISO C ]),,
66
                  [enable_iso_c=no])
67
68
    AC_MSG_CHECKING(what language compliance flags to pass to the C compiler)
69
    complCFLAGS=
70
    if test "x$enable_iso_c" != "xno"; then
71
	if test "x$GCC" = "xyes"; then
72
	case " $CFLAGS " in
73
	    *[\ \	]-ansi[\ \	]*) ;;
74
	    *) complCFLAGS="$complCFLAGS -ansi" ;;
75
	esac
76
	case " $CFLAGS " in
77
	    *[\ \	]-pedantic[\ \	]*) ;;
78
	    *) complCFLAGS="$complCFLAGS -pedantic" ;;
79
	esac
80
	fi
81
    fi
82
    AC_MSG_RESULT($complCFLAGS)
83
84
    WARN_CFLAGS="$warning_flags $complCFLAGS"
85
    AC_SUBST(WARN_CFLAGS)
86
])
288 by Lucas Rocha
Install .desktop for gnome-settings-daemon in a standard autostart
87
88
dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
89
dnl autostars m4 macro for expanding directories using configure's prefix
90
91
dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
92
93
dnl Copying and distribution of this file, with or without modification,
94
dnl are permitted in any medium without royalty provided the copyright
95
dnl notice and this notice are preserved.
96
97
dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
98
99
dnl example:
100
dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
101
dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
102
103
AC_DEFUN([AS_AC_EXPAND],
104
[
105
  EXP_VAR=[$1]
106
  FROM_VAR=[$2]
107
108
  dnl first expand prefix and exec_prefix if necessary
109
  prefix_save=$prefix
110
  exec_prefix_save=$exec_prefix
111
112
  dnl if no prefix given, then use /usr/local, the default prefix
113
  if test "x$prefix" = "xNONE"; then
114
    prefix="$ac_default_prefix"
115
  fi
116
  dnl if no exec_prefix given, then use prefix
117
  if test "x$exec_prefix" = "xNONE"; then
118
    exec_prefix=$prefix
119
  fi
120
121
  full_var="$FROM_VAR"
122
  dnl loop until it doesn't change anymore
123
  while true; do
124
    new_full_var="`eval echo $full_var`"
125
    if test "x$new_full_var" = "x$full_var"; then break; fi
126
    full_var=$new_full_var
127
  done
128
129
  dnl clean up
130
  full_var=$new_full_var
131
  AC_SUBST([$1], "$full_var")
132
133
  dnl restore prefix and exec_prefix
134
  prefix=$prefix_save
135
  exec_prefix=$exec_prefix_save
136
])
1954 by Richard Hughes
color: Move the device registration functionality from gcm-session to the color plugin
137