configure.ac 6.32 KB
Newer Older
dkirov's avatar
dkirov committed
1
AC_INIT([Gajim - A Jabber Instant Messager],
2
		[0.12.3],[http://trac.gajim.org/],[gajim])
dkirov's avatar
dkirov committed
3
AC_PREREQ([2.59])
4
AM_INIT_AUTOMAKE([1.8])
dkirov's avatar
dkirov committed
5
AC_CONFIG_HEADER(config.h)
6
AC_CONFIG_MACRO_DIR([m4])
dkirov's avatar
dkirov committed
7 8
AM_MAINTAINER_MODE

9 10 11
dnl Make Objective-C work with automake
AM_CONDITIONAL([am__fastdepOBJC], false)

dkirov's avatar
dkirov committed
12
IT_PROG_INTLTOOL([0.35.0])
13
PKG_PROG_PKG_CONFIG([0.19])
dkirov's avatar
dkirov committed
14 15 16 17 18 19 20 21 22 23

AM_DISABLE_STATIC
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)

AC_ISC_POSIX
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
dkirov's avatar
dkirov committed
24 25
AC_C_CONST
AC_CHECK_HEADERS([libintl.h])
dkirov's avatar
dkirov committed
26
AC_PATH_X
dkirov's avatar
dkirov committed
27

dkirov's avatar
dkirov committed
28

dkirov's avatar
dkirov committed
29 30 31 32
GETTEXT_PACKAGE=gajim
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"], [Gettext package])
AM_GLIB_GNU_GETTEXT
dkirov's avatar
dkirov committed
33
AM_NLS
dkirov's avatar
dkirov committed
34 35


dkirov's avatar
dkirov committed
36 37 38
dnl ****
dnl pygtk and gtk+
dnl ****
39
PKG_CHECK_MODULES([PYGTK], [gtk+-2.0 >= 2.8.0 pygtk-2.0 >= 2.8.0])
dkirov's avatar
dkirov committed
40 41 42 43 44
AC_SUBST(PYGTK_CFLAGS)
AC_SUBST(PYGTK_LIBS)
PYGTK_DEFS=`$PKG_CONFIG --variable=defsdir pygtk-2.0`
AC_SUBST(PYGTK_DEFS)

dkirov's avatar
dkirov committed
45 46 47 48
dnl *****
dnl dbus
dnl *****
AC_ARG_ENABLE([remote], 
jimpp's avatar
jimpp committed
49
  [  --disable-remote        disable remote control via DBus [default auto]],
dkirov's avatar
dkirov committed
50 51 52 53 54 55 56
  enable_remote=$enableval, enable_remote=auto)

if test "x$enable_remote" = "xauto"; then
	 PKG_CHECK_EXISTS([dbus-1],enable_remote=yes,enable_remote=no)
fi

if test "x$enable_remote" = "xyes";then
57
	PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.60])
dkirov's avatar
dkirov committed
58 59 60 61 62 63 64 65 66 67 68
	AC_SUBST(DBUS_CFLAGS)
	AC_SUBST(DBUS_LIBS)
	have_remote=true
else
	have_remote=false
fi
AM_CONDITIONAL(BUILD_REMOTE_CONTROL, $have_remote)

dnl ****
dnl gtkspell
dnl ****
dkirov's avatar
dkirov committed
69
AC_ARG_ENABLE(gtkspell, 
jimpp's avatar
jimpp committed
70
  [  --disable-gtkspell      do not build spell checking support [default auto]],
dkirov's avatar
dkirov committed
71
  enable_gtkspell=$enableval, enable_gtkspell=auto)
dkirov's avatar
dkirov committed
72

dkirov's avatar
dkirov committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86
if test "x$enable_gtkspell" = "xauto";then
	PKG_CHECK_EXISTS([gtkspell-2.0], [enable_gtkspell=yes], [enable_gtkspell=no])
fi
if test "x$enable_gtkspell" = "xyes";then
	PKG_CHECK_MODULES([GTKSPELL], [gtkspell-2.0])
	AC_SUBST(GTKSPELL_CFLAGS)
	AC_SUBST(GTKSPELL_LIBS)
	have_gtkspell=true
else
	have_gtkspell=false
