Changeset 181

Show
Ignore:
Timestamp:
06/09/07 21:25:19 (2 years ago)
Author:
takkaria
Message:

Fix up configure so that it defines things appropriately all the time.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/configure.ac

    r171 r181  
    1717dnl Check for C compiler 
    1818AC_PROG_CC 
    19 AC_PROG_CXX 
    2019AC_ISC_POSIX 
    2120AC_C_BIGENDIAN 
     
    7574        [enable_gtk=no]) 
    7675AC_ARG_ENABLE(curses, 
    77         [  --enable-curses                      Enables Curses frontend], 
     76        [  --enable-curses                      Enables Curses frontend (default: enabled)], 
    7877        [enable_curses=$enableval], 
    7978        [enable_curses=yes]) 
    8079AC_ARG_ENABLE(x11, 
    81         [  --enable-x11                         Enables X11 frontend], 
     80        [  --enable-x11                         Enables X11 frontend (default: enabled)], 
    8281        [enable_x11=$enableval], 
    8382        [enable_x11=yes]) 
    8483AC_ARG_ENABLE(sdl, 
    85         [  --enable-sdl                         Enables SDL frontend], 
     84        [  --enable-sdl                         Enables SDL frontend (default: enabled)], 
    8685        [enable_sdl=$enableval], 
    8786        [enable_sdl=yes]) 
     
    8988dnl Sound modules 
    9089AC_ARG_ENABLE(sdl_mixer, 
    91         [  --disable-sdl-mixer                  Disables SDL mixer sound support], 
    92         [disable_sdl_mixer=$disable_sdl_mixer], 
    93         [disable_sdl_mixer=no]) 
     90        [  --enable-sdl-mixer                   Enables SDL mixer sound support (default: enabled)], 
     91        [enable_sdl_mixer=$enable_sdl_mixer], 
     92        [enable_sdl_mixer=yes]) 
    9493 
    9594 
     
    132131        AC_PATH_XTRA 
    133132 
    134         if test "$X_DISPLAY_MISSING" != ""; then 
    135                 AC_DEFINE(USE_X11, 0, [Define to 1 if using the X11 frontend and X11 libraries are found.]) 
     133        if test "x$have_x" != "xyes"; then 
    136134                with_x11=no 
    137135        else 
     
    149147        if test "$SDL_CONFIG" = "no"; then 
    150148                with_sdl=no 
    151                 AC_DEFINE(USE_SDL, 0, [Define to 1 if using the SDL interface and SDL & SDL_ttf are found.]) 
    152         else 
    153                 AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, sdl_image=yes, sdl_image=no) 
    154                 AC_CHECK_LIB(SDL_ttf, TTF_Init, sdl_ttf=yes, sdl_ttf=no) 
    155  
    156                 if test "$sdl_image" = "yes"; then 
    157                 if test "$sdl_ttf" = "yes"; then 
     149        else 
     150                AC_CHECK_LIB(SDL_image, IMG_LoadPNG_RW, with_sdl=yes, with_sdl=no) 
     151                AC_CHECK_LIB(SDL_ttf, TTF_Init, with_sdlx=yes, with_sdl=no) 
     152 
     153                if test "$with_sdl" = "yes"; then 
    158154                        AC_DEFINE(USE_SDL, 1, [Define to 1 if using the SDL interface and SDL is found.]) 
    159155                        CFLAGS="${CFLAGS} ${SDL_CFLAGS}" 
    160156                        LDFLAGS="${LDFLAGS} ${SDL_LIBS} -lSDL_image -lSDL_ttf" 
    161                         with_sdl=yes 
    162                 fi; fi 
     157                fi 
    163158        fi 
    164159fi 
     
    171166        ) 
    172167        PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0], 
    173                 [with_get=yes], 
     168                [with_gtkx=yes], 
    174169                [with_gtk=no] 
    175170        ) 
     171 
    176172        if test "$with_gtk" = "yes"; then 
    177173                AC_DEFINE(USE_GTK, 1, [Define to 1 if using the GTK+ 2.x interface and GTK+ 2.x is found.]) 
    178174                CFLAGS="${CFLAGS} $GTK_CFLAGS" 
    179175                LDFLAGS="${LDFLAGS} $GTK_LIBS" 
    180         else 
    181                 AC_DEFINE(USE_GTK, 0, [Define to 1 if using the GTK+ 2.x interface and GTK+ 2.x is found.]) 
    182176        fi 
    183177fi 
     
    185179dnl SDL mixer checking 
    186180 
    187 if test "$disable_sdl_mixer" != "yes"; then 
     181if test "$enable_sdl_mixer" = "yes"; then 
    188182        AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio, found_sdl_mixer=yes, found_sdl_mixer=no) 
    189183 
    190184        if test "$found_sdl_mixer" = "yes"; then 
    191                 AC_DEFINE(SDL_SOUND, 1, [Enabled SDL_mixer sound support]) 
     185                AC_DEFINE(SDL_SOUND, 1, [Define to 1 if using SDL_mixer sound support and it's found.]) 
    192186                LDFLAGS="${LDFLAGS} -lSDL_mixer" 
    193         else 
    194                 AC_DEFINE(SDL_SOUND, 0, [Disabled SDL_mixer sound support]) 
    195187        fi 
    196188fi 
     
    209201 
    210202dnl Check for functions. 
    211 AC_FUNC_STAT 
    212203AC_CHECK_FUNCS([memmove memset mkdir strtol mkstemp setegid can_change_color]) 
    213204 
  • trunk/src/autoconf.h.in

    r167 r181  
    3737#undef HAVE_SETEGID 
    3838 
    39 /* Define to 1 if `stat' has the bug that it succeeds when given the 
    40    zero-length file name argument. */ 
    41 #undef HAVE_STAT_EMPTY_STRING_BUG 
    42  
    4339/* Define to 1 if you have the <stdint.h> header file. */ 
    4440#undef HAVE_STDINT_H 
     
    7167#undef HAVE_UNISTD_H 
    7268 
    73 /* Define to 1 if `lstat' dereferences a symlink specified with a trailing 
    74    slash. */ 
    75 #undef LSTAT_FOLLOWS_SLASHED_SYMLINK 
    76  
    7769/* Name of package */ 
    7870#undef PACKAGE 
     
    9688#undef RETSIGTYPE 
    9789 
    98 /* Disabled SDL_mixer sound support */ 
     90/* Define to 1 if using SDL_mixer sound support and it's found. */ 
    9991#undef SDL_SOUND 
    10092