| 1 |
AC_INIT([pcsxr], [1.9.94]) |
| 2 |
|
| 3 |
AC_CANONICAL_HOST |
| 4 |
AC_CANONICAL_BUILD |
| 5 |
AM_INIT_AUTOMAKE(foreign) |
| 6 |
AM_MAINTAINER_MODE |
| 7 |
|
| 8 |
AC_CONFIG_HEADERS([include/config.h:include/config.h.in]) |
| 9 |
|
| 10 |
AC_PROG_CC |
| 11 |
AM_PROG_CC_C_O |
| 12 |
AC_PROG_INSTALL |
| 13 |
AC_STDC_HEADERS |
| 14 |
AM_PROG_AS |
| 15 |
|
| 16 |
LT_PREREQ([2.2.6]) |
| 17 |
LT_INIT([disable-static]) |
| 18 |
|
| 19 |
AM_GLIB_GNU_GETTEXT |
| 20 |
IT_PROG_INTLTOOL([0.35.0]) |
| 21 |
|
| 22 |
GETTEXT_PACKAGE=pcsxr |
| 23 |
AC_SUBST(GETTEXT_PACKAGE) |
| 24 |
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["${GETTEXT_PACKAGE}"], [gettext domain]) |
| 25 |
|
| 26 |
PKG_CHECK_MODULES(GLIB2, glib-2.0 >= 2.20, [], AC_MSG_ERROR([*** glib2 >= 2.20 not found!])) |
| 27 |
PKG_CHECK_MODULES(GTK3, gtk+-3.0 , [], AC_MSG_ERROR([*** libgtk3 >= 3.0 not found!])) |
| 28 |
|
| 29 |
PKG_CHECK_MODULES([SDL2], [sdl2 >= 2.0.0], |
| 30 |
[AC_DEFINE([HAVE_SDL2], [1], [Use SDL2])], |
| 31 |
[PKG_CHECK_MODULES([SDL], [sdl >= 1.2.12], |
| 32 |
[AC_DEFINE([HAVE_SDL], [1], [Use SDL]) |
| 33 |
], AC_MSG_ERROR([*** SDL >= 1.2.12 not found!])) |
| 34 |
]) |
| 35 |
|
| 36 |
AC_SUBST(GLIB2_CFLAGS) |
| 37 |
AC_SUBST(GLIB2_LIBS) |
| 38 |
AC_SUBST(GTK3_CFLAGS) |
| 39 |
AC_SUBST(GTK3_LIBS) |
| 40 |
|
| 41 |
AC_CONFIG_FILES([Makefile |
| 42 |
data/Makefile |
| 43 |
doc/Makefile |
| 44 |
libpcsxcore/Makefile |
| 45 |
gui/Makefile |
| 46 |
plugins/dfinput/Makefile |
| 47 |
plugins/dfsound/Makefile |
| 48 |
plugins/dfxvideo/Makefile |
| 49 |
plugins/dfcdrom/Makefile |
| 50 |
plugins/dfnet/Makefile |
| 51 |
pixmaps/Makefile |
| 52 |
po/Makefile.in]) |
| 53 |
|
| 54 |
AC_CHECK_LIB(dl, dlsym, [LIBS="$LIBS -ldl"], []) |
| 55 |
AC_CHECK_LIB(socket, socket, [LIBS="$LIBS -lsocket"], []) |
| 56 |
AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"], []) |
| 57 |
AC_CHECK_LIB(umem, umem_alloc, [LIBS="$LIBS -lumem"], []) |
| 58 |
|
| 59 |
AM_CONDITIONAL(SOUND_OSS, false) |
| 60 |
AM_CONDITIONAL(SOUND_SDL, false) |
| 61 |
AM_CONDITIONAL(SOUND_OPENAL, false) |
| 62 |
AM_CONDITIONAL(SOUND_NULL, false) |
| 63 |
|
| 64 |
dnl Check for ALSA 1.x, OSS, OpenAL or PulseAudio |
| 65 |
|
| 66 |
AC_ARG_ENABLE(sound, [ --enable-sound=... force selection of sound backend (alsa/null/oss/pulseaudio/sdl/openal) (default: sdl)], |
| 67 |
[ SOUND="$enableval" ],[ SOUND="sdl" ]) |
| 68 |
|
| 69 |
if test "x$SOUND" = xalsa; then |
| 70 |
PKG_CHECK_MODULES(ALSA, alsa >= 1.0.0, have_alsa=yes, have_alsa=no) |
| 71 |
elif test "x$SOUND" = xpulseaudio; then |
| 72 |
PKG_CHECK_MODULES(PULSEAUDIO, libpulse >= 0.9.16, have_pulseaudio=yes) |
| 73 |
elif test "x$SOUND" = xoss; then |
| 74 |
AC_CHECK_HEADER(sys/soundcard.h, have_oss=yes, have_oss=no) |
| 75 |
if test "x$have_oss" = xno; then |
| 76 |
AC_MSG_ERROR([sys/soundcard.h not found!]) |
| 77 |
else |
| 78 |
AM_CONDITIONAL(SOUND_OSS, true) |
| 79 |
fi |
| 80 |
elif test "x$SOUND" = xopenal; then |
| 81 |
PKG_CHECK_MODULES(OPENAL, openal >= 1.0.0, have_openal=yes) |
| 82 |
elif test "x$SOUND" = xno; then |
| 83 |
AM_CONDITIONAL(SOUND_NULL, true) |
| 84 |
elif test "x$SOUND" = xnull; then |
| 85 |
AM_CONDITIONAL(SOUND_NULL, true) |
| 86 |
else |
| 87 |
AM_CONDITIONAL(SOUND_SDL, true) |
| 88 |
fi |
| 89 |
|
| 90 |
AM_CONDITIONAL(SOUND_ALSA, test "x$have_alsa" = xyes) |
| 91 |
AC_SUBST(ALSA_LIBS) |
| 92 |
AM_CONDITIONAL(SOUND_OPENAL, test "x$have_openal" = xyes) |
| 93 |
AC_SUBST(OPENAL_LIBS) |
| 94 |
AM_CONDITIONAL(SOUND_PULSEAUDIO, test "x$have_pulseaudio" = xyes) |
| 95 |
AC_SUBST(PULSEAUDIO_CFLAGS) |
| 96 |
AC_SUBST(PULSEAUDIO_LIBS) |
| 97 |
|
| 98 |
AC_CHECK_HEADER(zlib.h, have_zlib=yes, have_zlib=no) |
| 99 |
if test "x$have_zlib" = xno; then |
| 100 |
AC_MSG_ERROR([unable to find libz headers]) |
| 101 |
fi |
| 102 |
AC_CHECK_HEADER(X11/extensions/Xv.h, have_xv=yes, have_xv=no) |
| 103 |
if test "x$have_xv" = xno; then |
| 104 |
AC_MSG_ERROR([unable to find xv headers]) |
| 105 |
fi |
| 106 |
AC_CHECK_HEADER(X11/extensions/XTest.h, have_xtest=yes, have_xtest=no) |
| 107 |
if test "x$have_xtest" = xno; then |
| 108 |
AC_MSG_ERROR([unable to find xtest headers]) |
| 109 |
fi |
| 110 |
|
| 111 |
AM_CONDITIONAL(USE_LIBCDIO, false) |
| 112 |
|
| 113 |
AC_ARG_ENABLE(libcdio, [ --enable-libcdio use GNU libcdio for CD-ROM support (default=no)], |
| 114 |
[ BUILD_LIBCDIO="$enableval" ],[ BUILD_LIBCDIO="no" ]) |
| 115 |
|
| 116 |
if test "$BUILD_LIBCDIO" = "yes"; then |
| 117 |
PKG_CHECK_MODULES(LIBCDIO, libcdio, [], AC_MSG_ERROR([*** libcdio not found!])) |
| 118 |
AM_CONDITIONAL(USE_LIBCDIO, true) |
| 119 |
fi |
| 120 |
|
| 121 |
AC_SUBST(LIBCDIO_CFLAGS) |
| 122 |
AC_SUBST(LIBCDIO_LIBS) |
| 123 |
|
| 124 |
AC_ARG_ENABLE(opengl, [ --enable-opengl build OpenGL plugin (default=no)], |
| 125 |
[ BUILD_OPENGL="$enableval" ],[ BUILD_OPENGL="no" ]) |
| 126 |
|
| 127 |
PEOPSXGL="" |
| 128 |
|
| 129 |
if test "$BUILD_OPENGL" = "yes"; then |
| 130 |
AC_CHECK_HEADER(GL/gl.h, have_gl=yes, have_gl=no) |
| 131 |
if test "x$have_gl" = xno; then |
| 132 |
AC_MSG_ERROR([unable to find OpenGL headers]) |
| 133 |
fi |
| 134 |
AC_CHECK_HEADER(GL/glx.h, have_glx=yes, have_glx=no) |
| 135 |
if test "x$have_glx" = xno; then |
| 136 |
AC_MSG_ERROR([unable to find GLX headers]) |
| 137 |
fi |
| 138 |
AC_CHECK_HEADER(X11/extensions/xf86vmode.h, have_vmode=yes, have_vmode=no, |
| 139 |
[[#include <GL/gl.h> |
| 140 |
#include <GL/glx.h> |
| 141 |
]]) |
| 142 |
if test "x$have_vmode" = xno; then |
| 143 |
AC_MSG_ERROR([unable to find xf86vmode headers]) |
| 144 |
fi |
| 145 |
PEOPSXGL="plugins/peopsxgl" |
| 146 |
AC_SUBST(PEOPSXGL) |
| 147 |
AC_CONFIG_FILES([plugins/peopsxgl/Makefile]) |
| 148 |
fi |
| 149 |
|
| 150 |
AC_ARG_ENABLE(sio1, [ --enable-sio1 build SIO1 plugin (default=yes)], |
| 151 |
[ BUILD_SIO1="$enableval" ],[ BUILD_SIO1="yes" ]) |
| 152 |
|
| 153 |
BLADESIO1="" |
| 154 |
|
| 155 |
if test "$BUILD_SIO1" = "yes"; then |
| 156 |
AC_DEFINE([ENABLE_SIO1API], [1], [Define if we want use sio interface.]) |
| 157 |
BLADESIO1="plugins/bladesio1" |
| 158 |
AC_SUBST(BLADESIO1) |
| 159 |
AC_CONFIG_FILES([plugins/bladesio1/Makefile]) |
| 160 |
fi |
| 161 |
|
| 162 |
#####apt-get install libavcodec-dev libavformat-dev libavutil-dev |
| 163 |
AC_ARG_ENABLE(ccdda, [ --enable-ccdda support for compressed CDDA formats via ffmpeg (default=no)], |
| 164 |
[ BUILD_CCDDA="$enableval" ],[ BUILD_CCDDA="no" ]) |
| 165 |
|
| 166 |
if test "$BUILD_CCDDA" = "yes"; then |
| 167 |
AC_DEFINE([ENABLE_CCDDA], [1], [Defined when compressed cdda support wanted.]) |
| 168 |
#AC_CHECK_HEADER([libavutil/mathematics.h],, AC_MSG_ERROR("No ffmpeg headers libavcodec/avcodec.h libavutil/mathematics.h")) |
| 169 |
#AC_CHECK_HEADER([libavcodec/avcodec.h],, AC_MSG_ERROR("No ffmpeg headers libavcodec/avcodec.h libavutil/mathematics.h")) |
| 170 |
AC_CHECK_HEADERS([libavcodec/avcodec.h libavutil/mathematics.h libavformat/avformat.h],,AC_MSG_ERROR("No ffmpeg headers libavcodec/avcodec.h libavformat/avformat.h libavutil/mathematics.h")) |
| 171 |
#AC_CHECK_LIB([avcodec], [main], [LIBS="$LIBS -l:libavcodec.so.52 "], AC_MSG_ERROR("No avcodec library")) |
| 172 |
#AC_CHECK_LIB(avutil, [main], [LIBS="$LIBS -l:libavutil.so.52 "], AC_MSG_ERROR("No avutil library")) |
| 173 |
#AC_CHECK_LIB(avformat, [main], [LIBS="$LIBS -l:libavformat.so.52 "], AC_MSG_ERROR("No avformat library")) |
| 174 |
AC_CHECK_LIB([avcodec], [main], [LIBS="$LIBS -lavcodec"], AC_MSG_ERROR("No avcodec library")) |
| 175 |
AC_CHECK_LIB([avutil], [main], [LIBS="$LIBS -lavutil"], AC_MSG_ERROR("No avutil library")) |
| 176 |
AC_CHECK_LIB([avformat], [main], [LIBS="$LIBS -lavformat"], AC_MSG_ERROR("No avformat library")) |
| 177 |
#AC_CHECK_LIB(avcodec ,[main],AC_DEFINE([HAVE_LIBAVCODEC], [1], [ ]),AC_MSG_ERROR([$errormsgl])) |
| 178 |
#AC_CHECK_LIB(swscale ,[main],AC_DEFINE([HAVE_LIBSWSCALE], [1], [ ]),AC_MSG_ERROR([$errormsgl]), [-lavutil]) |
| 179 |
#AC_CHECK_LIB(avdevice ,[main],AC_DEFINE([HAVE_LIBAVDEVICE], [1], [ ]),AC_MSG_ERROR([$errormsgl]), [-lavcodec -lavutil -lavformat]) |
| 180 |
fi |
| 181 |
|
| 182 |
AM_CONDITIONAL(X86_NASM, false) |
| 183 |
|
| 184 |
if expr x"$build_cpu" : 'xi.86' > /dev/null; then |
| 185 |
if expr x"$build_os" : 'x.*linux.*' > /dev/null; then |
| 186 |
AC_PATH_PROG([NASM],[nasm],[missing]) |
| 187 |
if test "$NASM" = "missing"; then |
| 188 |
AC_MSG_WARN([unable to find nasm, needed to build dfx11video]) |
| 189 |
AM_CONDITIONAL(X86_NASM, false) |
| 190 |
else |
| 191 |
AM_CONDITIONAL(X86_NASM, true) |
| 192 |
fi |
| 193 |
fi |
| 194 |
fi |
| 195 |
|
| 196 |
AM_CONDITIONAL(ARCH_X86, false) |
| 197 |
AM_CONDITIONAL(ARCH_X86_64, false) |
| 198 |
AM_CONDITIONAL(ARCH_PPC, false) |
| 199 |
|
| 200 |
AC_ARG_ENABLE(dynarec, [ --enable-dynarec=... force selection of dynamic recompiler platform (auto/no/x86/x86_64/ppc) (default: auto)], |
| 201 |
[ DYNAREC="$enableval" ],[ DYNAREC="auto" ]) |
| 202 |
|
| 203 |
if test "x$DYNAREC" = xauto; then |
| 204 |
DYNARECSEL="auto" |
| 205 |
elif test "x$DYNAREC" = xx86; then |
| 206 |
DYNARECSEL="x86" |
| 207 |
elif test "x$DYNAREC" = xx86_64; then |
| 208 |
DYNARECSEL="x86_64" |
| 209 |
elif test "x$DYNAREC" = xppc; then |
| 210 |
DYNARECSEL="ppc" |
| 211 |
elif test "x$DYNAREC" = xno; then |
| 212 |
DYNARECSEL="no" |
| 213 |
else |
| 214 |
AC_MSG_WARN([Dynamic Recompiler "$DYNAREC" not found. Autodetecting...]) |
| 215 |
DYNARECSEL="auto" |
| 216 |
fi |
| 217 |
|
| 218 |
if test "x$DYNARECSEL" = xauto; then |
| 219 |
if expr x"$build_cpu" : 'xi.86' > /dev/null; then |
| 220 |
DYNARECSEL="x86" |
| 221 |
elif expr x"$build_cpu" : 'xx86_64' > /dev/null; then |
| 222 |
DYNARECSEL="x86_64" |
| 223 |
elif expr x"$build_cpu" : 'xpowerpc' > /dev/null; then |
| 224 |
DYNARECSEL="ppc" |
| 225 |
fi |
| 226 |
fi |
| 227 |
|
| 228 |
if test "x$DYNARECSEL" = xno; then |
| 229 |
AC_DEFINE([NOPSXREC], [1], [Define if we are compiling without dynamic recompiler.]) |
| 230 |
elif test "x$DYNARECSEL" = xx86; then |
| 231 |
AC_DEFINE([__i386__], [1], [Define if we are compiling for x86 architectures.]) |
| 232 |
AM_CONDITIONAL(ARCH_X86, true) |
| 233 |
|
| 234 |
AC_MSG_RESULT([Dynamic Recompiler selected: x86]) |
| 235 |
elif test "x$DYNARECSEL" = xx86_64; then |
| 236 |
AC_DEFINE([__x86_64__], [1], [Define if we are compiling for x86_64 architectures.]) |
| 237 |
AM_CONDITIONAL(ARCH_X86_64, true) |
| 238 |
dnl CFLAGS+=" -m64 " |
| 239 |
dnl AC_COMPILE_IFELSE(AC_LANG_PROGRAM,,AC_MSG_ERROR([Cannot compile with -m64])) |
| 240 |
AC_MSG_RESULT([Dynamic Recompiler selected: x86_64]) |
| 241 |
elif test "x$DYNARECSEL" = xppc; then |
| 242 |
AC_DEFINE([__ppc__], [1], [Define if we are compiling for powerpc architectures.]) |
| 243 |
AM_CONDITIONAL(ARCH_PPC, true) |
| 244 |
AC_MSG_RESULT([Dynamic Recompiler selected: ppc]) |
| 245 |
fi |
| 246 |
|
| 247 |
AC_C_BIGENDIAN(AC_DEFINE([__BIGENDIAN__],[],[define on a big endian system])) |
| 248 |
|
| 249 |
AC_DEFINE([__LINUX__], [1], [Define if building on a GNU/Linux system.]) |
| 250 |
AC_DEFINE([MAXPATHLEN], [4096], [Define to the maximum length of any path.]) |
| 251 |
|
| 252 |
AC_OUTPUT |