# Public domain REGISTER("--enable-lockdebug", "Expensive threads debugging [default: no]") REGISTER("--enable-warnings", "Suggested compiler warnings [default: no]") REGISTER("--enable-threads", "Thread safety [default: check]") REGISTER("--enable-gui", "Build Agar-GUI [default: yes]") REGISTER("--enable-utf8", "Unicode text/input support [default: yes]") REGISTER("--enable-8bpp", "Support for 8 bpp display [default: yes]") REGISTER("--enable-16bpp", "Support for 16 bpp display [default: yes]") REGISTER("--enable-24bpp", "Support for 24 bpp display [default: yes]") REGISTER("--enable-32bpp", "Support for 32 bpp display [default: yes]") REGISTER("--enable-network", "Build network client library [default: check]") REGISTER("--enable-server", "Build network server library [default: no]") REGISTER("--with-gl", "OpenGL rendering support [default: check]") REGISTER("--with-jpeg", "JPEG screenshot support [default: check]") REGISTER("--with-freetype", "GUI: Enable FreeType support [default: check]") # Agar version HDEFINE(VERSION, "1.3.2") HDEFINE(RELEASE, "Landscapes Turn To Ash") # Installation directories MDEFINE(SHAREDIR, "\${PREFIX}/share/agar") HDEFINE(SHAREDIR, "$PREFIX/share/agar") MDEFINE(LOCALEDIR, "\${PREFIX}/share/agar/locale") HDEFINE(LOCALEDIR, "$PREFIX/share/agar/locale") MDEFINE(TTFDIR, "\${PREFIX}/share/agar/fonts") HDEFINE(TTFDIR, "$PREFIX/share/agar/fonts") MDEFINE(INCLDIR, "\${PREFIX}/include/agar") HDEFINE(INCLDIR, "$PREFIX/include/agar") CHECK(cc) CHECK(sys_types) CHECK(stdlib_h) CHECK(unistd_h) CHECK(limits_h) CHECK(progname) CHECK(free_null) CHECK(math) CHECK(gethostname) CHECK(getpwuid) CHECK(getuid) CHECK(getenv) CHECK(setenv) CHECK(strsep) CHECK(snprintf) CHECK(vsnprintf) CHECK(vasprintf) CHECK(arc4random) CHECK(md5) CHECK(sha1) CHECK(rmd160) CHECK(x11) CHECK(signal) CHECK(setjmp) CHECK(strtoll) CHECK(strtold) CHECK(altivec) CHECK(byte_order) C_DEFINE(_AGAR_INTERNAL) C_DEFINE(_BSD_SOURCE) C_INCDIR($SRC) C_NO_SECURE_WARNINGS() #C_EXTRA_WARNINGS() #C_FATAL_WARNINGS() if [ "${enable_warnings}" = "yes" ]; then C_OPTION(-Wall) C_OPTION(-Werror) C_OPTION(-Wmissing-prototypes) MDEFINE(WNO_UNINITIALIZED, "-Wno-uninitialized") else MDEFINE(WNO_UNINITIALIZED, "") fi if [ "${enable_lockdebug}" = "yes" ]; then HDEFINE(LOCKDEBUG, 1) else HUNDEF(LOCKDEBUG) fi # SDL is required. CHECK(sdl, 1.2.0) if [ "${HAVE_SDL}" != "yes" ]; then echo "*" echo "* Agar-GUI requires the SDL library. You can download it " echo "* from: http://www.libsdl.org/" echo "*" exit 1 fi # # Check GUI-specific dependencies. # if [ "${enable_gui}" != "no" ]; then HDEFINE(ENABLE_GUI, 1) # Enable Freetype support if the Freetype library is found. Otherwise # fall back to the bitmap font engine. if [ "${with_freetype}" != "no" ]; then CHECK(freetype, 7.0.1) if [ "${HAVE_FREETYPE}" != "yes" ]; then echo "*" echo "* Agar needs FreeType to display vector fonts" echo "* (http://www.freetype.org/)." echo "*" echo "* If you really want to use Agar's built-in low" echo "* quality bitmap font engine, run the configure" echo "* script again using the --without-freetype flag." echo "*" echo "* Note that the bundled bitmap font only includes" echo "* the basic US-ASCII characters and is not meant" echo "* to be used except for porting to new platforms." echo "*" exit 1 fi else HUNDEF(HAVE_FREETYPE) MDEFINE(FREETYPE_CFLAGS, "") MDEFINE(FREETYPE_LIBS, "") fi # Enable OpenGL support if an OpenGL library is found. if [ "${with_gl}" != "no" ]; then CHECK(opengl) if [ "${HAVE_OPENGL}" = "yes" ]; then MDEFINE(SDL_CFLAGS, "$SDL_CFLAGS $OPENGL_CFLAGS") else if [ "${with_gl}" = "yes" ]; then echo "*" echo "* --with-gl was requested, but no OpenGL" echo "* library was found. Try running the" echo "* configure script again without this" echo "* option." echo "*" exit 1 else HUNDEF(HAVE_OPENGL) fi fi else HUNDEF(HAVE_OPENGL) MDEFINE(OPENGL_CFLAGS, "") MDEFINE(OPENGL_LIBS, "") fi # Enable JPEG support if libjpeg is found (only used for screenshots). if [ "${with_jpeg}" != "no" ]; then CHECK(jpeg) if [ "${HAVE_JPEG}" != "yes" ]; then if [ "${with_jpeg}" = "yes" ]; then echo "*" echo "* --with-jpeg was requested, but libjpeg" echo "* was not found. Try running configure" echo "* again without this option." echo "*" exit 1 else HUNDEF(HAVE_JPEG) fi fi else HUNDEF(HAVE_JPEG) MDEFINE(JPEG_CFLAGS, "") MDEFINE(JPEG_LIBS, "") fi else HUNDEF(ENABLE_GUI) HUNDEF(HAVE_FREETYPE) MDEFINE(FREETYPE_CFLAGS, "") MDEFINE(FREETYPE_LIBS, "") HUNDEF(HAVE_OPENGL) MDEFINE(OPENGL_CFLAGS, "") MDEFINE(OPENGL_LIBS, "") HUNDEF(HAVE_JPEG) MDEFINE(JPEG_CFLAGS, "") MDEFINE(JPEG_LIBS, "") fi # Enable network support if system supports getaddrinfo(). # XXX Should enable check by default if [ "${enable_network}" = "yes" ]; then CHECK(getaddrinfo) if [ "${HAVE_GETADDRINFO}" = "yes" ]; then HDEFINE(NETWORK, 1) else if [ "${enable_network}" = "yes" ]; then echo "*" echo "* --enable-network was requested, but this system" echo "* does not support getaddrinfo(). Try running the" echo "* configure script again without this option." echo "*" exit 1 else HUNDEF(NETWORK) fi fi else HUNDEF(NETWORK) HUNDEF(HAVE_GETADDRINFO) fi # Enable network server code only if requested explicitely. # TODO: other checks if [ "${enable_server}" = "yes" ]; then if [ "${HAVE_GETADDRINFO}" = "yes" ]; then HDEFINE(SERVER, 1) else if [ "${enable_server}" = "yes" ]; then echo "*" echo "* --enable-server was requested, but this system" echo "* does not support getaddrinfo(). Try running the" echo "* configure script again without this option." echo "*" exit 1 else HUNDEF(SERVER) fi fi else HUNDEF(SERVER) HUNDEF(HAVE_GETADDRINFO) fi # Enable threads support if POSIX threads are available. if [ "${enable_threads}" != "no" ]; then CHECK(pthreads) if [ "${HAVE_PTHREADS}" = "yes" ]; then if [ "${HAVE_PTHREADS_XOPEN}" = "no" ]; then if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE}" = "no" ]; then if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE_NP}" = "no" ]; then if [ "${enable_threads}" = "yes" ]; then echo "*" echo "* --enable-threads was given, but your" echo "* pthreads library lacks support for" echo "* recursive mutexes. Try running the" echo "* configure script again without this" echo "* option." echo "*" exit 1 fi fi fi fi HDEFINE(THREADS, 1) else if [ "${enable_threads}" = "yes" ]; then echo "*" echo "* --enable-threads was given, but no pthreads" echo "* library was found on your system. Try running" echo "* the configure script again without this option." echo "*" exit 1 fi fi else HUNDEF(THREADS) HUNDEF(HAVE_PTHREADS) HUNDEF(HAVE_PTHREADS_XOPEN) MDEFINE(PTHREADS_CFLAGS, "") MDEFINE(PTHREADS_LIBS, "") MDEFINE(PTHREADS_XOPEN_CFLAGS, "") MDEFINE(PTHREADS_XOPEN_LIBS, "") # # Lock macros expand to no-ops when compiled !THREADS, which may # result in unused variables in some places. # if [ "${enable_warnings}" = "yes" ]; then C_OPTION(-Wno-unused) fi fi # Enable UTF8 support by default. if [ "${enable_utf8}" != "no" ]; then HDEFINE(UTF8, 1) else HUNDEF(UTF8) fi # Disable astronomical units (constants are too large for some compilers). # TODO test HUNDEF(ASTRONOMICAL_UNITS) # Enable conversion of historical units. HDEFINE(HISTORICAL_UNITS, 1) # Support 8/16/24/32bpp video displays by default. # Disable unused modes to reduce code size and gain some cycles. if [ "${enable_8bpp}" != "no" ]; then HDEFINE(VIEW_8BPP, 1) else HUNDEF(VIEW_8BPP) fi if [ "${enable_16bpp}" != "no" ]; then HDEFINE(VIEW_16BPP, 1) else HUNDEF(VIEW_16BPP) fi if [ "${enable_24bpp}" != "no" ]; then HDEFINE(VIEW_24BPP, 1) else HUNDEF(VIEW_24BPP) fi if [ "${enable_32bpp}" != "no" ]; then HDEFINE(VIEW_32BPP, 1) else HUNDEF(VIEW_32BPP) fi # Enable NLS if requested explicitely. if [ "${enable_nls}" = "yes" ]; then CHECK(gettext) if [ "${HAVE_GETTEXT}" != "yes" ]; then echo "*" echo "* --enable-nls was given but gettext was not found. Try" echo "* running configure again without this option." echo "*" exit 1 fi fi