mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-28 14:49:54 +00:00
Merge pull request #49 from Quuxplusone/simple-autotools
Clean up the autotools; TravisCI for both Linux and OSX
This commit is contained in:
commit
e61b68bd37
29
.travis.yml
29
.travis.yml
@ -8,12 +8,31 @@ addons:
|
|||||||
- libsdl-gfx1.2-dev
|
- libsdl-gfx1.2-dev
|
||||||
- libsdl-ttf2.0-dev
|
- libsdl-ttf2.0-dev
|
||||||
- libglew-dev
|
- libglew-dev
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
- gcc
|
||||||
- clang
|
- clang
|
||||||
|
before_install:
|
||||||
|
- |-
|
||||||
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
brew update && brew install sdl sdl_gfx sdl_mixer sdl_ttf
|
||||||
|
# work around https://stackoverflow.com/questions/51034399/ for now
|
||||||
|
(cd /usr/local/include && ln -sf SDL/SDL.h)
|
||||||
|
fi
|
||||||
script:
|
script:
|
||||||
- autoreconf -fiv
|
- |-
|
||||||
- ./configure
|
# Build hyperrogue.
|
||||||
- make
|
autoreconf -vi
|
||||||
- sudo make install
|
./configure
|
||||||
- ./hyperrogue --help
|
make
|
||||||
|
- |-
|
||||||
|
# Test hyperrogue.
|
||||||
|
./hyperrogue --help
|
||||||
|
- |-
|
||||||
|
# Test "make dist". ("make distcheck" is expected to fail.)
|
||||||
|
make dist
|
||||||
|
- |-
|
||||||
|
# Test "sudo make install".
|
||||||
|
sudo make install
|
||||||
|
46
Makefile.am
46
Makefile.am
@ -1,57 +1,45 @@
|
|||||||
# Hyperrogue binairy rules
|
|
||||||
bin_PROGRAMS = hyperrogue
|
bin_PROGRAMS = hyperrogue
|
||||||
hyperroguedir = $(datadir)/hyperrogue
|
hyperroguedir = $(datadir)/hyperrogue
|
||||||
dist_hyperrogue_DATA = hyperrogue-music.txt DejaVuSans-Bold.ttf
|
|
||||||
dist_doc_DATA = README.md
|
|
||||||
hyperrogue_SOURCES = hyper.cpp savepng.cpp
|
hyperrogue_SOURCES = hyper.cpp savepng.cpp
|
||||||
|
|
||||||
# Some definitions used in graph.cpp
|
|
||||||
hyperrogue_CPPFLAGS = -DFONTDESTDIR=\"$(pkgdatadir)/DejaVuSans-Bold.ttf\" -DMUSICDESTDIR=\"$(pkgdatadir)/hyperrogue-music.txt\" -DSOUNDDESTDIR=\"$(pkgdatadir)/sounds/\"
|
hyperrogue_CPPFLAGS = -DFONTDESTDIR=\"$(pkgdatadir)/DejaVuSans-Bold.ttf\" -DMUSICDESTDIR=\"$(pkgdatadir)/hyperrogue-music.txt\" -DSOUNDDESTDIR=\"$(pkgdatadir)/sounds/\"
|
||||||
hyperrogue_CXXFLAGS = -std=c++11
|
hyperrogue_CXXFLAGS = -O2 -std=c++11 ${AM_CXXFLAGS}
|
||||||
|
dist_hyperrogue_DATA = hyperrogue-music.txt DejaVuSans-Bold.ttf
|
||||||
|
|
||||||
# Musicdir
|
# docdir
|
||||||
|
dist_doc_DATA = README.md
|
||||||
|
|
||||||
|
# musicdir
|
||||||
musicdir=$(datadir)/hyperrogue/music
|
musicdir=$(datadir)/hyperrogue/music
|
||||||
dist_music_DATA = music/hr3-caves.ogg music/hr3-desert.ogg music/hr3-hell.ogg music/hr3-jungle.ogg music/hr3-mirror.ogg music/hr3-rlyeh.ogg music/hr3-crossroads.ogg music/hr3-graveyard.ogg music/hr3-icyland.ogg music/hr3-laboratory.ogg music/hr3-motion.ogg
|
dist_music_DATA = music/hr3-caves.ogg music/hr3-desert.ogg music/hr3-hell.ogg music/hr3-jungle.ogg music/hr3-mirror.ogg music/hr3-rlyeh.ogg music/hr3-crossroads.ogg music/hr3-graveyard.ogg music/hr3-icyland.ogg music/hr3-laboratory.ogg music/hr3-motion.ogg
|
||||||
|
|
||||||
# Soundsdir
|
# soundsdir
|
||||||
soundsdir=$(datadir)/hyperrogue/sounds
|
soundsdir=$(datadir)/hyperrogue/sounds
|
||||||
dist_sounds_DATA = sounds/*
|
dist_sounds_DATA = sounds/*
|
||||||
|
|
||||||
# Langen binary rules
|
|
||||||
noinst_PROGRAMS = langen
|
noinst_PROGRAMS = langen
|
||||||
langen_SOURCES = langen.cpp
|
langen_SOURCES = langen.cpp
|
||||||
# Disable optimization, not needed
|
langen_CXXFLAGS = -O0 -std=c++11 ${AM_CXXFLAGS}
|
||||||
langen_CXXFLAGS = -O0 -std=c++11
|
BUILT_SOURCES = language-data.cpp
|
||||||
|
|
||||||
# Generation of language-data.cpp
|
|
||||||
language-data.cpp: langen
|
language-data.cpp: langen
|
||||||
./langen > language-data.cpp
|
./langen > language-data.cpp
|
||||||
|
|
||||||
# Generation of savepng
|
|
||||||
#noinst_PROGRAMS += savepng
|
|
||||||
#savepng_SOURCES = savepng.c
|
|
||||||
|
|
||||||
# Local clean rules
|
|
||||||
clean-local:
|
|
||||||
rm -rf language-data.cpp
|
|
||||||
|
|
||||||
# First target made
|
|
||||||
BUILT_SOURCES = language-data.cpp graph.cpp
|
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# Platform specific setup
|
# Platform specific setup
|
||||||
#############################
|
#############################
|
||||||
windres_prefix=""
|
|
||||||
if MINGW
|
|
||||||
hyperrogue_SOURCES += hyper.res
|
|
||||||
hyperrogue_CPPFLAGS += ${wincppflags}
|
|
||||||
#hyperrogue_LDFLAGS = "-static-libgcc -static-libstdc++"
|
|
||||||
windres_prefix += "${host_cpu}-w64-mingw32-"
|
|
||||||
|
|
||||||
|
if MAC
|
||||||
|
hyperrogue_LDFLAGS = -lSDLmain -framework AppKit -framework OpenGL
|
||||||
|
endif MAC
|
||||||
|
|
||||||
|
if MINGW
|
||||||
|
nodist_hyperrogue_SOURCES = hyper.res
|
||||||
|
windres_prefix = ${host_cpu}-w64-mingw32-
|
||||||
endif MINGW
|
endif MINGW
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# Arch specific setup
|
# Arch specific setup
|
||||||
#############################
|
#############################
|
||||||
|
|
||||||
hyper.res: hyper.rc hr-icon.ico
|
hyper.res: hyper.rc hr-icon.ico
|
||||||
${windres_prefix}windres hyper.rc -O coff -o hyper.res
|
${windres_prefix}windres hyper.rc -O coff -o hyper.res
|
||||||
|
10
README.md
10
README.md
@ -1,6 +1,12 @@
|
|||||||
|
|
||||||
# HyperRogue
|
# HyperRogue
|
||||||
**Current version: 10.4b**
|
<p align="right">
|
||||||
|
<a href="https://travis-ci.org/zenorogue/hyperrogue/builds">
|
||||||
|
<img align="right" src="https://badges.herokuapp.com/travis/zenorogue/hyperrogue?branch=master&label=autotools" alt="TravisCI badge">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p align="left">
|
||||||
|
<b>Current version: 10.4i</b>
|
||||||
|
</p>
|
||||||
|
|
||||||
A puzzle roguelike in the hyperbolic plane. See the [HyperRogue website](http://roguetemple.com/z/hyper.php) for detailed and most up-to-date information.
|
A puzzle roguelike in the hyperbolic plane. See the [HyperRogue website](http://roguetemple.com/z/hyper.php) for detailed and most up-to-date information.
|
||||||
|
|
||||||
|
63
configure.ac
63
configure.ac
@ -1,60 +1,33 @@
|
|||||||
# -*- Autoconf -*-
|
|
||||||
# Process this file with autoconf to produce a configure script.
|
|
||||||
|
|
||||||
AC_PREREQ([2.68])
|
AC_PREREQ([2.68])
|
||||||
AC_INIT([hyperrogue], [10.4b])
|
AC_INIT([hyperrogue], [10.4i])
|
||||||
|
AC_LANG([C++])
|
||||||
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
|
||||||
${CXXFLAGS=""}
|
|
||||||
AC_CONFIG_SRCDIR([hyperpoint.cpp])
|
AC_CONFIG_SRCDIR([hyperpoint.cpp])
|
||||||
#AC_CONFIG_HEADERS([config.h])
|
|
||||||
|
|
||||||
# Checks for programs.
|
|
||||||
AC_PROG_CXX
|
AC_PROG_CXX
|
||||||
AC_PROG_CC
|
|
||||||
|
|
||||||
# Check for which host we are on and setup a few things
|
|
||||||
# specifically based on the host
|
|
||||||
AC_CANONICAL_HOST
|
AC_CANONICAL_HOST
|
||||||
AM_CONDITIONAL(DARWIN, test ["${host_os#*darwin}" != "$host_os"])
|
|
||||||
|
|
||||||
AM_CONDITIONAL(LINUX, test ["${host_os#*linux}" != "$host_os"])
|
AM_CONDITIONAL(LINUX, test ["${host_os#*linux}" != "$host_os"])
|
||||||
|
AM_CONDITIONAL(MAC, test ["${host_os#*darwin}" != "$host_os"])
|
||||||
AM_CONDITIONAL(MINGW, test ["${host_os#*mingw}" != "$host_os"])
|
AM_CONDITIONAL(MINGW, test ["${host_os#*mingw}" != "$host_os"])
|
||||||
export wincppflags=""
|
AM_COND_IF(LINUX, AC_DEFINE([LINUX], [1]))
|
||||||
AS_IF( test ["${host_os#*mingw}" != "$host_os"], [export EXEEXT=".exe"],[])
|
AM_COND_IF(MAC, AC_DEFINE([MAC], [1]))
|
||||||
|
AM_COND_IF(MINGW, AC_DEFINE([WINDOWS], [1]))
|
||||||
|
|
||||||
# Checks for libraries.
|
AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h], break, AC_MSG_RESULT([OpenGL header was not found]))
|
||||||
# FIXME: Replace `main' with a function in `-lGL':
|
AC_CHECK_HEADERS([GL/glew.h], [], AC_MSG_RESULT([GLEW header was not found]))
|
||||||
AC_CHECK_LIB([GL], [main], [], AC_MSG_ERROR([GL library was not found]))
|
AC_CHECK_HEADERS([png.h], [], AC_MSG_RESULT([png.h header was not found]))
|
||||||
# FIXME: Replace `main' with a function in `-lSDL':
|
|
||||||
AC_CHECK_LIB([SDL], [main], [], AC_MSG_ERROR([SDL library was not found]))
|
|
||||||
# FIXME: Replace `main' with a function in `-lSDL_mixer':
|
|
||||||
AC_CHECK_LIB([SDL_mixer], [main], [], AC_MSG_ERROR([SDL_mixer library was not found]))
|
|
||||||
# FIXME: Replace `main' with a function in `-lSDL_gfx':
|
|
||||||
AC_CHECK_LIB([SDL_gfx], [main], [], [AS_IF( test ["${host_os#*mingw}" != "$host_os"], [export wincppflags=$wincppflags" dll/SDL_gfx.dll" && AC_MSG_RESULT([Building for windows, ignoring])] ,AC_MSG_ERROR([SDL_gfx library was not found]))])
|
|
||||||
# FIXME: Replace `main' with a function in `-lSDL_ttf':
|
|
||||||
AC_CHECK_LIB([SDL_ttf], [main], [], [AS_IF( test ["${host_os#*mingw}" != "$host_os"], [export wincppflags=$wincppflags" dll/SDL_ttf.dll" && AC_MSG_RESULT([Building for windows, ignoring])] ,AC_MSG_ERROR([SDL_ttf library was not found]))])
|
|
||||||
# Test for libpng
|
|
||||||
AC_CHECK_LIB([png], [main], [], AC_MSG_ERROR([png library was not found]))
|
|
||||||
# Test for glew
|
|
||||||
AC_CHECK_LIB([GLEW], [main], [], AC_MSG_ERROR([Glew library was not found]))
|
|
||||||
|
|
||||||
# Checks for header files.
|
|
||||||
AC_CHECK_HEADERS([stdlib.h unistd.h])
|
|
||||||
AC_CHECK_HEADERS([SDL/SDL.h], [], AC_MSG_ERROR([SDL/SDL.h header was not found]))
|
AC_CHECK_HEADERS([SDL/SDL.h], [], AC_MSG_ERROR([SDL/SDL.h header was not found]))
|
||||||
#AC_CHECK_HEADERS([SDL/SDL_gfx.h], [], [AC_MSG_ERROR([SDL/SDL_gfx.h header was not found])])
|
AC_CHECK_HEADERS([SDL/SDL_gfxPrimitives.h], [], AC_MSG_RESULT([SDL/SDL_gfxPrimitives.h header was not found]))
|
||||||
AC_CHECK_HEADERS([SDL/SDL_mixer.h], [], AC_MSG_ERROR([SDL/SDL_mixer.h header was not found]))
|
AC_CHECK_HEADERS([SDL/SDL_mixer.h], [], AC_MSG_ERROR([SDL/SDL_mixer.h header was not found]))
|
||||||
AC_CHECK_HEADERS([SDL/SDL_ttf.h], [], AS_IF( test ["${host_os#*mingw}" != "$host_os"], [] ,AC_MSG_ERROR([SDL/SDL_ttf.h header was not found])))
|
AC_CHECK_HEADERS([SDL/SDL_ttf.h], [], AC_MSG_RESULT([SDL/SDL_ttf.h header was not found]))
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
AC_SEARCH_LIBS([glBegin], [GL opengl32], [], AC_MSG_RESULT([OpenGL library was not found]))
|
||||||
# AC_CHECK_HEADER_STDBOOL
|
AC_SEARCH_LIBS([glewInit], [GLEW glew32], [], AC_MSG_RESULT([GLEW library was not found]))
|
||||||
AC_C_INLINE
|
AC_SEARCH_LIBS([png_create_info_struct], [png], [], AC_MSG_RESULT([png library was not found]))
|
||||||
AC_TYPE_SIZE_T
|
AC_SEARCH_LIBS([SDL_SetVideoMode], [SDL], [], AC_MSG_ERROR([SDL library was not found]))
|
||||||
|
AC_SEARCH_LIBS([aacircleColor], [SDL_gfx], [], AC_MSG_RESULT([SDL_gfx library was not found]))
|
||||||
# Checks for library functions.
|
AC_SEARCH_LIBS([Mix_LoadMUS], [SDL_mixer], [], AC_MSG_ERROR([SDL_mixer library was not found]))
|
||||||
AC_CHECK_FUNCS([memset sqrt strstr])
|
AC_SEARCH_LIBS([TTF_OpenFont], [SDL_ttf], [], AC_MSG_RESULT([SDL_ttf library was not found]))
|
||||||
|
|
||||||
AC_SUBST([wincppflags])
|
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
AC_CONFIG_FILES([Makefile])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
Loading…
Reference in New Issue
Block a user