File: configure.ac

package info (click to toggle)
freedroid 1.0.2%2Bcvs040112-5
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 8,436 kB
  • ctags: 1,925
  • sloc: ansic: 13,307; sh: 3,286; objc: 185; makefile: 70
file content (130 lines) | stat: -rw-r--r-- 3,687 bytes parent folder | download | duplicates (7)
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
# Process this file with autoconf to produce a configure script.
AC_INIT(freedroid, 1.1.0-pre1)

dnl Setup for automake
SDL_VERSION=1.2.3

dnl Detect the canonical host and target build environment

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE

AM_CONFIG_HEADER(config.h)

# Checks for programs.
#AC_PROG_AWK
AC_PROG_CC
AC_PROG_MAKE_SET

# Checks for libraries.
AC_CHECK_LIB([m], [sin],, 
	AC_MSG_ERROR([libm not found!! 
No maths library?? What kinda crazy system is that??]))

##AC_CHECK_LIB([c], [printf],, AC_MSG_ERROR([libc not found!! ]))

AC_PATH_X	
AC_PATH_XTRA
if test x$have_x = xyes; then
	CFLAGS="$CFLAGS $X_CFLAGS"
fi

## Check for SDL
AC_MSG_NOTICE([[Checking for compulsory SDL libraries:]])

AM_PATH_SDL($SDL_VERSION,
            :,
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

AC_CHECK_LIB([SDL], [SDL_Init],, AC_MSG_ERROR([
--------------------------------------------------
SDL library needed for Freedroid!
see http://www.libsdl.org/
--------------------------------------------------]))

AC_CHECK_LIB([jpeg], [jpeg_start_compress],,AC_MSG_ERROR([
--------------------------------------------------
libjpeg needed to run Freedroid!
see http://www.ijg.org/
--------------------------------------------------]))

AC_CHECK_LIB([z], [compress],, AC_MSG_ERROR([
--------------------------------------------------
zlib is needed to run Freedroid!
see http://www.gzip.org/zlib/
--------------------------------------------------]))


AC_CHECK_LIB([png], [png_read_png],, AC_MSG_ERROR([
--------------------------------------------------
libpng needed to run Freedroid
see http://www.libpng.org/pub/png/libpng.html
--------------------------------------------------]))

AC_CHECK_LIB([SDL_image], [IMG_LoadJPG_RW],, AC_MSG_ERROR([
--------------------------------------------------
SDL_image library needed for Freedroid!
see http://www.libsdl.org/
--------------------------------------------------]))

AC_MSG_NOTICE([[Checking for optional SDL libraries:]])
AC_CHECK_LIB([SDL_mixer], [Mix_OpenAudio],, AC_MSG_WARN([
--------------------------------------------------
libSDL_mixer not found!
you need the SDL_mixer library if you want sound!
(see see http://www.libsdl.org/)
--> compiling without sound support
--------------------------------------------------]))

AC_CHECK_LIB([vorbis], [ov_open],, AC_MSG_WARN([
--------------------------------------------------
libvorbis not found!
You need the Vorbis libs installed if you want
Freedroid to be able to play Ogg files (e.g. the Intro theme)
--------------------------------------------------]))


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h sys/ioctl.h sys/time.h time.h \
			  unistd.h dirent.h sys/soundcard.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

# Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([memset sqrt strstr strtok strcspn strspn rand])

dnl Don't Check for getopt_long 
dnl just use bundled version like hello does, and gnuchess


case "$target" in
     *-*-cygwin* | *-*-mingw32*)
     CFLAGS="$CFLAGS  -DFD_DATADIR='\".\"'"
     win32=true
     ;;

     *)
     CFLAGS="$CFLAGS  -DFD_DATADIR='\"\$(pkgdatadir)\"'"   #avoid expansion of $pkgdatadir !
     win32=false
     ;;
esac

dnl send a signal to automake if we're compiling for win32
AM_CONDITIONAL(WIN32, test x$win32 = xtrue)


AC_CONFIG_FILES([Makefile src/Makefile map/Makefile sound/Makefile graphics/Makefile 
graphics/classic_theme/Makefile graphics/lanzz_theme/Makefile graphics/para90_theme/Makefile])

AC_OUTPUT