File: configure.py

package info (click to toggle)
vg 1.59.0%2Bds-0.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 361,528 kB
  • sloc: cpp: 479,590; ansic: 191,648; python: 23,671; javascript: 13,961; sh: 7,025; makefile: 5,577; perl: 3,636; lisp: 293; java: 136
file content (44 lines) | stat: -rw-r--r-- 1,227 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
import sys
import shutil


def make_source_me():
    var_dict = {
            "LIBRARY_PATH":"lib",
            "LD_LIBRARY_PATH":"lib",
            "LD_INCLUDE_PATH":"include",
            "C_INCLUDE_PATH":"include",
            "CPLUS_INCLUDE_PATH":"include",
            "INCLUDE_PATH":"include",
            "PATH":"bin"                                                                   }

    my_wd = os.getcwd()
    out_file = "source_me.sh"

    with open(out_file, "w") as ofi:
        for i in var_dict:
            o_line  = "export" + " " + i + "=" + my_wd + "/" + var_dict[i] + ":$" + i + "\n"
            ofi.write(o_line)

def set_compiler():
    compiler_dict = {
        "CC": "gcc",
        "CXX": "g++"
        }

    out_file = "source_me.sh"
    with open(out_file, "a") as ofi:
        for i in compiler_dict:
            o_line = "export" + " " + i + "=" + "$(which " + compiler_dict[i] + ")\n"
            ofi.write(o_line)

def check_deps():
    return

## pulled these out with this line: for i in `cat source_me.sh | cut -f 2 -d " " | cut -f 1 -d "="`; do echo "\"\$$i\":\"\","; done
if __name__ == "__main__":
    make_source_me() 
    set_compiler()
## "$CC":"",
            #"$CXX":"",