1# Process this file with autoconf to produce a configure script.
2AC_INIT(src/main.c)
3AC_CANONICAL_SYSTEM
4AC_PREREQ(2.5)
5AM_INIT_AUTOMAKE(mt_gtk_client, 0.1.98)
6AM_CONFIG_HEADER(config.h)
7
8AC_ISC_POSIX
9
10# Checks for programs.
11AC_PROG_CC
12dnl AM_PROG_LIBTOOL
13AM_GNU_GETTEXT([external])
14
15AC_ARG_ENABLE( gnome2,
16[  --enable-gnome2         Enable gnome2 support],
17[ GNOME2=yes ])
18
19# Checks for libraries.
20if test "x$GNOME2" = "xyes"; then
21  PKG_CHECK_MODULES(GLIB, libgnomeui-2.0 >= 2.0 glib-2.0 >= 1.3.1 gthread-2.0 >= 2.0 gtk+-2.0 >= 2.0  libxml-2.0 >= 2.0)
22  AC_SUBST(GLIB_CFLAGS)
23  AC_SUBST(GLIB_LIBS)
24  AC_DEFINE_UNQUOTED(GNOME2,"yes",[enable gnome2 support])
25else
26  PKG_CHECK_MODULES(GLIB, $LIBGNOMEUI glib-2.0 >= 1.3.1 gthread-2.0 >= 2.0 gtk+-2.0 >= 2.0 libxml-2.0 >= 2.0)
27  AC_SUBST(GLIB_CFLAGS)
28  AC_SUBST(GLIB_LIBS)
29fi
30
31AM_LIB_MAITRETAROT(0,0,0,$GLIB_CFLAGS, $GLIB_LIBS)
32AC_SUBST(LIBMT_CFLAGS)
33AC_SUBST(LIBMT_LIBS)
34
35AM_LIB_MT_CLIENT(0,0,0,$GLIB_CFLAGS, $GLIB_LIBS)
36AC_SUBST(LIBMT_CFLAGS)
37AC_SUBST(LIBMT_LIBS)
38
39# Checks for header files.
40AC_HEADER_STDC
41AC_CHECK_HEADERS([netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
42
43# Checks for typedefs, structures, and compiler characteristics.
44AC_HEADER_TIME
45AC_C_CONST
46
47# Checks for library functions.
48AC_CHECK_FUNCS([bzero gethostbyname gethostname socket])
49
50GETTEXT_PACKAGE=mtgtkclient
51AC_SUBST(GETTEXT_PACKAGE)
52AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[defines the GETTEXT package name])
53
54dnl Add the languages which your application supports here.
55ALL_LINGUAS="fr"
56AM_GNU_GETTEXT
57
58dnl Use -Wall if we have gcc.
59changequote(,)dnl
60if test "x$GCC" = "xyes"; then
61  case " $CFLAGS " in
62  *[\ \	]-Wall[\ \	]*) ;;
63  *) CFLAGS="$CFLAGS -Wall" ;;
64  esac
65fi
66changequote([,])dnl
67
68dnl installation path cardpics images
69cardpics_dir=$datadir/cardpics/images
70cardpics_flag="-DCARDPICS_DIR=\\\"$cardpics_dir/\\\""
71
72AC_ARG_WITH( cardpics-dir,
73[  --with-cardpics-dir     Directory containing the cardpics cards images],
74[cardpics_dir=${withval}; cardpics_flag="-DCARDPICS_DIR=\\\"${withval}\\\"" ])
75
76AC_SUBST(cardpics_flag)
77AC_SUBST(cardpics_dir)
78
79
80dnl installation path
81mt_gtk_client_dir=$datadir/mt_gtk_client
82mt_gtk_client_flag="-DDATA_DIR=\\\"$mt_gtk_client_dir/\\\""
83
84AC_ARG_ENABLE( install,
85[  --disable-install       No installation. Played from the source directory.],
86[mt_gtk_client_dir=../data; mt_gtk_client_flag="-DDATA_DIR=\\\"../\\\"" ])
87
88AC_SUBST(mt_gtk_client_flag)
89AC_SUBST(mt_gtk_client_dir)
90
91
92AC_OUTPUT([ po/Makefile.in m4/Makefile
93	Makefile
94	src/Makefile
95	data/Makefile
96	mt_gtk_client.spec
97])
98