File: configure.in

package info (click to toggle)
visualboyadvance 1.8.0.dfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,216 kB
  • ctags: 17,097
  • sloc: cpp: 93,502; ansic: 48,351; sh: 3,561; makefile: 378; lex: 72; yacc: 60; sed: 16
file content (186 lines) | stat: -rw-r--r-- 3,988 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
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
dnl Process this file with autoconf to produce a configure script.

AC_INIT(src/armdis.h)

AC_CANONICAL_HOST
AC_CANONICAL_TARGET

case "$target" in
  i?86-*-*)
    VBA_USE_C_CORE=no
    VBA_USE_MMX=yes
    ;;
  *)
    VBA_USE_C_CORE=yes
    VBA_USE_MMX=no
    ;;
esac

AM_INIT_AUTOMAKE(VisualBoyAdvance, 1.8.0)

AC_ARG_ENABLE(c-core,
  AC_HELP_STRING([--enable-c-core],[enable C core (default is no on x86 targets)]),
  , enable_c_core=$VBA_USE_C_CORE)

AC_ARG_ENABLE(profiling,
  AC_HELP_STRING([--enable-profiling],[enable profiling (default is yes)]),
  , enable_profiling=yes)

AC_ARG_WITH(mmx,
  AC_HELP_STRING([--with-mmx],[use MMX (default is yes on x86 targets)]),
  , with_mmx=$VBA_USE_MMX)

AC_ARG_ENABLE(sdl,
  AC_HELP_STRING([--enable-sdl],[build the SDL interface (default is yes)]),
  , enable_sdl=yes)

AC_ARG_ENABLE(gtk,
[  --enable-gtk=[[VERSION]]  build the GTK+ interface (default is no)],[
if test "x$enable_gtk" != xno; then
  enable_gtk=yes
  if test "x$enableval" = xyes; then
    gtk_version=2.0
  else
    gtk_version=$enableval
  fi
fi
],[
enable_gtk=no
])

AC_ARG_ENABLE(dev,
  AC_HELP_STRING([--enable-dev],[enable development features (default is yes)]),
  , enable_dev=yes)

dnl Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_YACC
AM_PROG_LEX
AC_PROG_CXX
AC_PROG_RANLIB
AC_PATH_PROG(NASM, nasm)

dnl Checks for libraries.
AC_CHECK_LIB(z, gzopen,
  , AC_MSG_ERROR([*** Cannot compile without zlib.]))
AC_CHECK_LIB(pthread, pthread_yield)

PKG_CHECK_MODULES(LIBPNG, libpng)
CPPFLAGS="$CPPFLAGS $LIBPNG_CFLAGS"
LIBS="$LIBS $LIBPNG_LIBS"

dnl Checks for header files.
AC_PATH_X
AC_HEADER_STDC
AC_CHECK_HEADERS(malloc.h strings.h unistd.h arpa/inet.h netinet/in.h zutil.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([
#include <sys/socket.h>
socklen_t x;
],[
],[
AC_MSG_RESULT(yes)
],[
AC_TRY_COMPILE([
#include <sys/socket.h>
int accept (int, struct sockaddr *, size_t *);
],[
],[
AC_MSG_RESULT(size_t)
AC_DEFINE(socklen_t,size_t)
],[
AC_MSG_RESULT(int)
AC_DEFINE(socklen_t,int)
])
])

AC_C_BIGENDIAN

VBA_LIBS="../gb/libgb.a"

CXXFLAGS="$CXXFLAGS -DBKPT_SUPPORT"

if test "x$enable_c_core" = xyes; then
  CXXFLAGS="$CXXFLAGS -DC_CORE"
fi

if test "x$enable_profiling" = xyes; then
  CXXFLAGS="$CXXFLAGS -DPROFILING"
  VBA_SRC_EXTRA="$VBA_SRC_EXTRA prof"
  VBA_LIBS="$VBA_LIBS ../prof/libprof.a"
fi

if test "x$with_mmx" = xyes; then
  if test "x$NASM" = x; then
    AC_MSG_ERROR([*** Couldn't find nasm program.])
  fi
  CXXFLAGS="$CXXFLAGS -DMMX"
  VBA_SRC_EXTRA="$VBA_SRC_EXTRA i386"
  VBA_LIBS="$VBA_LIBS ../i386/lib386.a"
fi

if test "x$enable_sdl" = xyes || test "x$enable_gtk" = xyes; then
  SDL_VERSION=1.2.2
  AM_PATH_SDL($SDL_VERSION,[
  ],[
  AC_MSG_ERROR([*** Couldn't find SDL library (version >= $SDL_VERSION).])
  ])
fi

if test "x$enable_sdl" = xyes; then
  VBA_SRC_EXTRA="$VBA_SRC_EXTRA sdl"
fi

if test "x$enable_gtk" = xyes; then
  dnl Internationalisation support.
  ALL_LINGUAS="fr sv pt_BR"
  AM_GNU_GETTEXT(external)
  AC_CHECK_HEADERS(libintl.h)
  GETTEXT_PACKAGE=vba
  AC_SUBST(GETTEXT_PACKAGE)

  PKG_CHECK_MODULES(GTKMM, gtkmm-$gtk_version >= 2.0.0 libglademm-$gtk_version >= 2.1.0)
  AC_SUBST(GTKMM_CFLAGS)
  AC_SUBST(GTKMM_LIBS)
  if test "x$gtk_version" = x2.0; then
    GTKMM_CPPFLAGS="-DGTKMM20"
  fi
  AC_SUBST(GTKMM_CPPFLAGS)
  VBA_EXTRA="$VBA_EXTRA po"
  VBA_SRC_EXTRA="$VBA_SRC_EXTRA gtk"
fi

if test "x$enable_dev" = xyes; then
  CXXFLAGS="$CXXFLAGS -DDEV_VERSION"
fi

if test "x$enable_sdl" != xyes && test "x$enable_gtk" != xyes; then
  AC_MSG_WARN([*** You have chosen not to build any frontend.])
fi

AC_SUBST(VBA_EXTRA)
AC_SUBST(VBA_SRC_EXTRA)
AC_SUBST(VBA_LIBS)

dnl Generated files.
AC_CONFIG_FILES([
Makefile
m4/Makefile
po/Makefile.in
src/Makefile
src/gb/Makefile
src/gtk/Makefile
src/gtk/images/Makefile
src/i386/Makefile
src/prof/Makefile
src/sdl/Makefile
win32/Makefile
])
AC_OUTPUT