- drv_short = m.group(1)
- if drv_short.lower() > names['short']:
- out += tmpl(TMPL_AUTOCONF_AC_ARG_ENABLE)
- state = 'done'
- if line == '# Checks for libraries.':
- # new one at the end
- out += tmpl(TMPL_AUTOCONF_AC_ARG_ENABLE)
- state = 'done'
- out += line + '\n'
- if state != 'done':
- raise Exception('AC_ARG_ENABLE markers not found in configure.ac')
- configure_ac = out
-
- # add driver Makefile to AC_CONFIG_FILES
- out = ''
- state = 'copy'
- for line in configure_ac.split('\n')[:-1]:
- if state == 'copy':
- if line.find("AC_CONFIG_FILES([Makefile") > -1:
- state = 'acconf'
- elif state == 'acconf':
- m = re.match('\t\t hardware/([^/]+)/Makefile', line)
+ active = True
+ if active:
+ if (m and m.group(1).upper() > names['name'].upper()) or m is None:
+ out += tmpl(TMPL_AUTOCONF_DRIVER)
+ state = 'automake'
+ active = False
+ elif state == 'automake':
+ m = re.match('DRIVER2\(\[([^\]]+)', line)