File: configure.in

package info (click to toggle)
njam 1.25-11
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,380 kB
  • sloc: cpp: 3,810; sh: 2,958; perl: 384; ansic: 236; objc: 224; makefile: 112
file content (100 lines) | stat: -rw-r--r-- 2,416 bytes parent folder | download | duplicates (8)
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

AC_INIT(src/njam.cpp)
VERSION=0.1.25
PACKAGE=njam
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE($PACKAGE,"$VERSION")
CFLAGS="$CFLAGS"

dnl Determine default prefix
if test "x$prefix" = "xNONE"; then
  prefix="/usr/local"
fi

AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET

dnl ---- Checks for header files.

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h strings.h sys/ioctl.h sys/time.h unistd.h)


AC_ARG_WITH(sdl,     [  --with-sdl              build SDL interface], [], [with_sdl=yes])


dnl ---- SDL component needs: libvorbisfile.la libsmpeg.la libogg.la

if test "$with_sdl" != "no" ; then
AC_CHECK_PROG(SDL_CONFIG, sdl-config,yes)
if test x$SDL_CONFIG = "x"; then
  AC_MSG_ERROR([SDL_CONFIG not found!!! Install sdl libs])
fi

if test "$SDL_CONFIG" ; then
SDL_LIBS="`sdl-config --libs`"
SDL_CFLAGS="`sdl-config --cflags`"
INCS="$INCS $SDL_CFLAGS"
AC_CHECK_LIB(SDL, SDL_Init, [
AC_CHECK_HEADERS(SDL/SDL.h, ,[
AC_MSG_ERROR(SDL found but headers are missing!!)
with_sdl=no
])], [with_sdl=no], $SDL_LIBS)

AC_CHECK_LIB(SDL_image, IMG_Load, ,[
AC_MSG_ERROR([SDL_image libs and headers are missing!! Install sdl-image libs]) 
], $SDL_LIBS)
SDL_LIBS="$SDL_LIBS -lSDL_image"

AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, ,[
AC_MSG_ERROR([SDL_mixer libs and headers are missing!! Install sdl-mixer libs]) 
], $SDL_LIBS)
SDL_LIBS="$SDL_LIBS -lSDL_mixer"

AC_CHECK_LIB(SDL_net, SDLNet_TCP_Open, ,[
AC_MSG_ERROR([SDL_net libs and headers are missing!! Install sdl-net libs]) 
], $SDL_LIBS)
SDL_LIBS="$SDL_LIBS -lSDL_net"

else
with_sdl=no
fi
fi

AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)

CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

dnl Determine if maintainer portions of the Makefiles should be included.
dnl AM_MAINTAINER_MODE

dnl default prefix
DEFAULT_PREFIX="$prefix"
AC_SUBST(DEFAULT_PREFIX)

dnl datadir
DEFAULT_LIBDIR="$datadir"
AC_SUBST(DEFAULT_LIBDIR)


dnl Print results
AC_MSG_RESULT([])
AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.])
AC_MSG_RESULT([])
AC_MSG_RESULT([Using '$DEFAULT_PREFIX' for installation.])
AC_MSG_RESULT([Using '$DEFAULT_LIBDIR' for installation libraries.])
AC_MSG_RESULT([Using '$CXX' for C++ compiler.])
AC_MSG_RESULT([Building with '$SDL_CFLAGS' for C++ compiler flags.])
AC_MSG_RESULT([Building with '$SDL_LIBS' for linker flags.])
AC_MSG_RESULT([])

AC_OUTPUT(Makefile
src/Makefile
)