summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-08-05 18:31:50 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-08-05 18:40:24 -0700
commitfb1e500e572774131d0891018332fc625b6a4c52 (patch)
tree0121538ef76a719bb320088013a629b7ffb87c1a /configure
parent09f72397156edb97631209c4cac765364f420bd3 (diff)
downloadtmwa-fb1e500e572774131d0891018332fc625b6a4c52.tar.gz
tmwa-fb1e500e572774131d0891018332fc625b6a4c52.tar.bz2
tmwa-fb1e500e572774131d0891018332fc625b6a4c52.tar.xz
tmwa-fb1e500e572774131d0891018332fc625b6a4c52.zip
Use attoconf and proper versionsv13.8.5
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure72
1 files changed, 72 insertions, 0 deletions
diff --git a/configure b/configure
new file mode 100755
index 0000000..f28b002
--- /dev/null
+++ b/configure
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+
+# Copyright 2013 Ben Longbons <b.r.longbons@gmail.com>
+#
+# This file is part of The Mana World (Athena server)
+#
+# attoconf is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# attoconf is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with attoconf. If not, see <http://www.gnu.org/licenses/>.
+
+from __future__ import print_function, division, absolute_import
+
+import os
+import subprocess
+import sys
+
+from attoconf.version import require_version
+require_version(0, 3)
+
+from attoconf.classy import add_slots
+from attoconf.lib.c import Cxx
+from attoconf.lib.lex import Flex
+from attoconf.lib.yacc import Bison
+from attoconf.lib.install import Install
+from attoconf.lib.make import Make
+from attoconf.types import enum
+
+
+def get_version(srcdir):
+ return subprocess.check_output(
+ ['git', 'describe', '--tags'],
+ cwd=srcdir).strip()
+
+
+@add_slots
+class Configuration(Cxx, Flex, Bison, Install, Make):
+ def general(self):
+ super(Configuration, self).general()
+ home = os.path.expanduser('~')
+ self.add_alias('--user', ['--prefix=%s' % home],
+ help='alias for --prefix=$HOME', hidden=False)
+
+ def features(self):
+ super(Configuration, self).features()
+ # TODO: check VERSION_CONTROL environment variable?
+ # not really important: this option is only to make Frost happy
+ self.add_option('--enable-backups-during-install', init='none',
+ type=enum('none', 'numbered', 'existing', 'simple'), check=None,
+ help='Back up existing files during \'make install\'', hidden=True,
+ help_var='CONTROL')
+
+
+def main():
+ srcdir = os.path.dirname(sys.argv[0])
+ proj = Configuration(srcdir)
+ proj.set_package('tmwa', get_version(srcdir), 'The Mana World (Athena server)')
+ proj.jiggle()
+ build = proj.build('.')
+ build.configure(sys.argv[1:], os.environ)
+
+
+if __name__ == '__main__':
+ main()