i# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.57) AC_INIT(briquolo, 0.5.6, cedric.bregardis@free.fr) dnl AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_SRCDIR([src/MenuJeu.h]) dnl AC_CONFIG_HEADERS([config.h]) AM_CONFIG_HEADER([config.h]) AC_CANONICAL_TARGET AM_INIT_AUTOMAKE(dist-bzip2) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB AC_PROG_YACC # Checks for header files. AC_FUNC_ALLOCA AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([argz.h fcntl.h langinfo.h libintl.h limits.h locale.h malloc.h stddef.h stdio_ext.h stdlib.h string.h strings.h sys/param.h sys/timeb.h unistd.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_C_VOLATILE # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MMAP AC_FUNC_REALLOC AC_FUNC_STAT AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify getcwd mempcpy mkdir munmap nl_langinfo pow setlocale sqrt stpcpy strcasecmp strchr strcspn strdup strstr strtoul]) dnl CXXFLAGS="-Wall -O3 -pipe `sdl-config --cflags` -I./" dnl CXXFLAGS="-Wall -Wextra -Wfloat-equal -Wshadow -Wconversion" CXXFLAGS="-Wall" dnl Test de libfreetype dnl AC_CHECK_PROG(png_config,libfreetype-config,libfreetype-config,[AC_MSG_ERROR([*** Libfreetype-config not found. You need libfreetype.])]) AC_PATH_PROG(freetypeconfig, freetype-config, ,$prefix/bin:$PATH) if test "x$freetypeconfig" = "x" then echo "freetype-config not found" else echo "freetype-config found" CXXFLAGS="$CXXFLAGS `$freetypeconfig --cflags`" LIBS="$LIBS `$freetypeconfig --libs`" fi dnl Test de libpng dnl AC_CHECK_PROG(png_config,libpng-config,libpng-config,[AC_MSG_ERROR([*** Libpng-config not found. You need libpng.])]) AC_PATH_PROG(pngconfig, libpng-config, ,$prefix/bin:$PATH) if test "x$pngconfig" = "x" then echo "libpng-config not found. We search for libpng manually" AC_CHECK_LIB(png, png_access_version_number,,[AC_MSG_ERROR([*** You need libpng])], -lm -lz) LIBS="$LIBS -lpng -lz" else CXXFLAGS="$CXXFLAGS `$pngconfig --cppflags` `libpng-config --cflags`" LIBS="$LIBS `$pngconfig --ldflags` `$pngconfig --libs`" fi dnl Nécessaire pour le test SDL dnl AC_CANONICAL_HOST dnl Test de SDL SDL_VERSION=1.2.4 AM_PATH_SDL($SDL_VERSION, :, AC_MSG_ERROR([*** You need libSDL >= $SDL_VERSION ])) CXXFLAGS="$CXXFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" dnl On teste gettext AM_GNU_GETTEXT AM_ICONV LIBS="$LIBS $INTLLIBS $LIBICONV" dnl On définit la variable du répertoire des locales if test "x$prefix" = "xNONE" then LOCALEDIR=$ac_default_prefix/share/locale else LOCALEDIR=$prefix/share/locale fi AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR", [Répertoire des locale]) #check host OS AC_MSG_CHECKING(host OS) case "${host}" in *-*-cygwin* | *-*-mingw32* ) LIB_GL=opengl32 LIB_GLU=glu32 PROGRAM_EXT=".exe" AC_MSG_RESULT(Host OS is Win32) LIBS="-l$LIB_GL -l$LIB_GLU $LIBS" LIBS="-lSDL_mixer $LIBS" LIBS="-lSDL_ttf $LIBS" LIBS="$LIBS -lwinmm" ;; *) AC_PATH_X if test "x$x_includes" != "x" then CPPFLAGS="$CPPFLAGS -I$x_includes" fi if test "x$x_libraries" != "x" then LIBS="$LIBS -L$x_libraries" fi LIB_GL=GL LIB_GLU=GLU PROGRAM_EXT= AC_MSG_RESULT(Host OS is not Win32) dnl Test de OpenGL AC_CHECK_LIB($LIB_GL,glVertex3f,,[AC_MSG_ERROR([*** You need OpenGL])]) dnl Test de glu AC_CHECK_LIB($LIB_GLU,gluLookAt,,[AC_MSG_ERROR([*** You need Glu])], -lm ) dnl Test de SDL-mixer AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,,[AC_MSG_ERROR([SDL-mixer])]) LIBS="$LIBS -lSDL_mixer" dnl Test de SDL_ttf AC_CHECK_LIB(SDL_ttf,TTF_Init,,[AC_MSG_ERROR([SDL_ttf])]) LIBS="$LIBS -lSDL_ttf" esac dnl Debugging AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging [default=no]], mogl_debug=1, mogl_debug=0 ) if test $mogl_debug -eq 1 then CXXFLAGS="-g $CXXFLAGS" else CXXFLAGS="-O3 $CXXFLAGS" fi CPPFLAGS="-DDATADIR_BRIQUOLO=\\\"$datadir/$PACKAGE\\\" $CPPFLAGS" AC_CONFIG_FILES([ po/Makefile.in m4/Makefile intl/Makefile Makefile desktop/Makefile data/Makefile data/data/Makefile data/tableau/Makefile data/tableau/old/Makefile data/tableau/new/Makefile src/MOGL/Makefile src/Makefile]) AC_OUTPUT