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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334
|
AC_INIT(src/applet.c)
AC_PREREQ(2.53)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(fast-user-switch-applet, 2.24.0)
AM_MAINTAINER_MODE
##############################
# Standard Junk
##############################
IT_PROG_INTLTOOL([0.35.0])
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_LIBTOOL
AC_SUBST(VERSION)
AC_CONFIG_MACRO_DIR([m4])
##############################
# Custom Junk
##############################
AC_DEFUN([AC_DEFINE_PATH], [
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
ac_define_path=`eval echo [$]$2`
ac_define_path=`eval echo [$]ac_define_path`
$1="$ac_define_path"
AC_SUBST($1)
ifelse($3, ,
AC_DEFINE_UNQUOTED($1, "$ac_define_path"),
AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3))
])
##############################
# Dependencies
##############################
GTK_REQUIRED_VERSION=2.8.0
PANEL_REQUIRED_VERSION=2.0.0
GLADE_REQUIRED_VERSION=2.0.0
GLIB_REQUIRED_VERSION=2.15.3
PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
libpanelapplet-2.0 >= $PANEL_REQUIRED_VERSION
libgnomeui-2.0 >= $PANEL_REQUIRED_VERSION
libglade-2.0 >= $GLADE_REQUIRED_VERSION
gio-2.0 >= $GLIB_REQUIRED_VERSION)
AC_SUBST(APPLET_CFLAGS)
AC_SUBST(APPLET_LIBS)
AC_CHECK_FUNCS([setresuid setenv unsetenv clearenv])
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GCONFTOOL, gconftool-2)
dnl Specify the gconf configuration source,
dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults
AM_GCONF_SOURCE_2
#############################
# X, Xau, Xmu
#############################
#
# If Pango included the shared library dependencies from X11 in
# the pkg-config output, then we use that (to avoid duplicates).
# but if they were omitted to avoid binary compatibility problems
# then we need to repeat the checks.
#
if $PKG_CONFIG --exists pangoxft ; then
PANGO_PACKAGES="pangox pangoxft"
else
PANGO_PACKAGES="pangox"
fi
x_libs="`$PKG_CONFIG --libs $PANGO_PACKAGES`"
case x_libs in
*-lX11*) pango_omitted_x_deps=no ;;
*) pango_omitted_x_deps=yes ;;
esac
if test $pango_omitted_x_deps = yes ; then
AC_PATH_XTRA
if test x$no_x = xyes ; then
AC_MSG_ERROR([X development libraries not found])
else
X_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
fi
fi
fusa_save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $X_LIBS"
AC_CHECK_LIB(Xau, XauFileName,
X_LIBS="$X_LIBS -lXau",
[AC_MSG_ERROR([Xau development libraries not found])])
AC_CHECK_LIB(Xmu, XmuClientWindow,
X_LIBS="$X_LIBS -lXmu",
[AC_MSG_ERROR([Xmu development libraries not found])])
LDFLAGS=$fusa_save_LDFLAGS
##############################
# Users & Groups Config
##############################
USERS_ADMIN=
AC_ARG_WITH([users_admin],
AC_HELP_STRING([--with-users-admin=program],
[The command line to run a users and groups configuration tool]),
[users_admin_cmd="$withval"])
if test "x$users_admin_cmd" = "x"; then
AC_PATH_PROG(users_admin, users-admin)
if test "x$users_admin" = "x"; then
users_admin_cmd="disabled"
else
users_admin_cmd="$users_admin"
fi
else
if test "x$users_admin_cmd" = "xno"; then
AC_MSG_RESULT([disabling users and groups admin command])
users_admin=
users_admin_cmd="disabled"
else
AC_MSG_RESULT([using "$users_admin_cmd" as the users and groups admin command])
users_admin="$users_admin_cmd"
fi
fi
if test "x$users_admin" != "x"; then
AC_DEFINE_UNQUOTED(USERS_ADMIN, "$users_admin",
[The command line to a users and groups configuration tool])
fi
##############################
# GDM Setup App
##############################
GDM_SETUP=
AC_ARG_WITH([gdm_setup],
AC_HELP_STRING([--with-gdm-setup=program],
[The command line to the login screen setup tool]),
[gdm_setup_cmd="$withval"])
if test "x$gdm_setup_cmd" = "x"; then
AC_PATH_PROG(gdm_setup, gdmsetup)
if test "x$gdm_setup" = "x"; then
gdm_setup_cmd="disabled"
else
gdm_setup_cmd="$gdm_setup"
fi
else
if test "x$gdm_setup_cmd" = "xno"; then
AC_MSG_RESULT([disabling login screen setup command])
gdm_setup=
gdm_setup_cmd="disabled"
else
AC_MSG_RESULT([using "$gdm_setup_cmd" as the login screen setup command])
gdm_setup="$gdm_setup_cmd"
fi
fi
if test "x$gdm_setup" != "x"; then
AC_DEFINE_UNQUOTED(GDM_SETUP, "$gdm_setup",
[The command line to the login screen setup tool])
fi
##############################
# GDM Config File
##############################
GDMCONFIGFILE=
AC_ARG_WITH([gdm_config],
AC_HELP_STRING([--with-gdm-config=file],
[The location of the GDM configuration file]),
[gdmconfigfile="$withval"])
if test "x$gdmconfigfile" = "x" -o "x$gdmconfigfile" = "xno"; then
AC_MSG_CHECKING([for GDM configuration file])
if test -f "/etc/gdm/gdm.conf"; then
gdmconfigfile="/etc/gdm/gdm.conf"
elif test -f "/etc/X11/gdm/gdm.conf"; then
gdmconfigfile="/etc/X11/gdm/gdm.conf"
elif test -f "/etc/gdm/custom.conf"; then
gdmconfigfile="/etc/gdm/custom.conf"
elif test -f "/etc/X11/gdm/custom.conf"; then
gdmconfigfile="/etc/X11/gdm/custom.conf"
elif test -f "/etc/gdm/gdm.conf-custom"; then
gdmconfigfile="/etc/gdm/gdm.conf-custom"
elif test -f "/etc/X11/gdm/gdm.conf-custom"; then
gdmconfigfile="/etc/X11/gdm/gdm.conf-custom"
else
AC_MSG_ERROR([The GDM config file could not be found, please specify it manually])
fi
AC_MSG_RESULT([$gdmconfigfile])
else
AC_MSG_RESULT([using "$gdmconfigfile" as the gdm.conf location])
fi
AC_DEFINE_PATH(GDMCONFIGFILE, "$gdmconfigfile", [The location of the GDM configuration file])
##############################
# Compile Flags
##############################
GNOME_COMPILE_WARNINGS(maximum)
AC_ARG_ENABLE(more-warnings,
[ --enable-more-warnings Maximum compiler warnings],
set_more_warnings="$enableval",[set_more_warnings=yes])
if test "$GCC" = "yes" -a "x$set_more_warnings" = "xyes"; then
for option in -Wcast-align -Wchar-subscripts -Wsign-compare -Wno-strict-aliasing; do
fusa_save_CFLAGS="$CFLAGS"
CFLAGS="$WARN_CFLAGS $option $CFLAGS"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
CFLAGS="$fusa_save_CFLAGS"
if test $has_option = yes; then
WARN_CFLAGS="$WARN_CFLAGS $option"
fi
AC_MSG_RESULT($has_option)
unset has_option
unset fusa_save_CFLAGS
done
unset option
fi
AC_SUBST(WARN_CFLAGS)
##############################
# I18n
##############################
GETTEXT_PACKAGE=fast-user-switch-applet
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain])
AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory])
AM_GLIB_GNU_GETTEXT
##############################
# Documentation
##############################
GNOME_DOC_INIT
##############################
# ./configure Flags messings
##############################
cflags_set=${CFLAGS+set}
# find the actual value for $prefix that we'll end up with
REAL_PREFIX=
if test "x$prefix" = "xNONE"; then
REAL_PREFIX=$ac_default_prefix
else
REAL_PREFIX=$prefix
fi
# Have to go $sysconfdir->$prefix/etc->/usr/local/etc
# if you actually know how to code shell then fix this :-)
SYSCONFDIR_TMP="$sysconfdir"
old_prefix=$prefix
prefix=$REAL_PREFIX
EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
prefix=$old_prefix
AC_SUBST(EXPANDED_SYSCONFDIR)
dnl Save flags to aclocal
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
AC_DEFINE_PATH(PREFIX, "${prefix}", [prefix directory])
AC_DEFINE_PATH(SYSCONFDIR, "${sysconfdir}", [system configuration dir])
AC_DEFINE_PATH(LIBDIR, "${libdir}", [system configuration dir])
##############################
# Flags
##############################
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
##############################
# Files
##############################
AC_OUTPUT([
Makefile
data/Makefile
help/Makefile
src/Makefile
po/Makefile.in
])
##############################
# Results
##############################
AC_MSG_NOTICE([
Fast User Switch Applet Configuration:
Prefix: $prefix
GDM Config File: $gdmconfigfile
GDM Setup: $gdm_setup_cmd
Users Admin: $users_admin_cmd
])
|