{"action":"closed","issue":{"url":"https://api.github.com/repos/waf-project/waf/issues/1574","labels_url":"https://api.github.com/repos/waf-project/waf/issues/1574/labels{/name}","comments_url":"https://api.github.com/repos/waf-project/waf/issues/1574/comments","events_url":"https://api.github.com/repos/waf-project/waf/issues/1574/events","html_url":"https://github.com/waf-project/waf/issues/1574","id":76521361,"number":1574,"title":"duplicated LINKFLAGS if both C and C++ compilers are configured","user":{"login":"che2","id":2295003,"avatar_url":"https://avatars.githubusercontent.com/u/2295003?v=3","gravatar_id":"","url":"https://api.github.com/users/che2","html_url":"https://github.com/che2","followers_url":"https://api.github.com/users/che2/followers","following_url":"https://api.github.com/users/che2/following{/other_user}","gists_url":"https://api.github.com/users/che2/gists{/gist_id}","starred_url":"https://api.github.com/users/che2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/che2/subscriptions","organizations_url":"https://api.github.com/users/che2/orgs","repos_url":"https://api.github.com/users/che2/repos","events_url":"https://api.github.com/users/che2/events{/privacy}","received_events_url":"https://api.github.com/users/che2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-14T23:16:30Z","updated_at":"2015-05-20T17:21:32Z","closed_at":"2015-05-20T17:21:32Z","body":"The contents of LINKFLAGS or LDFLAGS environment variables are duplicated if both a c compiler and a c++ compiler are configured using:\r\n\r\n    def configure(ctx):\r\n        ctx.load('compiler_c')\r\n        ctx.load('compiler_cxx')\r\n\r\nThe reason is that both of the c and c++ compiler plugins (say gcc.py and gxx.py) calls the function conf.link_add_flags(), which is defined in c_config.py:\r\n\r\n    def link_add_flags(conf):\r\n        \"\"\"\r\n        Add LINKFLAGS / LDFLAGS from os.environ to conf.env\r\n\t\"\"\"\r\n        conf.add_os_flags('LINKFLAGS')\r\n        conf.add_os_flags('LDFLAGS')\r\n\r\nThis results in LINKFLAGS being added twice to ctx.env.\r\n\r\n    $ LINKFLAGS='-lblah' waf configure\r\n    $ cat build/c4che/_cache.py\r\n      ...\r\n      LINKFLAGS = ['-lblah', '-lblah']\r\n      ..."}}