updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / camfr / machine_cfg.py.arch
blobb8777e7e1792182ffc1cd6ff400b417affdbeb37
1 # This Python script contains all the machine dependent settings
2 # needed during the build process.
4 import popen2, os
6 # Get compiler flags from Archlinux's /etc/makepkg.conf.
8 #r, w = popen2.popen2("source /etc/makepkg.conf ; echo $CFLAGS")
9 #CXXFLAGS = r.readline().strip()
10 #r.close()
11 #w.close()
13 # Compilers to be used.
15 cc = os.getenv("CC")
16 if cc == None:
17    cc = "gcc"
18 cxx = os.getenv("CXX")
19 if cxx == None:
20    cxx = "g++"
21 f77 = os.getenv("F77")
22 if f77 == None:
23    f77 = "gfortran"    
24 link = cxx
25 flags = os.getenv("CXXFLAGS")
26 if flags == None:
27    flags = "-O"
28 fflags = os.getenv("FFLAGS")
29 if fflags == None:
30    fflags = flags
31 link_flags = os.getenv("LDFLAGS")
32 if link_flags == None:
33    link_flags = ""
38 # Compiler flags.
40 # Note: for the Fortran name definition you can define one of the following
41 #       preprocessor macros:
43 #           FORTRAN_SYMBOLS_WITHOUT_TRAILING_UNDERSCORES
44 #           FORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE
45 #           FORTRAN_SYMBOLS_WITH_DOUBLE_TRAILING_UNDERSCORES
49 base_flags = " -DFORTRAN_SYMBOLS_WITH_SINGLE_TRAILING_UNDERSCORE -DNDEBUG "
50 flags_noopt = base_flags
51 flags = flags + base_flags 
52 fflags =  fflags + base_flags
55 include_dirs = []
57 if os.path.isdir("/usr/include/python2"):
58    include_dirs.append("/usr/include/python2")   
59    include_dirs.append("/usr/lib/python2/site-packages")
60 elif os.path.isdir("/usr/include/python2.7"):
61    include_dirs.append("/usr/include/python2.7")   
62    include_dirs.append("/usr/lib/python2.7/site-packages")
63 elif os.path.isdir("/usr/include/python2.6"):
64    include_dirs.append("/usr/include/python2.6")   
65    include_dirs.append("/usr/lib/python2.6/site-packages")
66 elif os.path.isdir("/usr/include/python2.5"):
67    include_dirs.append("/usr/include/python2.5")   
68    include_dirs.append("/usr/lib/python2.5/site-packages")
69 elif os.path.isdir("/usr/include/python2.4"):
70    include_dirs.append("/usr/include/python2.4")
71    include_dirs.append("/usr/lib/python2.4/site-packages")
72 elif os.path.isdir("/usr/include/python2.3"):
73    include_dirs.append("/usr/include/python2.3")   
74    include_dirs.append("/usr/lib/python2.3/site-packages")
75 else:
76    print "Python dir not found!"
77    sys.exit()
80 library_dirs = []
81 #library_dirs = ["/opt/intel/mkl8/lib/32"]
83 # Library names.
85 libs = ["boost_python", "blitz", "lapack", "blas", "gfortran"]
86 #libs = ["boost_python", "blitz", "mkl_lapack64", "mkl", "gfortran"]
90 dllsuffix = ".so"
91 strip_command = ""
92 extra_files = [("doc", ["docs/camfr.pdf"])]