File: configure.in

package info (click to toggle)
pipewalker 0.9.4-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,620 kB
  • sloc: cpp: 3,159; sh: 1,032; makefile: 103
file content (78 lines) | stat: -rw-r--r-- 2,198 bytes parent folder | download | duplicates (4)
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
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.64)
AC_INIT([PipeWalker], [0.9.4], [artemsen@gmail.com], [], [http://pipewalker.sourceforge.net])
AM_INIT_AUTOMAKE([-Wall -Werror])
AC_CONFIG_SRCDIR([src/cell.cpp])

# Check for some target-specific stuff
test -z "${WIN32}" && WIN32="no"
case "${build}" in
	*-mingw32*)
		WIN32="yes"
	;;
esac

AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])

# Checks for programs.
AC_PROG_CXX

# Check for debug option
AC_ARG_ENABLE(debug,
	[AS_HELP_STRING([--enable-debug], [enable debug data generation (default=no)])],
	[CXXFLAGS="$CXXFLAGS -g -Wall -Werror -O0"],
	[CXXFLAGS="$CXXFLAGS -DNDEBUG=1 -O3"]
)

# Checks for typedefs, structures, and compiler characteristics
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T

# Checks for header files
AC_HEADER_STDC
AC_HEADER_ASSERT
AC_HEADER_DIRENT
AC_CHECK_HEADER([SDL/SDL.h], [], [AC_MSG_ERROR(SDL/SDL.h header file not found)])
AC_CHECK_HEADER([GL/gl.h], [], [AC_MSG_ERROR(GL/gl.h header file not found)])
AS_IF([test "${WIN32}" = "yes"],
	[AC_CHECK_HEADER([GdiPlus.h], [], [AC_MSG_ERROR(GdiPlus.h header file not found)])],
	[AC_CHECK_HEADER([png.h], [], [AC_MSG_ERROR(png.h header file not found)])]
)
AC_CHECK_HEADERS(string map vector iterator fstream complex algorithm)

# Checks for libraries
AC_CHECK_LIB([SDL], [main], [], [AC_MSG_ERROR(SDL library not found)])
AC_CHECK_LIB([GL], [main],
	[OPENGL_LIBS="-lGL"],
	[AC_CHECK_LIB(opengl32, main,
		[OPENGL_LIBS="-lopengl32"],
		[AC_MSG_ERROR(OpenGL library not found)]
	])
)
AS_IF([test "${WIN32}" = "yes"],
	[AC_CHECK_LIB([gdiplus], [main], [], [AC_MSG_ERROR(GDI+ library not found)])],
	[
	AC_CHECK_LIB([png], [main], [], [AC_MSG_ERROR(PNG library not found)])
	]
)

# Set compiler/linker flags
AS_IF([test "${WIN32}" = "yes"],
	[CXXFLAGS="$CXXFLAGS -DPW_GAMEDATADIR='\"data\\\\\"'"],
	[CXXFLAGS="$CXXFLAGS -DPW_GAMEDATADIR='\"$datadir/$PACKAGE/\"'"]
)
LIBS="$LIBS $OPENGL_LIBS"
AS_IF([test "${WIN32}" = "yes"],
	[LDFLAGS="$LDFLAGS -mwindows -static-libgcc -static-libstdc++"]
)

AC_CONFIG_FILES(
		Makefile
		src/Makefile
		extra/Makefile
		data/Makefile
)
AC_OUTPUT