File: configure.in

package info (click to toggle)
fenix 0.92a.dfsg1-12
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 8,492 kB
  • sloc: ansic: 42,357; sh: 3,474; perl: 527; makefile: 180; cpp: 19
file content (156 lines) | stat: -rw-r--r-- 3,729 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
AC_INIT(fenix,0.93)

AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM

AM_MAINTAINER_MODE

echo "Your machine: ${target_cpu} ${target_os}"

AC_ARG_ENABLE(debug,
[  --enable-debug       enable use of Debug (default: no)],
        enable_debug=$enableval, enable_debug=no)

AC_ARG_ENABLE(mmx,
[  --disable-mmx           disable MMX assembly routines],
        mmx=$enableval, mmx=yes)

AC_ARG_ENABLE(fxc,
[  --disable-fxc         build fxc (compilador) (default: yes)],
        fxc=$enableval, fxc=yes)

AC_ARG_ENABLE(fxi,
[  --disable-fxi         build fxi (interprete) (default: yes)],
        fxi=$enableval, fxi=yes)

AC_ARG_ENABLE(map,
[  --enable-map         build map 			   (default: no)],
        map=$enableval, map=yes)

AC_ARG_ENABLE(fpg,
[  --enable-fpg         build fpg 			   (default: no)],
        fpg=$enableval, fpg=yes)

AM_CONDITIONAL(DO_FXC, test "x$fxc" = "xyes")
AM_CONDITIONAL(DO_FXI, test "x$fxi" = "xyes")
AM_CONDITIONAL(DO_MAP, test "x$map" = "xyes")
AM_CONDITIONAL(DO_FPG, test "x$fpg" = "xyes")
AC_CHECK_TOOL(WINDRES, windres, )
AM_CONDITIONAL(HAVE_WINDRES, test "$WINDRES" != "")

dnl Aqui es donde se chequeara el SO, pero solo hay una opcion xD
case "$target_os" in
    linux-gnu*|kfreebsd-gnu*)
        case "$target_cpu" in
            powerpc*)
	            COMMON_CFLAGS="-Wall -DTARGET_LinuxPPC -DTARGET_Linux"
                ;;

            *)
	            COMMON_CFLAGS="-Wall -DTARGET_Linux"
	            COMMON_LIBS="$COMMON_LIBS -Wl,-Bdynamic -lc"
                ;;
        esac
	    ;;

    mingw32)
        INCLUDES="-I/usr/local/include"
	    LIBS="-L/usr/local/lib"
	    COMMON_CFLAGS="$INCLUDES -DTARGET_Win32 -DWIN32 -D_WIN32"
	    COMMON_LIBS="$LIBS -lz -lshlwapi"
	    ;;

    dragonfly*)
        INCLUDES="-I/usr/local/include"
	    LIBS="-pthread -L/usr/local/lib"
        COMMON_CFLAGS="-Wall -DTARGET_BSD"
	    ;;

    darwin*)
            INCLUDES="-I/usr/local/include"
	    LIBS="-L/usr/local/lib"
            COMMON_CFLAGS="-Wall -DTARGET_MAC"
	    ;;

esac

AM_INIT_AUTOMAKE(1.6)
#AM_INIT_AUTOMAKE(no-dependencies)

AC_PROG_INSTALL

dnl Check for compilers
AC_PROG_CC

AC_CHECK_LIB(m,fabs,LIBS="$LIBS",AC_MSG_RESULT(math library not found))

if test -z "$CFLAGS"; then
	if test "x$enable_debug" = "xyes"; then
		CFLAGS="-g"
	else
		CFLAGS="-O2 -finline-functions -ffast-math"
	fi
fi
CFLAGS="$CFLAGS $INCLUDES"

dnl librerias para todos

AC_CHECK_LIB(png, png_read_info,[AC_CHECK_HEADER(png.h,LIBS="$LIBS",)], AC_MSG_ERROR(*** PNG library not found ***), -lz -lm)

AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h,LIBS="$LIBS",)], [AC_MSG_ERROR(zlib library not found)])

dnl fxc o fxi (las SDL)
if test "$fxc" = yes || test "$fxi" = yes; then

	dnl Check for SDL library
	SDL_VERSION=1.2.0
	AM_PATH_SDL($SDL_VERSION,
    	     :,
	 	AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
	)

fi

if test "$fxi" = yes; then
    AC_CHECK_LIB(SDL_mixer, main, LIBS="$LIBS", AC_MSG_ERROR([*** SDL_mixer library not found!]))
    AC_CHECK_LIB(X11, [XQueryTree,XMoveWindow],,)
fi

dnl para map
if test "$map" = yes; then
	AC_CHECK_LIB(gif,DGifOpenFileName,LIBS="$LIBS",AC_MSG_ERROR(libgif library not found))
fi

dnl make these visible to all Makefiles
AC_SUBST(DO_FXC)
AC_SUBST(DO_FXI)
AC_SUBST(DO_MAP)
AC_SUBST(DO_FPG)

AC_SUBST(COMMON_LIBS)
AC_SUBST(COMMON_CFLAGS)


AC_OUTPUT([
Makefile
fxc/Makefile
fxc/src/Makefile
fxi/Makefile
fxi/src/Makefile
map/Makefile
fpg/Makefile
])

echo
echo Fenix $VERSION
echo
echo Debug Mode .... : $enable_debug
echo Building fxc .... : $fxc
echo Building fxi .... : $fxi
echo Building map .... : $map
echo Building fpg .... : $fpg
echo
echo The binary will be installed in $prefix/bin
echo
echo configure complete, now type \'make\' and pray.
echo