aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: d97fdccb3af1ea557b8c78078b816cc2fb7f795d (plain)
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
AC_PREREQ(2.53)
AC_INIT([matchbox-desktop], 0.9.1, [mallum@handhelds.org])
AC_CONFIG_SRCDIR([src/mbdesktop.c])
AC_CONFIG_AUX_DIR(.)

AM_INIT_AUTOMAKE()
AM_MAINTAINER_MODE
AM_CONFIG_HEADER([config.h])

# Checks for programs.
AC_GNU_SOURCE
AC_PROG_CC
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_VOLATILE

# Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([alarm memset mkdir strchr strdup])

AC_ARG_ENABLE(startup_notification,
  [  --enable-startup-notification   enable startup notification support],
     enable_startup_notification=$enableval, enable_startup_notification=no )

AC_ARG_ENABLE(dnotify,
  [  --enable-dnotify      enable dnotify support (Linux 2.4+ only).],
  enable_dnotify=$enableval, enable_dnotify=no)

AC_ARG_ENABLE(debug,
  [  --enable-debug    enable debug ( verbose ) build],
     enable_debug=$enableval, enable_debug=no )

PKG_CHECK_MODULES(LIBMB, libmb >= 1.5,,
	         AC_MSG_ERROR([*** Required Matchbox Library (libmb) not installed ***]))

dnl ------ Crappy check for module loader -----------------------------------

# FIXME: Improve this for BSD's etc

AC_CHECK_HEADERS(dlfcn.h, have_dlstuff=yes, have_dlstuff=no)

if test x$havedlstuff = xno; then
   AC_MSG_ERROR([*** Required dlfcn.h not found])
fi


dnl ------ Debug Build ------------------------------------------------------

if test x$enable_debug = xyes; then
      LIBMB_CFLAGS="$LIBMB_CFLAGS -DDEBUG"
fi

dnl ----- DNOTIFY ----------------------------------------------------------

if test x$enable_dnotify = xyes; then
## FIXME: need to actually check its present
  AC_DEFINE(USE_DNOTIFY, [1], [Has dnotify support])
fi

dnl ----- Xsettings ---------------------------------------------------------

AC_MSG_CHECKING([for libmb xsettings support])

if $PKG_CONFIG --libs libmb | grep -i xsettings ; then
     mb_have_xsettings="yes"
     AC_DEFINE(USE_XSETTINGS, [1], [Use XSettings])
     AC_MSG_RESULT([yes])
else
     mb_have_xsettings="no"	
     AC_MSG_RESULT([no])
fi

dnl ----- Startup Notification ---------------------------------------------


if test x$enable_startup_notification != xno; then
  PKG_CHECK_MODULES(SN, libstartup-notification-1.0, ,
			   AC_MSG_ERROR([*** Required Startup Notification Librays not installed ***]))

  AC_DEFINE(USE_LIBSN, [1], [Has StartupNotification Support])
fi


dnl ------ GCC flags --------------------------------------------------------

if test "x$GCC" = "xyes"; then
        GCC_WARNINGS="-g -Wall -fno-strict-aliasing"
fi


dnl ------ Substitute in found libs, clags to Makefiles etc -----------------

if test "x$prefix" = xNONE; then
   prefix="${ac_default_prefix}"
fi
if test "x$exec_prefix" = xNONE; then
   exec_prefix='${prefix}'
fi

MBDESKTOP_PLUGIN_DIR=$libdir/matchbox/desktop
eval MBDESKTOP_PLUGIN_DIR=`eval echo "$MBDESKTOP_PLUGIN_DIR"`

AC_SUBST(MBDESKTOP_PLUGIN_DIR)
AC_SUBST(LIBMB_CFLAGS)
AC_SUBST(LIBMB_LIBS)
AC_SUBST(GCC_WARNINGS)

AC_SUBST(SN_CFLAGS)
AC_SUBST(SN_LIBS)

AC_OUTPUT([
Makefile
matchbox-desktop.pc
src/Makefile
modules/Makefile
data/Makefile
data/mbdesktop_modules
])

dnl ==========================================================================
echo "
                    Matchbox-desktop $VERSION
                  =========================

        Prefix:                 ${prefix}
	Plug-in location        ${MBDESKTOP_PLUGIN_DIR}
        Source code location:   ${srcdir}
        Compiler:               ${CC} 


        Building with Debug:                ${enable_debug}

        Building with Startup-Notification: ${enable_startup_notification}
	Building with DNOTIFY:		    ${enable_dnotify}

"