File: configure.in

package info (click to toggle)
lgeneral 1.2.3+dfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,312 kB
  • ctags: 3,311
  • sloc: ansic: 29,061; sh: 3,574; makefile: 375; sed: 93
file content (176 lines) | stat: -rw-r--r-- 5,705 bytes parent folder | download
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)

AC_CANONICAL_TARGET
AC_USE_SYSTEM_EXTENSIONS

AM_INIT_AUTOMAKE(lgeneral,1.2.3)

AM_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC
AC_PROG_RANLIB
AM_PROG_CC_C_O

dnl various CFLAGS
CFLAGS="$CFLAGS -Wall"
#CFLAGS="-O0 -g -Wall"

dnl Checks for libraries.
AC_CHECK_LIB(m, main,, AC_MSG_ERROR(maths library is needed))
dnl AC_CHECK_LIB(dl, main,, AC_CHECK_LIB(c, dlopen,, AC_MSG_ERROR(dl library is needed)))
dnl AC_CHECK_LIB(dl, main,, AC_MSG_ERROR(dl library is needed))

dnl Checks for functions.
AC_CHECK_FUNCS(strcasestr)

dnl check for mkdir accepting permissions
AC_MSG_CHECKING(if mkdir rejects permissions)
ac_mkdir_perm_broken=yes
AC_TRY_COMPILE([#include <unistd.h>], [mkdir("test", 0777)], [ac_mkdir_perm_broken=no])
if test x$ac_mkdir_perm_broken = xyes ; then
  AC_DEFINE_UNQUOTED(HAVE_BROKEN_MKDIR, 1, [Defined if mkdir rejects a second permissions parameter.])
fi
AC_MSG_RESULT($ac_mkdir_perm_broken)

dnl L10n support
ALL_LINGUAS="en de"

AC_GNU_SOURCE
AM_GNU_GETTEXT

XGETTEXTFLAGS=
MSGFMTFLAGS=-v
MSGMERGEFLAGS=
MSGCONVFLAGS=--to-code=iso-8859-1
INTLINCLUDES=

dnl check for msgconv
AC_PATH_PROG(MSGCONV, msgconv, cat)
dnl reset flags if msgconv is "dummy"
test "x$MSGCONV" = xcat && MSGCONVFLAGS=

dnl FIXME: This does no logging whatsoever if anything goes wrong
if test x$USE_NLS = xyes -a x$XGETTEXT != "x:" ; then
  AC_MSG_CHECKING(whether xgettext needs --from-code)
  ac_xgettext_needs_from_code=error
  ac_xgettext_from_code=--from-code=iso-8859-1
  cat <<EOF >ac_tmp.c
int main() { _("�������"); }
EOF
  $XGETTEXT -k_ $ac_xgettext_from_code ac_tmp.c >/dev/null 2>&1 && ac_xgettext_needs_from_code=yes
  $XGETTEXT -k_ ac_tmp.c >/dev/null 2>&1 && ac_xgettext_needs_from_code=no
  AC_MSG_RESULT($ac_xgettext_needs_from_code)
  if test $ac_xgettext_needs_from_code = yes ; then
    XGETTEXTFLAGS="$XGETTEXTFLAGS $ac_xgettext_from_code"
  elif test $ac_xgettext_needs_from_code = error ; then
    AC_MSG_ERROR(Both invocations of $XGETTEXT failed!)
  fi
  rm -f ac_tmp.c
fi

dnl determining include paths for libintl.h
if test x$USE_INCLUDED_LIBINTL = xyes ; then
  INTLINCLUDES="-I\$(top_srcdir)/intl -I\$(top_builddir)/intl"
fi

dnl newer versions of gettext don't support CATALOGS -> create it here
if test "x$CATALOGS" = x ; then
  AC_MSG_CHECKING(for catalogs to be installed);
  for l in $ALL_LINGUAS ; do
    CATALOGS="$CATALOGS$l$CATOBJEXT "
  done
  AC_MSG_RESULT($ALL_LINGUAS)
  AC_SUBST(CATALOGS)
fi

dnl newer versions of gettext don't export POFILES and GMOFILES
dnl export them here to stay compatible with older versions
if test "x$POFILES" = x ; then
  for l in $ALL_LINGUAS ; do
    POFILES="$POFILES${l}.po "
  done
  AC_SUBST(POFILES)
fi
if test "x$GMOFILES" = x ; then
  for l in $ALL_LINGUAS ; do
    GMOFILES="$GMOFILES$l$CATOBJEXT "
  done
  AC_SUBST(GMOFILES)
fi

AC_SUBST(XGETTEXTFLAGS)
AC_SUBST(MSGFMTFLAGS)
AC_SUBST(MSGMERGEFLAGS)
AC_SUBST(MSGCONVFLAGS)
AC_SUBST(INTLINCLUDES)

dnl find out whether we can determine the path of the running executable
ac_paths_determ=generic
  ac_can_determ_paths=no
  AC_DEFINE_UNQUOTED(PATHS_GENERIC, 1, [Defined if detecting executable's path name is not supported at runtime.])
AC_MSG_RESULT($ac_can_determ_paths)
AC_MSG_RESULT(executable's path determination strategy... $ac_paths_determ)
AM_CONDITIONAL(compile_paths_linux, test x$ac_paths_determ = xlinux)

dnl check SDL version
AM_PATH_SDL(1.1.4,, AC_MSG_ERROR(lib SDL >=1.1.4 is needed))

dnl check sound
sound_flag="-DWITH_SOUND"
mixer_flag="-lSDL_mixer"
AC_ARG_ENABLE( sound,
[  --disable-sound         Disables sound], sound_flag=""; mixer_flag="")

dnl check if SDL_mixer's installed
dnl if not: clear sound_flag and mixer_flag
AC_CHECK_LIB(SDL_mixer, main,
AC_MSG_RESULT("SDL_Mixer found"), 
AC_MSG_RESULT("SDL_Mixer NOT found \(get it at http://libsdl.org\): Audio disabled"); sound_flag=""; mixer_flag="")

AC_SUBST(sound_flag)
AC_SUBST(mixer_flag)

dnl check use of dynamic libraries
dnl SINCE NEVER USED TEMPORARILY DISABLED MS
dnl dl_lib_flag="-ldl"
dnl dl_flag="-DUSE_DL"
dnl export_flag="-Wl,-export-dynamic"
dl_lib_flag=""
dl_flag=""
export_flag=""
AC_ARG_ENABLE( dl,
[  --disable-dl         Disable use of dynamic AI modules], dl_flag=""; export_flag=""; dl_lib_flag="";)
AC_SUBST(dl_flag)
AC_SUBST(export_flag)
AC_SUBST(dl_lib_flag)

dnl installation path
inst_dir=$datadir/lgeneral
inst_flag="-DINSTALLDIR=\\\"$inst_dir\\\""

dis_flag=""
AC_ARG_ENABLE( install,
[  --disable-install       No installation. Played from the source directory.], 
inst_dir=.
inst_flag=)

AC_SUBST(inst_dir)
AC_SUBST(inst_flag)

# create Makefiles for Makefile.ins in po-subdirectories.
# FIXME! autoconf is simply too stupid to grok that for-loop
#for ac_domain in lgeneral ; do
  AC_CONFIG_COMMANDS([po-lgeneral],
     [case "$CONFIG_FILES" in *po/lgeneral/Makefile.in*)
        sed -e "/POTFILES =/r po/lgeneral/POTFILES" po/lgeneral/Makefile.in > po/lgeneral/Makefile
      esac])
  AC_CONFIG_COMMANDS([po-pg],
     [case "$CONFIG_FILES" in *po/pg/Makefile.in*)
        cat po/pg/Makefile.in > po/pg/Makefile
      esac])
#done

AC_OUTPUT(Makefile lgc-pg/Makefile lgc-pg/convdata/Makefile lged/Makefile src/Makefile src/nations/Makefile src/scenarios/Makefile src/units/Makefile src/sounds/Makefile src/music/Makefile src/terrain/Makefile src/maps/Makefile src/gfx/Makefile  src/gfx/flags/Makefile src/gfx/terrain/Makefile src/gfx/units/Makefile src/ai_modules/Makefile src/campaigns/Makefile src/themes/Makefile src/themes/default/Makefile util/Makefile intl/Makefile po/Makefile po/lgeneral/Makefile.in po/pg/Makefile.in tools/Makefile tools/ltrextract/Makefile)