fi
AM_CONDITIONAL(BUILD_GTKSPELL, $have_gtkspell)


dkirov's avatar
dkirov committed
87 88 89 90
dnl ****
dnl xscreensaver
dnl ****
AC_ARG_ENABLE([idle],
jimpp's avatar
jimpp committed
91
  [  --disable-idle          do not build idle module [default auto]],
dkirov's avatar
dkirov committed
92 93 94 95 96 97 98 99 100 101 102
  enable_idle=$enableval, enable_idle=yes)

if test "x$enable_idle" = "xyes";then 
	PKG_CHECK_EXISTS([xscrnsaver], [have_xscrnsaver=yes], [have_xscrnsaver=no])

	if test "x$have_xscrnsaver" = "xyes";then
		PKG_CHECK_MODULES([XSCRNSAVER], xscrnsaver)
		AC_SUBST(XSCRNSAVER_LIBS)
		have_idle=true
	else
		# Checks for libraries.
103
		LIBS=-L$x_libraries
dkirov's avatar
dkirov committed
104 105 106 107 108
		AC_CHECK_LIB([X11], [XOpenDisplay])
		AC_CHECK_LIB([Xext], [XMissingExtension])
		AC_CHECK_LIB([Xss], [XScreenSaverAllocInfo])
		XSCRNSAVER_LIBS="$LIBS"
		AC_SUBST([XSCRNSAVER_LIBS])
109
		if test "x$XSCRNSAVER_LIBS" = "x-L";then 
dkirov's avatar
dkirov committed
110 111 112 113 114
			have_idle=false
		else
			have_idle=true
		fi
	fi
dkirov's avatar
dkirov committed
115
else
dkirov's avatar
dkirov committed
116
	have_idle=false
dkirov's avatar
dkirov committed
117
fi
dkirov's avatar
dkirov committed
118
AM_CONDITIONAL(BUILD_IDLE, $have_idle)
dkirov's avatar
dkirov committed
119 120 121 122 123 124

AM_PATH_PYTHON([2.4])
if test "x$PYTHON" = "x:"; then
	AC_MSG_ERROR([Python not found])
fi

dkirov's avatar
dkirov committed
125 126 127 128
dnl ****
dnl tray icon
dnl ****
AC_ARG_ENABLE(trayicon,
jimpp's avatar
jimpp committed
129
  [  --disable-trayicon      do not build trayicon module [default yes]],
dkirov's avatar
dkirov committed
130 131 132 133
  enable_trayicon=$enableval, enable_trayicon=yes)
test "x$enable_trayicon" = "xyes" && have_trayicon=true || have_trayicon=false
AM_CONDITIONAL(BUILD_TRAYICON, $have_trayicon)

134 135 136 137
dnl ****
dnl Cocoa
dnl ****
AC_ARG_ENABLE([cocoa],
jimpp's avatar
jimpp committed
138
  [  --disable-cocoa         do not build cocoa integration [default auto]],
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
  enable_cocoa=$enableval, enable_cocoa=yes)

if test "x$enable_cocoa" = "xyes";then 
  dnl There is no pkgconfig for cocoa; lets do a header check
  temp_save_cflags="$CFLAGS"
  CFLAGS="$CFLAGS -ObjC"
  AC_CHECK_HEADER(Cocoa/Cocoa.h, [have_cocoa=true], [have_cocoa=false])
  AC_CHECK_HEADER(AppKit/AppKit.h, [have_appkit=true], [have_appkit=false])
  CFLAGS="$temp_save_cflags"

  if test "x$have_cocoa" = "xtrue";then
     COCOA_LIBS="$COCOA_LIBS -Xlinker -framework -Xlinker Cocoa"
  fi
  if test "x$have_appkit" = "xtrue";then
     COCOA_LIBS="$COCOA_LIBS -Xlinker -framework -Xlinker AppKit"
  fi
  if test "x$COCOA_LIBS" != "x";then
	 AC_SUBST(COCOA_LIBS)
     true
  fi
fi
AM_CONDITIONAL(BUILD_COCOA, $have_cocoa)

