summaryrefslogtreecommitdiff
path: root/makefiledir
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-09 17:04:08 +0000
committertruelight <truelight@openttd.org>2004-08-09 17:04:08 +0000
commitefaeb275f78e18d594d9ee8ff04eccd2dc59512c (patch)
treebc8e1f56d77706d14d048cb2d99e53291930b520 /makefiledir
downloadopenttd-efaeb275f78e18d594d9ee8ff04eccd2dc59512c.tar.xz
(svn r1) Import of revision 975 of old (crashed) SVN
Diffstat (limited to 'makefiledir')
-rw-r--r--makefiledir/Makefile.config_writer81
-rw-r--r--makefiledir/Makefile.libdetection80
2 files changed, 161 insertions, 0 deletions
diff --git a/makefiledir/Makefile.config_writer b/makefiledir/Makefile.config_writer
new file mode 100644
index 000000000..bea32fea2
--- /dev/null
+++ b/makefiledir/Makefile.config_writer
@@ -0,0 +1,81 @@
+# This file generates Makefile.config
+# Create default config from autodetected values
+# Magic at work, note that you can't use commas in arguments for this
+CONFIG_LINE=@$(SHELL) -c 'echo $(1)' >> $(MAKE_CONFIG) 2> /dev/null
+
+$(MAKE_CONFIG):
+
+ touch $(MAKE_CONFIG)
+
+ $(call CONFIG_LINE,\# OpenTTD config file for makefile)
+ $(call CONFIG_LINE,\# Set your options here - 1 for use and empty for disable)
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# User setup flags)
+ $(call CONFIG_LINE,\# Translator: adds TODO to any untranslated strings)
+ $(call CONFIG_LINE,\# Display_Warnings: when off it hides some warnings while compiling)
+ $(call CONFIG_LINE,\# MIDI: sets path to midi player)
+ $(call CONFIG_LINE,\# MIDI_ARG: sets an argument which is used when calling the midi player. Default off)
+ $(call CONFIG_LINE,STATIC:=$(STATIC))
+ $(call CONFIG_LINE,TRANSLATOR:=$(TRANSLATOR))
+ $(call CONFIG_LINE,DISPLAY_WARNINGS:=$(DISPLAY_WARNINGS))
+ $(call CONFIG_LINE,DEBUG:=$(DEBUG))
+ $(call CONFIG_LINE,PROFILE:=$(PROFILE))
+ $(call CONFIG_LINE,MIDI:=$(MIDI))
+ $(call CONFIG_LINE,MIDI_ARG:=$(MIDI_ARG))
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# DATA_DIR_PREFIX is the path to OpenTTD. It can be absolute or relative)
+ $(call CONFIG_LINE,\# USE_HOMEDIR sets \~/ in front of DATA_DIR_PREFIX so it uses the homedir)
+ $(call CONFIG_LINE,\# do not type \~/ yourself because that will not work)
+ $(call CONFIG_LINE,\# Folders should end with /)
+ $(call CONFIG_LINE,BINARY_DIR:=$(BINARY_DIR))
+ $(call CONFIG_LINE,INSTALL_DIR:=$(INSTALL_DIR))
+ $(call CONFIG_LINE,USE_HOMEDIR:=$(USE_HOMEDIR))
+ $(call CONFIG_LINE,GAME_DATA_DIR:=$(GAME_DATA_DIR))
+ $(call CONFIG_LINE,PERSONAL_DIR:=$(PERSONAL_DIR))
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# Experimental)
+ $(call CONFIG_LINE,WITH_NETWORK:=$(WITH_NETWORK))
+ $(call CONFIG_LINE,WITH_DIRECTMUSIC:=$(WITH_DIRECTMUSIC))
+ $(call CONFIG_LINE,)
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# Flag to skip test for OS when building static)
+ $(call CONFIG_LINE,\# OpenTTD have only been succesfully tested with static builds on MorphOS and MacOSX)
+ $(call CONFIG_LINE,\# If you want to try anyway on other OSes, set this flag)
+ $(call CONFIG_LINE,\# Inform us if you have success)
+ $(call CONFIG_LINE,SKIP_STATIC_CHECK:=$(SKIP_STATIC_CHECK))
+ $(call CONFIG_LINE,)
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# Everything below this line is autogenerated)
+ $(call CONFIG_LINE,\#)
+ $(call CONFIG_LINE,\# If you need to change anything below, you should run "make upgradeconf")
+ $(call CONFIG_LINE,\# If that does not fix the problem, you should make a bug report.)
+ $(call CONFIG_LINE,\# It would really help if you could tell how to autodetect the missing setting)
+ $(call CONFIG_LINE,\# That info could be where the missing lib is placed)
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# Libs)
+ $(call CONFIG_LINE,WITH_ZLIB:=$(WITH_ZLIB))
+ $(call CONFIG_LINE,WITH_SDL:=$(WITH_SDL))
+ $(call CONFIG_LINE,WITH_PNG:=$(WITH_PNG))
+ $(call CONFIG_LINE,STATIC_ZLIB_PATH:=$(STATIC_ZLIB_PATH))
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# OS flags)
+ $(call CONFIG_LINE,WIN32:=$(WIN32))
+ $(call CONFIG_LINE,UNIX:=$(UNIX))
+ $(call CONFIG_LINE,OSX:=$(OSX))
+ $(call CONFIG_LINE,FREEBSD:=$(FREEBSD))
+ $(call CONFIG_LINE,MORPHOS:=$(MORPHOS))
+ $(call CONFIG_LINE,CYGWIN:=$(CYGWIN))
+ $(call CONFIG_LINE,MINGW:=$(MINGW))
+ $(call CONFIG_LINE,)
+
+ $(call CONFIG_LINE,\# misc)
+ $(call CONFIG_LINE,SDL-CONFIG:=$(SDL-CONFIG))
+ $(call CONFIG_LINE,CONFIG_INCLUDED:=yes)
+ $(call CONFIG_LINE,PATH_SET:=$(PATH_SET))
diff --git a/makefiledir/Makefile.libdetection b/makefiledir/Makefile.libdetection
new file mode 100644
index 000000000..8f8458c76
--- /dev/null
+++ b/makefiledir/Makefile.libdetection
@@ -0,0 +1,80 @@
+# this file detects what OS and libs the computer have/are running
+
+# Automatically recognize if building on Win32
+ifdef WINDIR
+ifndef UNIX
+WIN32:=1
+endif
+else
+UNIX:=1
+endif
+
+# Automatically recognize if building on FreeBSD
+ifeq ($(shell uname),FreeBSD)
+FREEBSD:=1
+endif
+
+# Automatically recognize if building on MacOSX
+ifeq ($(VENDOR), apple)
+OSX:=1
+# OSX uses the unix setup too
+UNIX:=1
+endif
+
+# Automatically recognize if building on MorphOS
+ifeq ($(shell uname), MorphOS)
+MORPHOS:=1
+# MorphOS uses UNIX setup too
+UNIX:=1
+endif
+
+# FreeBSD uses sdl11 instead of sdl
+ifdef FREEBSD
+SDL-CONFIG:=sdl11-config
+else
+SDL-CONFIG:=sdl-config
+endif
+
+
+# Library detections
+WITH_SDL:=$(shell $(SDL-CONFIG) --version 2>/dev/null)
+
+# libpng detection
+ifdef FREEBSD
+# a little hack was needed for FreeBSD because it misses libpng-config
+WITH_PNG:=$(shell ls /usr/lib | grep "libpng" 2>/dev/null) $(shell \
+ls /usr/local/lib | grep "libpng" 2>/dev/null)
+ifdef WITH_PNG
+# makes the flag look nicer in makefile.config
+WITH_PNG:=1
+endif
+else
+WITH_PNG:=$(shell libpng-config --version 2>/dev/null)
+endif
+
+ifdef WITH_PNG
+# LibPNG depends on Zlib
+WITH_ZLIB:=1
+else
+# We go looking for zlib with a little hack
+WITH_ZLIB:=$(shell ls /usr/include | grep "zlib.h" 2>/dev/null) \
+$(shell ls /usr/local/include | grep "zlib.h" 2>/dev/null)
+ifdef WITH_ZLIB
+WITH_ZLIB:=1
+endif
+endif
+
+
+# sets the default paths
+ifdef UNIX
+ifndef OSX
+ifndef MORPHOS
+ifndef BIN_DIR
+#BINARY_DIR:=
+#DATA_DIR_PREFIX:=
+#INSTALL_DIR:=/usr/local/
+#USE_HOMEDIR:=
+endif
+endif
+endif
+endif \ No newline at end of file