# Public domain # ex:syn=bsdbuild # # Agar configure script source. # # This is a BSDBuild configure source. The configure script is generated by the # mkconfigure(1) utility of BSDBuild (https://bsdbuild.hypertriton.com/). # package("Agar") version("1.7.1") release("Ancient Egypt") register_section("Libraries to build:") register("--enable-au", "AU: Audio and sound toolkit [no]") register("--enable-gui", "GUI: The Agar GUI library [yes]") register("--enable-map", "MAP: 2D tile engine [no]") register("--enable-math", "MATH: Math library and advanced rendering [yes]") register("--enable-micro", "MA: Micro-Agar GUI library [no]") register("--enable-net", "NET: Network interface library [yes]") register("--enable-sg", "SG: Scene graph and 3D engine [yes]") register("--enable-sk", "SK: Sketch and constraint solver [yes]") register("--enable-vg", "VG: Simple 2D vector graphics [yes]") register_section("Global Agar options:") register("--with-memory-model=(S|M|L)", "Select Agar memory model [auto]") register("--with-float", "Floating-point support [auto]") register("--enable-shared", "Build shared libraries [check]") register("--enable-type-safety", "Run-time type safety checks [no]") register("--enable-debug", "Debug build (implies type-safety) [no]") register("--enable-debug-surfaces", "Trace AG_Surface operations [no]") register("--enable-legacy", "Deprecated interfaces [yes]") register("--enable-threads", "Thread safety [check]") register("--enable-warnings", "Suggested compiler warnings [no]") register("--with-pthreads[=PREFIX]", "POSIX Threads support [check]") register("--with-attributes", "Compiler attributes and annotations [yes]") register("--with-inline", "Inline functions [yes]") register_section("Options specific to CORE library:") register("--enable-ansi-color", "Produce colorized output [yes]") register("--enable-dso", "Dynamically loaded modules [yes]") register("--enable-exec", "The AG_Execute(3) interface [yes]") register("--enable-event-loop", "The standard AG_EventLoop(3) [yes]") register("--enable-namespaces", "Namespaces for object classes [yes]") register("--enable-named-args", "Named AG_Event arguments [yes]") register("--enable-serialization", "File I/O and serialization [yes]") register("--enable-string", "AG_Printf(3) formatting engine [yes]") register("--enable-timers", "The AG_Timer(3) interface [yes]") register("--enable-unicode", "Support for Unicode [yes]") register("--enable-user", "The AG_User(3) interface [yes]") register("--enable-verbosity", "Verbose error messages [yes]") register("--with-db[45][=PREFIX]", "AG_Db: Berkeley DB backend [no]") register("--with-mysql[=PREFIX]", "AG_Db: MySQL backend [no]") register("--with-iconv[=PREFIX]", "Character set conversion [check]") register("--with-inline-byteswap", "Inline endianness swaps [yes]") register("--with-inline-error", "Inline malloc() wrappers [yes]") register("--with-inline-event", "Inline event argument accessors [yes]") register("--with-inline-io", "Inline serialization frontends [yes]") register("--with-inline-object", "Inline some AG_Object calls [yes]") register("--with-inline-string", "Inline some string functions [yes]") register("--with-inline-tbl", "Inline some AG_Tbl functions [yes]") register("--with-inline-threads", "Inline AG_Threads functions [yes]") register("--with-inline-variable", "Inline some AG_Variable calls [yes]") register_section("Options specific to MATH library:") register("--with--fp", "Precision (single|double|quad) [double]") register("--with-altivec[=inline]", "AltiVec-optimized routines [check]") register("--with-sse[=inline]", "SSE-optimized routines [check]") register("--with-sse[234]", "SSE2 SSE3 SSE4 routines [check]") register_section("Options specific to NET library:") register("--enable-web", "HTTP/1.1 application server [no]") register("--with-z[=PREFIX]", "zlib compression library [check]") register_section("Options specific to GUI library:") register("--enable-widgets", "The standard widget library [yes]") register("--enable-wm-hints", "Interface with window managers [yes]") register("--with-freetype[=PREFIX]", "Enable FreeType support [check]") register("--with-fontconfig[=PREFIX]", "Enable Fontconfig support [check]") register("--with-gl[=PREFIX]", "OpenGL rendering support [check]") register("--with-jpeg[=PREFIX]", "Built-in JPEG image support [check]") register("--with-png[=PREFIX]", "Built-in PNG image support [check]") register("--with-x[=PREFIX]", "Build with X windows support [check]") register("--with-xinerama[=PREFIX]", "Build with Xinerama support [check]") register("--with-glx[=PREFIX]", "Enable accelerated X driver [check]") register("--with-sdl[=PREFIX]", "Enable SDL 1.2 driver [check]") register("--with-sdl2[=PREFIX]", "Enable SDL 2.0 driver [check]") register("--with-wgl", "Enable MS Windows driver [check]") register("--with-cocoa", "Enable MacOS X Cocoa driver [check]") register("--with-inline-surface", "Inline pixel access routines [yes]") register("--with-inline-widget", "Inline some AG_Widget functions [yes]") register_section("Options specific to AU library:") register("--with-sndfile[=PREFIX]", "Enable sndfile support [check]") register("--with-portaudio[=PREFIX]", "Enable portaudio driver [check]") register_section("Options specific to SG library:") register("--with-glu[=PREFIX]", "OpenGL Utility Library (GLU) [check]") default_dir(DATADIR, "${PREFIX}/share/agar") default_dir(LOCALEDIR, "${DATADIR}/locale") default_dir(TTFDIR, "${DATADIR}/fonts") default_dir(INCLDIR, "${PREFIX}/include/agar") if [ "${DATADIR}" = "NONE" ]; then hdefine(LOCALEDIR, "NONE") mdefine(LOCALEDIR, "NONE") hdefine(TTFDIR, "NONE") mdefine(TTFDIR, "NONE") fi echo ' _ _ _ ___' echo ' / _ \ / _ \ / _ \ | _ \' echo ' | |_| | | (_| | | |_| | | |_) |' echo ' |_| |_| \__, | |_| |_| |_| |_|' echo ' |___/ ' if [ "${with_memory_model}" = '' ]; then case "${host}" in amd64-* | hppa64-* | ia64-* | mips64-* | ppc64*-* | sh64-* | sparc64-* | x86_64-*) with_memory_model="L" ;; bbc | c64 | c128 | geos | nes) with_memory_model="S" ;; *) with_memory_model="M" ;; esac fi case "${with_memory_model}" in S* | s*) hdefine_unquoted(AG_MODEL, "AG_SMALL") mdefine(MEMORY_MODEL, "SMALL") ;; M* | m*) hdefine_unquoted(AG_MODEL, "AG_MEDIUM") mdefine(MEMORY_MODEL, "MEDIUM") ;; L* | l*) hdefine_unquoted(AG_MODEL, "AG_LARGE") mdefine(MEMORY_MODEL, "LARGE") ;; *) echo "No such memory model: ${with_memory_model} (use: SMALL, MEDIUM or LARGE)" exit 1 esac echo " v$VERSION for $host_machine ($MEMORY_MODEL)" echo "" case "${host}" in gba | gp32 | nds | 3ds) host="arm-none-eabi" PATH="${DEVKITARM}/bin:${PATH}" require(cc) require(devkitpro, 0, ${with_devkitpro}) echo "checking for byte order...little-endian (${host})" mdefine(_MK_BYTE_ORDER, "LE") hdefine(_MK_LITTLE_ENDIAN, "yes") hundef(_MK_BIG_ENDIAN) ;; gamecube | wii | wiiu) host="powerpc-eabi" PATH="${DEVKITPPC}/bin:${PATH}" require(cc) require(devkitpro, 0, ${with_devkitpro}) mdefine(_MK_BYTE_ORDER, "BE") hdefine(_MK_BIG_ENDIAN, "yes") hundef(_MK_LITTLE_ENDIAN) ;; switch) host="aarch64-none-elf" PATH="${DEVKITA64}/bin:${PATH}" require(cc) require(devkitpro, 0, ${with_devkitpro}) CFLAGS="${CFLAGS} -mlittle-endian" mdefine(_MK_BYTE_ORDER, "LE") hdefine(_MK_LITTLE_ENDIAN, "yes") hundef(_MK_BIG_ENDIAN) ;; bbc | c64 | c128 | geos | nes) require(cc) disable(objc) enable_micro="yes" enable_gui="no" enable_sg="no" enable_sk="no" enable_vg="no" enable_shared="no" with_attributes="no" with_float="no" enable_ansi_color="no" enable_dso="no" enable_exec="no" enable_event_loop="no" enable_namespaces="no" enable_named_args="no" enable_net="no" enable_serialization="no" enable_string="no" enable_threads="no" enable_timers="no" enable_type_safety="no" enable_unicode="no" enable_user="no" enable_verbosity="no" enable_math="no" echo "checking for byte order...little-endian (${host})" mdefine(_MK_BYTE_ORDER, "LE") hdefine(_MK_LITTLE_ENDIAN, "yes") hundef(_MK_BIG_ENDIAN) ;; *) require(cc) check(objc) if [ "${HAVE_FLOAT}" = "yes" -a "${with_float}" = "no" ]; then echo "disabling floating-point support" mdefine(HAVE_FLOAT, "no") mdefine(HAVE_LONG_DOUBLE, "no") hundef(HAVE_FLOAT) hundef(HAVE_LONG_DOUBLE) fi if [ "${CROSS_COMPILING}" = "yes" ]; then if [ "${byte_order}" = "" ]; then case "${host}" in armel-* | sh5el-* | earmvel-* | i*86-* | mips*el-* | mipsel-* | powerpcle-* | powerpc64le-* | riscv*-* | vax-* | x86_64-*) byte_order="LE" ;; aarch64_be-* | armeb-* | avr32-* | earmveb-* | hppa*-* | m68k-* | mc68* | mips*eb-* | mipseb-* | openrisc-* | powerpc-* | rs6000-* | sh3eb-* | sparc*-*) byte_order="BE" ;; *) echo "*" echo "* Could not guess the byte order of ${host}." echo "* Please use --byte-order=LE or --byte-order=BE" echo "*" exit 1 ;; esac fi fi check(byte_order) ;; esac # Force a static build if requested. if [ "${enable_shared}" != 'no' ]; then mdefine(LIB_SHARED, "Yes") else mdefine(LIB_SHARED, "No") fi # # Determine available C compiler attributes. We have to assume that the compiler # used to build an Agar application on a given system will have at least the # same attributes available to it as the compiler that was used to build the # Agar library itself. If not, --without-attributes should be used. # if [ "${with_attributes}" != 'no' ]; then check(cc_attributes) else disable(cc_attributes) fi hdefine_if("${with_attributes}" != 'no', AG_USE_ATTRIBUTES) # # Expand inlinables by default. Keep a dlsymmable copy of all # functions available (with names in lowercase form). # if [ "${with_inline}" = 'no' ]; then with_inline_byteswap="no" with_inline_error="no" with_inline_io="no" with_inline_object="no" with_inline_string="no" with_inline_tbl="no" with_inline_threads="no" with_inline_variable="no" with_inline_surface="no" with_inline_widget="no" fi hdefine_if("${with_inline_byteswap}" != "no", AG_INLINE_BYTESWAP) hdefine_if("${with_inline_error}" != "no", AG_INLINE_ERROR) hdefine_if("${with_inline_io}" != "no", AG_INLINE_IO) hdefine_if("${with_inline_object}" != "no", AG_INLINE_OBJECT) hdefine_if("${with_inline_string}" != "no", AG_INLINE_STRING) hdefine_if("${with_inline_tbl}" != "no", AG_INLINE_TBL) hdefine_if("${with_inline_threads}" != "no", AG_INLINE_THREADS) hdefine_if("${with_inline_variable}" != "no", AG_INLINE_VARIABLE) hdefine_if("${with_inline_surface}" != "no", AG_INLINE_SURFACE) hdefine_if("${with_inline_widget}" != "no", AG_INLINE_WIDGET) check(sys_types) check(sys_stat) check(stdlib_h) check(unistd_h) check(limits_h) check(float_h) check(math) check(math_c99) check(fdclose) check(getpwuid) check(getpwnam_r) check(getenv) check(getuid) check(strsep) check(asprintf) check(snprintf) check(vsnprintf) check(vasprintf) check(signal) check(strtoll) check(strtold) check(dlopen) check(dyld) check(shl_load) check(gettimeofday) check(select) check(glob) check(getopt) check(execvp) check(clock_gettime) check(clock_win32) check(nanosleep) check(kqueue) check(timerfd) check(csidl) check(xbox) check(mprotect) check(dirfd) # C compiler options c_define(_AGAR_INTERNAL) c_define(_DEFAULT_SOURCE) c_define(_BSD_SOURCE) c_no_secure_warnings() case "${host}" in *-*-darwin*) c_define(_DARWIN_C_SOURCE) ;; esac if [ "${enable_warnings}" = 'yes' ]; then c_option(-Wall) c_option(-Werror) c_option(-Wmissing-prototypes) c_option(-Wno-switch) case "${host}" in *-*-darwin*) c_option(-Wno-deprecated-declarations) ;; esac fi if [ "${enable_debug}" = 'yes' ]; then hdefine(AG_DEBUG, "yes") hdefine(AG_TYPE_SAFETY, "yes") mdefine(CFLAGS, "${CFLAGS} -g") else hundef(AG_DEBUG) hdefine_if("${enable_type_safety}" = 'yes', AG_TYPE_SAFETY) fi if [ "${enable_debug_surfaces}" = 'yes' ]; then mdefine(CFLAGS, "${CFLAGS} -DDEBUG_SURFACES") fi hdefine_if("${enable_ansi_color}" != 'no', AG_ANSI_COLOR) hdefine_if("${enable_dso}" != 'no', AG_ENABLE_DSO) hdefine_if("${enable_event_loop}" != 'no', AG_EVENT_LOOP) hdefine_if("${enable_exec}" != 'no', AG_ENABLE_EXEC) hdefine_if("${enable_legacy}" != 'no', AG_LEGACY) hdefine_if("${enable_named_args}" != 'no', AG_NAMED_ARGS) hdefine_if("${enable_namespaces}" != 'no', AG_NAMESPACES) hdefine_if("${enable_serialization}" != 'no', AG_SERIALIZATION) hdefine_if("${enable_string}" != 'no', AG_ENABLE_STRING) hdefine_if("${enable_timers}" != 'no', AG_TIMERS) hdefine_if("${enable_unicode}" != 'no', AG_UNICODE) hdefine_if("${enable_user}" != 'no', AG_USER) hdefine_if("${enable_verbosity}" != 'no', AG_VERBOSITY) hdefine_if("${enable_widgets}" != 'no', AG_WIDGETS) hdefine_if("${enable_wm_hints}" != 'no', AG_WM_HINTS) # # Options specific to the Agar-GUI library. # if [ "${enable_gui}" != 'no' ]; then hdefine(ENABLE_GUI, "yes") mdefine(ENABLE_GUI_LIBS, "-L../gui -lag_gui") mdefine(SUBDIR_gui, "gui") # Enable SDL2 support if SDL2 is found. if [ "${with_sdl2}" != 'no' ]; then check(sdl2, 2.0.0, ${prefix_sdl2}) if [ "${HAVE_SDL2}" != 'yes' ]; then if [ "${with_sdl2}" = 'yes' ]; then echo "*" echo "* --with-sdl2 was requested, but SDL 2.0 " echo "* library was not found." echo "*" exit 1 fi disable(sdl2) fi else disable(sdl2) fi # Fallback on SDL 1.2 if found. Mutually exclusive with SDL2. if [ "${HAVE_SDL2}" != "yes" -a "${with_sdl}" != 'no' ]; then check(sdl, 1.2.0, ${prefix_sdl}) if [ "${HAVE_SDL}" != 'yes' ]; then if [ "${with_sdl}" = 'yes' ]; then echo "*" echo "* --with-sdl was requested, but SDL 1.2 " echo "* library was not found." echo "*" exit 1 fi disable(sdl) fi else disable(sdl) fi # Enable OpenGL support if an OpenGL library is found. if [ "${with_gl}" != 'no' ]; then check(opengl, 0, ${prefix_gl}) 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." echo "*" exit 1 fi disable(opengl) fi else disable(opengl) fi # Enable X Windows support if Xlib is found. if [ "${with_x}" != 'no' ]; then check(x11, 0, ${prefix_x}) if [ "${HAVE_X11}" != 'yes' ]; then if [ "${with_x}" = 'yes' ]; then echo "*" echo "* --with-x was requested, but Xlib " echo "* was not found." echo "*" exit 1 else disable(x11) fi fi if [ "${with_xinerama}" != 'no' ]; then check(xinerama, 0, ${prefix_xinerama}) if [ "${HAVE_XINERAMA}" != 'yes' ]; then if [ "${with_xinerama}" = 'yes' ]; then echo "*" echo "* --with-xinerama was requested, but the " echo "* Xinerama extension was not found." echo "*" exit 1 fi disable(xinerama) fi else disable(xinerama) fi else disable(x11) disable(xinerama) fi # Enable MacOS X / Cocoa support if Cocoa is found. if [ "${with_cocoa}" != 'no' ]; then check(cocoa, 0) if [ "${HAVE_COCOA}" != 'yes' ]; then if [ "${with_cocoa}" = 'yes' ]; then echo "*" echo "* --with-cocoa was requested, but the " echo "* Cocoa framework was not found." echo "*" exit 1 fi disable(cocoa) fi else disable(cocoa) fi # # Platform-specific OpenGL APIs # if [ "${HAVE_OPENGL}" = 'yes' ]; then # Enable GLX support if the GLX library is found. if [ "${with_glx}" != 'no' ]; then check(glx, 1.4, ${prefix_glx}) if [ "${HAVE_GLX}" != 'yes' ]; then if [ "${with_glx}" = 'yes' ]; then echo "*" echo "* --with-glx was requested, but no" echo "* compatible GLX library was found." echo "*" exit 1 fi disable(glx) fi else disable(glx) fi # Enable WGL support on Windows. if [ "${with_wgl}" != 'no' ]; then check(wgl, 0) if [ "${HAVE_WGL}" != 'yes' ]; then if [ "${with_wgl}" = 'yes' ]; then echo "*" echo "* --with-wgl was requested, but the" echo "* WGL test has failed." echo "*" exit 1 fi disable(wgl) fi else disable(wgl) fi else disable(glx) disable(wgl) fi # 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, ${prefix_freetype}) if [ "${HAVE_FREETYPE}" != 'yes' ]; then echo "*" echo "* The FreeType library was not found, aborting!" 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" echo "* monospace bitmap font engine (not recommended)," echo "* please use: ./configure --without-freetype" echo "*" exit 1 fi else disable(freetype) fi # Use fontconfig if available. if [ "${with_fontconfig}" != 'no' ]; then check(fontconfig, 2.6.0, ${prefix_fontconfig}) else disable(fontconfig) fi # Enable JPEG format support if libjpeg is found. if [ "${with_jpeg}" != 'no' ]; then check(jpeg, 0, ${prefix_jpeg}) if [ "${HAVE_JPEG}" != 'yes' ]; then if [ "${with_jpeg}" = 'yes' ]; then echo "*" echo "* --with-jpeg was requested, but libjpeg" echo "* was not found." echo "*" exit 1 fi disable(jpeg) fi else disable(jpeg) fi # Enable PNG format support if libpng is found. if [ "${with_png}" != 'no' ]; then check(png, 1.2.49, ${prefix_png}) if [ "${HAVE_PNG}" != 'yes' ]; then if [ "${with_png}" = 'yes' ]; then echo "*" echo "* --with-png was requested, but libpng" echo "* was not found." echo "*" exit 1 fi disable(png) fi else disable(png) fi else hundef(ENABLE_GUI) mdefine(ENABLE_GUI_LIBS, "") mdefine(SUBDIR_gui, "") disable(sdl) disable(sdl2) disable(x11) disable(xinerama) disable(cocoa) disable(opengl) disable(glx) disable(wgl) disable(freetype) disable(fontconfig) disable(jpeg) disable(png) fi if [ "${enable_micro}" = 'yes' ]; then hdefine(ENABLE_MICRO, "yes") mdefine(ENABLE_MICRO_LIBS, "-L../micro -lag_micro_gui") mdefine(SUBDIR_micro, "micro") else hundef(ENABLE_MICRO) mdefine(ENABLE_MICRO_LIBS, "") mdefine(SUBDIR_micro, "") fi # Enable the network library (ag_net). if [ "${enable_net}" != 'no' ]; then mdefine(SUBDIR_net, "net") check(getaddrinfo) check(siocgifconf) check(sockopts) check(winsock) mdefine(HAVE_NETWORK, "yes") hdefine(AG_NETWORK, "yes") else mdefine(SUBDIR_net, "") disable(getaddrinfo) disable(siocgifconf) disable(sockopts) disable(winsock) mdefine(HAVE_NETWORK, "no") hundef(AG_NETWORK) fi # Build HTTP application server support into the ag_net library. if [ "${enable_web}" = 'yes' ]; then check(zlib, 0, ${prefix_z}) check_header(sys/uio.h) check_header(sys/param.h) mdefine(HAVE_WEB, "yes") hdefine(AG_WEB, "yes") else disable(zlib); hundef(HAVE_SYS_UIO_H) hundef(HAVE_SYS_PARAM_H) mdefine(HAVE_WEB, "no") hundef(AG_WEB) fi # Enable Berkeley DB module for AG_Db if requested if [ "${with_db4}" = 'yes' ]; then check(db4, 0, ${prefix_db4}) if [ "${HAVE_DB4}" != 'yes' ]; then if [ "${with_db4}" = 'yes' ]; then echo "*" echo "* --with-db4 requested and DB4 was not found" echo "*" exit 1 else disable(db4) fi fi else disable(db4) fi # Enable MySQL module for AG_Db if requested. if [ "${with_mysql}" = 'yes' ]; then check(mysql, 5.5.8, ${prefix_mysql}) if [ "${HAVE_MYSQL}" != 'yes' ]; then if [ "${with_mysql}" = 'yes' ]; then echo "*" echo "* --with-mysql was requested, but libmysqlclient" echo "* was not found." echo "*" exit 1 fi disable(mysql) fi else disable(mysql) fi # Enable threads support if POSIX threads are available. if [ "${enable_threads}" != 'no' ]; then check(pthreads, 0, ${prefix_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 seems to lack support" echo "* for recursive mutexes." echo "*" exit 1 fi hundef(AG_THREADS) fi fi fi hdefine(AG_THREADS, "yes") else if [ "${enable_threads}" = 'yes' ]; then echo "*" echo "* --enable-threads was given, but no pthreads" echo "* library was found on your system." echo "*" exit 1 fi hundef(AG_THREADS) fi else disable(pthreads) hundef(AG_THREADS) if [ "${enable_warnings}" = 'yes' ]; then # # Lock macros expand to no-ops when compiled !AG_THREADS, # which may result in unused variables. # c_option(-Wno-unused) fi fi # Enable NLS if requested explicitely. if [ "${enable_nls}" = 'yes' ]; then check(iconv, 0, ${prefix_iconv}) check(gettext, 0, ${prefix_gettext}) if [ "${HAVE_GETTEXT}" != 'yes' ]; then echo "*" echo "* --enable-nls was given but gettext was not found." echo "*" exit 1 fi else disable(iconv) disable(gettext) fi # # Options specific to the Agar-Math library # if [ "${enable_math}" != 'no' ]; then hdefine(ENABLE_MATH, "yes") mdefine(SUBDIR_math, "math") else hundef(ENABLE_MATH) mdefine(SUBDIR_math, "") fi # # MATH: Enable AltiVec optimizations if compiler supports AltiVec. # if [ "${with_altivec}" != 'no' ]; then check(altivec) if [ "${HAVE_ALTIVEC}" != 'yes' ]; then if [ "${with_altivec}" = 'yes' -o "${with_altivec}" = 'inline' ]; then echo "*" echo "* --with-altivec was requested, but " echo "* AltiVec is not supported by compiler" echo "*" exit 1 else disable(altivec) hundef(INLINE_ALTIVEC) fi else hdefine_if("${with_altivec}" = 'inline', INLINE_ALTIVEC) fi else disable(altivec) hundef(INLINE_ALTIVEC) fi # # MATH: Enable SSE optimizations if compiler supports intrinsics. A CPU check # is done, so that enabling SSE will not break the build on non-SSE machines # (unless --with-sse=inline is used, in which case ag_math will require SSE). # if [ "${with_sse}" != 'no' ]; then check(sse) if [ "${HAVE_SSE}" != 'yes' ]; then if [ "${with_sse}" = 'yes' -o "${with_sse}" = 'inline' ]; then echo "*" echo "* --with-sse was requested, but SSE " echo "* intrinsics not supported by compiler" echo "*" exit 1 fi disable(sse) else hdefine_if("${with_sse}" = 'inline', INLINE_SSE) hundef_if("${with_sse2}" = 'no', HAVE_SSE2) hundef_if("${with_sse3}" = 'no', HAVE_SSE3) fi else disable(sse) fi # # MATH: Select single, double or quad precision for the M_Real type. # if [ "${with_single_fp}" = 'yes' ]; then if [ "${HAVE_MATH_C99}" != 'yes' ]; then echo "*" echo "* --with-single-fp was requested, but your compiler does" echo "* not support the C99 math routines (sinf(), etc)." echo "*" exit 1 fi hdefine(SINGLE_PRECISION, "yes") else hundef(SINGLE_PRECISION) fi hdefine_if("${with_double_fp}" != 'no', DOUBLE_PRECISION) if [ "${with_quad_fp}" = 'yes' ]; then if [ "${HAVE_LONG_DOUBLE}" != 'yes' ]; then echo "*" echo "* --with-quad-fp was requested, but your compiler" echo "* does not support the C99 long double type." echo "*" exit 1 fi if [ "${HAVE_MATH_C99}" != 'yes' ]; then echo "*" echo "* --with-quad-fp was requested, but the C99 math" echo "* routines (sinl(), etc.) are not available." echo "*" exit 1 fi hdefine(QUAD_PRECISION, "yes") else hundef(QUAD_PRECISION) fi # # VG: Enable the VG library (needs GUI). # if [ "${enable_vg}" != 'no' -a "${enable_gui}" != 'no' ]; then hdefine(ENABLE_VG, "yes") mdefine(SUBDIR_vg, "vg") else hundef(ENABLE_VG) mdefine(SUBDIR_vg, "") fi # # AU: Enable the AU library (needs GUI). # if [ "${enable_au}" = 'yes' -a "${enable_gui}" != 'no' ]; then hdefine(ENABLE_AU, "yes") mdefine(SUBDIR_au, "au") check(sndfile, 1.0.21, ${prefix_sndfile}) check(portaudio, 19.0, ${prefix_portaudio}) else hundef(ENABLE_AU) mdefine(SUBDIR_au, "") disable(sndfile) disable(portaudio) fi # # MAP: Enable the MAP library (needs GUI). # if [ "${enable_map}" = 'yes' -a "${enable_gui}" != 'no' ]; then hdefine(ENABLE_MAP, "yes") mdefine(SUBDIR_map, "map") else hundef(ENABLE_MAP) mdefine(SUBDIR_map, "") fi # # SG: Enable the SG library (needs MATH, GUI). # if [ "${enable_sg}" != 'no' -a "${enable_gui}" != 'no' \ -a "${enable_math}" != 'no' -a "${HAVE_OPENGL}" = 'yes' ]; then hdefine(ENABLE_SG, "yes") mdefine(SUBDIR_sg, "sg") # Enable GLU if found (used by the SG_Image(3) object class). if [ "${with_glu}" != 'no' ]; then check(glu, 0, ${prefix_glu}) if [ "${HAVE_GLU}" = 'yes' ]; then mdefine(SDL_CFLAGS, "$SDL_CFLAGS $GLU_CFLAGS") else if [ "${with_glu}" = 'yes' ]; then echo "*" echo "* --with-glu was requested, but no GLU" echo "* library was found." echo "*" exit 1 fi disable(glu) fi else disable(glu) fi else hundef(ENABLE_SG) mdefine(SUBDIR_sg, "") disable(glu) fi # # SK: Enable the SK library (needs MATH, GUI). # if [ "${enable_sk}" != 'no' -a "${enable_gui}" != 'no' \ -a "${enable_math}" != 'no' -a "${HAVE_OPENGL}" = 'yes' ]; then hdefine(ENABLE_SK, "yes") mdefine(SUBDIR_sk, "sk") else hundef(ENABLE_SK) mdefine(SUBDIR_sk, "") fi # # CORE: Conditionally compiled sources in Agar-Core. # mdefine(SRCS_CORE, "") if [ "${HAVE_SNPRINTF}" != 'yes' ]; then mappend(SRCS_CORE, "snprintf.c") fi if [ "${HAVE_CLOCK_WIN32}" = 'yes' ]; then mappend(SRCS_CORE, "time_win32.c") fi if [ "${HAVE_CLOCK_GETTIME}" = 'yes' ]; then if [ "${HAVE_NANOSLEEP}" = 'yes' ]; then mappend(SRCS_CORE, "time_posix.c") fi if [ "${HAVE_PTHREADS}" = 'yes' ]; then mappend(SRCS_CORE, "time_renderer.c") fi fi if [ "${HAVE_GETTIMEOFDAY}" = 'yes' ]; then if [ "${HAVE_SELECT}" = 'yes' ]; then mappend(SRCS_CORE, "time_gettimeofday.c") fi fi if [ "${HAVE_DB4}" = 'yes' ]; then mappend(SRCS_CORE, "db_bdb.c") fi if [ "${HAVE_MYSQL}" = 'yes' ]; then mappend(SRCS_CORE, "db_mysql.c") fi if [ "${HAVE_GETPWUID}" = 'yes' ]; then mappend(SRCS_CORE, "user_posix.c") fi if [ "${HAVE_XBOX}" = 'yes' ]; then mappend(SRCS_CORE, "user_xbox.c xbox.c") fi if [ "${HAVE_CSIDL}" = 'yes' ]; then mappend(SRCS_CORE, "user_win32.c") fi # # NET: Conditionally compiled sources in Agar-Net. # if [ "${HAVE_NETWORK}" = 'yes' ]; then if [ "${HAVE_WINSOCK1}" = 'yes' ]; then mappend(SRCS_NET, "net_winsock1.c") fi if [ "${HAVE_WINSOCK2}" = 'yes' ]; then mappend(SRCS_NET, "net_winsock2.c") fi if [ "${HAVE_GETADDRINFO}" = 'yes' ]; then mappend(SRCS_NET, "net_bsd.c") fi if [ "${HAVE_WEB}" = 'yes' ]; then mappend(SRCS_NET, "web.c web_auth.c web_var.c") fi fi # # GUI: Conditionally compiled sources in Agar-GUI. # mdefine(SRCS_GUI, "") if [ "${HAVE_FREETYPE}" = 'yes' ]; then mappend(SRCS_GUI, "font_ft.c") fi if [ "${HAVE_SDL}" = 'yes' ]; then mappend(SRCS_GUI, "drv_sdl_common.c drv_sdlfb.c") if [ "${HAVE_OPENGL}" = 'yes' ]; then mappend(SRCS_GUI, "drv_sdlgl.c") fi fi if [ "${HAVE_SDL2}" = 'yes' ]; then mappend(SRCS_GUI, "drv_sdl2_common.c drv_sdl_keysyms.c drv_sdl2fb.c") if [ "${HAVE_OPENGL}" = 'yes' ]; then mappend(SRCS_GUI, "drv_sdl2gl.c drv_sdl2mw.c") fi fi if [ "${HAVE_OPENGL}" = 'yes' ]; then mappend(SRCS_GUI, "drv_gl_common.c") if [ "${HAVE_GLX}" = 'yes' ]; then mappend(SRCS_GUI, "drv_glx.c") fi if [ "${HAVE_WGL}" = 'yes' ]; then mappend(SRCS_GUI, "drv_wgl.c") fi fi if [ "${HAVE_COCOA}" = 'yes' ]; then mappend(SRCS_GUI, "drv_cocoa.m") fi # # AU: Conditionally compiled sources in Agar-AU. # mdefine(SRCS_AU, "") if [ "${AG_THREADS}" = 'yes' ]; then if [ "${HAVE_SNDFILE}" = 'yes' ]; then mappend(SRCS_AU, "au_dev_file.c") fi if [ "${HAVE_PORTAUDIO}" = 'yes' ]; then mappend(SRCS_AU, "au_dev_pa.c") fi fi # Set up configure script output c_incprep($BLD/include/agar) c_incdir($BLD/include) c_incdir_config($BLD/include/agar/config) # # "agar-config" script and pc(5) module generation: # config_script(agar-core-config,\ "-I${INCLDIR} ${GETTEXT_CFLAGS} ${DSO_CFLAGS} \ ${CLOCK_CFLAGS} ${ICONV_CFLAGS}",\ "-L${LIBDIR} -lag_core ${MATH_LIBS} ${PTHREADS_LIBS} \ ${DB4_LIBS} ${MYSQL_LIBS} ${GETTEXT_LIBS} ${DSO_LIBS} \ ${CLOCK_LIBS} ${ICONV_LIBS}") pkgconfig_mod(agar-core, "Agar object system and utility library", "", "", \ "-I\${includedir}/agar ${PTHREADS_XOPEN_CFLAGS} ${ALTIVEC_CHECK_CFLAGS} \ ${GETTEXT_CFLAGS} ${DSO_CFLAGS} ${DB4_CFLAGS} \ ${MYSQL_CFLAGS} ${CLOCK_CFLAGS}", \ "-L\${libdir} -lag_core", \ "-lag_core ${PTHREADS_XOPEN_LIBS} ${GETTEXT_LIBS} ${DSO_LIBS} \ ${DB4_LIBS} ${MYSQL_LIBS} ${CLOCK_LIBS} ${WINSOCK1_LIBS} \ ${WINSOCK2_LIBS}") if [ "${enable_gui}" != 'no' ]; then config_script(agar-config,\ "-I${INCLDIR} ${SDL_CFLAGS} ${SDL2_CFLAGS} ${FREETYPE_CFLAGS} \ ${FONTCONFIG_CFLAGS} ${OPENGL_CFLAGS} ${X11_CFLAGS} ${GLX_CFLAGS} \ ${XINERAMA_CFLAGS} ${COCOA_CFLAGS} ${MATH_CFLAGS} ${PNG_CFLAGS} \ ${PTHREADS_CFLAGS} ${DB4_CFLAGS} ${MYSQL_CFLAGS} \ ${GETTEXT_CFLAGS} ${DSO_CFLAGS} ${CLOCK_CFLAGS} \ ${UIM_CFLAGS} ${ICONV_CFLAGS}",\ "-L${LIBDIR} -lag_gui -lag_core ${SDL_LIBS} ${SDL2_LIBS} \ ${FREETYPE_LIBS} ${FONTCONFIG_LIBS} ${OPENGL_LIBS} ${X11_LIBS} \ ${XINERAMA_LIBS} ${COCOA_LIBS} ${MATH_LIBS} ${JPEG_LIBS} \ ${PNG_LIBS} ${PTHREADS_LIBS} ${DB4_LIBS} ${MYSQL_LIBS} \ ${GETTEXT_LIBS} ${DSO_LIBS} ${CLOCK_LIBS} \ ${UIM_LIBS} ${ICONV_LIBS}") pkgconfig_mod(agar, "Agar cross-platform GUI toolkit", \ "${X11_PC} ${SDL_PC} ${SDL2_PC} ${FREETYPE_PC} ${FONTCONFIG_PC} \ ${OPENGL_PC} ${XINERAMA_PC} ${JPEG_PC} ${PNG_PC} ${UIM_PC}", \ "", \ "-I\${includedir}/agar ${COCOA_CFLAGS} ${MATH_CFLAGS} \ ${PTHREADS_CFLAGS} ${DB4_CFLAGS} ${MYSQL_CFLAGS} \ ${GETTEXT_CFLAGS} ${DSO_CFLAGS} ${CLOCK_CFLAGS}", \ "-L\${libdir} -lag_gui -lag_core", \ "-lag_gui -lag_core ${COCOA_LIBS} ${MATH_LIBS} ${PTHREADS_LIBS} \ ${DB4_LIBS} ${MYSQL_LIBS} ${GETTEXT_LIBS} ${DSO_LIBS} \ ${CLOCK_LIBS} ${ICONV_LIBS}") fi if [ "${enable_micro}" = 'yes' ]; then config_script(agar-micro-config,"-I${INCLDIR}",\ "-L${LIBDIR} -lag_micro_gui -lag_core") fi if [ "${enable_au}" = 'yes' ]; then config_script(agar-au-config,\ "-I${INCLDIR} ${PORTAUDIO_CFLAGS} ${SNDFILE_CFLAGS}",\ "-L${LIBDIR} -lag_au ${PORTAUDIO_LIBS} ${SNDFILE_LIBS}") pkgconfig_mod(agar-au, "Agar audio library", \ "agar ${PORTAUDIO_PC} ${SNDFILE_PC}", "", \ "-I\${includedir}/agar", \ "-L\${libdir} -lag_au", \ "-lag_au ${PORTAUDIO_LIBS} ${SNDFILE_LIBS}") fi if [ "${enable_map}" = 'yes' -a "${enable_gui}" != 'no' ]; then config_script(agar-map-config,"-I${INCLDIR}","-L${LIBDIR} -lag_map") pkgconfig_mod(agar-map, "Agar 2D tile engine", \ "agar-rg agar-math agar", "", \ "-I\${includedir}/agar ${OPENGL_CFLAGS}", \ "-L\${libdir} -lag_map", \ "-lag_map ${OPENGL_LIBS}") fi if [ "${enable_math}" != 'no' ]; then config_script(agar-math-config,\ "-I${INCLDIR} ${MATH_CFLAGS} ${ALTIVEC_CFLAGS} \ ${SSE_CFLAGS} ${SSE2_CFLAGS} ${SSE3_CFLAGS} ${MATH_CFLAGS}", \ "-L${LIBDIR} -lag_math ${MATH_LIBS}") if [ "${enable_gui}" != 'no' ]; then AGAR_MATH_REQUIRES="agar" else AGAR_MATH_REQUIRES="agar-core" fi pkgconfig_mod(agar-math, "Agar math library", "${AGAR_MATH_REQUIRES}",\ "", \ "-I\${includedir}/agar ${ALTIVEC_CFLAGS} ${SSE_CFLAGS} ${SSE2_CFLAGS} \ ${SSE3_CFLAGS} ${MATH_CFLAGS}", \ "-L\${libdir} -lag_math", \ "-lag_math ${MATH_LIBS}") fi if [ "${enable_net}" != 'no' ]; then config_script(agar-net-config,\ "-I${INCLDIR} ${ZLIB_CFLAGS}",\ "-L${LIBDIR} -lag_net ${ZLIB_LIBS}") pkgconfig_mod(agar-net, "Agar network interface", "", "", \ "-I\${includedir}/agar ${ZLIB_CFLAGS}", \ "-L\${libdir} -lag_core", \ "-lag_net ${WINSOCK1_LIBS} ${WINSOCK2_LIBS} ${ZLIB_LIBS}") fi if [ "${enable_sg}" != 'no' ]; then config_script(agar-sg-config,\ "-I${INCLDIR} ${AGAR_MATH_CFLAGS} ${GLU_CFLAGS}",\ "-L${LIBDIR} -lag_sg ${AGAR_MATH_LIBS} ${GLU_LIBS}") pkgconfig_mod(agar-sg, "Agar 3D scene graph library", \ "agar-math agar", "", \ "-I\${includedir}/agar ${GLU_CFLAGS}", \ "-L\${libdir} -lag_sg", \ "-lag_sg ${AGAR_MATH_LIBS} ${GLU_LIBS}") fi if [ "${enable_sk}" != 'no' ]; then config_script(agar-sk-config,\ "-I${INCLDIR} ${AGAR_MATH_CFLAGS}",\ "-L${LIBDIR} -lag_sk ${AGAR_MATH_LIBS}") pkgconfig_mod(agar-sk, "Agar sketch engine library", \ "agar-math agar", "", \ "-I\${includedir}/agar", \ "-L\${libdir} -lag_sk", \ "-lag_sk ${AGAR_MATH_LIBS}") fi if [ "${enable_vg}" != 'no' ]; then config_script(agar-vg-config, "-I${INCLDIR}", "-L${LIBDIR} -lag_vg") pkgconfig_mod(agar-vg, "Agar vector graphics library", "agar", "", \ "-I\${includedir}/agar ${MATH_CFLAGS}", \ "-L\${libdir} -lag_vg", \ "-lag_vg ${MATH_LIBS}") fi # # Get the SVN revision number (or 0) # #(cd ${SRCDIR} && \ # ${SH} mk/gen-revision.sh "${SRCDIR}" AGAR_REVISION > $bb_incdir/revision.h)