1*e0c4386eSCy SchubertConfigure Internals 2*e0c4386eSCy Schubert=================== 3*e0c4386eSCy Schubert 4*e0c4386eSCy Schubert[ note: this file uses markdown for formatting ] 5*e0c4386eSCy Schubert 6*e0c4386eSCy SchubertIntro 7*e0c4386eSCy Schubert----- 8*e0c4386eSCy Schubert 9*e0c4386eSCy SchubertThis is a collection of notes that are hopefully of interest to those 10*e0c4386eSCy Schubertwho decide to dive into Configure and what it does. This is a living 11*e0c4386eSCy Schubertdocument and anyone is encouraged to add to it and submit changes. 12*e0c4386eSCy SchubertThere's no claim for this document to be complete at any time, but it 13*e0c4386eSCy Schubertwill hopefully reach such a point in time. 14*e0c4386eSCy Schubert 15*e0c4386eSCy Schubert 16*e0c4386eSCy Schubert---------------------------------------------------------------------- 17*e0c4386eSCy Schubert 18*e0c4386eSCy SchubertParsing build.info files, processing conditions 19*e0c4386eSCy Schubert----------------------------------------------- 20*e0c4386eSCy Schubert 21*e0c4386eSCy SchubertProcessing conditions in build.info files is done with the help of a 22*e0c4386eSCy Schubertcondition stack that tell if a build.info should be processed or if it 23*e0c4386eSCy Schubertshould just be skipped over. The possible states of the stack top are 24*e0c4386eSCy Schubertexpressed in the following comment from Configure: 25*e0c4386eSCy Schubert 26*e0c4386eSCy Schubert # The top item of this stack has the following values 27*e0c4386eSCy Schubert # -2 positive already run and we found ELSE (following ELSIF should fail) 28*e0c4386eSCy Schubert # -1 positive already run (skip until ENDIF) 29*e0c4386eSCy Schubert # 0 negatives so far (if we're at a condition, check it) 30*e0c4386eSCy Schubert # 1 last was positive (don't skip lines until next ELSE, ELSIF or ENDIF) 31*e0c4386eSCy Schubert # 2 positive ELSE (following ELSIF should fail) 32*e0c4386eSCy Schubert 33*e0c4386eSCy SchubertGround rule is that non-condition lines are skipped over if the 34*e0c4386eSCy Schubertstack top is > 0. Condition lines (IF, ELSIF, ELSE and ENDIF 35*e0c4386eSCy Schubertstatements) need to be processed either way to keep track of the skip 36*e0c4386eSCy Schubertstack states, so they are a little more intricate. 37*e0c4386eSCy Schubert 38*e0c4386eSCy SchubertInstead of trying to describe in words, here are some example of what 39*e0c4386eSCy Schubertthe skip stack should look like after each line is processed: 40*e0c4386eSCy Schubert 41*e0c4386eSCy SchubertExample 1: 42*e0c4386eSCy Schubert 43*e0c4386eSCy Schubert| IF[1] | 1 | | 44*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 45*e0c4386eSCy Schubert| IF[1] | 1 1 | | 46*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 47*e0c4386eSCy Schubert| ELSIF[1] | 1 -1 | | 48*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 49*e0c4386eSCy Schubert| ELSE | 1 -2 | | 50*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 51*e0c4386eSCy Schubert| ENDIF | 1 | | 52*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 53*e0c4386eSCy Schubert| ELSIF[1] | -1 | | 54*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 55*e0c4386eSCy Schubert| IF[1] | -1 -1 | | 56*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 57*e0c4386eSCy Schubert| ELSIF[1] | -1 -1 | | 58*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 59*e0c4386eSCy Schubert| ELSE | -1 -2 | | 60*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 61*e0c4386eSCy Schubert| ENDIF | -1 | | 62*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 63*e0c4386eSCy Schubert| ENDIF | | | 64*e0c4386eSCy Schubert 65*e0c4386eSCy SchubertExample 2: 66*e0c4386eSCy Schubert 67*e0c4386eSCy Schubert| IF[0] | 0 | | 68*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 69*e0c4386eSCy Schubert| IF[1] | 0 -1 | | 70*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 71*e0c4386eSCy Schubert| ELSIF[1] | 0 -1 | | 72*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 73*e0c4386eSCy Schubert| ELSE | 0 -2 | | 74*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 75*e0c4386eSCy Schubert| ENDIF | 0 | | 76*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 77*e0c4386eSCy Schubert| ELSIF[1] | 1 | | 78*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 79*e0c4386eSCy Schubert| IF[1] | 1 1 | | 80*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 81*e0c4386eSCy Schubert| ELSIF[1] | 1 -1 | | 82*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 83*e0c4386eSCy Schubert| ELSE | 1 -2 | | 84*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 85*e0c4386eSCy Schubert| ENDIF | 1 | | 86*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 87*e0c4386eSCy Schubert| ENDIF | | | 88*e0c4386eSCy Schubert 89*e0c4386eSCy SchubertExample 3: 90*e0c4386eSCy Schubert 91*e0c4386eSCy Schubert| IF[0] | 0 | | 92*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 93*e0c4386eSCy Schubert| IF[0] | 0 -1 | | 94*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 95*e0c4386eSCy Schubert| ELSIF[1] | 0 -1 | | 96*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 97*e0c4386eSCy Schubert| ELSE | 0 -2 | | 98*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 99*e0c4386eSCy Schubert| ENDIF | 0 | | 100*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 101*e0c4386eSCy Schubert| ELSIF[1] | 1 | | 102*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 103*e0c4386eSCy Schubert| IF[0] | 1 0 | | 104*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 105*e0c4386eSCy Schubert| ELSIF[1] | 1 1 | | 106*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 107*e0c4386eSCy Schubert| ELSE | 1 -2 | | 108*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 109*e0c4386eSCy Schubert| ENDIF | 1 | | 110*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 111*e0c4386eSCy Schubert| ENDIF | | | 112*e0c4386eSCy Schubert 113*e0c4386eSCy SchubertExample 4: 114*e0c4386eSCy Schubert 115*e0c4386eSCy Schubert| IF[0] | 0 | | 116*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 117*e0c4386eSCy Schubert| IF[0] | 0 -1 | | 118*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 119*e0c4386eSCy Schubert| ELSIF[0] | 0 -1 | | 120*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 121*e0c4386eSCy Schubert| ELSE | 0 -2 | | 122*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 123*e0c4386eSCy Schubert| ENDIF | 0 | | 124*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 125*e0c4386eSCy Schubert| ELSIF[1] | 1 | | 126*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 127*e0c4386eSCy Schubert| IF[0] | 1 0 | | 128*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 129*e0c4386eSCy Schubert| ELSIF[0] | 1 0 | | 130*e0c4386eSCy Schubert| ... whatever ... | | this line is skipped over | 131*e0c4386eSCy Schubert| ELSE | 1 2 | | 132*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 133*e0c4386eSCy Schubert| ENDIF | 1 | | 134*e0c4386eSCy Schubert| ... whatever ... | | this line is processed | 135*e0c4386eSCy Schubert| ENDIF | | | 136*e0c4386eSCy Schubert 137