configure.in 3.92 KB
Newer Older
1 2 3 4 5 6 7
dnl ==========================================================================
dnl
dnl If you add a version number here, you *must* add an AC_SUBST line for
dnl it too, or it will never make it into the spec file!
dnl
dnl ==========================================================================

8
AC_PREREQ(2.53)
9
AC_INIT(gdl)
10
AM_CONFIG_HEADER(config.h)
11

12
GDL_MAJOR_VERSION=0
13
GDL_MINOR_VERSION=7
Naba Kumar's avatar
Naba Kumar committed
14
GDL_MICRO_VERSION=10
15 16 17 18
PACKAGE=gdl
GDL_VERSION=$GDL_MAJOR_VERSION.$GDL_MINOR_VERSION.$GDL_MICRO_VERSION

AM_INIT_AUTOMAKE($PACKAGE, $GDL_VERSION)
19

20 21 22 23 24 25
dnl with higher autotools, we can set ACLOCAL_AMFLAGS instead, which is
dnl the better solution; this does the trick for automake-1.4
dnl gnome-autogen.sh sets ACLOCAL_FLAGS, which points to the cvs gnome
dnl autoconf macros
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

26 27 28 29
AC_SUBST(GDL_MAJOR_VERSION)
AC_SUBST(GDL_MINOR_VERSION)
AC_SUBST(GDL_MICRO_VERSION)
AC_SUBST(GDL_VERSION)
Dave Camp's avatar
Dave Camp committed
30

31 32 33
SNAPSHOT=0_`date +%Y%m%d_%H%M%S`_cvs
AC_SUBST(SNAPSHOT)

Johannes Schmid's avatar
Johannes Schmid committed
34 35
GTK_REQUIRED=2.4.0
GNOME_REQUIRED=2.6.0
36
XML_REQUIRED=2.2.8
37
LIBGLADE_REQUIRED=2.0.0
Johannes Schmid's avatar
Johannes Schmid committed
38
GNOME_VFS_REQUIRED=2.6.0
Naba Kumar's avatar
Naba Kumar committed
39
GCONF_REQUIRED=2.0.0
40 41 42 43

AC_SUBST(GTK_REQUIRED)
AC_SUBST(GNOME_REQUIRED)
AC_SUBST(XML_REQUIRED)
44
AC_SUBST(LIBGLADE_REQUIRED)
Dave Camp's avatar
Dave Camp committed
45

Dave Camp's avatar
Dave Camp committed
46 47
AM_MAINTAINER_MODE

48 49 50
AC_ISC_POSIX
AC_PROG_CC

51 52 53
AC_CHECK_HEADERS([libintl.h])
AC_TYPE_SIGNAL

Dave Camp's avatar
Dave Camp committed
54 55
AC_PROG_CXX
AC_STDC_HEADERS
56
AM_SANITY_CHECK
Johannes Schmid's avatar
Johannes Schmid committed
57 58 59 60

AC_DISABLE_STATIC
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
61

Dave Camp's avatar
Dave Camp committed
62 63

dnl ***************
64
dnl GTK Libraries 
Dave Camp's avatar
Dave Camp committed
65
dnl ***************
66

Johannes Schmid's avatar
Johannes Schmid committed
67 68 69 70
PKG_CHECK_MODULES(XML, libxml-2.0 >= $XML_REQUIRED)
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)

Johannes Schmid's avatar
Johannes Schmid committed
71 72 73 74 75
PKG_CHECK_MODULES(GDL_DEPENDENCIES, 
	gtk+-2.0 >= $GTK_REQUIRED 
	libglade-2.0 >= $LIBGLADE_REQUIRED)
AC_SUBST(GDL_DEPENDENCIES_CFLAGS)
AC_SUBST(GDL_DEPENDENCIES_LIBS)
Johannes Schmid's avatar
Johannes Schmid committed
76

Johannes Schmid's avatar
Johannes Schmid committed
77 78 79 80 81 82 83 84 85 86 87
dnl ****************
dnl GNOME Libraries
dnl ****************


AC_ARG_ENABLE(gnome,
	[ --disable-gnome	Compile without gnome support], 
	[ if test "$enableval" = "no"; then
		user_disabled_gnome=1
	  fi ],
	[ user_disabled_gnome=0 ])
