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