dnl ****
dnl Carbon
dnl ****
AC_ARG_ENABLE([carbon],
jimpp's avatar
jimpp committed
166
  [  --disable-carbon        do not build with carbon [default auto]],
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
  enable_carbon=$enableval, enable_carbon=yes)

if test "x$enable_carbon" = "xyes";then 
  dnl There is no pkgconfig for carbon; lets do a header check
  AC_CHECK_HEADER(Carbon/Carbon.h, [have_carbon=true], [have_carbon=false])
  AC_CHECK_HEADER(IOKit/IOKitLib.h, [have_iokit=true], [have_iokit=false])

  if test "x$have_carbon" = "xtrue";then
     CARBON_LIBS="$CARBON_LIBS -Xlinker -framework -Xlinker Carbon"
  fi
  if test "x$have_iokit" = "xtrue";then
     CARBON_LIBS="$CARBON_LIBS -Xlinker -framework -Xlinker IOKit"
  fi
  if test "x$CARBON_LIBS" != "x";then
	 AC_SUBST(CARBON_LIBS)
     have_idle_osx=true
     dnl Disable X11 idle
     have_idle=false
     AM_CONDITIONAL(BUILD_IDLE, false)
     dnl Disable custom trayicon
     have_trayicon=gtk+
     AM_CONDITIONAL(BUILD_TRAYICON, false)
     dnl Hack to work around failure in gettext package detection on OS/X
     if test "x$GMSGFMT" = "x";then
        AC_SUBST(GMSGFMT, msgfmt)
        AC_SUBST(MSGFMT, msgfmt)
        AC_SUBST(XGETTEXT, xgettext)
     fi
  else
	 have_carbon=false
     have_idle_osx=false
  fi
fi
AM_CONDITIONAL(BUILD_IDLE_OSX, $have_carbon)
AM_CONDITIONAL(BUILD_CARBON, $have_carbon)

203 204 205
ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}"
AC_SUBST(ACLOCAL_AMFLAGS)

dkirov's avatar
dkirov committed
206
AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
dkirov's avatar
dkirov committed
207
AC_SUBST([PYTHON_INCLUDES])
dkirov's avatar
dkirov committed
208

dkirov's avatar
dkirov committed
209
AS_AC_EXPAND(DATADIR, "${datadir}")
210
AS_AC_EXPAND(LIBDIR, "${libdir}")
dkirov's avatar
dkirov committed
211
AS_AC_EXPAND(DOCDIR, "${docdir}")
212
AS_AC_EXPAND(LOCALEDIR, "${localedir}")
dkirov's avatar
dkirov committed
213 214 215 216

AC_SUBST(VERSION)
AC_SUBST(PACKAGE)

dkirov's avatar
dkirov committed
217
AC_CONFIG_FILES([ 
dkirov's avatar
dkirov committed
218 219 220 221 222 223
	Makefile
	data/Makefile
	data/glade/Makefile
	data/emoticons/Makefile
	data/pixmaps/Makefile
	data/iconsets/Makefile
js's avatar
js committed
224
	data/moods/Makefile
225
	data/activities/Makefile
dkirov's avatar
dkirov committed
226
	data/gajim.desktop.in
dkirov's avatar
dkirov committed
227
	data/defs.py
dkirov's avatar
dkirov committed
228 229
	src/Makefile
	src/common/Makefile
js's avatar
js committed
230 231 232
	src/osx/Makefile
	src/osx/growl/Makefile
	src/osx/syncmenu/Makefile
dkirov's avatar
dkirov committed
233
	scripts/gajim
234 235
	scripts/gajim-remote:scripts/gajim.in
	scripts/gajim-history-manager:scripts/gajim.in
dkirov's avatar
dkirov committed
236 237 238
	po/Makefile.in
])
AC_OUTPUT
dkirov's avatar
dkirov committed
239 240 241 242 243 244
echo " 
***************************** 
  Build features:
    spell check ...... ${have_gtkspell}
    remote control ... ${have_remote}
    trayicon ......... ${have_trayicon}
jimpp's avatar
jimpp committed
245
    idle module ...... ${have_idle}
246
    idle module OSX .. ${have_idle_osx}
jimpp's avatar
jimpp committed
247
    cocoa (OSX)....... ${have_cocoa}
dkirov's avatar
dkirov committed
248
*****************************"