aboutsummaryrefslogtreecommitdiff
path: root/mklinux.csh
blob: 7c091fcbd6fe5107c202f4c64b650a1e535657ea (plain) (blame)
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/csh

# Shave and a Haircut
# (c) 2019 Epic Games
# US Patent 6720962

set debugOpt = ""
set mayaVersions = ""

while ("$1" != "")
    if ("$1" == "debug") then
        set debugOpt = "debug"
    else if ("${mayaVersions}" == "") then
        set mayaVersions = $1
    endif

    shift
end

set tmpLog=$$.log

#
# If no explicit version was specified on the command line, then build all
# of the maya versions which can be built on this architecture and
# operating system version.
#
if ("${mayaVersions}" == "") then
    set mayaVersions = `utils/getMayaVersions.sh auto | cut -f 1`

    # Since we're doing a "full" build, get rid of all the old RPMs.
    rm -f shaveHaircut_Maya*.rpm
endif

set prevBaseConfig = ""

foreach mayaVersion (${mayaVersions})
    # Is this version of maya installed?
    set foundMaya = "n"
    set mayaRootDir = "/usr/autodesk"

    if (-d ${mayaRootDir}/maya${mayaVersion}/include/maya) then
        set foundMaya = "y"
        # Do we have the right compiler?
        set compilerVersion = `utils/getg++.sh -v ${mayaVersion}`
        set compiler = `utils/getg++.sh ${mayaVersion}`

        if ("${compiler}" == "") then
            echo "mklinux:warning: cannot find gcc compiler version needed for Maya ${mayaVersion}. Skipping."
        else

            # If we already have a built base and it was built using the
            # same configuration, then we can just reuse it.  Otherwise
            # we need to rebuild the base.
            eval 'set baseConfig = "${compilerVersion}"'

            if ("${baseConfig}" != "${prevBaseConfig}") then
                ./mklinuxBase ${mayaVersion} ${debugOpt}
                eval 'set prevBaseConfig = "'${baseConfig}'"'
            endif

            echo "mklinuxVersion $mayaVersion $debugOpt build"
            ./mklinuxVersion ${mayaVersion} ${debugOpt}
            set result = $status

            if ($result == 2) then
                echo "mklinux:warning: skipping Maya $version build"
            else if ($result != 0) then
                exit 1;
            endif
        endif
    endif

    if ("$foundMaya" == "n") then
        echo "mklinux:warning: Maya ${mayaVersion} not installed. Skipping."
    endif
end

# We have several people working on Shave at the moment and we don't want them
# posting every time they run a build, so comment this out for now.
#
#./postlinux

exit 0