File: configure.in

package info (click to toggle)
ltris 1.0.19-3
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 3,356 kB
  • ctags: 2,332
  • sloc: ansic: 14,224; sh: 4,211; asm: 1,332; makefile: 537; yacc: 288; sed: 16; perl: 5
file content (85 lines) | stat: -rw-r--r-- 2,356 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(Makefile.am)

AC_CANONICAL_TARGET

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(ltris,1.0.19)

dnl Checks for programs.
AM_GNU_GETTEXT
AC_PROG_CC
AC_PROG_RANLIB

CFLAGS="$CFLAGS -Wall"

dnl Check Zarus install
AC_ARG_ENABLE( zaurus,
[  --enable-zaurus         Compile for Zaurus], CFLAGS="$CFLAGS -DZAURUS")
AC_ARG_ENABLE( softfloat,
[  --enable-softfloat      Use Softfloat for CPUs without FPU], CFLAGS="$CFLAGS -msoft-float"; LIBS="$LIBS $float")

dnl check SDL version
sdl_flag=""
AM_PATH_SDL(1.0.0,, AC_MSG_ERROR(lib SDL is needed))
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AM_PATH_SDL(1.1.5, sdl_flag="-DSDL_1_1_5",)
CFLAGS="$CFLAGS $sdl_flag"

dnl check sound
sound_flag="-DSOUND"
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: Audio disabled"); sound_flag=""; mixer_flag="")

AC_SUBST(sound_flag)
AC_SUBST(mixer_flag)

dnl set sound buffer size
buf_flag="-DAUDIO_BUFFER_SIZE=256"
AC_ARG_WITH( buffer-size,
[  --with-buffer-size=BUFSIZE       Set this value to 2048 if you encounter sound delay.],
buf_flag="-DAUDIO_BUFFER_SIZE=$withval",)
AC_SUBST(buf_flag)

dnl set localedir
localedir=$datadir/locale
locdir_flag="-DLOCALEDIR=\\\"$localedir\\\""

dnl installation path
inst_dir=$datadir/ltris
hi_dir=$localstatedir

dnl check if installation was disabled
dis_flag=""
AC_ARG_ENABLE( install,
[  --disable-install           No installation. Played from the source directory.], 
inst_dir="." hi_dir="." dis_flag="-DDISABLE_INSTALL"
locdir_flag="-DLOCALEDIR=\\\"../dict\\\"" 
    rm -rf dict; mkdir dict
    for lang in `cat po/LINGUAS`; do
        mkdir dict/$lang; mkdir dict/$lang/LC_MESSAGES
        ln -s ../../../po/$lang.gmo dict/$lang/LC_MESSAGES/$PACKAGE.mo
    done
)

inst_flag="-DSRC_DIR=\\\"$inst_dir\\\""
hi_inst_flag="-DHI_DIR=\\\"$hi_dir\\\""

AC_SUBST(inst_dir)
AC_SUBST(hi_dir)
AC_SUBST(inst_flag)
AC_SUBST(hi_inst_flag)
AC_SUBST(dis_flag)
AC_SUBST(locdir_flag)

AC_OUTPUT(Makefile src/Makefile icons/Makefile src/sounds/Makefile src/gfx/Makefile intl/Makefile po/Makefile.in m4/Makefile )