[go: up one dir, main page]

File: configure.ac

package info (click to toggle)
lordsawar 0.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 37,964 kB
  • ctags: 10,636
  • sloc: cpp: 91,045; sh: 4,737; xml: 2,142; makefile: 1,325
file content (202 lines) | stat: -rw-r--r-- 5,854 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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
166
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
dnl Process this file with autoconf to produce a configure script.
dnl This is useful to force using autoreconf 2.5.x
dnl Copyright (C) 2015 Ben Asselstine
dnl This file is licensed under the terms of the GNU GPL version 3 or later.
AC_PREREQ(2.59)
AC_INIT([lordsawar], [0.3.1], [lordsawar-discuss@nongnu.org], [lordsawar])
AC_CONFIG_SRCDIR([config.h.in])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE

IT_PROG_INTLTOOL

GETTEXT_PACKAGE=lordsawar
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"],
                   [The domain to use with gettext])
AM_GLIB_GNU_GETTEXT

PROGRAMNAME_LOCALEDIR=[${datadir}/locale]
AC_SUBST(PROGRAMNAME_LOCALEDIR)
    
dnl Checks for programs.
AC_PROG_CXX
if test -n "$CXX"; then
  gppver=`$CXX --version 2>/dev/null | sed -e '2,$d' -e 's@^\([[^0-9.]]*\) \([[0-9.]]*\)\(.*\)@\2@'`
else
  AC_MSG_ERROR([*** C++ compiler not found.])
fi
AC_SUBST([gppver])

AC_PROG_LIBTOOL

dnl check for libxml and libxslt
PKG_CHECK_MODULES(XSLT, [libxslt >= 1.1.20])
AC_SUBST(XSLT_CFLAGS)

dnl Check for glib

PKG_CHECK_MODULES(GLIBMM, glibmm-2.4)

AC_SUBST(GLIBMM_CFLAGS)
AC_SUBST(GLIBMM_LIBS)

dnl Check for gtkmm

PKG_CHECK_MODULES(GTKMM, gtkmm-3.0)

AC_SUBST(GTKMM_CFLAGS)
AC_SUBST(GTKMM_LIBS)
			     		      
PKG_CHECK_MODULES(XMLPP, libxml++-2.6)
AC_SUBST(XMLPP_CFLAGS)
AC_SUBST(XMLPP_LIBS)

PKG_CHECK_MODULES(ARCHIVE, [libarchive >= 0.28])
AC_SUBST(ARCHIVE_CFLAGS)
AC_SUBST(ARCHIVE_CFLAGS)

dnl Finally, check for libsigc++
PKG_CHECK_MODULES(LIBSIGC, sigc++-2.0)

AC_SUBST(LIBSIGC_CFLAGS)
AC_SUBST(LIBSIGC_LIBS)
AC_SUBST(HOME)


dnl----------------------------------------------------------------------
dnl Below here are options to modify default behaviour

dnl Do we want to compile the editor?
AC_ARG_ENABLE(editor,
            [  --enable-editor  compile editor (default=yes)],
            use_editor="$enableval", use_editor="yes")
AM_CONDITIONAL([WANT_EDITOR], [test $use_editor = "yes"])

dnl Do we want to compile the game list server?
AC_ARG_ENABLE(gls,
            [  --enable-gls     compile game list server (default=yes)],
            use_gls="$enableval", use_gls="yes")
AM_CONDITIONAL([WANT_GLS], [test $use_gls = "yes"])

dnl Do we want to compile the game host server?
AC_ARG_ENABLE(ghs,
            [  --enable-ghs     compile game host server (default=yes)],
            use_ghs="$enableval", use_ghs="yes")
AM_CONDITIONAL([WANT_GHS], [test $use_ghs = "yes"])

use_sound=1
AC_ARG_ENABLE(sound, [  --enable-sound         Enable or disable sound usage (default on)],
                use_sound="$enableval", use_sound="yes")

if test $use_sound = yes; then
PKG_CHECK_MODULES(GSTREAMER, gstreamermm-0.10)
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
AC_DEFINE([LW_SOUND], 1, [enables sound])
fi

dnl ...the standard screen resolution...
AC_ARG_WITH(resolution,
           [  --with-resolution=RES standard resolution for lordsawar [default=800x600]], 
            SCREEN_RESOLUTION="$withval", SCREEN_RESOLUTION="800x600")
AC_SUBST(SCREEN_RESOLUTION)

dnl ..do we want to disable optimizations? (useful only for some debugging cases)...
AC_ARG_ENABLE(optimizations,
             [  --enable-optimizations    enable compiler optimizations (disable for debugging) [default=yes]],
             use_opts="$enableval", use_opts="yes")

if test x$use_opts = xno; then
    AC_MSG_WARN([Optimizations have been disabled])
    CXXFLAGS=-g
fi

dnl ...and finally a workaround to get the absolute data path
if test x$prefix = xNONE; then
    prefix="/usr/local"
fi

rm -f src/main.o

eval LORDSAWAR_DATADIR="$datadir/lordsawar"
AC_SUBST(LORDSAWAR_DATADIR)

eval eval DATADIR="$datadir"
AC_SUBST(DATADIR)

echo "$ac_cv_host" | grep "mingw" --quiet
if test "x$?" = "x0"; then
        wincheck=true
else
        wincheck=false
fi
AM_CONDITIONAL([WINDOWS_OS], [test x$wincheck = xtrue])

AC_CONFIG_FILES([make-windows-zip.sh],[chmod +x make-windows-zip.sh])

AC_CONFIG_FILES([
        dat/Makefile 
        dat/icons/Makefile 
        dat/icons/32x32/Makefile 
        dat/icons/64x64/Makefile 
        dat/lordsawar.desktop.in
        dat/lordsawar-editor.desktop.in
        dat/army/Makefile 
        dat/army/default/Makefile 
        dat/army/bigdefault/Makefile 
        dat/army/duel/Makefile 
        dat/tilesets/Makefile
        dat/tilesets/default/Makefile
        dat/tilesets/bigdefault/Makefile
        dat/tilesets/stark/Makefile
        dat/tilesets/bigstark/Makefile
        dat/tilesets/wesnoth/Makefile
        dat/tilesets/bigwesnoth/Makefile
        dat/shield/Makefile 
        dat/shield/default/Makefile 
        dat/shield/dol/Makefile 
        dat/shield/plain/Makefile 
        dat/citysets/Makefile 
        dat/citysets/default/Makefile 
        dat/citysets/bigdefault/Makefile 
        dat/citysets/dol/Makefile 
        dat/citysets/bigdol/Makefile 
        dat/various/Makefile 
        dat/various/items/Makefile
        dat/various/editor/Makefile
        dat/various/xslt/Makefile
        dat/map/Makefile 
        dat/map/dol/Makefile 
        dat/map/duel/Makefile 
        dat/music/Makefile
        dat/glade/Makefile
        dat/glade/editor/Makefile
        po/Makefile.in
        Makefile 
        src/Makefile
        doc/Makefile
        help/Makefile
        help/figures/Makefile
        src/editor/Makefile
        src/gls/Makefile
        src/ghs/Makefile
        src/gui/Makefile])
AC_OUTPUT
echo ""
echo "LordsAWar! is now configured. Type 'make' to compile it."
echo ""
echo "Configuration:"
echo " Installation location : $prefix"
echo " Editor compilation    : $use_editor"
echo " Game-list Server      : $use_gls"
echo " Game-host Server      : $use_ghs"
echo " Enable Sounds         : $use_sound"
echo ""
echo "Extra Options:"
echo " Compiler Optimizations: $use_opts"