Bug 2099

Summary: DCE does not look for includes in the correct folder
Product: dce Reporter: Matthieu Coudron <mattator>
Component: otherAssignee: Hajime Tazaki <tazaki>
Status: NEW ---    
Severity: enhancement CC: ns-bugs
Priority: P5    
Version: unspecified   
Hardware: PC   
OS: Linux   

Description Matthieu Coudron 2015-04-17 11:13:36 EDT
The first problem is when you install ns3 to a non standard folder, dce keeps looking in /usr/local/include folder.
To fix this (not sure if it works in all cases though), I've added this line :
conf.env.append_value('INCLUDES', os.path.join(conf.env['NS3_DIR'], 'include/ns3-dev')
next to 
conf.env.append_value('NS3_EXECUTABLE_PATH', os.path.join(conf.env['NS3_DIR'], 'bin'))
in top wscript file.

A 2nd problem is that waf fails when not setting --with-ns3 without a clear error message.
My proposal is to add an "else" in top wscript:
===
    if Options.options.with_ns3 is not None and os.path.isdir(Options.options.with_ns3):↲                                                                                                                          
        conf.env['NS3_DIR']= os.path.abspath(Options.options.with_ns3)↲
        if not 'PKG_CONFIG_PATH' in os.environ:↲
            os.environ['PKG_CONFIG_PATH']= os.path.join(Options.options.with_ns3, 'lib', 'pkgconfig')↲
        else:↲
            os.environ['PKG_CONFIG_PATH']+= ":" + os.path.join(Options.options.with_ns3, 'lib', 'pkgconfig')↲
↲
        conf.env.append_value('NS3_EXECUTABLE_PATH', os.path.join(conf.env['NS3_DIR'], 'bin'))↲
        conf.env.append_value('INCLUDES', os.path.join(conf.env['NS3_DIR'], 'include'))↲
    else:↲
        Logs.error("Please set --with-ns3 to the folder (--prefix option ) where you installed ns3 (ns3$ ./waf install) ")↲
        raise SystemExit(1)↲
        return↲

 when you do "waf configure --with-ns3=$HOME/ns3install" , gcc still searches the include folder in /usr/local instead of "$HOME/ns3install/include"
====
Comment 1 Matthieu Coudron 2015-04-17 11:16:55 EDT
When I write "a non standard folder", I mean you configure ns3 with ./waf configure --prefix=$HOME/ns3install for instance.