configure.ac revision a966c04f
1# $Id: configure.ac,v 1.1.1.1 2008/07/30 02:54:04 mrg Exp $
2
3AC_PREREQ(2.57)
4AC_INIT([libXpm], 3.5.7, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], libXpm)
5AC_CONFIG_SRCDIR([Makefile.am])
6AM_INIT_AUTOMAKE([dist-bzip2])
7
8AM_MAINTAINER_MODE
9
10AM_CONFIG_HEADER([config.h])
11
12# Checks for programs.
13AC_PROG_LIBTOOL
14AC_PROG_CC
15
16# Checks for pkg-config packages
17PKG_CHECK_MODULES(XPM, xproto x11)
18AC_SUBST(XPM_CFLAGS)
19AC_SUBST(XPM_LIBS)
20
21# Checks for header files.
22AC_HEADER_STDC
23
24# Checks for functions
25AC_CHECK_FUNCS([strlcat])
26
27# Checks for typedefs, structures, and compiler characteristics.
28
29if test "x$GCC" = "xyes"; then
30	GCC_WARNINGS="-Wall -Wpointer-arith -Wstrict-prototypes \
31	-Wmissing-prototypes -Wmissing-declarations \
32	-Wnested-externs -fno-strict-aliasing"
33	CFLAGS="$GCC_WARNINGS $CFLAGS"
34fi
35
36# Internationalization & localization support
37AC_SEARCH_LIBS([gettext], [intl], [USE_GETTEXT="yes"], [USE_GETTEXT="no"])
38AC_MSG_CHECKING([where to install localized messages])
39AC_ARG_WITH([localedir], AC_HELP_STRING([--with-localedir=<path>],
40	[Path to install message files in (default: datadir/locale)]),
41	[LOCALEDIR=${withval}], [LOCALEDIR=${datadir}/locale])
42AC_DEFINE_DIR([LOCALEDIR], [LOCALEDIR], [Location of translated messages])
43if test "x$LOCALEDIR" = "xno" -o "x$USE_GETTEXT" = "xno" ; then
44	AC_MSG_RESULT([nowhere])
45	USE_GETTEXT="no"
46else
47	AC_MSG_RESULT([$LOCALEDIR])
48fi
49
50if test "x$USE_GETTEXT" = "xyes" ; then
51	AC_DEFINE([USE_GETTEXT], 1, 
52		  [Define to 1 if you want to use the gettext() function.])
53fi
54AM_CONDITIONAL(USE_GETTEXT, test "x$USE_GETTEXT" = "xyes")
55
56# Optional feature: When ___.xpm is requested, also look for ___.xpm.Z & .gz
57# Replaces ZFILEDEF = -DSTAT_ZFILE in old Imakefile
58AC_ARG_ENABLE(stat-zfile,
59	AC_HELP_STRING([--enable-stat-zfile],
60			[Search for files with .Z & .gz extensions automatically @<:@default=yes@:>@]),
61              [STAT_ZFILE=$enableval], [STAT_ZFILE=yes])
62if test x$STAT_ZFILE = xyes ; then
63	AC_DEFINE(STAT_ZFILE, 1, [Define to 1 to automatically look for files with .Z & .gz extensions])
64fi
65
66PKG_CHECK_MODULES(SXPM, xt xext xextproto, build_sxpm=true, build_sxpm=false)
67
68AM_CONDITIONAL(BUILD_SXPM, test x$build_sxpm = xtrue)
69
70XORG_MANPAGE_SECTIONS
71XORG_RELEASE_VERSION
72
73AC_OUTPUT([Makefile
74           src/Makefile
75	   sxpm/Makefile
76	   cxpm/Makefile
77	   xpm.pc])
78