| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # libjingle | 3 # libjingle |
| 4 # Copyright 2015 Google Inc. | 4 # Copyright 2015 Google Inc. |
| 5 # | 5 # |
| 6 # Redistribution and use in source and binary forms, with or without | 6 # Redistribution and use in source and binary forms, with or without |
| 7 # modification, are permitted provided that the following conditions are met: | 7 # modification, are permitted provided that the following conditions are met: |
| 8 # | 8 # |
| 9 # 1. Redistributions of source code must retain the above copyright notice, | 9 # 1. Redistributions of source code must retain the above copyright notice, |
| 10 # this list of conditions and the following disclaimer. | 10 # this list of conditions and the following disclaimer. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 Uses libtool to generate FAT archive files for each generated library. | 40 Uses libtool to generate FAT archive files for each generated library. |
| 41 | 41 |
| 42 Args: | 42 Args: |
| 43 lib_base_dir: directory whose subdirectories are named by architecture and | 43 lib_base_dir: directory whose subdirectories are named by architecture and |
| 44 contain the built libraries for that architecture | 44 contain the built libraries for that architecture |
| 45 | 45 |
| 46 Returns: | 46 Returns: |
| 47 Exit code of libtool. | 47 Exit code of libtool. |
| 48 """ | 48 """ |
| 49 output_dir_name = 'fat' | 49 include_dir_name = 'include' |
| 50 output_dir_name = 'lib' |
| 50 archs = [arch for arch in os.listdir(lib_base_dir) | 51 archs = [arch for arch in os.listdir(lib_base_dir) |
| 51 if arch[:1] != '.' and arch != output_dir_name] | 52 if arch[:1] != '.' and arch != output_dir_name |
| 53 and arch != include_dir_name] |
| 52 # For each arch, find (library name, libary path) for arch. We will merge | 54 # For each arch, find (library name, libary path) for arch. We will merge |
| 53 # all libraries with the same name. | 55 # all libraries with the same name. |
| 54 libs = {} | 56 libs = {} |
| 55 for dirpath, _, filenames in os.walk(lib_base_dir): | 57 for dirpath, _, filenames in os.walk(lib_base_dir): |
| 56 if dirpath.endswith(output_dir_name): | 58 if dirpath.endswith(output_dir_name): |
| 57 continue | 59 continue |
| 58 for filename in filenames: | 60 for filename in filenames: |
| 59 if not filename.endswith('.a'): | 61 if not filename.endswith('.a'): |
| 60 continue | 62 continue |
| 61 entry = libs.get(filename, []) | 63 entry = libs.get(filename, []) |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 def Main(): | 129 def Main(): |
| 128 parser = optparse.OptionParser() | 130 parser = optparse.OptionParser() |
| 129 _, args = parser.parse_args() | 131 _, args = parser.parse_args() |
| 130 if len(args) != 1: | 132 if len(args) != 1: |
| 131 parser.error('Error: Exactly 1 argument required.') | 133 parser.error('Error: Exactly 1 argument required.') |
| 132 lib_base_dir = args[0] | 134 lib_base_dir = args[0] |
| 133 MergeLibs(lib_base_dir) | 135 MergeLibs(lib_base_dir) |
| 134 | 136 |
| 135 if __name__ == '__main__': | 137 if __name__ == '__main__': |
| 136 sys.exit(Main()) | 138 sys.exit(Main()) |
| OLD | NEW |