Skip to content

Commit

Permalink
rename some _linux files to _posix and introduce os_bsd
Browse files Browse the repository at this point in the history
The os_bsd variable is only available on FreeBSD and OpenBSD.
Later on others like NetBSD and DragonflyBSD can be added.
This variable was introduced in order to have shorter
conditions in the gyp files.

BUG=
TEST=compile

Patch by Robert Nagy <robert.nagy@gmail.com>
Review URL: http://codereview.chromium.org/8567001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109929 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mark@chromium.org committed Nov 14, 2011
1 parent ddbfc54 commit df9167b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
17 changes: 9 additions & 8 deletions base/base.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'base_paths_android.cc',
'base_paths_mac.h',
'base_paths_mac.mm',
'base_paths_linux.cc',
'base_paths_posix.cc',
'base_paths_win.cc',
'base_paths_win.h',
'base_switches.h',
Expand Down Expand Up @@ -196,8 +196,8 @@
'metrics/stats_table.cc',
'metrics/stats_table.h',
'native_library.h',
'native_library_linux.cc',
'native_library_mac.mm',
'native_library_posix.cc',
'native_library_win.cc',
'observer_list.h',
'observer_list_threadsafe.h',
Expand Down Expand Up @@ -293,8 +293,8 @@
'sys_info_posix.cc',
'sys_info_win.cc',
'sys_string_conversions.h',
'sys_string_conversions_linux.cc',
'sys_string_conversions_mac.mm',
'sys_string_conversions_posix.cc',
'sys_string_conversions_win.cc',
'task.cc',
'task.h',
Expand Down Expand Up @@ -450,10 +450,8 @@
'system_monitor/system_monitor_posix.cc',
],
'sources/': [
['include', '^native_library_linux\\.cc$'],
['include', '^process_util_linux\\.cc$'],
['include', '^sys_info_linux\\.cc$'],
['include', '^sys_string_conversions_linux\\.cc$'],
['include', '^worker_pool_linux\\.cc$'],
# TODO(michaelbai): The below files are excluded because of the
# missing JNI, add them back when JNI is ready.
Expand Down Expand Up @@ -509,8 +507,11 @@
],
}],
[ 'OS == "mac"', {
'sources!': [
'files/file_path_watcher_stub.cc',
'sources/': [
['exclude', '^files/file_path_watcher_stub\\.cc$'],
['exclude', '^base_paths_posix\\.cc$'],
['exclude', '^native_library_posix\\.cc$'],
['exclude', '^sys_string_conversions_posix\\.cc$'],
],
}],
[ 'OS == "openbsd"', {
Expand Down Expand Up @@ -619,7 +620,7 @@
}],
],
}],
[ 'OS == "freebsd" or OS == "openbsd"', {
[ 'os_bsd==1', {
'include_dirs': [
'/usr/local/include',
],
Expand Down
2 changes: 1 addition & 1 deletion base/base_paths_linux.cc → base/base_paths_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const char kSelfExe[] = "/proc/self/exe";

// The name of this file relative to the source root. This is used for checking
// that the source checkout is in the correct place.
static const char kThisSourceFile[] = "base/base_paths_linux.cc";
static const char kThisSourceFile[] = "base/base_paths_posix.cc";

bool PathProviderPosix(int key, FilePath* result) {
FilePath path;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down
8 changes: 8 additions & 0 deletions build/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@
'os_posix%': 1,
}],

# A flag for BSD platforms
['OS=="freebsd" or OS=="openbsd"', {
'os_bsd%': 1,
}, {
'os_bsd%': 0,
}],

# NSS usage.
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and use_openssl==0', {
'use_nss%': 1,
Expand Down Expand Up @@ -349,6 +356,7 @@
'use_aura%': '<(use_aura)',
'use_openssl%': '<(use_openssl)',
'use_nss%': '<(use_nss)',
'os_bsd%': '<(os_bsd)',
'os_posix%': '<(os_posix)',
'use_glib%': '<(use_glib)',
'toolkit_uses_gtk%': '<(toolkit_uses_gtk)',
Expand Down

0 comments on commit df9167b

Please sign in to comment.