forked from libretro/emux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
122 lines (103 loc) · 3.67 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
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
AC_INIT([emux], [0.1], [[email protected]])
AC_CONFIG_AUX_DIR([build])
# Retrieve target os
AC_CANONICAL_TARGET
AC_PROG_CC
AC_PROG_RANLIB
AC_CONFIG_SRCDIR([main/main.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([Makefile])
AM_INIT_AUTOMAKE([subdir-objects -Wall -Werror])
AM_SILENT_RULES([yes])
AM_PROG_CC_C_O
PKG_PROG_PKG_CONFIG
# Export source directory to the environment
export EMUX_SRC_DIR=$srcdir
# Copy desired configuration if requested
if test "$CONF" != ""; then
if ! test -f $EMUX_SRC_DIR/mach/configs/$CONF; then
AC_MSG_ERROR([could not find $EMUX_SRC_DIR/mach/configs/$CONF!])
fi
cp $EMUX_SRC_DIR/mach/configs/$CONF $PWD/.config
fi
# Copy default configuration if no .config file is found
if ! test -f $PWD/.config; then
cp $EMUX_SRC_DIR/mach/configs/all_defconfig $PWD/.config
fi
# Launch configuration menu if requested
if test "$MENU" != ""; then
kconfig-$MENU $EMUX_SRC_DIR/Kconfig <& AS_ORIGINAL_STDIN_FD
fi
# Set all CONFIG_xxx variables from .config file
source $PWD/.config
# Make sure at least one machine is selected
if test "$CONFIG_MACH" != "y"; then
AC_MSG_ERROR([please select at least one machine.])
fi
# Add libroxml if needed
if test "$CONFIG_INPUT_XML" == "y"; then
PKG_CHECK_MODULES([ROXML], [libroxml])
fi
# Add libcaca if needed
if test "$CONFIG_INPUT_CACA" == "y" || test "$CONFIG_VIDEO_CACA" == "y"; then
PKG_CHECK_MODULES([CACA], [caca])
fi
# Add OpenGL/SDL if needed
if test "$CONFIG_VIDEO_OPENGL" == "y"; then
PKG_CHECK_MODULES([SDL2], [sdl2])
PKG_CHECK_MODULES([GL], [gl])
PKG_CHECK_MODULES([GLU], [glu])
fi
# Add SDL if needed
if test "$CONFIG_INPUT_SDL" == "y" || test "$CONFIG_VIDEO_SDL" == "y"; then
PKG_CHECK_MODULES([SDL2], [sdl2])
fi
# Helps defining CONFIG_xxx macros in config.h and automake conditionals
AC_DEFUN([AX_DECLARE_CONFIG], [
AM_CONDITIONAL($1, test "$$1" != "")
if test "$$1" != ""; then
AC_DEFINE_UNQUOTED($1, $$1, $1)
fi
])
# Declare all our CONFIG_xxx variables
AX_DECLARE_CONFIG([CONFIG_AUDIO_SDL])
AX_DECLARE_CONFIG([CONFIG_INPUT_CACA])
AX_DECLARE_CONFIG([CONFIG_INPUT_SDL])
AX_DECLARE_CONFIG([CONFIG_INPUT_XML])
AX_DECLARE_CONFIG([CONFIG_VIDEO_CACA])
AX_DECLARE_CONFIG([CONFIG_VIDEO_OPENGL])
AX_DECLARE_CONFIG([CONFIG_VIDEO_SDL])
AX_DECLARE_CONFIG([CONFIG_CPU_CHIP8])
AX_DECLARE_CONFIG([CONFIG_CPU_LR35902])
AX_DECLARE_CONFIG([CONFIG_CPU_RP2A03])
AX_DECLARE_CONFIG([CONFIG_CPU_Z80])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_AUDIO_APU])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_AUDIO_PAPU])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_AUDIO_SN76489])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_DMA_NES])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_INPUT_GB])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_INPUT_NES])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_INPUT_SMS])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_GB])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_MBC1])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_NES])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_MMC1])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_MMC3])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_NROM])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_ROM])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_SEGA])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_MAPPER_SMS])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_SERIAL_GB])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_TIMER_GB])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_VIDEO_LCDC])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_VIDEO_PPU])
AX_DECLARE_CONFIG([CONFIG_CONTROLLER_VIDEO_VDP])
AX_DECLARE_CONFIG([CONFIG_MACH_CHIP8])
AX_DECLARE_CONFIG([CONFIG_MACH_GB])
AX_DECLARE_CONFIG([CONFIG_MACH_NES])
AX_DECLARE_CONFIG([CONFIG_MACH_SMS])
AX_DECLARE_CONFIG([CONFIG_CMDLINE])
AX_DECLARE_CONFIG([CONFIG_CMDLINE_FROM_ARGS])
AX_DECLARE_CONFIG([CONFIG_CMDLINE_EXTEND])
AX_DECLARE_CONFIG([CONFIG_CMDLINE_FORCE])
AC_OUTPUT