-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.in
190 lines (156 loc) · 5.27 KB
/
configure.in
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
dnl
dnl configure.in for TI85 Emulator, (c) 2001 Milan Pikula <[email protected]>
dnl
dnl Init
AC_INIT(src/main.c)
AM_INIT_AUTOMAKE(ti85emu, 0.1.0)
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_RANLIB
dnl *** AC_PROG_MAKE_SET
dnl portability?
AC_MINIX
AC_ISC_POSIX
AC_AIX
AC_CHECK_HEADERS(string.h)
dnl Look at the GUI option
AC_DEFUN(TEST_LIB,[ AC_CHECK_LIB($1,$2,,AC_MSG_ERROR(*** Missing library $1 ***)) ])
AC_DEFUN(TEST_LIBS,[ AC_CHECK_LIB($1,$2,,AC_MSG_ERROR(*** Missing library $1 ***),$3) ])
dnl AC_MSG_CHECKING(for GUI to use)
AC_ARG_WITH(gui,
[ --with-gui=X specify the graphical user interface (GUI) to:
gtk use GTK user interface
fltk use FLTK user interface],
[
dnl AC_MSG_RESULT(${withval} (forced))
gui="${withval}"],
[gui="unset"])
AC_ARG_ENABLE(fltk-flashing,
[ --enable-fltk-flashing enable this to get faster emulator, at the cost
of flashing display. This is suitable for use
on slow machines with LCD display, such as
Agenda VR3d. Default is DISABLE.],
[
if test "$enable_fltk_flashing" = "yes"; then
AC_DEFINE(FLTK_FLASHING)
fi
],
[])
AC_ARG_ENABLE(fltk-relevant,
[ --enable-fltk-relevant enable this to avoid unnecessary screen
redrawing. This improves the speed if running
over network or on a slow X display, but
slightly increases the
on slow machines with LCD display, such as
Agenda VR3d. Default is ENABLE.],
[
if test "$enable_fltk_relevant" = "yes"; then
AC_DEFINE(FLTK_RELEVANT)
fi
],
[AC_DEFINE(FLTK_RELEVANT)])
AC_ARG_ENABLE(gtk-relevant,
[ --enable-gtk-relevant enable this to avoid unnecessary screen
redrawing. This improves the speed if running
over network or on a slow X display, but
slightly increases the
on slow machines with LCD display, such as
Agenda VR3d. Default is ENABLE.],
[
if test "$enable_gtk_relevant" = "yes"; then
AC_DEFINE(GTK_RELEVANT)
fi
],
[AC_DEFINE(GTK_RELEVANT)])
if test "$gui" = "unset"; then
AC_CHECK_LIB(gtk,main,[
dnl AC_MSG_RESULT(gtk)
gui=gtk
],[],[-lgdk])
fi
if test "$gui" = "unset"; then
AC_CHECK_LIB(fltk,main,[
dnl AC_MSG_RESULT(fltk)
gui=fltk
],[])
fi
dnl Check, if the given GUI is correct
guifile="0"
if test "$gui" = "gtk"; then
dnl TEST_LIB(X11,XCreateSimpleWindow)
dnl TEST_LIB(Xext,XMissingExtension)
dnl TEST_LIBS(gtk,gtk_window_new,[-lgdk])
dnl TEST_LIB(gdk,gdk_init)
AM_PATH_GLIB(1.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" ,AC_MSG_ERROR(*** GLIB >= 1.0.0 required ***))
AM_PATH_GTK(1.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" ,AC_MSG_ERROR(*** GTK >= 1.0.0 required ***))
AC_DEFINE(GUI_GTK)
guifile="ti85emu_gtk"
msxfile="libmsx.a"
fi
if test "$gui" = "fltk"; then
TEST_LIB(stdc++,cout)
TEST_LIB(X11,XCreateSimpleWindow)
TEST_LIB(Xext,XMissingExtension)
TEST_LIB(fltk,fl_yes)
AC_DEFINE(GUI_FLTK)
guifile="ti85emu_fltk"
msxfile="libxmsx.a"
fi
if test "$guifile" = "0"; then
AC_MSG_ERROR(*** Cannot find a GUI. Try ./configure --help ***)
fi
AC_ARG_WITH(speed,
[ --with-speed=X set the speed of emulation to:
full run at FULL SPEED including idle time of
calculator (this kills the machine and also
turns the calculator off too often)
freal run at FULL SPEED during computations,
REAL SPEED when idle. (this enables the fast
computations and graphs, while preserves
the real blinking of cursor and power off)
(default)
real run at REAL SPEED in computations and when
idle. (this mode is suitable for playing
games and running assembler software)],
[
speed="${withval}"],
[speed="freal"])
if test "$speed" = "full"; then
AC_DEFINE(SPEED_FULL)
fi
if test "$speed" = "freal"; then
AC_DEFINE(SPEED_FREAL)
fi
if test "$speed" = "real"; then
AC_DEFINE(SPEED_REAL)
fi
AC_ARG_WITH(snapfile,
[ --with-snapfile=X sets the file name for a snapshot file, used
to store the state of the calculator. Default
is '85snap.sna' in the current directory.],
[
AC_DEFINE_UNQUOTED(SNAPFILE,"${withval}")],
[AC_DEFINE_UNQUOTED(SNAPFILE,"85snap.sna")])
AC_ARG_WITH(romfile,
[ --with-romfile=X sets the file name for a ROM image file.
Default is '/usr/share/ti85rom.bin'.],
[
AC_DEFINE_UNQUOTED(ROMFILE,"${withval}")],
[AC_DEFINE_UNQUOTED(ROMFILE,"/usr/share/ti85rom.bin")])
AC_SUBST(guifile)
AC_SUBST(msxfile)
AC_SUBST(GUI_FLTK)
AC_SUBST(FLTK_FLASHING)
AC_SUBST(FLTK_RELEVANT)
AC_SUBST(GUI_GTK)
AC_SUBST(GTK_RELEVANT)
AC_SUBST(SPEED_FULL)
AC_SUBST(SPEED_FREAL)
AC_SUBST(SPEED_REAL)
AC_SUBST(SNAPFILE)
AC_SUBST(ROMFILE)
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
AC_OUTPUT(Makefile src/Makefile src/MSX/Makefile)