Johannes Schmid's avatar
Johannes Schmid committed
88

Johannes Schmid's avatar
Johannes Schmid committed
89 90 91 92 93 94 95 96 97 98
DEPRECATED_FLAGS=""
AC_MSG_CHECKING(if gnome is disabled)
if test "$user_disabled_gnome" = 1; then
	AC_MSG_RESULT(yes)
	gnome="no"
else
	AC_MSG_RESULT(no)
	
	PKG_CHECK_MODULES(GNOME,
		[libgnomeui-2.0 >= $GNOME_REQUIRED, 
Naba Kumar's avatar
Naba Kumar committed
99 100
		gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED,
		gconf-2.0 >= $GCONF_REQUIRED],
Johannes Schmid's avatar
Johannes Schmid committed
101 102 103 104
		[gnome="yes"],
		[gnome="no"])
	AC_SUBST(GNOME_CFLAGS)
	AC_SUBST(GNOME_LIBS)
Naba Kumar's avatar
Naba Kumar committed
105
	AC_DEFINE_UNQUOTED(HAVE_GNOME, 1, [GNOME support enabled])
Johannes Schmid's avatar
Johannes Schmid committed
106
fi
Johannes Schmid's avatar
Johannes Schmid committed
107

Johannes Schmid's avatar
Johannes Schmid committed
108
AM_CONDITIONAL(HAVE_GNOME, [test x$gnome = xyes])
Johannes Schmid's avatar
Johannes Schmid committed
109

110 111 112 113 114
# Do not set deprecated flags as long as #457562 is not fixed
#if test x$MAINT = x; then
#	DEPRECATED_FLAGS="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED -DBONOBO_DISABLE_DEPRECATED -DBONOBO_UI_DISABLE_DEPRECATED"
#	AC_SUBST(DEPRECATED_FLAGS)
#fi
Johannes Schmid's avatar
Johannes Schmid committed
115 116 117 118 119 120 121 122 123 124 125 126 127 128

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    native_win32=yes
    ;;
  *)
    native_win32=no
    ;;
esac
AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")

EXTRA_CPPFLAGS=
129
EXTRA_LDFLAGS="-no-undefined"
Johannes Schmid's avatar
Johannes Schmid committed
130 131
if test "x$native_win32" = "xyes"; then
  EXTRA_CPPFLAGS="-mms-bitfields"
132
  EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--kill-at -Wl,--export-all-symbols"
Johannes Schmid's avatar
Johannes Schmid committed
133 134 135
fi
AC_SUBST(EXTRA_CPPFLAGS)
AC_SUBST(EXTRA_LDFLAGS)
Johannes Schmid's avatar
Johannes Schmid committed
136

137 138 139 140 141
# marshal and enum generators
GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
AC_SUBST(GLIB_GENMARSHAL)
GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
AC_SUBST(GLIB_MKENUMS)
Dave Camp's avatar
Dave Camp committed
142

143
ALL_LINGUAS=""
144
GETTEXT_PACKAGE=gdl-1
145
AC_SUBST(GETTEXT_PACKAGE)
146
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext])
147
IT_PROG_INTLTOOL([0.35.0])
148 149

AM_GLIB_GNU_GETTEXT
150
AM_GLIB_DEFINE_LOCALEDIR(GNOMELOCALEDIR)
Dave Camp's avatar
Dave Camp committed
151

152 153 154 155 156 157 158 159 160 161 162
dnl Set PREFIX
if test "x${prefix}" = "xNONE"; then
  packageprefix=${ac_default_prefix}
else
  packageprefix=${prefix}
fi

# images directory
gdl_images_dir="${packageprefix}/share/gdl/images"
AC_SUBST(gdl_images_dir)

163
# check for gtk-doc
164
GTK_DOC_CHECK(1.4)
165

Dave Camp's avatar
Dave Camp committed
166 167 168 169
AC_OUTPUT([
Makefile
gdl/Makefile
po/Makefile.in 
170 171
docs/Makefile
docs/reference/Makefile
172
gdl.spec
173
gdl-1.0.pc
174
gdl-gnome-1.0.pc
175
])