-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
85 lines (68 loc) · 2.14 KB
/
configure.ac
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
AC_PREREQ([2.71])
AC_INIT([nes-tools], [0.1])
AC_CONFIG_SRCDIR([src/cpu6502.c])
AC_CONFIG_HEADERS([src/config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
# User-specified SDL2 headers path.
AC_ARG_WITH([sdl-headers],
[AS_HELP_STRING([--with-sdl-headers=DIR],
[Specify the directory containing SDL2 headers])],
[sdl_headers=$withval],
[sdl_headers=""])
if test -n "$sdl_headers"; then
CFLAGS="$CFLAGS -I$sdl_headers"
fi
# User-specified SDL2 libraries path.
AC_ARG_WITH([sdl-lib],
[AS_HELP_STRING([--with-sdl-lib=DIR],
[Specify the directory containing the SDL2 library])],
[sdl_lib=$withval],
[sdl_lib=""])
if test -n "$sdl_lib"; then
LDFLAGS="$LDFLAGS -L$sdl_lib"
fi
# User-specified SDL2_ttf headers path.
AC_ARG_WITH([sdl-ttf-headers],
[AS_HELP_STRING([--with-sdl-ttf-headers=DIR],
[Specify the directory containing SDL2_ttf headers])],
[sdl_ttf_headers=$withval],
[sdl_ttf_headers=""])
if test -n "$sdl_ttf_headers"; then
CFLAGS="$CFLAGS -I$sdl_ttf_headers"
fi
# User-specified SDL2 libraries path.
AC_ARG_WITH([sdl-ttf-lib],
[AS_HELP_STRING([--with-sdl-ttf-lib=DIR],
[Specify the directory containing the SDL2_ttf library])],
[sdl_ttf_lib=$withval],
[sdl_ttf_lib=""])
if test -n "$sdl_ttf_lib"; then
LDFLAGS="$LDFLAGS -L$sdl_ttf_lib"
fi
# Validate SDL2 installation.
AC_CHECK_HEADER([SDL_ttf.h],
[AC_MSG_NOTICE([SDL2_ttf headers found])],
[AC_MSG_ERROR([SDL2_ttf headers not found in $sdl_ttf_headers])])
AC_CHECK_LIB([SDL2_ttf], [TTF_Init],
[AC_MSG_NOTICE([SDL2_ttf library found])],
[AC_MSG_ERROR([SDL2_ttf library not found in $sdl_ttf_lib])])
AC_CHECK_HEADER([SDL.h],
[AC_MSG_NOTICE([SDL2 headers found])],
[AC_MSG_ERROR([SDL2 headers not found in $sdl_headers])])
AC_CHECK_LIB([SDL2], [SDL_Init],
[AC_MSG_NOTICE([SDL2 library found])],
[AC_MSG_ERROR([SDL2 library not found in $sdl_lib])])
# Checks for header files.
AC_CHECK_HEADERS([
stdlib.h stdint.h time.h
SDL.h SDL_ttf.h
stdarg.h stdio.h
])
AC_CONFIG_FILES([
Makefile
src/Makefile
src/audio/Makefile
])
AC_OUTPUT