7 # Variables for 'waf dist'
32 def fetch_svn_revision (path):
33 cmd = "LANG= svn info " + path + " | awk '/^Revision:/ { print $2}'"
34 return commands.getoutput(cmd)
36 def fetch_git_revision (path):
37 cmd = "LANG= git log --abbrev HEAD^..HEAD " + path
38 output = commands.getoutput(cmd).splitlines()
39 rev = output[0].replace ("commit", "git")[0:10]
42 if "git-svn-id" in line:
43 line = line.split('@')[1].split(' ')
49 def create_stored_revision():
51 if os.path.exists('.svn'):
52 rev = fetch_svn_revision('.');
53 elif os.path.exists('.git'):
54 rev = fetch_git_revision('.');
55 elif os.path.exists('libs/ardour/svn_revision.cc'):
56 print "Using packaged svn revision"
59 print "Missing libs/ardour/svn_revision.cc. Blame the packager."
63 text = '#include <ardour/svn_revision.h>\n'
64 text += 'namespace ARDOUR { extern const char* svn_revision = \"' + rev + '\"; }\n'
65 print 'Writing svn revision info to libs/ardour/svn_revision.cc'
66 o = file('libs/ardour/svn_revision.cc', 'w')
70 print 'Could not open libs/ardour/svn_revision.cc for writing\n'
77 autowaf.set_options(opt)
78 opt.add_option('--arch', type='string', dest='arch',
79 help='Architecture-specific compiler flags')
80 opt.add_option('--aubio', action='store_true', default=True, dest='aubio',
81 help="Use Paul Brossier's aubio library for feature detection (if available)")
82 opt.add_option('--audiounits', action='store_true', default=False, dest='audiounits',
83 help='Compile with Apple\'s AudioUnit library (experimental)')
84 opt.add_option('--coreaudio', action='store_true', default=False, dest='coreaudio',
85 help='Compile with Apple\'s CoreAudio library')
86 opt.add_option('--fpu-optimization', action='store_true', default=True, dest='fpu_optimization',
87 help='Build runtime checked assembler code')
88 opt.add_option('--freedesktop', action='store_true', default=False, dest='freedesktop',
89 help='Install MIME type, icons and .desktop file as per freedesktop.org standards')
90 opt.add_option('--freesound', action='store_true', default=False, dest='freesound',
91 help='Include Freesound database lookup')
92 opt.add_option('--gtkosx', action='store_true', default=False, dest='gtkosx',
93 help='Compile for use with GTK-OSX, not GTK-X11')
94 opt.add_option('--lv2', action='store_true', default=False, dest='lv2',
95 help='Compile with support for LV2 (if slv2 is available)')
96 opt.add_option('--nls', action='store_true', default=True, dest='nls',
97 help='Enable i18n (native language support)')
98 opt.add_option('--surfaces', action='store_true', default=False, dest='surfaces',
99 help='Build support for control surfaces')
100 opt.add_option('--syslibs', action='store_true', default=True, dest='syslibs',
101 help='Use existing system versions of various libraries instead of internal ones')
102 opt.add_option('--tranzport', action='store_true', default=True, dest='tranzport',
103 help='Compile with support for Frontier Designs Tranzport (if libusb is available)')
104 opt.add_option('--universal', action='store_true', default=False, dest='universal',
105 help='Compile as universal binary (requires that external libraries are universal)')
106 opt.add_option('--versioned', action='store_true', default=False, dest='versioned',
107 help='Add revision information to executable name inside the build directory')
108 opt.add_option('--vst', action='store_true', default=False, dest='vst',
109 help='Compile with support for VST')
110 opt.add_option('--wiimote', action='store_true', default=False, dest='wiimote',
111 help='Build the wiimote control surface')
112 opt.add_option('--windows-key', type='string', dest='windows_key',
113 help='Set X Modifier (Mod1,Mod2,Mod3,Mod4,Mod5) for "Windows" key [Default: Mod4]', default='Mod4><Super')
117 def sub_config_and_use(conf, name, has_objects = True):
118 conf.sub_config(name)
119 autowaf.set_local_lib(conf, name, has_objects)
122 create_stored_revision()
123 autowaf.set_recursive()
124 autowaf.configure(conf)
125 autowaf.check_pkg(conf, 'glib-2.0', uselib_store='GLIB', atleast_version='2.2')
126 autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM', atleast_version='2.14.0')
128 sub_config_and_use(conf, i)
130 # Fix utterly braindead FLAC include path to not smash assert.h
131 conf.env['CPPPATH_FLAC'] = []
133 autowaf.print_summary(conf)
134 opts = Options.options
135 autowaf.display_header('Ardour Configuration')
136 autowaf.display_msg(conf, 'Architecture flags', opts.arch)
137 autowaf.display_msg(conf, 'Aubio', bool(conf.env['HAVE_AUBIO']))
138 autowaf.display_msg(conf, 'AudioUnits', opts.audiounits)
139 autowaf.display_msg(conf, 'CoreAudio', opts.coreaudio)
140 autowaf.display_msg(conf, 'FPU Optimization', opts.fpu_optimization)
141 autowaf.display_msg(conf, 'Freedesktop Files', opts.freedesktop)
142 autowaf.display_msg(conf, 'Freesound', opts.freesound)
143 autowaf.display_msg(conf, 'GtkOSX', opts.gtkosx)
144 autowaf.display_msg(conf, 'LV2 Support', bool(conf.env['HAVE_SLV2']))
145 autowaf.display_msg(conf, 'Rubberband', bool(conf.env['HAVE_RUBBERBAND']))
146 autowaf.display_msg(conf, 'Samplerate', bool(conf.env['HAVE_SAMPLERATE']))
147 autowaf.display_msg(conf, 'Soundtouch', bool(conf.env['HAVE_SOUNDTOUCH']))
148 autowaf.display_msg(conf, 'Translation', opts.nls)
149 autowaf.display_msg(conf, 'Surfaces', opts.surfaces)
150 autowaf.display_msg(conf, 'System Libraries', opts.syslibs)
151 autowaf.display_msg(conf, 'Tranzport', opts.tranzport)
152 autowaf.display_msg(conf, 'Universal Binary', opts.universal)
153 autowaf.display_msg(conf, 'Versioned Binary', opts.versioned)
154 autowaf.display_msg(conf, 'VST Support', opts.vst)
155 autowaf.display_msg(conf, 'Wiimote Support', opts.wiimote)
156 autowaf.display_msg(conf, 'Windows Key', opts.windows_key)
159 autowaf.set_recursive()