summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2004-12-04 20:34:59 +0000
committerbjarni <bjarni@openttd.org>2004-12-04 20:34:59 +0000
commit47713d05e3e1f4819d1b86916d3a0a23471b9f37 (patch)
tree4f8c18d0c4c783aa0f7fcf9586df521de2e94557
parent40121d60cd3b0054fdf0927c8363fe2f74fd4d97 (diff)
downloadopenttd-47713d05e3e1f4819d1b86916d3a0a23471b9f37.tar.xz
(svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
-rw-r--r--Makefile13
-rw-r--r--makefiledir/Makefile.config_writer1
2 files changed, 12 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 0dd0b564e..ec75285dc 100644
--- a/Makefile
+++ b/Makefile
@@ -103,6 +103,7 @@
# Experimental (does not work properly):
# WITH_NETWORK: enable networking
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support
+# DEDICATED: allows compilation on UNIX without SDL. Useful for dedicated servers
##############################################################################
@@ -112,7 +113,7 @@
# Makefile version tag
# it checks if the version tag in makefile.config is the same and force update outdated config files
-MAKEFILE_VERSION:=3
+MAKEFILE_VERSION:=4
# CONFIG_WRITER have to be found even for manual configuration
CONFIG_WRITER=makefiledir/Makefile.config_writer
@@ -207,9 +208,17 @@ endif
# Force SDL on UNIX platforms
ifndef WITH_SDL
ifdef UNIX
-$(error You need to have SDL installed in order to run OpenTTD on UNIX.)
+ifndef DEDICATED
+$(error You need to have SDL installed in order to run OpenTTD on UNIX. Use DEDICATED if you want to compile a CLI based server)
endif
endif
+endif
+
+# For some reason it will not link with libpng if SDL is disabled
+# this automatically disables libpng if no SDL is found
+ifndef WITH_SDL
+WITH_PNG:=
+endif
diff --git a/makefiledir/Makefile.config_writer b/makefiledir/Makefile.config_writer
index 116838c1a..c138945c1 100644
--- a/makefiledir/Makefile.config_writer
+++ b/makefiledir/Makefile.config_writer
@@ -44,6 +44,7 @@ $(MAKE_CONFIG):
$(call CONFIG_LINE,\# Experimental)
$(call CONFIG_LINE,WITH_NETWORK:=$(WITH_NETWORK))
$(call CONFIG_LINE,WITH_DIRECTMUSIC:=$(WITH_DIRECTMUSIC))
+ $(call CONFIG_LINE,DEDICATED:=$(DEDICATED))
$(call CONFIG_LINE,)
$(call CONFIG_LINE,)