system.gyp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. {
  5. 'variables': {
  6. 'conditions': [
  7. ['sysroot!=""', {
  8. 'pkg-config': './pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
  9. }, {
  10. 'pkg-config': 'pkg-config'
  11. }]
  12. ],
  13. },
  14. 'conditions': [
  15. [ 'os_posix==1 and OS!="mac"', {
  16. 'variables': {
  17. # We use our own copy of libssl3, although we still need to link against
  18. # the rest of NSS.
  19. 'use_system_ssl%': 0,
  20. },
  21. }, {
  22. 'variables': {
  23. 'use_system_ssl%': 1,
  24. },
  25. }],
  26. [ 'chromeos==0', {
  27. # Hide GTK and related dependencies for Chrome OS, so they won't get
  28. # added back to Chrome OS. Don't try to use GTK on Chrome OS.
  29. 'targets': [
  30. {
  31. 'target_name': 'gtk',
  32. 'type': 'none',
  33. 'toolsets': ['host', 'target'],
  34. 'variables': {
  35. # gtk requires gmodule, but it does not list it as a dependency
  36. # in some misconfigured systems.
  37. 'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
  38. },
  39. 'conditions': [
  40. ['_toolset=="target"', {
  41. 'direct_dependent_settings': {
  42. 'cflags': [
  43. '<!@(<(pkg-config) --cflags <(gtk_packages))',
  44. ],
  45. },
  46. 'link_settings': {
  47. 'ldflags': [
  48. '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
  49. ],
  50. 'libraries': [
  51. '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
  52. ],
  53. },
  54. }, {
  55. 'direct_dependent_settings': {
  56. 'cflags': [
  57. '<!@(pkg-config --cflags <(gtk_packages))',
  58. ],
  59. },
  60. 'link_settings': {
  61. 'ldflags': [
  62. '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
  63. ],
  64. 'libraries': [
  65. '<!@(pkg-config --libs-only-l <(gtk_packages))',
  66. ],
  67. },
  68. }],
  69. ],
  70. },
  71. {
  72. 'target_name': 'gtkprint',
  73. 'type': 'none',
  74. 'conditions': [
  75. ['_toolset=="target"', {
  76. 'direct_dependent_settings': {
  77. 'cflags': [
  78. '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
  79. ],
  80. },
  81. 'link_settings': {
  82. 'ldflags': [
  83. '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
  84. ],
  85. 'libraries': [
  86. '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
  87. ],
  88. },
  89. }],
  90. ],
  91. },
  92. {
  93. 'target_name': 'gdk',
  94. 'type': 'none',
  95. 'conditions': [
  96. ['_toolset=="target"', {
  97. 'direct_dependent_settings': {
  98. 'cflags': [
  99. '<!@(<(pkg-config) --cflags gdk-2.0)',
  100. ],
  101. },
  102. 'link_settings': {
  103. 'ldflags': [
  104. '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
  105. ],
  106. 'libraries': [
  107. '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
  108. ],
  109. },
  110. }],
  111. ],
  112. },
  113. ], # targets
  114. }, { # chromeos==1
  115. 'targets': [
  116. {
  117. # TODO(satorux): Remove this once dbus-glib clients are gone.
  118. 'target_name': 'dbus-glib',
  119. 'type': 'none',
  120. 'direct_dependent_settings': {
  121. 'cflags': [
  122. '<!@(<(pkg-config) --cflags dbus-glib-1)',
  123. ],
  124. },
  125. 'link_settings': {
  126. 'ldflags': [
  127. '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-glib-1)',
  128. ],
  129. 'libraries': [
  130. '<!@(<(pkg-config) --libs-only-l dbus-glib-1)',
  131. ],
  132. },
  133. },
  134. ],
  135. }]
  136. ], # conditions
  137. 'targets': [
  138. {
  139. 'target_name': 'ssl',
  140. 'type': 'none',
  141. 'conditions': [
  142. ['_toolset=="target"', {
  143. 'conditions': [
  144. ['use_openssl==1', {
  145. 'dependencies': [
  146. '../../third_party/openssl/openssl.gyp:openssl',
  147. ],
  148. }],
  149. ['use_openssl==0 and use_system_ssl==0', {
  150. 'dependencies': [
  151. '../../net/third_party/nss/ssl.gyp:libssl',
  152. '../../third_party/zlib/zlib.gyp:zlib',
  153. ],
  154. 'direct_dependent_settings': {
  155. 'include_dirs+': [
  156. # We need for our local copies of the libssl3 headers to come
  157. # before other includes, as we are shadowing system headers.
  158. '<(DEPTH)/net/third_party/nss/ssl',
  159. ],
  160. 'cflags': [
  161. '<!@(<(pkg-config) --cflags nss)',
  162. ],
  163. },
  164. 'link_settings': {
  165. 'ldflags': [
  166. '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
  167. ],
  168. 'libraries': [
  169. '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
  170. ],
  171. },
  172. }],
  173. ['use_openssl==0 and use_system_ssl==1', {
  174. 'direct_dependent_settings': {
  175. 'cflags': [
  176. '<!@(<(pkg-config) --cflags nss)',
  177. ],
  178. 'defines': [
  179. 'USE_SYSTEM_SSL',
  180. ],
  181. },
  182. 'link_settings': {
  183. 'ldflags': [
  184. '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
  185. ],
  186. 'libraries': [
  187. '<!@(<(pkg-config) --libs-only-l nss)',
  188. ],
  189. },
  190. }],
  191. ]
  192. }],
  193. ],
  194. },
  195. {
  196. 'target_name': 'freetype2',
  197. 'type': 'none',
  198. 'conditions': [
  199. ['_toolset=="target"', {
  200. 'direct_dependent_settings': {
  201. 'cflags': [
  202. '<!@(<(pkg-config) --cflags freetype2)',
  203. ],
  204. },
  205. 'link_settings': {
  206. 'ldflags': [
  207. '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
  208. ],
  209. 'libraries': [
  210. '<!@(<(pkg-config) --libs-only-l freetype2)',
  211. ],
  212. },
  213. }],
  214. ],
  215. },
  216. {
  217. 'target_name': 'fontconfig',
  218. 'type': 'none',
  219. 'conditions': [
  220. ['_toolset=="target"', {
  221. 'direct_dependent_settings': {
  222. 'cflags': [
  223. '<!@(<(pkg-config) --cflags fontconfig)',
  224. ],
  225. },
  226. 'link_settings': {
  227. 'ldflags': [
  228. '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
  229. ],
  230. 'libraries': [
  231. '<!@(<(pkg-config) --libs-only-l fontconfig)',
  232. ],
  233. },
  234. }],
  235. ],
  236. },
  237. {
  238. 'target_name': 'gconf',
  239. 'type': 'none',
  240. 'conditions': [
  241. ['use_gconf==1 and _toolset=="target"', {
  242. 'direct_dependent_settings': {
  243. 'cflags': [
  244. '<!@(<(pkg-config) --cflags gconf-2.0)',
  245. ],
  246. 'defines': [
  247. 'USE_GCONF',
  248. ],
  249. },
  250. 'link_settings': {
  251. 'ldflags': [
  252. '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
  253. ],
  254. 'libraries': [
  255. '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
  256. ],
  257. },
  258. }],
  259. ],
  260. },
  261. {
  262. 'target_name': 'gio',
  263. 'type': 'none',
  264. 'conditions': [
  265. ['use_gio==1 and _toolset=="target"', {
  266. 'direct_dependent_settings': {
  267. 'cflags': [
  268. '<!@(<(pkg-config) --cflags gio-2.0)',
  269. ],
  270. 'defines': [
  271. 'USE_GIO',
  272. ],
  273. 'conditions': [
  274. ['linux_link_gsettings==0', {
  275. 'defines': ['DLOPEN_GSETTINGS'],
  276. }],
  277. ],
  278. },
  279. 'link_settings': {
  280. 'ldflags': [
  281. '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
  282. ],
  283. 'libraries': [
  284. '<!@(<(pkg-config) --libs-only-l gio-2.0)',
  285. ],
  286. 'conditions': [
  287. ['linux_link_gsettings==0 and OS=="linux"', {
  288. 'libraries': [
  289. '-ldl',
  290. ],
  291. }],
  292. ],
  293. },
  294. }],
  295. ],
  296. },
  297. {
  298. 'target_name': 'x11',
  299. 'type': 'none',
  300. 'toolsets': ['host', 'target'],
  301. 'conditions': [
  302. ['_toolset=="target"', {
  303. 'direct_dependent_settings': {
  304. 'cflags': [
  305. '<!@(<(pkg-config) --cflags x11)',
  306. ],
  307. },
  308. 'link_settings': {
  309. 'ldflags': [
  310. '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
  311. ],
  312. 'libraries': [
  313. '<!@(<(pkg-config) --libs-only-l x11 xi)',
  314. ],
  315. },
  316. }, {
  317. 'direct_dependent_settings': {
  318. 'cflags': [
  319. '<!@(pkg-config --cflags x11)',
  320. ],
  321. },
  322. 'link_settings': {
  323. 'ldflags': [
  324. '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
  325. ],
  326. 'libraries': [
  327. '<!@(pkg-config --libs-only-l x11 xi)',
  328. ],
  329. },
  330. }],
  331. ],
  332. },
  333. {
  334. 'target_name': 'xext',
  335. 'type': 'none',
  336. 'conditions': [
  337. ['_toolset=="target"', {
  338. 'direct_dependent_settings': {
  339. 'cflags': [
  340. '<!@(<(pkg-config) --cflags xext)',
  341. ],
  342. },
  343. 'link_settings': {
  344. 'ldflags': [
  345. '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
  346. ],
  347. 'libraries': [
  348. '<!@(<(pkg-config) --libs-only-l xext)',
  349. ],
  350. },
  351. }],
  352. ],
  353. },
  354. {
  355. 'target_name': 'xfixes',
  356. 'type': 'none',
  357. 'conditions': [
  358. ['_toolset=="target"', {
  359. 'direct_dependent_settings': {
  360. 'cflags': [
  361. '<!@(<(pkg-config) --cflags xfixes)',
  362. ],
  363. },
  364. 'link_settings': {
  365. 'ldflags': [
  366. '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
  367. ],
  368. 'libraries': [
  369. '<!@(<(pkg-config) --libs-only-l xfixes)',
  370. ],
  371. },
  372. }],
  373. ],
  374. },
  375. {
  376. 'target_name': 'libgcrypt',
  377. 'type': 'none',
  378. 'conditions': [
  379. ['_toolset=="target" and use_cups==1', {
  380. 'direct_dependent_settings': {
  381. 'cflags': [
  382. '<!@(libgcrypt-config --cflags)',
  383. ],
  384. },
  385. 'link_settings': {
  386. 'libraries': [
  387. '<!@(libgcrypt-config --libs)',
  388. ],
  389. },
  390. }],
  391. ],
  392. },
  393. {
  394. 'target_name': 'selinux',
  395. 'type': 'none',
  396. 'conditions': [
  397. ['_toolset=="target"', {
  398. 'link_settings': {
  399. 'libraries': [
  400. '-lselinux',
  401. ],
  402. },
  403. }],
  404. ],
  405. },
  406. {
  407. 'target_name': 'gnome_keyring',
  408. 'type': 'none',
  409. 'conditions': [
  410. ['use_gnome_keyring==1', {
  411. 'direct_dependent_settings': {
  412. 'cflags': [
  413. '<!@(<(pkg-config) --cflags gnome-keyring-1)',
  414. ],
  415. 'defines': [
  416. 'USE_GNOME_KEYRING',
  417. ],
  418. 'conditions': [
  419. ['linux_link_gnome_keyring==0', {
  420. 'defines': ['DLOPEN_GNOME_KEYRING'],
  421. }],
  422. ],
  423. },
  424. 'conditions': [
  425. ['linux_link_gnome_keyring!=0', {
  426. 'link_settings': {
  427. 'ldflags': [
  428. '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
  429. ],
  430. 'libraries': [
  431. '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
  432. ],
  433. },
  434. }, {
  435. 'conditions': [
  436. ['OS=="linux"', {
  437. 'link_settings': {
  438. 'libraries': [
  439. '-ldl',
  440. ],
  441. },
  442. }],
  443. ],
  444. }],
  445. ],
  446. }],
  447. ],
  448. },
  449. {
  450. # The unit tests use a few convenience functions from the GNOME
  451. # Keyring library directly. We ignore linux_link_gnome_keyring and
  452. # link directly in this version of the target to allow this.
  453. # *** Do not use this target in the main binary! ***
  454. 'target_name': 'gnome_keyring_direct',
  455. 'type': 'none',
  456. 'conditions': [
  457. ['use_gnome_keyring==1', {
  458. 'direct_dependent_settings': {
  459. 'cflags': [
  460. '<!@(<(pkg-config) --cflags gnome-keyring-1)',
  461. ],
  462. 'defines': [
  463. 'USE_GNOME_KEYRING',
  464. ],
  465. 'conditions': [
  466. ['linux_link_gnome_keyring==0', {
  467. 'defines': ['DLOPEN_GNOME_KEYRING'],
  468. }],
  469. ],
  470. },
  471. 'link_settings': {
  472. 'ldflags': [
  473. '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
  474. ],
  475. 'libraries': [
  476. '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
  477. ],
  478. },
  479. }],
  480. ],
  481. },
  482. {
  483. 'target_name': 'dbus',
  484. 'type': 'none',
  485. 'direct_dependent_settings': {
  486. 'cflags': [
  487. '<!@(<(pkg-config) --cflags dbus-1)',
  488. ],
  489. },
  490. 'link_settings': {
  491. 'ldflags': [
  492. '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
  493. ],
  494. 'libraries': [
  495. '<!@(<(pkg-config) --libs-only-l dbus-1)',
  496. ],
  497. },
  498. },
  499. {
  500. 'target_name': 'glib',
  501. 'type': 'none',
  502. 'toolsets': ['host', 'target'],
  503. 'variables': {
  504. 'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
  505. },
  506. 'conditions': [
  507. ['_toolset=="target"', {
  508. 'direct_dependent_settings': {
  509. 'cflags': [
  510. '<!@(<(pkg-config) --cflags <(glib_packages))',
  511. ],
  512. },
  513. 'link_settings': {
  514. 'ldflags': [
  515. '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
  516. ],
  517. 'libraries': [
  518. '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
  519. ],
  520. },
  521. }, {
  522. 'direct_dependent_settings': {
  523. 'cflags': [
  524. '<!@(pkg-config --cflags <(glib_packages))',
  525. ],
  526. },
  527. 'link_settings': {
  528. 'ldflags': [
  529. '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
  530. ],
  531. 'libraries': [
  532. '<!@(pkg-config --libs-only-l <(glib_packages))',
  533. ],
  534. },
  535. }],
  536. ['chromeos==1', {
  537. 'link_settings': {
  538. 'libraries': [ '-lXtst' ]
  539. }
  540. }],
  541. ],
  542. },
  543. {
  544. 'target_name': 'pangocairo',
  545. 'type': 'none',
  546. 'toolsets': ['host', 'target'],
  547. 'conditions': [
  548. ['_toolset=="target"', {
  549. 'direct_dependent_settings': {
  550. 'cflags': [
  551. '<!@(<(pkg-config) --cflags pangocairo)',
  552. ],
  553. },
  554. 'link_settings': {
  555. 'ldflags': [
  556. '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo)',
  557. ],
  558. 'libraries': [
  559. '<!@(<(pkg-config) --libs-only-l pangocairo)',
  560. ],
  561. },
  562. }, {
  563. 'direct_dependent_settings': {
  564. 'cflags': [
  565. '<!@(pkg-config --cflags pangocairo)',
  566. ],
  567. },
  568. 'link_settings': {
  569. 'ldflags': [
  570. '<!@(pkg-config --libs-only-L --libs-only-other pangocairo)',
  571. ],
  572. 'libraries': [
  573. '<!@(pkg-config --libs-only-l pangocairo)',
  574. ],
  575. },
  576. }],
  577. ],
  578. },
  579. {
  580. 'target_name': 'libresolv',
  581. 'type': 'none',
  582. 'link_settings': {
  583. 'libraries': [
  584. '-lresolv',
  585. ],
  586. },
  587. },
  588. {
  589. 'target_name': 'ibus',
  590. 'type': 'none',
  591. 'conditions': [
  592. ['use_ibus==1', {
  593. 'variables': {
  594. 'ibus_min_version': '1.3.99.20110425',
  595. },
  596. 'direct_dependent_settings': {
  597. 'defines': ['HAVE_IBUS=1'],
  598. 'cflags': [
  599. '<!@(<(pkg-config) --cflags "ibus-1.0 >= <(ibus_min_version)")',
  600. ],
  601. },
  602. 'link_settings': {
  603. 'ldflags': [
  604. '<!@(<(pkg-config) --libs-only-L --libs-only-other "ibus-1.0 >= <(ibus_min_version)")',
  605. ],
  606. 'libraries': [
  607. '<!@(<(pkg-config) --libs-only-l "ibus-1.0 >= <(ibus_min_version)")',
  608. ],
  609. },
  610. }],
  611. ],
  612. },
  613. {
  614. 'target_name': 'udev',
  615. 'type': 'none',
  616. 'conditions': [
  617. # libudev is not available on *BSD
  618. ['_toolset=="target" and os_bsd!=1', {
  619. 'direct_dependent_settings': {
  620. 'cflags': [
  621. '<!@(<(pkg-config) --cflags libudev)'
  622. ],
  623. },
  624. 'link_settings': {
  625. 'ldflags': [
  626. '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)',
  627. ],
  628. 'libraries': [
  629. '<!@(<(pkg-config) --libs-only-l libudev)',
  630. ],
  631. },
  632. }],
  633. ],
  634. },
  635. ],
  636. }