mirror of
https://git.code.sf.net/p/quake/quake2forge
synced 2024-12-12 13:42:21 +00:00
- Added compiler optimisations back to the Makefiles,
courtesy of configure. Some basic optimisations are added unless optimisations are explicitly disabled. Extra optimisations are added based on the cpu being built on.
This commit is contained in:
parent
ac7df517ed
commit
905edaed62
6 changed files with 40 additions and 34 deletions
25
configure.in
25
configure.in
|
@ -300,6 +300,31 @@ AC_SUBST(DL_LIBS)
|
||||||
#SDL_FLAGS=`sdl-config --libs`
|
#SDL_FLAGS=`sdl-config --libs`
|
||||||
#AC_SUBST(SDL_FLAGS)
|
#AC_SUBST(SDL_FLAGS)
|
||||||
|
|
||||||
|
dnl -------------------------
|
||||||
|
dnl Optimising compiler flags
|
||||||
|
dnl -------------------------
|
||||||
|
|
||||||
|
OPT_CFLAGS=""
|
||||||
|
USE_OPT=""
|
||||||
|
AC_MSG_CHECKING(whether to allow compiler optimisations)
|
||||||
|
AC_ARG_ENABLE(opt,
|
||||||
|
[ --disable-opt disable compiler optimisations ],
|
||||||
|
AC_MSG_RESULT(optimisations disabled),
|
||||||
|
AC_MSG_RESULT(optimisations enabled)
|
||||||
|
USE_OPT="yes"
|
||||||
|
OPT_CFLAGS="$OPT_CFLAGS -O2 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"
|
||||||
|
)
|
||||||
|
if test "x$USE_OPT" = "xyes"; then
|
||||||
|
case "${host}" in
|
||||||
|
i?86-*-*)
|
||||||
|
OPT_CFLAGS="$OPT_CFLAGS -malign-loops=2 -malign-jumps=2 -malign-functions=2"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
AC_SUBST(OPT_CFLAGS)
|
||||||
|
|
||||||
dnl -------------------
|
dnl -------------------
|
||||||
dnl Checks for asm junk
|
dnl Checks for asm junk
|
||||||
dnl -------------------
|
dnl -------------------
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
SUBDIRS = . baseq2 ctf xatrix rogue
|
SUBDIRS = . baseq2 ctf xatrix rogue
|
||||||
|
|
||||||
std_cflags = -Wall -Werror -pipe
|
std_cflags = -Wall -Werror -pipe @OPT_CFLAGS@
|
||||||
module_ldflags = -module -avoid-version -rpath $(pkglibdir)
|
module_ldflags = -module -avoid-version -rpath $(pkglibdir)
|
||||||
|
|
||||||
bin_PROGRAMS = quake2
|
bin_PROGRAMS = quake2
|
||||||
|
|
|
@ -16,6 +16,6 @@ game_la_SOURCES = g_ai.c g_chase.c g_cmds.c g_svcmds.c g_combat.c \
|
||||||
p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
|
p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
|
||||||
q_shared.c
|
q_shared.c
|
||||||
|
|
||||||
AM_CFLAGS = -fPIC -Wall -Werror -pipe
|
AM_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@
|
||||||
AM_CPPFLAGS = -I..
|
AM_CPPFLAGS = -I..
|
||||||
LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
||||||
|
|
|
@ -2,34 +2,15 @@
|
||||||
|
|
||||||
pkglibdir=$(libdir)/@PACKAGE@/ctf
|
pkglibdir=$(libdir)/@PACKAGE@/ctf
|
||||||
pkglib_LTLIBRARIES = game.la
|
pkglib_LTLIBRARIES = game.la
|
||||||
game_la_SOURCES = \
|
game_la_SOURCES = g_ai.c g_chase.c g_cmds.c g_combat.c g_ctf.c \
|
||||||
g_ai.c \
|
g_func.c g_items.c g_main.c g_misc.c g_monster.c \
|
||||||
g_chase.c \
|
g_phys.c g_save.c g_spawn.c g_svcmds.c g_target.c \
|
||||||
g_cmds.c \
|
g_trigger.c g_utils.c g_weapon.c \
|
||||||
g_combat.c \
|
m_move.c \
|
||||||
g_ctf.c \
|
p_client.c p_hud.c p_menu.c p_trail.c p_view.c \
|
||||||
g_func.c \
|
p_weapon.c \
|
||||||
g_items.c \
|
q_shared.c
|
||||||
g_main.c \
|
|
||||||
g_misc.c \
|
|
||||||
g_monster.c \
|
|
||||||
g_phys.c \
|
|
||||||
g_save.c \
|
|
||||||
g_spawn.c \
|
|
||||||
g_svcmds.c \
|
|
||||||
g_target.c \
|
|
||||||
g_trigger.c \
|
|
||||||
g_utils.c \
|
|
||||||
g_weapon.c \
|
|
||||||
m_move.c \
|
|
||||||
p_client.c \
|
|
||||||
p_hud.c \
|
|
||||||
p_menu.c \
|
|
||||||
p_trail.c \
|
|
||||||
p_view.c \
|
|
||||||
p_weapon.c \
|
|
||||||
q_shared.c
|
|
||||||
|
|
||||||
AM_CFLAGS = -fPIC -Wall -Werror -pipe
|
AM_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@
|
||||||
AM_CPPFLAGS = -I..
|
AM_CPPFLAGS = -I..
|
||||||
LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
||||||
|
|
|
@ -19,7 +19,7 @@ game_la_SOURCES = dm_ball.c dm_tag.c \
|
||||||
m_tank.c m_turret.c m_widow.c m_widow2.c \
|
m_tank.c m_turret.c m_widow.c m_widow2.c \
|
||||||
p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
|
p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
|
||||||
q_shared.c
|
q_shared.c
|
||||||
#game_la_CFLAGS = -fPIC -Wall -Werror -pipe
|
#game_la_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@
|
||||||
game_la_CFLAGS = -I.. -fPIC -pipe
|
game_la_CFLAGS = -I.. -fPIC -pipe @OPT_CFLAGS@
|
||||||
game_la_LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
game_la_LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
||||||
endif # DO_ROGUE
|
endif # DO_ROGUE
|
||||||
|
|
|
@ -16,7 +16,7 @@ game_la_SOURCES = g_ai.c g_chase.c g_cmds.c g_combat.c g_func.c \
|
||||||
m_parasite.c m_soldier.c m_supertank.c m_tank.c \
|
m_parasite.c m_soldier.c m_supertank.c m_tank.c \
|
||||||
p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
|
p_client.c p_hud.c p_trail.c p_view.c p_weapon.c \
|
||||||
q_shared.c
|
q_shared.c
|
||||||
#game_la_CFLAGS = -fPIC -Wall -Werror -pipe
|
#game_la_CFLAGS = -fPIC -Wall -Werror -pipe @OPT_CFLAGS@
|
||||||
game_la_CFLAGS = -I.. -fPIC -pipe
|
game_la_CFLAGS = -I.. -fPIC -pipe @OPT_CFLAGS@
|
||||||
game_la_LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
game_la_LDFLAGS = -module -avoid-version -rpath $(pkglibdir)
|
||||||
endif # DO_XATRIX
|
endif # DO_XATRIX
|
||||||
|
|
Loading…
Reference in a new issue