1 # configure.ac with sensible comments
3 ### INITIALIZATION ############################################################
6 # Args: (human-readable package name, package version, bug report address,
8 AC_INIT([chimara], [0.1])
9 # Sanity check to make sure we are running Autoconf from the right directory
10 AC_CONFIG_SRCDIR(libchimara/chimara-glk.c)
11 # Put m4 macros in their own directory
12 AC_CONFIG_MACRO_DIR(m4)
14 AM_INIT_AUTOMAKE([-Wall])
15 # Configure with --enable-silent-rules to cut down on clutter
16 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
18 ### LIBRARY VERSIONING ########################################################
19 # Only update immediately before a public release
21 CHIMARA_CURRENT=0 # Increment if interface changes
22 CHIMARA_REVISION=0 # Increment if source changes; set 0 if interface changes
23 CHIMARA_AGE=0 # Increment if interfaces added; set 0 if removed
24 LT_VERSION_INFO="$CHIMARA_CURRENT:$CHIMARA_REVISION:$CHIMARA_AGE"
25 AC_SUBST(LT_VERSION_INFO)
27 ### REQUIREMENTS ##############################################################
28 GTK_REQUIRED_VERSION=2.12
29 GLIB_REQUIRED_VERSION=2.16
30 GTK_DOC_REQUIRED_VERSION=1.9
31 AC_SUBST(GTK_REQUIRED_VERSION)
32 AC_SUBST(GLIB_REQUIRED_VERSION)
33 AC_SUBST(GTK_DOC_REQUIRED_VERSION)
35 ### DECLARE COMPILERS #########################################################
37 AC_USE_SYSTEM_EXTENSIONS # Define _GNU_SOURCE if using GCC
38 AC_PROG_CC # C compiler
39 AM_PROG_CC_C_O # Automake requires this for per-target CFLAGS
40 AC_C_INLINE # Define inline keyword
41 AC_PROG_YACC # Building nitfol requires yacc
43 ### DECLARE PROGRAMS ##########################################################
45 AC_PROG_INSTALL # Install
46 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:]) # Disable unnecessary Libtool checks
47 m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) # to save time (1.5 only)
48 LT_INIT # Libtool 2.2.6 and up
49 #LT_INIT([dlopen]) # Should call it this way, but
50 #LT_PREREQ([2.2.6]) # ...goddamn Debian still has 1.5
51 AC_PROG_LIBTOOL # Old way of declaring Libtool
52 AM_GNU_GETTEXT([external]) # Gettext, link to system libintl
53 IT_PROG_INTLTOOL([0.40.0]) # Intltool
54 PKG_PROG_PKG_CONFIG # pkg_config
55 GTK_DOC_CHECK($GTK_DOC_REQUIRED_VERSION)
56 # Other utilities used in this package's various make scripts
58 AC_PATH_PROG([PERL], [perl]) # Perl
59 AC_PATH_PROG([TEST], [test]) # Test
60 AC_PATH_PROG([ECHO], [echo]) # Echo
62 ### TYPES #####################################################################
69 ### INTERNATIONALIZATION ######################################################
71 AM_GNU_GETTEXT_VERSION([0.17])
72 GETTEXT_PACKAGE=chimara
73 AC_SUBST(GETTEXT_PACKAGE)
74 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
76 ### ILIAD #####################################################################
77 AC_ARG_ENABLE([iliad],
78 [AS_HELP_STRING([--enable-iliad],[Compiles Chimara for the iLiad])],
79 [AS_CASE([${enableval}],
82 [AC_MSG_ERROR([bad value ${enableval} for --enable-iliad])]
87 AM_CONDITIONAL([TARGET_ILIAD], [$TEST "x$iliad" = xtrue])
89 ### RPM CONFIGURATION ##########################################################
90 # --enable-rpm requires rpm and rpmbuild
91 AC_PATH_PROG([RPMBUILD], [rpmbuild], [notfound])
93 [AS_HELP_STRING([--enable-rpm],[Configure for building RPM package [no] (requires rpm and rpmbuild)])],
94 [AS_CASE([${enableval}],
96 [$TEST "x$RPMBUILD" = xnotfound],
97 [AC_MSG_ERROR([rpmbuild is required for --enable-rpm])],
100 [AC_MSG_ERROR([bad value ${enableval} for --enable-rpm])]
104 AM_CONDITIONAL([BUILDING_RPM], [$TEST "x$rpm" = xtrue])
106 ### CHECK FOR LIBRARIES #######################################################
108 # Libraries needed to build Chimara library
109 PKG_CHECK_MODULES([CHIMARA], [
110 glib-2.0 >= $GLIB_REQUIRED_VERSION
111 gtk+-2.0 >= $GTK_REQUIRED_VERSION
116 CHIMARA_LIBS="$CHIMARA_LIBS -lm"
117 AC_SUBST(CHIMARA_LIBS)
118 # Libraries needed to build test programs
119 PKG_CHECK_MODULES([TEST], [
120 gtk+-2.0 >= $GTK_REQUIRED_VERSION
121 gmodule-2.0 >= $GLIB_REQUIRED_VERSION
124 # Plugin flags; include '-module' in each Makefile.am, because AC_SUBSTed
125 # variables are black boxes to Automake, so it has to know about it being a
126 # module in the makefile itself.
127 PLUGIN_LIBTOOL_FLAGS='-avoid-version -shared -export-symbols-regex "^glk"'
128 AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
130 ### OUTPUT ####################################################################
132 # Output platform-specific definitions to config.h
133 AC_CONFIG_HEADERS([config.h])
134 # List of other files for Autoconf to output
141 interpreters/Makefile
142 interpreters/frotz/Makefile
143 interpreters/nitfol/Makefile
144 interpreters/glulxe/Makefile
145 interpreters/git/Makefile
149 docs/reference/Makefile
150 docs/reference/version.xml
151 docs/reference/build-selector-table.pl