1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

Clean up the autotools.

It still seems to work on MinGW mainly by accident,
but at least it's a lot shorter and clearer and more
portable at this point. We can start testing it in
TravisCI and then work on making it work "less by accident"
incrementally.
This commit is contained in:
Arthur O'Dwyer 2018-06-30 17:56:53 -07:00
parent 23a3cb4a53
commit 0946300663
4 changed files with 35 additions and 18681 deletions

View File

@ -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

View File

@ -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

18607
glew.c

File diff suppressed because it is too large Load Diff

BIN
hyper.exe

Binary file not shown.