Changeset 614


Ignore:
Timestamp:
May 9, 2011, 12:55:14 AM (6 years ago)
Author:
sam
Message:

build: add a `--with-assetsdir' configure flag to specify where the
game data should be installed.

Location:
abuse/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/PACKAGERS

    r609 r614  
    1212
    1313
    14 2.) Data directory
     142.) Assets directory
    1515
    16 The default data directory is ${prefix}/share/games/abuse. With the default
    17 prefix value, this expands to /usr/local/share/games/abuse.
     16The default assets directory is ${datadir}/games/abuse. With the default prefix
     17value, this expands to /usr/local/share/games/abuse.
     18
     19To override the assets directory, use the `--with-assetsdir' configure flag,
     20for instance:
     21
     22    ./configure --with-assetsdir=/opt/abuse
    1823
    1924
  • abuse/trunk/configure.ac

    r610 r614  
    2020fi
    2121
    22 dnl Figure out where the datafiles will be
    23 EXPDATADIR="-DEXPDATADIR=\\\"$datadir/games/abuse\\\""
    24 AC_SUBST(EXPDATADIR)
    25 
    2622AC_ARG_ENABLE(debug,
    2723  [  --enable-debug          build debug versions of the game (default no)])
     
    3127  [  --disable-nonfree       disable non-free data (default no)])
    3228
    33 dnl Checks for libraries
     29AC_ARG_WITH(assetsdir,
     30  [  --with-assetsdir=DIR    override default game data directory])
     31
     32dnl  Figure out where the datafiles will be
     33if test "x${with_assetsdir}" = x; then
     34  with_assetsdir='$(datadir)/games/abuse'
     35fi
     36AC_SUBST([assetsdir], [$with_assetsdir])
     37
     38dnl  Checks for libraries
    3439dnl Do we need to link against something for X shared memory support?
    35 AC_CHECK_LIB(Xext,XShmAttach,:,[
    36 AC_CHECK_LIB(XextSam,XShmAttach,LIBS="$LIBS -lXextSam",,$X_LIBS -lX11 -lXext)
    37 ],$X_LIBS -lX11)
     40AC_CHECK_LIB(Xext, XShmAttach, :,
     41             [AC_CHECK_LIB(XextSam, XShmAttach, LIBS="$LIBS -lXextSam", :,
     42                           $X_LIBS -lX11 -lXext)],
     43             $X_LIBS -lX11)
    3844
    3945dnl Checks for Solaris compatibility
    40 AC_CHECK_LIB(m,pow,LIBS="$LIBS -lm")
    41 AC_CHECK_LIB(socket,socket,LIBS="$LIBS -lsocket")
    42 AC_CHECK_LIB(nsl,gethostbyname,LIBS="$LIBS -lnsl")
     46AC_CHECK_LIB(m, pow, LIBS="$LIBS -lm")
     47AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
     48AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
    4349
    4450dnl Check for SDL
     
    114120    #else
    115121    #include <GL/gl.h>
    116     #endif
    117 ],[
    118 ],[
    119 have_opengl=yes
    120 ])
     122    #endif],
     123  [],
     124  [have_opengl=yes])
    121125AC_MSG_RESULT($have_opengl)
    122 if test x$have_opengl = xyes; then
     126if test "x$have_opengl" = xyes; then
    123127    CFLAGS="$CFLAGS -DHAVE_OPENGL"
    124128    CXXFLAGS="$CXXFLAGS -DHAVE_OPENGL"
     
    140144echo "
    141145------ Configuration for $PACKAGE $VERSION ------
    142     Compiler:         ${CC} (version `${CC} --version`)
    143     Install prefix:   $prefix
    144     SDL version:      `sdl-config --version`
    145     OpenGL support:   $have_opengl
     146    Compiler:          ${CC} (`${CC} --version | head -n 1`)
     147    Install prefix:    ${prefix}
     148    Assets directory:  ${with_assetsdir}
     149    SDL version:       `sdl-config --version`
     150    OpenGL support:    ${have_opengl}
    146151
    147152Now type 'make' to build $PACKAGE.
  • abuse/trunk/data/Makefile.am

    r609 r614  
    22EXTRA_DIST = \
    33    $(demos) $(music) $(lisp) $(extra) $(art) $(levels) $(doc) $(sound)
    4 
    5 datafiledir = $(datadir)/games/abuse
    64
    75install-data-local:
    86        @for p in $(EXTRA_DIST); do \
    97          d="`echo \"$$p\" | sed -ne 's@\(.*\)/.*@\1@p'`"; \
    10           $(MKDIR_P) "$(DESTDIR)$(datafiledir)/$$d"; \
    11           echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(datafiledir)/$$d"; \
    12           $(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(datafiledir)/$$d" || exit $$?; \
     8          $(MKDIR_P) "$(DESTDIR)$(assetsdir)/$$d"; \
     9          echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(assetsdir)/$$d"; \
     10          $(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(assetsdir)/$$d" || exit $$?; \
    1311        done
    1412
    1513uninstall-local:
    1614        @for p in $(EXTRA_DIST); do \
    17           echo " ( cd '$(DESTDIR)$(datafiledir)' && rm -f" $$p ")"; \
    18           cd "$(DESTDIR)$(datafiledir)" && rm -f $$p; \
     15          echo " ( cd '$(DESTDIR)$(assetsdir)' && rm -f" $$p ")"; \
     16          cd "$(DESTDIR)$(assetsdir)" && rm -f $$p; \
    1917        done
    2018
  • abuse/trunk/src/sdlport/Makefile.am

    r481 r614  
    1 ## Process this file with automake to produce Makefile.in
    2 DEFS = @DEFS@ @EXPDATADIR@
     1
     2DEFS = @DEFS@
    33
    44noinst_LIBRARIES = libsdlport.a
     
    1919INCLUDES = -I$(srcdir)/../ -I$(srcdir)/../imlib $(SDL_CFLAGS)
    2020
    21 CPPFLAGS = @CPPFLAGS@ -DNO_CHECK
     21CPPFLAGS = @CPPFLAGS@ -DNO_CHECK -DASSETSDIR=\"$(datadir)/games/abuse\"
     22
  • abuse/trunk/src/sdlport/setup.cpp

    r555 r614  
    9393    if( (fd = fopen( rcfile, "w" )) != NULL )
    9494    {
    95         char datadir[255];
    96         strncpy(datadir, EXPDATADIR, 255);
    97 
    9895        fputs( "; Abuse-SDL Configuration file\n\n", fd );
    9996        fputs( "; Startup fullscreen\nfullscreen=0\n\n", fd );
     
    105102        fputs( "; Use OpenGL\ngl=0\n\n", fd );
    106103        fputs( "; Location of the datafiles\ndatadir=", fd );
    107         fputs( datadir, fd );
    108         fputs( "\n\n", fd );
     104        fputs( ASSETSDIR "\n\n", fd );
    109105        #endif
    110106        fputs( "; Use mono audio only\nmono=0\n\n", fd );
     
    434430        set_filename_prefix( (const char*)buffer );
    435431    #else
    436     set_filename_prefix( EXPDATADIR );
     432    set_filename_prefix( ASSETSDIR );
    437433    #endif
    438434
Note: See TracChangeset for help on using the changeset viewer.