aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: d4de0c196d8513bd9e8e29a51a02de570462946e (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
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
AC_PREREQ(2.53)
AC_INIT([matchbox-panel], 0.8, [mallum@handhelds.org])
AC_CONFIG_SRCDIR([src/panel.c])

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

# Checks for programs.
AC_PROG_CC
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([libintl.h stdlib.h string.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_HEADER_TIME

# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_CHECK_FUNCS([alarm getcwd gettimeofday memset mkdir select setenv setlocale strcasecmp strdup strpbrk strstr])

# maybe this should be locale support

#AC_ARG_ENABLE(translations,
#  [  --enable-translations    enable debug ( verbose ) build],
#     enable_translations=$enableval, enable_tra=no )

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

AC_ARG_ENABLE(nls,
  [  --enable-nls        enable Native Language Support ( gettext/libintl )],
   enable_nls=$enableval, enable_nls=no)

AC_ARG_ENABLE(sicons,
  [  --small-icons    enable small icons],
     enable_sicons=$enableval, enable_sicons=no )


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


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

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

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

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


if test x$enable_sn != 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 ----- NLS Fun -----------------------------------------------------------

INTLIBS=""
MOFILES=""

if test x$enable_nls = xyes; then

  LINGUAS="en_GB es_ES fi_FI de cs fr_FR"

  AC_CHECK_FUNC(gettext, [HAVEGETTEXT="yes"], 
	     AC_CHECK_LIB(intl, gettext, [INTLIBS="-lintl" HAVEGETTEXT="yes"],
		  	 INTLIBS="" ))

  AC_CHECK_PROG(XGETTEXT, xgettext, xgettext)

  if test "$XGETTEXT" != ""; then 
    if $XGETTEXT --help 2>&1 | grep illegal >/dev/null ; then
        echo "xgettext isn't GNU version"
        XGETTEXT=""
    fi
  fi

  if test "$LINGUAS" != ""; then
    if test "$XGETTEXT" != "" -a "$HAVEGETTEXT" != ""; then
       PO=""
       if test "$LINGUAS" = ""; then
   	    ling=` (cd src/po; /bin/ls *.po) `
    	    for l in $ling; do
	        lcode=`basename $l .po`
	        LINGUAS="$LINGUAS $lcode"
           done
       fi
       AC_DEFINE(ENABLE_NLS, [1], [NLS Please])
       echo "xgettext and gettext() exist; will build i18n support for $LINGUAS"
    else
        LINGUAS=""
        PO=""
        echo "xgettext and libintl.a don't both exist; will not build i18n support"
    fi
  else
    INTLIBS=""
    MOFILES=""
    PO=""
  fi

  for lang in $LINGUAS; do
    MOFILES="$MOFILES $lang.mo"
  done

fi

AC_SUBST(INTLIBS)
AC_SUBST(MOFILES)

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 ---- Png Support -------------------------------------------------------

if $PKG_CONFIG --libs libmb | grep png ; then
   found_png="yes"
else
   found_png="no"	
fi

AM_CONDITIONAL(WANT_PNGS, test x$found_png = xyes)  


dnl ---- Icons --------------------------------------------------------------

AM_CONDITIONAL(WANT_SMALL_ICONS, test x$enable_sicons = xyes)  

dnl ----- Specific Applet deps ----------------------------------------------


AC_CHECK_HEADERS(apm.h, enable_linux_apm=yes, enable_linux_apm=no)
if test x$enable_linux_apm = xyes; then
   miniapm_enabled="yes"
   AC_DEFINE(HAVE_APM_H, [1], [Have Linux APM headers])
fi

AC_CHECK_HEADERS(apmvar.h, enable_bsd_apm=yes, enable_bsd_apm=no)
if test x$enable_bsd_apm = xyes; then
   AC_DEFINE(HAVE_APMVAR_H, [1], [Have BSD APM headers])
   miniapm_enabled="yes"
fi

AM_CONDITIONAL(WANT_APM, test x$miniapm_enabled = x"yes")


# XXX wireless checks 


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

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


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

AC_SUBST(LIBMB_CFLAGS)
AC_SUBST(LIBMB_LIBS)

AC_OUTPUT([
Makefile
src/Makefile  
applets/Makefile
applets/dotdesktop/Makefile
applets/icons/Makefile
applets/small-icons/Makefile
po/Makefile
])