Bug 1206558 (part 6) - Factor out common libevent moz.build stuff. r=mshal.

Two parts.

- Most of the common stuff goes into the new libeventcommon.mozbuild file.

- A little bit of common bsd/linux stuff factored out in
  ipc/chromium/moz.build.

--HG--
extra : rebase_source : a4bb56a444ad5b0d5d808e5d58dd7abe7dd81dbe
This commit is contained in:
Nicholas Nethercote 2015-09-22 16:24:51 -07:00
Родитель 89cb2574cf
Коммит 91333243f4
3 изменённых файлов: 45 добавлений и 63 удалений

Просмотреть файл

@ -4,29 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
os_win = 0
os_posix = 0
os_macosx = 0
os_bsd = 0
os_linux = 0
if CONFIG['OS_ARCH'] == 'WINNT':
os_win = 1
else:
os_posix = 1
if CONFIG['OS_ARCH'] == 'Darwin':
os_macosx = 1
libevent_include_suffix = 'mac'
elif CONFIG['OS_ARCH'] in ['DragonFly', 'FreeBSD', 'GNU_kFreeBSD',
'NetBSD', 'OpenBSD']:
os_bsd = 1
libevent_include_suffix = 'bsd'
else:
os_linux = 1
if CONFIG['OS_TARGET'] == 'Android':
libevent_include_suffix = 'android'
else:
libevent_include_suffix = 'linux'
libevent_path_prefix = 'src/third_party'
include(libevent_path_prefix + '/libeventcommon.mozbuild')
UNIFIED_SOURCES += [
'src/base/at_exit.cc',
@ -96,12 +75,6 @@ if os_win:
]
elif not CONFIG['MOZ_NATIVE_LIBEVENT']:
DIRS += ['src/third_party']
DEFINES['HAVE_CONFIG_H'] = True
LOCAL_INCLUDES += sorted([
'src/third_party/libevent',
'src/third_party/libevent/include',
'src/third_party/libevent/' + libevent_include_suffix,
])
if os_posix:
UNIFIED_SOURCES += [
@ -162,15 +135,6 @@ if os_bsd:
SOURCES += [
'src/base/process_util_bsd.cc'
]
if CONFIG['MOZ_WIDGET_GTK']:
SOURCES += [
'src/base/message_pump_glib.cc',
]
if CONFIG['MOZ_ENABLE_QT']:
SOURCES += [
'!moc_message_pump_qt.cc',
'src/base/message_pump_qt.cc',
]
if os_linux:
SOURCES += [
@ -185,6 +149,8 @@ if os_linux:
]
DEFINES['ANDROID'] = True
DEFINES['_POSIX_MONOTONIC_CLOCK'] = 0
if os_bsd or os_linux:
if CONFIG['MOZ_WIDGET_GTK']:
SOURCES += [
'src/base/message_pump_glib.cc',

37
ipc/chromium/src/third_party/libeventcommon.mozbuild поставляемый Normal file
Просмотреть файл

@ -0,0 +1,37 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
os_win = 0
os_posix = 0
os_macosx = 0
os_bsd = 0
os_linux = 0
if CONFIG['OS_ARCH'] == 'WINNT':
os_win = 1
else:
os_posix = 1
if CONFIG['OS_ARCH'] == 'Darwin':
os_macosx = 1
libevent_include_suffix = 'mac'
elif CONFIG['OS_ARCH'] in ['DragonFly', 'FreeBSD', 'GNU_kFreeBSD',
'NetBSD', 'OpenBSD']:
os_bsd = 1
libevent_include_suffix = 'bsd'
else:
os_linux = 1
if CONFIG['OS_TARGET'] == 'Android':
libevent_include_suffix = 'android'
else:
libevent_include_suffix = 'linux'
if os_posix and not CONFIG['MOZ_NATIVE_LIBEVENT']:
DEFINES['HAVE_CONFIG_H'] = True
LOCAL_INCLUDES += sorted([
libevent_path_prefix + '/libevent',
libevent_path_prefix + '/libevent/include',
libevent_path_prefix + '/libevent/' + libevent_include_suffix,
])

29
ipc/chromium/src/third_party/moz.build поставляемый
Просмотреть файл

@ -4,30 +4,15 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['OS_ARCH'] == 'WINNT':
libevent_path_prefix = '.'
include(libevent_path_prefix + '/libeventcommon.mozbuild')
if os_win:
error('should not reach here on Windows')
if CONFIG['MOZ_NATIVE_LIBEVENT']:
error('should not reach here if we are using a native libevent')
os_macosx = 0
os_bsd = 0
os_linux = 0
if CONFIG['OS_ARCH'] == 'Darwin':
os_macosx = 1
libevent_include_suffix = 'mac'
elif CONFIG['OS_ARCH'] in ['DragonFly', 'FreeBSD', 'GNU_kFreeBSD',
'NetBSD', 'OpenBSD']:
os_bsd = 1
libevent_include_suffix = 'bsd'
else:
os_linux = 1
if CONFIG['OS_TARGET'] == 'Android':
libevent_include_suffix = 'android'
else:
libevent_include_suffix = 'linux'
UNIFIED_SOURCES += [
'libevent/buffer.c',
'libevent/bufferevent.c',
@ -54,12 +39,6 @@ SOURCES += [
# symbol clash.
'libevent/evdns.c',
]
DEFINES['HAVE_CONFIG_H'] = True
LOCAL_INCLUDES += sorted([
'libevent',
'libevent/include',
'libevent/' + libevent_include_suffix,
])
if os_macosx or os_bsd:
UNIFIED_SOURCES += [