# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT("xbmc", 2.1, bugs@xboxmediacenter.com) AC_CONFIG_HEADER([config.h]) AC_CANONICAL_HOST AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [enable debugging information (default is yes)])], [use_debug=$enableval], [use_debug=yes]) AC_ARG_ENABLE([gl], [AS_HELP_STRING([--enable-gl], [enable OpenGL rendering (default is yes)])], [use_gl=$enableval], [use_gl=yes]) AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [enable gprof profiling (default is no)])], [use_profiling=$enableval], [use_profiling=no]) AC_ARG_ENABLE([joystick], [AS_HELP_STRING([--enable-joystick], [enable SDL joystick support (default is yes)])], [use_joystick=$enableval], [use_joystick=yes]) AC_ARG_ENABLE([xrandr], [AS_HELP_STRING([--enable-xrandr], [enable XRandR support (default is yes)])], [use_xrandr=$enableval], [use_xrandr=yes]) AC_ARG_ENABLE([mms], [AS_HELP_STRING([--enable-mms], [enable libmms support (default is yes)])], [use_mms=$enableval], [use_mms=yes]) AC_ARG_ENABLE([pcre], [AS_HELP_STRING([--enable-pcre], [enable PCRE based regular expression support (default is yes)])], [use_pcre=$enableval], [use_pcre=yes]) AC_ARG_ENABLE([halmount], [AS_HELP_STRING([--enable-halmount], [enable automounting feature (default is no)])], [use_halmount=$enableval], [use_halmount=no]) AC_PATH_PROG(CCACHE,ccache,none) AC_ARG_ENABLE([ccache], [AS_HELP_STRING([--enable-ccache], [enable building with ccache feature (default is yes if ccache is installed)])], [use_ccache=$enableval], [use_ccache=yes]) # Checks for programs. AC_PROG_AWK AC_PROG_CXX AC_PROG_CC AC_PROG_LN_S AC_PROG_MAKE_SET if test "$host_vendor" = "apple" ; then AC_SUBST(CFLAGS, "-L/System/Library/Frameworks/OpenGL.framework/Libraries -L/opt/local/lib -L/opt/local/lib/mysql5/mysql -I/opt/local/include") AC_SUBST(CXXFLAGS, "-L/System/Library/Frameworks/OpenGL.framework/Libraries -L/opt/local/lib -L/opt/local/lib/mysql5/mysql -I/opt/local/include") AC_SUBST(LDFLAGS, "-L/System/Library/Frameworks/OpenGL.framework/Libraries -L/opt/local/lib -L/opt/local/lib/mysql5/mysql") AC_SUBST(INCLUDES, "-I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/mysql5 -I../xbmc -I../xbmc/lib -I../xbmc/osx -Ixbmc/lib -Ixbmc/osx -Ilib/libffmpeg-OSX/libavutil -I../xbmc/lib/libffmpeg-OSX -Ilib -Iosx -I.") fi # Checks for libraries. if test "$use_gl" = "yes"; then AC_CHECK_LIB([GL], [main],, AC_MSG_ERROR(libGL is required. Please see README.linux)) AC_CHECK_LIB([GLEW], [main],, AC_MSG_ERROR(libGLEW is required. Please see README.linux)) AC_CHECK_LIB([GLU], [main],, AC_MSG_ERROR(libGLU is required. Please see README.linux)) fi if test "$host_vendor" != "apple"; then AC_CHECK_LIB([Xinerama], [main],, AC_MSG_ERROR(libXinerama is required. Please see README.linux)) fi AC_CHECK_LIB([mad], [main],, AC_MSG_ERROR(libmad is required. Please see README.linux)) if test "$host_vendor" != "apple"; then AC_CHECK_LIB([tre], [main],, AC_MSG_ERROR(libtre is required. Please see README.linux)) fi AC_CHECK_LIB([ogg], [main],, AC_MSG_ERROR(libogg is required. Please see README.linux)) AC_CHECK_LIB([vorbis], [main],, AC_MSG_ERROR(libvorbis is required. Please see README.linux)) AC_CHECK_LIB([SDL], [main]) if test "$use_gl" = "no"; then AC_MSG_RESULT(== WARNING: OpenGL support is disabled. XBMC will run VERY slow. ==) AC_CHECK_LIB([SDL_gfx], [main]) fi AC_CHECK_LIB([SDL_image], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) AC_CHECK_LIB([SDL_mixer], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) AC_CHECK_LIB([dl], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) ) AC_CHECK_LIB([freetype], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) AC_CHECK_LIB([fontconfig], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) AC_CHECK_LIB([fribidi], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) #AC_CHECK_LIB([lzo], [main],, AC_MSG_ERROR(== Could not find liblzo)) AC_CHECK_LIB([lzo2], [main],, AC_CHECK_LIB([lzo], [main],, AC_MSG_ERROR(== Could not find either liblzo or liblzo2 - one of these must be present)) ) AC_CHECK_LIB([sqlite3], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux)) AC_CHECK_LIB([asound], [main]) # check for asound library, fedora AC_CHECK_LIB([rt], [clock_gettime]) # check for rt library, required for clock_gettime AC_CHECK_LIB([resolv], [main]) # check for resolv library AC_CHECK_LIB([png12], [main]) # check for cximage library AC_CHECK_LIB([jasper], [main]) # check for cximage library AC_CHECK_LIB([jpeg], [main]) # check for cximage library if test "$host_vendor" != "apple" ; then if test "$use_xrandr" = "yes" ; then AC_CHECK_LIB([Xrandr], [main],, use_xrandr="no";AC_MSG_RESULT(== Could not find libXRandR. SDL will be used for resolution support. ==)) else AC_MSG_RESULT(== XRandR support disabled. SDL will be used for resolution support. ==) fi fi if test "$use_mms" = "yes"; then AC_CHECK_LIB([mms], [main],AC_CHECK_LIB([mms], [mms_seek],,use_mms="no";AC_MSG_RESULT(== Your libmms doesn't have mms_seek. MMS support disabled ==)), use_mms="no";AC_MSG_RESULT(== Could not find libmms. MMS support disabled. ==)) else AC_MSG_RESULT(== MMS support disabled. ==) fi if test "$use_pcre" = "yes"; then AC_CHECK_LIB([pcre], [main],, use_pcre="no";AC_MSG_RESULT(== Could not find libpcre. PCRE support disabled. ==)) else AC_MSG_RESULT(== PCRE support disabled. ==) fi if test "$host_vendor" != "apple" ; then AC_CHECK_LIB([hal], [main],LZO_INCLUDES="$LZO_INCLUDES -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/hal" , AC_MSG_ERROR(== Could not find a required library. Please see README.linux) ) AC_CHECK_LIB([dbus-1], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) ) AC_CHECK_LIB([hal-storage], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) ) fi # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/time.h sys/timeb.h sys/vfs.h termios.h unistd.h utime.h wchar.h wctype.h]) AC_CHECK_HEADERS([lzo/lzo1.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STAT AC_HEADER_STDBOOL AC_C_CONST AC_TYPE_UID_T AC_C_INLINE AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_INT8_T AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_PID_T AC_C_RESTRICT AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_CHECK_MEMBERS([struct stat.st_rdev]) AC_HEADER_TIME AC_STRUCT_TM AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_ALLOCA AC_FUNC_CHOWN AC_FUNC_CLOSEDIR_VOID AC_FUNC_ERROR_AT_LINE AC_FUNC_FSEEKO AC_PROG_GCC_TRADITIONAL AC_FUNC_LSTAT AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MEMCMP AC_FUNC_MKTIME AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AC_FUNC_SETVBUF_REVERSED AC_TYPE_SIGNAL AC_FUNC_STAT AC_FUNC_STRCOLL AC_FUNC_STRFTIME AC_FUNC_STRTOD AC_FUNC_UTIME_NULL AC_FUNC_VPRINTF AC_CHECK_FUNCS([atexit dup2 fdatasync floor fs_stat_dev ftime ftruncate getcwd gethostbyaddr gethostbyname gethostname getpagesize getpass gettimeofday inet_ntoa lchown localeconv memchr memmove memset mkdir modf munmap pow rmdir select setenv setlocale socket sqrt strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul sysinfo tzset utime]) dashes="------------------------" final_message="\n XBMC Configuration:" final_message="\n$dashes$final_message\n$dashes" if test "$use_debug" = "yes"; then final_message="$final_message\n Debugging:\tYes" if test "$use_profiling" = "yes"; then final_message="$final_message\n Profiling:\tYes" DEBUG_FLAGS="-g -pg -D_DEBUG -Wall" else final_message="$final_message\n Profiling:\tNo" DEBUG_FLAGS="-g -D_DEBUG -Wall" fi else final_message="$final_message\n Debugging:\tNo" if test "$use_profiling" = "yes"; then final_message="$final_message\n Profiling:\tYes" DEBUG_FLAGS="-pg -O2" else final_message="$final_message\n Profiling:\tNo" DEBUG_FLAGS="-O2" fi fi if test "$use_gl" = "yes"; then final_message="$final_message\n OpenGL:\tYes" SDL_DEFINES="" else final_message="$final_message\n OpenGL:\tNo (Very Slow)" SDL_DEFINES="-DHAS_SDL_2D" fi if test "$use_joystick" = "yes"; then final_message="$final_message\n Joystick:\tYes" SDL_DEFINES="$SDL_DEFINES -DHAS_SDL_JOYSTICK" else final_message="$final_message\n Joystick:\tNo" fi if test "$use_xrandr" = "yes"; then final_message="$final_message\n XRandR:\tYes" SDL_DEFINES="$SDL_DEFINES -DHAS_XRANDR" else final_message="$final_message\n XRandR:\tNo" fi if test "$use_mms" = "yes"; then final_message="$final_message\n MMS:\t\tYes" SDL_DEFINES="$SDL_DEFINES -DHAS_MMS" else final_message="$final_message\n MMS:\t\tNo" fi if test "$use_pcre" = "yes"; then final_message="$final_message\n PCRE Support:\tYes" SDL_DEFINES="$SDL_DEFINES -DHAS_PCRE" else final_message="$final_message\n PCRE Support:\tNo" fi if test -d "/usr/include/lzo"; then LZO_INCLUDES="$LZO_INCLUDES -I/usr/include/lzo" else LZO_INCLUDES="$LZO_INCLUDES" fi case $host in i*86-*-linux-gnu) ARCH="i486-linux" ;; x86_64-*-linux-gnu) ARCH="x86_64-linux" ;; i386-apple-darwin9.2.2) ARCH="x86-osx" ;; *) AC_MSG_ERROR(==unsupported host) esac AC_SUBST([ARCH]) # check for where libpython is if test "$host_vendor" != "apple" ; then AC_CHECK_FILE(/usr/lib/python2.4/config/libpython2.4-pic.a, AC_SUBST(python_lib_a,/usr/lib/python2.4/config/libpython2.4-pic.a), AC_CHECK_FILE(/usr/lib/python2.4/config/libpython2.4.a, AC_SUBST(python_lib_a,/usr/lib/python2.4/config/libpython2.4.a), AC_MSG_ERROR(==Can not find libPython anywhere)) ) fi if test "$use_halmount" = "yes"; then final_message="$final_message\n Automount:\tYes" SDL_DEFINES="$SDL_DEFINES -DHAL_HANDLEMOUNT" else final_message="$final_message\n Automount:\tNo" fi if test "$use_ccache" = "yes"; then if test "$ac_cv_path_CCACHE" = "none"; then echo "ccache not found. Falling back to default CC" final_message="$final_message\n ccache:\tNo" else CC="$ac_cv_path_CCACHE $CC" CXX="$ac_cv_path_CCACHE $CXX" AC_MSG_NOTICE(enabling ccache) final_message="$final_message\n ccache:\tYes" fi else final_message="$final_message\n ccache:\tNo" fi if test -x "/usr/bin/svnversion"; then SDL_DEFINES="$SDL_DEFINES -D'SVN_REV=\"$(svnversion -n .)\"'" fi AC_SUBST(DEBUG_FLAGS) AC_SUBST(SDL_DEFINES) AC_SUBST(LZO_INCLUDES) AC_CONFIG_FILES([Makefile Makefile.include xbmc/lib/libPython/linux/Makefile xbmc/lib/libUPnP/Makefile tools/Linux/xbmc.sh]) AC_OUTPUT final_message="$final_message\n prefix:\t$prefix\n$dashes" echo -e "$final_message\n"