# HG changeset patch # User Ritor1 # Date 1382354650 -21600 # Node ID 4cae2d58cfb494a1cd2bf962dec139243163d6ca # Parent 1a1c4040bee43e8315df0212c76a9af3218d9921# Parent 948c43b11599c76e09a820ab3ac7238cca989776 Слияние diff -r 1a1c4040bee4 -r 4cae2d58cfb4 .gitignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.gitignore Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,5 @@ +.hg +Debug +Release +*.orig +.hg/* diff -r 1a1c4040bee4 -r 4cae2d58cfb4 .hgignore --- a/.hgignore Mon Oct 21 17:23:59 2013 +0600 +++ b/.hgignore Mon Oct 21 17:24:10 2013 +0600 @@ -2,3 +2,4 @@ Debug/ Release/ *.orig +.git/* diff -r 1a1c4040bee4 -r 4cae2d58cfb4 Actor.cpp --- a/Actor.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/Actor.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -44,6 +44,7 @@ stru319 stru_50C198; // idb +std::array<uint, 5> dword_4DF380_hostilityRanges = {0,1024,2560,5120,10240}; //----- (0041AF52) -------------------------------------------------------- @@ -2361,137 +2362,99 @@ v6->UpdateAnimation(); } -//----- (00SelectTarget) -------------------------------------------------------- +//----- (00401221) -------------------------------------------------------- void Actor::_SelectTarget(unsigned int uActorID, int *a2, bool can_target_party) { - //Actor *v3; // esi@1 - //unsigned int v4; // ebx@1 int v5; // ecx@1 - //unsigned int v6; // eax@1 - //Actor *v7; // edi@2 - //__int16 v8; // ax@3 - int v9; // eax@10 signed int v10; // eax@13 - int v11; // ebx@16 - int v12; // eax@16 - //int v13; // eax@25 + uint v11; // ebx@16 + uint v12; // eax@16 signed int v14; // eax@31 - int v15; // edi@43 - int v16; // ebx@45 - int v17; // eax@45 - //int v18; // eax@51 - int v19; // [sp+Ch] [bp-24h]@16 - //int *v20; // [sp+10h] [bp-20h]@1 - signed int v21; // [sp+14h] [bp-1Ch]@1 - //unsigned int v22; // [sp+18h] [bp-18h]@1 - int v23; // [sp+1Ch] [bp-14h]@16 - //unsigned int v24; // [sp+20h] [bp-10h]@1 - int v25; // [sp+24h] [bp-Ch]@1 - //signed int v26; // [sp+28h] [bp-8h]@1 - int v27; // [sp+2Ch] [bp-4h]@16 - int v28; // [sp+2Ch] [bp-4h]@45 + uint v15; // edi@43 + uint v16; // ebx@45 + uint v17; // eax@45 + signed int closestId; // [sp+14h] [bp-1Ch]@1 + uint v23; // [sp+1Ch] [bp-14h]@16 + unsigned int lowestRadius; // [sp+24h] [bp-Ch]@1 + uint v27; // [sp+2Ch] [bp-4h]@16 + uint v28; // [sp+2Ch] [bp-4h]@45 - v25 = -1; - //v22 = uActorID; - //v3 = &pActors[uActorID]; - //v4 = 0; + lowestRadius = UINT_MAX; v5 = 0; - //v6 = v3->uLastCharacterIDToHit; *a2 = 0; - //v20 = a2; - v21 = 0; - //v24 = v3->uLastCharacterIDToHit; - //v26 = 0; + closestId = 0; assert(uActorID < uNumActors); - auto _this = &pActors[uActorID]; + Actor* thisActor = &pActors[uActorID]; for (uint i = 0; i < uNumActors; ++i) { - auto actor = &pActors[i]; - //v7 = pActors; - //do - //{ - //v8 = v7->uAIState; + Actor* actor = &pActors[i]; if (actor->uAIState == Dead || actor->uAIState == Dying || actor->uAIState == Removed || actor->uAIState == Summoned || actor->uAIState == Disabled || uActorID == i ) continue; - if (_this->uLastCharacterIDToHit == 0 || (v9 = 8 * v5, LOBYTE(v9) = PID(OBJECT_Actor,v5), _this->uLastCharacterIDToHit != v9) ) + if (thisActor->uLastCharacterIDToHit == 0 || PID(OBJECT_Actor,v5) != thisActor->uLastCharacterIDToHit ) { - v10 = _this->GetActorsRelation(actor); + v10 = thisActor->GetActorsRelation(actor); if ( v10 == 0 ) continue; } - else if (_this->IsNotAlive()) + else if (thisActor->IsNotAlive()) { - _this->uLastCharacterIDToHit = 0; - v10 = _this->GetActorsRelation(actor); + thisActor->uLastCharacterIDToHit = 0; + v10 = thisActor->GetActorsRelation(actor); if ( v10 == 0 ) continue; } else { - //v18 = actor->uGroup; - if ( (actor->uGroup != 0 || _this->uGroup != 0) && actor->uGroup == _this->uGroup ) + if ( (actor->uGroup != 0 || thisActor->uGroup != 0) && actor->uGroup == thisActor->uGroup ) continue; v10 = 4; } - if ( _this->pMonsterInfo.uHostilityType ) - v10 = pMonsterStats->pInfos[_this->pMonsterInfo.uID].uHostilityType; - v11 = dword_4DF380[v10]; - v23 = abs(_this->vPosition.x - actor->vPosition.x); - v27 = abs(_this->vPosition.y - actor->vPosition.y); - v12 = abs(_this->vPosition.z - actor->vPosition.z); - v19 = v12; + if ( thisActor->pMonsterInfo.uHostilityType ) + v10 = pMonsterStats->pInfos[thisActor->pMonsterInfo.uID].uHostilityType; + v11 = dword_4DF380_hostilityRanges[v10]; + v23 = abs(thisActor->vPosition.x - actor->vPosition.x); + v27 = abs(thisActor->vPosition.y - actor->vPosition.y); + v12 = abs(thisActor->vPosition.z - actor->vPosition.z); if ( v23 <= v11 && v27 <= v11 && v12 <= v11 && sub_4070EF_prolly_detect_player(PID(OBJECT_Actor, i), PID(OBJECT_Actor, uActorID)) - && v23 * v23 + v27 * v27 + v19 * v19 < (unsigned int)v25 ) + && v23 * v23 + v27 * v27 + v12 * v12 < lowestRadius ) { - v25 = v23 * v23 + v27 * v27 + v19 * v19; - v21 = i; + lowestRadius = v23 * v23 + v27 * v27 + v12 * v12; + closestId = i; } - //v4 = 0; - //++v7; - //v5 = v26++ + 1; - //} - //while ( v26 < (signed int)uNumActors ); + } + if ( lowestRadius != UINT_MAX ) + { + *a2 = PID(OBJECT_Actor, closestId); } - if ( v25 != -1 ) - { - //v13 = 8 * v21; - //LOBYTE(v13) = PID(OBJECT_Actor,v21); - *a2 = PID(OBJECT_Actor, v21); - } - - if (pParty->Invisible()) - can_target_party = false; - - if (can_target_party) + + if (can_target_party && !pParty->Invisible()) { - v14 = _this->GetActorsRelation(0); - if ( BYTE2(_this->uAttributes) & 8 - && SHIDWORD(_this->pActorBuffs[12].uExpireTime) <= (signed int)0 - && (SHIDWORD(_this->pActorBuffs[12].uExpireTime) < (signed int)0 || LODWORD(_this->pActorBuffs[12].uExpireTime) <= 0) - && SHIDWORD(_this->pActorBuffs[1].uExpireTime) <= (signed int)0 - && (SHIDWORD(_this->pActorBuffs[1].uExpireTime) < (signed int)0 || LODWORD(_this->pActorBuffs[1].uExpireTime) <= 0) - && SHIDWORD(_this->pActorBuffs[2].uExpireTime) <= (signed int)0 - && (SHIDWORD(_this->pActorBuffs[2].uExpireTime) < (signed int)0 || LODWORD(_this->pActorBuffs[2].uExpireTime) <= 0) ) + if ( thisActor->uAttributes & 0x80000 + && thisActor->pActorBuffs[12].uExpireTime <= 0 + && thisActor->pActorBuffs[1].uExpireTime <= 0 + && thisActor->pActorBuffs[2].uExpireTime <= 0 ) v14 = 4; + else + v14 = thisActor->GetActorsRelation(0); if ( v14 != 0 ) { - v15 = dword_4DF380[4]; - if ( !_this->pMonsterInfo.uHostilityType ) - v15 = dword_4DF380[v14]; - v16 = abs(_this->vPosition.x - pParty->vPosition.x); - v28 = abs(_this->vPosition.y - pParty->vPosition.y); - v17 = abs(_this->vPosition.z - pParty->vPosition.z); - if ( v16 <= v15 && v28 <= v15 && v17 <= v15 ) + if ( !thisActor->pMonsterInfo.uHostilityType ) + v15 = dword_4DF380_hostilityRanges[v14]; + else + v15 = dword_4DF380_hostilityRanges[4]; + v16 = abs(thisActor->vPosition.x - pParty->vPosition.x); + v28 = abs(thisActor->vPosition.y - pParty->vPosition.y); + v17 = abs(thisActor->vPosition.z - pParty->vPosition.z); + if ( v16 <= v15 && v28 <= v15 && v17 <= v15 && (v16 * v16 + v28 * v28 + v17 * v17 < lowestRadius)) { - if ( v16 * v16 + v28 * v28 + v17 * v17 < (unsigned int)v25 ) - *a2 = OBJECT_Player; + *a2 = OBJECT_Player; } } } @@ -2500,133 +2463,77 @@ // 4DF390: using guessed type int dword_4DF390; //----- (0040104C) -------------------------------------------------------- -signed int Actor::GetActorsRelation(Actor *a2) +signed int Actor::GetActorsRelation(Actor *otherActPtr) { - Actor *v2; // esi@1 - int v3; // ebp@5 - int v4; // edi@11 unsigned int v5; // edx@15 unsigned int v6; // eax@16 - unsigned int v7; // ebp@19 - int v8; // eax@22 - unsigned int v9; // edx@25 - unsigned int v10; // edx@33 + unsigned int thisGroup; // ebp@19 + int otherGroup; // eax@22 + unsigned int thisAlly; // edx@25 + unsigned int otherAlly; // edx@33 - auto a1 = this; - v2 = a2; - if ( a1 ) + if ( otherActPtr) { - if ( SHIDWORD(a1->pActorBuffs[9].uExpireTime) >= 0 - && (SHIDWORD(a1->pActorBuffs[9].uExpireTime) > 0 || LODWORD(a1->pActorBuffs[9].uExpireTime) > 0) ) - return 4; - v3 = a1->pMonsterInfo.uID; + v5 = otherActPtr->uGroup; + v6 = this->uGroup; + if ( v5 != 0 && v6 != 0 && v5 == v6 ) + return 0; } - else + + if (this->pActorBuffs[ACTOR_BUFF_BERSERK].uExpireTime > 0) + return 4; + thisAlly = this->uAlly; + if ( this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 || thisAlly == 9999) + thisGroup = 0; + else if ( thisAlly > 0 ) { - v3 = 0; - } - if ( a2 ) - { - if ( SHIDWORD(a2->pActorBuffs[9].uExpireTime) >= 0 - && (SHIDWORD(a2->pActorBuffs[9].uExpireTime) > 0 || LODWORD(a2->pActorBuffs[9].uExpireTime) > 0) ) - return 4; - v4 = a2->pMonsterInfo.uID; + thisGroup = thisAlly; } else { - v4 = 0; + thisGroup = (this->pMonsterInfo.uID - 1) / 3 + 1; } - if ( a2 ) + + if ( otherActPtr ) { - if ( a1 ) + if (otherActPtr->pActorBuffs[ACTOR_BUFF_BERSERK].uExpireTime > 0) + return 4; + otherAlly = otherActPtr->uAlly; + if ( otherActPtr->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 || otherAlly == 9999) + otherGroup = 0; + else if ( otherAlly > 0 ) { - v5 = a2->uGroup; - if ( v5 ) - { - v6 = a1->uGroup; - if ( v6 ) - { - if ( v5 == v6 ) - return 0; - } - } + otherGroup = otherAlly; + } + else + { + otherGroup = (otherActPtr->pMonsterInfo.uID - 1) / 3 + 1; } } - if ( v3 ) - v7 = (v3 - 1) / 3 + 1; else - v7 = 0; - if ( v4 ) - v8 = (v4 - 1) / 3 + 1; - else - v8 = 0; - if ( a1 ) { - v9 = a1->uAlly; - if ( (signed int)v9 > 0 ) - { - if ( v9 != 9999 ) - { - v7 = a1->uAlly; - } - } - if(v9==9999) - v7 = 0; - if ( (signed __int64)a1->pActorBuffs[12].uExpireTime > 0 ) - v7 = 0; - } - if ( v2 ) - { - v10 = v2->uAlly; - if ( (signed int)v10 > 0 ) - { - if ( v10 != 9999 ) - { - v8 = v2->uAlly; - } - } - if(v10==9999) - v8 = 0; - if ( (signed __int64)v2->pActorBuffs[12].uExpireTime > 0 ) - v8 = 0; + otherGroup = 0; } - if ( a1 && (signed __int64)a1->pActorBuffs[1].uExpireTime > 0 && !v8 - || v2 && (signed __int64)v2->pActorBuffs[1].uExpireTime > 0 && !v7 ) + + if ( this->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 && !otherGroup + || otherActPtr && otherActPtr->pActorBuffs[ACTOR_BUFF_CHARM].uExpireTime > 0 && !thisGroup ) return 0; - if ( a1 && (signed __int64)a1->pActorBuffs[12].uExpireTime <= 0 && a1->uAttributes & 0x80000 && !v8 ) + if ( this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime <= 0 && this->uAttributes & 0x80000 && !otherGroup ) return 4; - if ( v2 && a1 && (signed __int64)a1->pActorBuffs[12].uExpireTime <= 0 && v2->uAttributes & 0x80000 ) + if (thisGroup >= 89 || otherGroup >= 89) + return 0; + + if ( thisGroup == 0 ) { - if ( v7 ) - { - if ( (signed int)v7 < 89 ) - { - if ( v8 < 89 ) - return pFactionTable->relations[v7][v8]; - return 0; - } - return 0; - } - return 4; + if ( (!otherActPtr || this->pActorBuffs[ACTOR_BUFF_ENSLAVED].uExpireTime > 0 && !(otherActPtr->uAttributes & 0x80000)) && !pFactionTable->relations[otherGroup][0]) + return pFactionTable->relations[0][otherGroup]; + else + return 4; } - if ( !v7 ) + else { - if ( (!v2 || (signed __int64)v2->pActorBuffs[12].uExpireTime > 0 || !(v2->uAttributes & 0x80000)) - && !pFactionTable->relations[v8][0]) - { - if ( v8 < 89 ) - return pFactionTable->relations[v7][v8]; - return 0; - } - return 4; + return pFactionTable->relations[thisGroup][otherGroup]; } - if ( (signed int)v7 < 89 ) - { - if ( v8 < 89 ) - return pFactionTable->relations[v7][v8]; - return 0; - } - return 0; } //----- (0045976D) -------------------------------------------------------- @@ -2776,203 +2683,162 @@ } //----- (0044FD29) -------------------------------------------------------- -int Actor::_44FD29(int a2) +void Actor::SummonMinion( int summonerId ) { - Actor *v2; // edi@1 - unsigned __int8 v3; // al@1 - int v4; // esi@1 + unsigned __int8 extraSummonLevel; // al@1 + int summonMonsterBaseType; // esi@1 int v5; // edx@2 - int v6; // eax@8 int v7; // edi@10 Actor *v8; // esi@10 MonsterInfo *v9; // ebx@10 MonsterDesc *v10; // edi@10 - unsigned __int16 v11; // ax@10 - int v12; // eax@10 int v13; // ebx@10 - int v14; // eax@10 int v15; // edi@10 - int v16; // eax@10 int v17; // ebx@10 - Actor *v18; // ecx@10 - signed __int64 v19; // qax@10 - unsigned int v20; // eax@12 - int v21; // eax@13 + unsigned int v19; // qax@10 int result; // eax@13 - Actor *v23; // eax@16 - int v24; // [sp+Ch] [bp-1Ch]@1 - unsigned int uFaceID; // [sp+10h] [bp-18h]@8 - int v26; // [sp+14h] [bp-14h]@10 + unsigned int monsterId; // [sp+10h] [bp-18h]@8 int v27; // [sp+18h] [bp-10h]@10 - int v28; // [sp+1Ch] [bp-Ch]@8 - int v29; // [sp+20h] [bp-8h]@10 - Actor *v30; // [sp+24h] [bp-4h]@1 + int actorSector; // [sp+1Ch] [bp-Ch]@8 + + + actorSector = 0; + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) + actorSector = pIndoor->GetSector(this->vPosition.x, this->vPosition.y, this->vPosition.z); - v2 = this; - v24 = a2; - v30 = this; - v3 = this->pMonsterInfo.uSpecialAbilityDamageDiceRolls; - v4 = this->pMonsterInfo.field_3C_some_special_attack; - if ( v3 ) + v19 = this->uAlly; + if ( !v19 ) + { + monsterId = this->pMonsterInfo.uID - 1; + v19 = (uint)(monsterId * 0.33333334); + } + v27 = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? 128 : 64; + v13 = rand() % 2048; + v15 = ((stru_5C6E00->Cos(v13) * (signed __int64)v27) >> 16) + this->vPosition.x; + v17 = ((stru_5C6E00->Sin(v13) * (signed __int64)v27) >> 16) + this->vPosition.y; + + if (uCurrentlyLoadedLevelType != LEVEL_Outdoor) { - if ( v3 >= 1u && v3 <= 3u ) - v4 = v4 + v3 - 1; + result = pIndoor->GetSector(v15, v17, this->vPosition.z); + if (result != actorSector) + return; + result = BLV_GetFloorLevel(v15, v17, v27, result, &monsterId); + if (result != -30000) + return; + if (abs(result - v27) > 1024) + return; + } + + extraSummonLevel = this->pMonsterInfo.uSpecialAbilityDamageDiceRolls; + summonMonsterBaseType = this->pMonsterInfo.field_3C_some_special_attack; + if ( extraSummonLevel ) + { + if ( extraSummonLevel >= 1u && extraSummonLevel <= 3u ) + summonMonsterBaseType = summonMonsterBaseType + extraSummonLevel - 1; } else { v5 = rand() % 100; - if ( v5 >= 60 ) + if ( v5 >= 90 ) + summonMonsterBaseType += 2; + else if ( v5 >= 60 ) { - ++v4; - if ( v5 >= 90 ) - ++v4; + summonMonsterBaseType += 1; } } - v6 = v2->vPosition.z; - v28 = 0; - uFaceID = v6; - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) - v28 = pIndoor->GetSector(v2->vPosition.x, v2->vPosition.y, v6); - v7 = v4 - 1; + v7 = summonMonsterBaseType - 1; v8 = &pActors[uNumActors]; - v27 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64; - v29 = v7; v9 = &pMonsterStats->pInfos[v7 + 1]; pActors[uNumActors].Reset(); v10 = &pMonsterList->pMonsters[v7]; strcpy(v8->pActorName, v9->pName); v8->sCurrentHP = LOWORD(v9->uHP); - memcpy(&v8->pMonsterInfo, v9, 0x58u); - v8->word_000086_some_monster_id = v29 + 1; + memcpy(&v8->pMonsterInfo, v9, sizeof(v8->pMonsterInfo)); + v8->word_000086_some_monster_id = summonMonsterBaseType; v8->uActorRadius = v10->uMonsterRadius; v8->uActorHeight = v10->uMonsterHeight; - v11 = v10->uMovementSpeed; v8->pMonsterInfo.uTreasureDiceRolls = 0; v8->pMonsterInfo.uTreasureType = 0; v8->pMonsterInfo.uExp = 0; - v8->uMovementSpeed = v11; - v12 = rand(); - v13 = v12 % 2048; - v14 = stru_5C6E00->Cos(v12 % 2048); - v26 = v14; - v15 = ((unsigned __int64)(v14 * (signed __int64)v27) >> 16) + v30->vPosition.x; - v16 = stru_5C6E00->Sin(v13); - v26 = v16; - v29 = (unsigned __int64)(v16 * (signed __int64)v27) >> 16; - LOWORD(v16) = uFaceID; - v17 = v29 + v30->vPosition.y; - v8->vInitialPosition.z = uFaceID; - v8->vPosition.z = v16; - LOWORD(v16) = v28; + v8->uMovementSpeed = v10->uMovementSpeed; + v8->vInitialPosition.z = this->vPosition.z; + v8->vPosition.z = this->vPosition.z; v8->vInitialPosition.x = v15; v8->vPosition.x = v15; v8->vInitialPosition.y = v17; v8->vPosition.y = v17; v8->uTetherDistance = 256; - v8->uSectorID = v16; + v8->uSectorID = actorSector; v8->PrepareSprites(0); - v18 = v30; v8->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; - LODWORD(v19) = v18->uAlly; - if ( !(uint)v19 ) - { - uFaceID = v18->pMonsterInfo.uID - 1; - v19 = (signed __int64)((double)uFaceID * 0.33333334); - v18 = v30; - } v8->uAlly = v19; - v20 = v18->uGroup; v8->uCurrentActionTime = 0; - v8->uGroup = v20; + v8->uGroup = this->uGroup; v8->uAIState = Summoned; v8->uCurrentActionLength = 256; v8->UpdateAnimation(); - if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor - || (v21 = v30->vPosition.z, - v27 = v30->vPosition.z, - result = pIndoor->GetSector(v15, v17, v21), - result == v28) - && (result = BLV_GetFloorLevel(v15, v17, v27, result, &uFaceID), result != -30000) - && (result = abs(result - v27), result <= 1024) ) - { - v23 = v30; - ++uNumActors; - ++v23->pMonsterInfo.uSpecialAbilityDamageDiceBonus; - if ( v23->uAttributes & 0x80000 ) - v8->uAttributes |= 0x80000u; - result = 8 * v24; - LOBYTE(result) = PID(OBJECT_Actor,v24); - v8->uSummonerID = result; - } - return result; + + ++uNumActors; + ++this->pMonsterInfo.uSpecialAbilityDamageDiceBonus; + if ( this->uAttributes & 0x80000 ) + v8->uAttributes |= 0x80000u; + v8->uSummonerID = PID(OBJECT_Actor,summonerId); + } // 46DF1A: using guessed type int __fastcall 46DF1A_collide_against_actor(int, int); //----- (0046DF1A) -------------------------------------------------------- -signed int __fastcall _46DF1A_collide_against_actor(int a1, int a2) +bool Actor::_46DF1A_collide_against_actor( int a1, int a2 ) { Actor *v2; // edi@1 unsigned __int16 v3; // ax@1 int v4; // esi@6 - int v5; // ecx@8 - int v6; // eax@10 - int v7; // edx@12 int v8; // ecx@14 int v9; // eax@14 int v10; // ebx@14 int v11; // esi@14 int v12; // ebx@15 int v13; // ebx@17 - unsigned int v14; // eax@20 - signed int result; // eax@21 - int v16; // [sp+Ch] [bp-10h]@1 - int v17; // [sp+10h] [bp-Ch]@14 - int v18; // [sp+14h] [bp-8h]@14 - int v19; // [sp+18h] [bp-4h]@14 - v16 = a1; v2 = &pActors[a1]; v3 = v2->uAIState; - if ( v3 == 11 || v3 == 4 || v3 == 19 || v3 == 5 || v3 == 17 ) - goto LABEL_25; + if ( v3 == Removed || v3 == Dying || v3 == Disabled || v3 == Dead || v3 == Summoned ) + return 0; v4 = v2->uActorRadius; if ( a2 ) v4 = a2; - v5 = v2->vPosition.x; - if ( stru_721530.sMaxX > v5 + v4 - || stru_721530.sMinX < v5 - v4 - || (v6 = v2->vPosition.y, stru_721530.sMaxY > v6 + v4) - || stru_721530.sMinY < v6 - v4 - || (v7 = v2->vPosition.z, stru_721530.sMaxZ > v7 + v2->uActorHeight) - || stru_721530.sMinZ < v7 - || (v8 = v5 - stru_721530.normal.x, - v9 = v6 - stru_721530.normal.y, - v10 = stru_721530.prolly_normal_d + v4, - v17 = stru_721530.prolly_normal_d + v4, - v11 = (v8 * stru_721530.direction.y - v9 * stru_721530.direction.x) >> 16, - v18 = v8, - v19 = v9, - abs((v8 * stru_721530.direction.y - v9 * stru_721530.direction.x) >> 16) > v10) - || (v12 = (v18 * stru_721530.direction.x + v19 * stru_721530.direction.y) >> 16, v12 <= 0) - || (signed int)(((unsigned __int64)(stru_721530.direction.z * (signed __int64)v12) >> 16) + stru_721530.normal.z) < v2->vPosition.z ) + + if (stru_721530.sMaxX > v2->vPosition.x + v4 || + stru_721530.sMinX < v2->vPosition.x - v4 || + stru_721530.sMaxY > v2->vPosition.y + v4 || + stru_721530.sMinY < v2->vPosition.y - v4 || + stru_721530.sMaxZ > v2->vPosition.z + v2->uActorHeight || + stru_721530.sMinZ < v2->vPosition.z) + { + return false; + } + v8 = v2->vPosition.x - stru_721530.normal.x; + v9 = v2->vPosition.y - stru_721530.normal.y; + v10 = stru_721530.prolly_normal_d + v4; + v11 = (v8 * stru_721530.direction.y - v9 * stru_721530.direction.x) >> 16; + v12 = (v8 * stru_721530.direction.x + v9 * stru_721530.direction.y) >> 16; + if ( abs(v11) > v10 || v12 <= 0) { -LABEL_25: - result = 0; + return false; } - else + if (((stru_721530.direction.z * (signed __int64)v12) >> 16) + stru_721530.normal.z < v2->vPosition.z) { - v13 = v12 - integer_sqrt(v17 * v17 - v11 * v11); - if ( v13 < 0 ) - v13 = 0; - if ( v13 < stru_721530.field_7C ) - { - stru_721530.field_7C = v13; - v14 = 8 * v16; - LOBYTE(v14) = PID(OBJECT_Actor,v16); - stru_721530.uFaceID = v14; - } - result = 1; + return false; } - return result; + + v13 = v12 - integer_sqrt(v10 * v10 - v11 * v11); + if ( v13 < 0 ) + v13 = 0; + if ( v13 < stru_721530.field_7C ) + { + stru_721530.field_7C = v13; + stru_721530.uFaceID = PID(OBJECT_Actor,a1); + } + return true; } //----- (00401A91) -------------------------------------------------------- void UpdateActorAI() diff -r 1a1c4040bee4 -r 4cae2d58cfb4 Actor.h --- a/Actor.h Mon Oct 21 17:23:59 2013 +0600 +++ b/Actor.h Mon Oct 21 17:24:10 2013 +0600 @@ -195,7 +195,7 @@ Reset(); } - int _44FD29(int a2); + void SummonMinion(int summonerId); void Reset(); void Remove(); void PrepareSprites(char load_sounds_if_bit1_set); @@ -245,6 +245,7 @@ int _43B3E0_CalcDamage(signed int dmgSource); static void AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3); + static bool _46DF1A_collide_against_actor(int a1, int a2); char pActorName[32]; signed __int16 sNPC_ID; diff -r 1a1c4040bee4 -r 4cae2d58cfb4 Indoor.cpp --- a/Indoor.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/Indoor.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -3424,7 +3424,7 @@ v28 = abs(pActors[v26].vPosition.y - v0->vPosition.y); v29 = abs(pActors[v26].vPosition.x - v0->vPosition.x); if ( int_get_vector_length(v29, v28, v27) >= v0->uActorRadius + (signed int)pActors[v26].uActorRadius - && _46DF1A_collide_against_actor(v54, 40) ) + && Actor::_46DF1A_collide_against_actor(v54, 40) ) ++v58; v22 = 0; } diff -r 1a1c4040bee4 -r 4cae2d58cfb4 Items.cpp --- a/Items.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/Items.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -2395,7 +2395,6 @@ } std::map<CHARACTER_ATTRIBUTE_TYPE, CEnchantment*>* currList = bonusList->second; return (currList->find(attrToGet) != currList->end()); - return false; } ITEM_EQUIP_TYPE ItemGen::GetItemEquipType() diff -r 1a1c4040bee4 -r 4cae2d58cfb4 Party.cpp --- a/Party.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/Party.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -1120,10 +1120,9 @@ v7 = pIcons_LOD->LoadTexturePtr(v5, TEXTURE_16BIT_PALETTE); v21 = areWeLoadingTexture; v8 = 0; - int startId = uActiveCharacter >= 0 ? uActiveCharacter - 1 : 0; for (int i = 0; i < 4; i++) { - v9 = &pPlayers[(startId + i) % 4]; //start with current active player, then cycle right if item won't fit + v9 = &pPlayers[(uActiveCharacter + i) % 4]; //start with current active player, then cycle right if item won't fit v10 = v9->AddItem(-1, pItem->uItemID); if ( v10 ) { diff -r 1a1c4040bee4 -r 4cae2d58cfb4 README.md --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.md Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2 @@ +Might-and-Magic-Trilogy +======================= diff -r 1a1c4040bee4 -r 4cae2d58cfb4 SpriteObject.cpp --- a/SpriteObject.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/SpriteObject.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -430,7 +430,7 @@ for (v56 =0; v56 < uNumActors; ++v56) { if ( v20->GetActorsRelation(&pActors[v56]) ) - _46DF1A_collide_against_actor(v56, 0); + Actor::_46DF1A_collide_against_actor(v56, 0); } } @@ -438,7 +438,7 @@ else { for ( i = 0; i < (signed int)uNumActors; ++i ) - _46DF1A_collide_against_actor(i, 0); + Actor::_46DF1A_collide_against_actor(i, 0); } v26 = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; v27 = ODM_GetFloorLevel( @@ -712,7 +712,7 @@ //if ( v14 != (unsigned int)(signed __int64)((double)v41 * 0.3333333333333333) ) if( pActors[pSpriteObject->spell_caster_pid >> 3].pMonsterInfo.uID != v39b->pMonsterInfo.uID ) //not sure: pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius - _46DF1A_collide_against_actor(v42, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); + Actor::_46DF1A_collide_against_actor(v42, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); ++v42; ++v39b;// += 836; } @@ -727,7 +727,7 @@ v39b = pActors.data();//[0].word_000086_some_monster_id; do { - _46DF1A_collide_against_actor(v42++, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); + Actor::_46DF1A_collide_against_actor(v42++, pMonsterList->pMonsters[v39b->word_000086_some_monster_id-1].uToHitRadius); ++v39b; } while ( v42 < (signed int)uNumActors ); diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/.travis.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/.travis.yml Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,58 @@ +language: cpp +compiler: + - clang + - gcc +env: + - SWIGLANG= +matrix: + include: + - compiler: gcc + env: SWIGLANG=csharp + - compiler: gcc + env: SWIGLANG=go + - compiler: gcc + env: SWIGLANG=guile + - compiler: gcc + env: SWIGLANG=java + - compiler: gcc + env: SWIGLANG=lua + - compiler: gcc + env: SWIGLANG=octave SWIGJOBS=-j4 + - compiler: gcc + env: SWIGLANG=perl5 + - compiler: gcc + env: SWIGLANG=php + - compiler: gcc + env: SWIGLANG=python + - compiler: gcc + env: SWIGLANG=python PY3=1 + - compiler: gcc + env: SWIGLANG=ruby + - compiler: gcc + env: SWIGLANG=tcl + allow_failures: + # None +before_install: + - lsb_release -a + - uname -a + - sudo apt-get -qq update + - time sudo apt-get -qq install libboost-dev + - if test "$SWIGLANG" = "csharp"; then sudo apt-get -qq install mono-devel; fi + - if test "$SWIGLANG" = "go"; then go env | sed -e 's/^/export /' > goenvsetup && source goenvsetup && rm -f goenvsetup; fi # Until configure.ac is fixed + - if test "$SWIGLANG" = "guile"; then sudo apt-get -qq install guile-2.0-dev; fi + - if test "$SWIGLANG" = "lua"; then sudo apt-get -qq install lua5.1 liblua5.1-dev; fi + - if test "$SWIGLANG" = "octave"; then sudo apt-get -qq install octave3.2 octave3.2-headers; fi + - if test "$SWIGLANG" = "php"; then sudo apt-get install php5-cli php5-dev; fi + - if test "$SWIGLANG" = "python" -a "$PY3"; then sudo apt-get install python3-dev; fi + - if test "$SWIGLANG" = "tcl"; then sudo apt-get -qq install tcl8.4-dev; fi +script: + - ./autogen.sh && ./configure + - make -s $SWIGJOBS + - if test -z "$SWIGLANG"; then make -s check-ccache; fi + - ./swig -version + - if test -n "$SWIGLANG"; then make -s check-$SWIGLANG-version; fi + - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-examples; fi + - if test -n "$SWIGLANG"; then make -k $SWIGJOBS check-$SWIGLANG-test-suite; fi +branches: + only: + - master diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/COPYING --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/COPYING Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) 19yy <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/Makefile.in Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,77 @@ +datarootdir = @datarootdir@ +srcdir=@srcdir@ +VPATH=@srcdir@ + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +mandir=@mandir@ +INSTALLCMD=@INSTALL@ +PACKAGE_NAME=@PACKAGE_NAME@ +# Soft link test can be skipped on systems that don't support soft linking +NOSOFTLINKSTEST= + +CC=@CC@ +CFLAGS=@CFLAGS@ -I. +SWIG=swig +SWIG_LIB=../../Lib +EXEEXT=@EXEEXT@ + +# Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix +transform = @program_transform_name@ + +LIBS= @LIBS@ +OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \ + cleanup.o snprintf.o unify.o +HEADERS = ccache.h mdfour.h + +all: $(PACKAGE_NAME)$(EXEEXT) + +# Note that HTML documentation is actually generated and used from the main SWIG documentation Makefile +docs: $(PACKAGE_NAME).1 web/ccache-man.html + +$(PACKAGE_NAME)$(EXEEXT): $(OBJS) $(HEADERS) + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + +$(PACKAGE_NAME).1: ccache.yo + -yodl2man -o $(PACKAGE_NAME).1 ccache.yo + +web/ccache-man.html: ccache.yo + yodl2html -o web/ccache-man.html ccache.yo + +install: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 + @echo "Installing $(PACKAGE_NAME)" + @echo "Installing $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT)" + ${INSTALLCMD} -d $(DESTDIR)${bindir} + ${INSTALLCMD} -m 755 $(PACKAGE_NAME)$(EXEEXT) $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT) + @echo "Installing $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1" + ${INSTALLCMD} -d $(DESTDIR)${mandir}/man1 + ${INSTALLCMD} -m 644 ${srcdir}/$(PACKAGE_NAME).1 $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 + +uninstall: $(PACKAGE_NAME)$(EXEEXT) $(PACKAGE_NAME).1 + rm -f $(DESTDIR)${bindir}/`echo $(PACKAGE_NAME) | sed '$(transform)'`$(EXEEXT) + rm -f $(DESTDIR)${mandir}/man1/`echo $(PACKAGE_NAME) | sed '$(transform)'`.1 + +clean: + /bin/rm -f $(OBJS) *~ $(PACKAGE_NAME)$(EXEEXT) + +check : test + +test: test.sh + SWIG_LIB='$(SWIG_LIB)' PATH=../..:$$PATH SWIG='$(SWIG)' CC='$(CC)' NOSOFTLINKSTEST='$(NOSOFTLINKSTEST)' ./test.sh + +check: test + +distclean: clean + /bin/rm -f Makefile config.h config.sub config.log build-stamp config.status ccache_swig_config.h + /bin/rm -rf autom4te.cache + +maintainer-clean: distclean + /bin/rm -f $(PACKAGE_NAME).1 web/ccache-man.html + + +# FIXME: To fix this, test.sh needs to be able to take ccache from the +# installed prefix, not from the source dir. +installcheck: + @echo "WARNING! This is not really \"installcheck\" yet." + $(MAKE) check diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/README Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,31 @@ +This is a re-implementation of "compilercache" in C + +The original compilercache scripts were by Erik Thiele +(erikyyy@erikyyy.de) and I would like to thank him for an excellent +piece of work. See http://www.erikyyy.de/compilercache/ for the +original shell scripts. + +I wrote ccache because I wanted to get a bit more speed out of a +compiler cache and I wanted to remove some of the limitations of the +shell-script version. + +Please see the manual page and documentation at +http://ccache.samba.org/ + +INSTALLATION +------------ + +Please run: + + ./configure + make + make install + +then read the ccache manual page + +----------- + +Andrew Tridgell +http://samba.org/~tridge/ +bugs@ccache.samba.org + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/README.swig --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/README.swig Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,8 @@ +This directory contains a version of ccache. The initial version was based on ccache-2.4 plus +debian patches 01-02, 04-14, see the debian/patches subdirectory. The ccache-win32-2.4 modifications +to ccache-2.4 have also been merged in. + +Changes have been made to support cacheing the output from SWIG. The ability to cache c/c++ compiler +output has been retained. + +Additional features added are the CCACHE_VERBOSE and CCACHE_SWIG environment variables, see docs. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/args.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/args.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,91 @@ +/* + convenient routines for argument list handling + + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ccache.h" + +ARGS *args_init(int init_argc, char **init_args) +{ + ARGS *args; + int i; + args = (ARGS *)x_malloc(sizeof(ARGS)); + args->argc = 0; + args->argv = (char **)x_malloc(sizeof(char *)); + args->argv[0] = NULL; + for (i=0;i<init_argc;i++) { + args_add(args, init_args[i]); + } + return args; +} + + +void args_add(ARGS *args, const char *s) +{ + args->argv = (char**)x_realloc(args->argv, (args->argc + 2) * sizeof(char *)); + args->argv[args->argc] = x_strdup(s); + args->argc++; + args->argv[args->argc] = NULL; +} + +/* pop the last element off the args list */ +void args_pop(ARGS *args, int n) +{ + while (n--) { + args->argc--; + free(args->argv[args->argc]); + args->argv[args->argc] = NULL; + } +} + +/* remove the first element of the argument list */ +void args_remove_first(ARGS *args) +{ + free(args->argv[0]); + memmove(&args->argv[0], + &args->argv[1], + args->argc * sizeof(args->argv[0])); + args->argc--; +} + +/* add an argument into the front of the argument list */ +void args_add_prefix(ARGS *args, const char *s) +{ + args->argv = (char**)x_realloc(args->argv, (args->argc + 2) * sizeof(char *)); + memmove(&args->argv[1], &args->argv[0], + (args->argc+1) * sizeof(args->argv[0])); + args->argv[0] = x_strdup(s); + args->argc++; +} + +/* strip any arguments beginning with the specified prefix */ +void args_strip(ARGS *args, const char *prefix) +{ + int i; + for (i=0; i<args->argc; ) { + if (strncmp(args->argv[i], prefix, strlen(prefix)) == 0) { + free(args->argv[i]); + memmove(&args->argv[i], + &args->argv[i+1], + args->argc * sizeof(args->argv[i])); + args->argc--; + } else { + i++; + } + } +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/ccache-swig.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/ccache-swig.1 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,453 @@ +.TH "ccache\-swig" "1" "" "" "" + +.PP +.SH "NAME" +ccache\-swig \- a fast compiler cache +.PP +.SH "SYNOPSIS" + +.PP +ccache\-swig [OPTION] +.PP +ccache\-swig <compiler> [COMPILER OPTIONS] +.PP +<compiler> [COMPILER OPTIONS] +.PP +.SH "DESCRIPTION" + +.PP +ccache\-swig is a compiler cache\&. It speeds up re\-compilation of C/C++/SWIG code +by caching previous compiles and detecting when the same compile is +being done again\&. ccache\-swig is ccache plus support for SWIG\&. ccache +and ccache\-swig are used interchangeably in this document\&. +.PP +.SH "OPTIONS SUMMARY" + +.PP +Here is a summary of the options to ccache\-swig\&. +.PP +.nf + +\-s show statistics summary +\-z zero statistics +\-c run a cache cleanup +\-C clear the cache completely +\-F <n> set maximum files in cache +\-M <n> set maximum size of cache (use G, M or K) +\-h this help page +\-V print version number + +.fi + +.PP +.SH "OPTIONS" + +.PP +These options only apply when you invoke ccache as \(dq\&ccache\-swig\(dq\&\&. When +invoked as a compiler none of these options apply\&. In that case your +normal compiler options apply and you should refer to your compilers +documentation\&. +.PP +.IP "\fB\-h\fP" +Print a options summary page +.IP +.IP "\fB\-s\fP" +Print the current statistics summary for the cache\&. The +statistics are stored spread across the subdirectories of the +cache\&. Using \(dq\&ccache\-swig \-s\(dq\& adds up the statistics across all +subdirectories and prints the totals\&. +.IP +.IP "\fB\-z\fP" +Zero the cache statistics\&. +.IP +.IP "\fB\-V\fP" +Print the ccache version number +.IP +.IP "\fB\-c\fP" +Clean the cache and re\-calculate the cache file count and +size totals\&. Normally the \-c option should not be necessary as ccache +keeps the cache below the specified limits at runtime and keeps +statistics up to date on each compile\&. This option is mostly useful +if you manually modify the cache contents or believe that the cache +size statistics may be inaccurate\&. +.IP +.IP "\fB\-C\fP" +Clear the entire cache, removing all cached files\&. +.IP +.IP "\fB\-F <maxfiles>\fP" +This sets the maximum number of files allowed in +the cache\&. The value is stored inside the cache directory and applies +to all future compiles\&. Due to the way the value is stored the actual +value used is always rounded down to the nearest multiple of 16\&. +.IP +.IP "\fB\-M <maxsize>\fP" +This sets the maximum cache size\&. You can specify +a value in gigabytes, megabytes or kilobytes by appending a G, M or K +to the value\&. The default is gigabytes\&. The actual value stored is +rounded down to the nearest multiple of 16 kilobytes\&. +.IP +.SH "INSTALLATION" + +.PP +There are two ways to use ccache\&. You can either prefix your compile +commands with \(dq\&ccache\-swig\(dq\& or you can create a symbolic link between +ccache\-swig and the names of your compilers\&. The first method is most +convenient if you just want to try out ccache or wish to use it for +some specific projects\&. The second method is most useful for when you +wish to use ccache for all your compiles\&. +.PP +To install for usage by the first method just copy ccache\-swig to somewhere +in your path\&. +.PP +To install for the second method do something like this: +.nf + + cp ccache\-swig /usr/local/bin/ + ln \-s /usr/local/bin/ccache\-swig /usr/local/bin/gcc + ln \-s /usr/local/bin/ccache\-swig /usr/local/bin/g++ + ln \-s /usr/local/bin/ccache\-swig /usr/local/bin/cc + ln \-s /usr/local/bin/ccache\-swig /usr/local/bin/swig + +.fi +This will work as long as /usr/local/bin comes before the path to gcc +(which is usually in /usr/bin)\&. After installing you may wish to run +\(dq\&which gcc\(dq\& to make sure that the correct link is being used\&. +.PP +Note! Do not use a hard link, use a symbolic link\&. A hardlink will +cause \(dq\&interesting\(dq\& problems\&. +.PP +.SH "EXTRA OPTIONS" + +.PP +When run as a compiler front end ccache usually just takes the same +command line options as the compiler you are using\&. The only exception +to this is the option \(cq\&\-\-ccache\-skip\(cq\&\&. That option can be used to tell +ccache that the next option is definitely not a input filename, and +should be passed along to the compiler as\-is\&. +.PP +The reason this can be important is that ccache does need to parse the +command line and determine what is an input filename and what is a +compiler option, as it needs the input filename to determine the name +of the resulting object file (among other things)\&. The heuristic +ccache uses in this parse is that any string on the command line that +exists as a file is treated as an input file name (usually a C +file)\&. By using \-\-ccache\-skip you can force an option to not be +treated as an input file name and instead be passed along to the +compiler as a command line option\&. +.PP +.SH "ENVIRONMENT VARIABLES" + +.PP +ccache uses a number of environment variables to control operation\&. In +most cases you won\(cq\&t need any of these as the defaults will be fine\&. +.PP +.IP "\fBCCACHE_DIR\fP" +the CCACHE_DIR environment variable specifies +where ccache will keep its cached compiler output\&. The default is +\(dq\&$HOME/\&.ccache\(dq\&\&. +.IP +.IP "\fBCCACHE_TEMPDIR\fP" +the CCACHE_TEMPDIR environment variable specifies +where ccache will put temporary files\&. The default is the same as +CCACHE_DIR\&. Note that the CCACHE_TEMPDIR path must be on the same +filesystem as the CCACHE_DIR path, so that renames of files between +the two directories can work\&. +.IP +.IP "\fBCCACHE_LOGFILE\fP" +If you set the CCACHE_LOGFILE environment +variable then ccache will write some log information on cache hits +and misses in that file\&. This is useful for tracking down problems\&. +.IP +.IP "\fBCCACHE_VERBOSE\fP" +If you set the CCACHE_VERBOSE environment +variable then ccache will display on stdout all the compiler invocations +that it makes\&. This can useful for debugging unexpected problems\&. +.IP +.IP "\fBCCACHE_PATH\fP" +You can optionally set CCACHE_PATH to a colon +separated path where ccache will look for the real compilers\&. If you +don\(cq\&t do this then ccache will look for the first executable matching +the compiler name in the normal PATH that isn\(cq\&t a symbolic link to +ccache itself\&. +.IP +.IP "\fBCCACHE_CC\fP" +You can optionally set CCACHE_CC to force the name +of the compiler to use\&. If you don\(cq\&t do this then ccache works it out +from the command line\&. +.IP +.IP "\fBCCACHE_PREFIX\fP" +This option adds a prefix to the command line +that ccache runs when invoking the compiler\&. Also see the section +below on using ccache with distcc\&. +.IP +.IP "\fBCCACHE_DISABLE\fP" +If you set the environment variable +CCACHE_DISABLE then ccache will just call the real compiler, +bypassing the cache completely\&. +.IP +.IP "\fBCCACHE_READONLY\fP" +the CCACHE_READONLY environment variable +tells ccache to attempt to use existing cached object files, but not +to try to add anything new to the cache\&. If you are using this because +your CCACHE_DIR is read\-only, then you may find that you also need to +set CCACHE_TEMPDIR as otherwise ccache will fail to create the +temporary files\&. +.IP +.IP "\fBCCACHE_CPP2\fP" +If you set the environment variable CCACHE_CPP2 +then ccache will not use the optimisation of avoiding the 2nd call to +the pre\-processor by compiling the pre\-processed output that was used +for finding the hash in the case of a cache miss\&. This is primarily a +debugging option, although it is possible that some unusual compilers +will have problems with the intermediate filename extensions used in +this optimisation, in which case this option could allow ccache to be +used\&. +.IP +.IP "\fBCCACHE_NOCOMPRESS\fP" +If you set the environment variable +CCACHE_NOCOMPRESS then there is no compression used on files that go +into the cache\&. However, this setting has no effect on how files are +retrieved from the cache, compressed results will still be usable\&. +.IP +.IP "\fBCCACHE_NOSTATS\fP" +If you set the environment variable +CCACHE_NOSTATS then ccache will not update the statistics files on +each compile\&. +.IP +.IP "\fBCCACHE_NLEVELS\fP" +The environment variable CCACHE_NLEVELS allows +you to choose the number of levels of hash in the cache directory\&. The +default is 2\&. The minimum is 1 and the maximum is 8\&. +.IP +.IP "\fBCCACHE_HARDLINK\fP" +If you set the environment variable +CCACHE_HARDLINK then ccache will attempt to use hard links from the +cache directory when creating the compiler output rather than using a +file copy\&. Using hard links is faster, but can confuse programs like +\(cq\&make\(cq\& that rely on modification times\&. Hard links are never made for +compressed cache files\&. +.IP +.IP "\fBCCACHE_RECACHE\fP" +This forces ccache to not use any cached +results, even if it finds them\&. New results are still cached, but +existing cache entries are ignored\&. +.IP +.IP "\fBCCACHE_UMASK\fP" +This sets the umask for ccache and all child +processes (such as the compiler)\&. This is mostly useful when you wish +to share your cache with other users\&. Note that this also affects the +file permissions set on the object files created from your +compilations\&. +.IP +.IP "\fBCCACHE_HASHDIR\fP" +This tells ccache to hash the current working +directory when calculating the hash that is used to distinguish two +compiles\&. This prevents a problem with the storage of the current +working directory in the debug info of a object file, which can lead +ccache to give a cached object file that has the working directory in +the debug info set incorrectly\&. This option is off by default as the +incorrect setting of this debug info rarely causes problems\&. If you +strike problems with gdb not using the correct directory then enable +this option\&. +.IP +.IP "\fBCCACHE_UNIFY\fP" +If you set the environment variable CCACHE_UNIFY +then ccache will use the C/C++ unifier when hashing the pre\-processor +output if \-g is not used in the compile\&. The unifier is slower than a +normal hash, so setting this environment variable loses a little bit +of speed, but it means that ccache can take advantage of not +recompiling when the changes to the source code consist of +reformatting only\&. Note that using CCACHE_UNIFY changes the hash, so +cached compiles with CCACHE_UNIFY set cannot be used when +CCACHE_UNIFY is not set and vice versa\&. The reason the unifier is off +by default is that it can give incorrect line number information in +compiler warning messages\&. +.IP +.IP "\fBCCACHE_EXTENSION\fP" +Normally ccache tries to automatically +determine the extension to use for intermediate C pre\-processor files +based on the type of file being compiled\&. Unfortunately this sometimes +doesn\(cq\&t work, for example when using the aCC compiler on HP\-UX\&. On +systems like this you can use the CCACHE_EXTENSION option to override +the default\&. On HP\-UX set this environment variable to \(dq\&i\(dq\& if you use +the aCC compiler\&. +.IP +.IP "\fBCCACHE_STRIPC\fP" +If you set the environment variable +CCACHE_STRIPC then ccache will strip the \-c option when invoking +the preprocessor\&. This option is primarily for the Sun Workshop +C++ compiler as without this option an unwarranted warning is displayed: +CC: Warning: \(dq\&\-E\(dq\& redefines product from \(dq\&object\(dq\& to \(dq\&source (stdout)\(dq\& +when \-E and \-c is used together\&. +.IP +.IP "\fBCCACHE_SWIG\fP" +When using SWIG as the compiler and it does not +have \(cq\&swig\(cq\& in the executable name, then the CCACHE_SWIG environment +variable needs to be set in order for ccache to work correctly with +SWIG\&. The use of CCACHE_CPP2 is also recommended for SWIG due to some +preprocessor quirks, however, use of CCACHE_CPP2 can often be skipped +\-\- check your generated code with and without this option set\&. Known +problems are using preprocessor directives within %inline blocks and +the use of \(cq\&#pragma SWIG\(cq\&\&. +.IP +.SH "CACHE SIZE MANAGEMENT" + +.PP +By default ccache has a one gigabyte limit on the cache size and no +maximum number of files\&. You can set a different limit using the +\(dq\&ccache \-M\(dq\& and \(dq\&ccache \-F\(dq\& options, which set the size and number of +files limits\&. +.PP +When these limits are reached ccache will reduce the cache to 20% +below the numbers you specified in order to avoid doing the cache +clean operation too often\&. +.PP +.SH "CACHE COMPRESSION" + +.PP +By default on most platforms ccache will compress all files it puts +into the cache +using the zlib compression\&. While this involves a negligible +performance slowdown, it significantly increases the number of files +that fit in the cache\&. You can turn off compression setting the +CCACHE_NOCOMPRESS environment variable\&. +.PP +.SH "HOW IT WORKS" + +.PP +The basic idea is to detect when you are compiling exactly the same +code a 2nd time and use the previously compiled output\&. You detect +that it is the same code by forming a hash of: +.PP +.IP o +the pre\-processor output from running the compiler with \-E +.IP o +the command line options +.IP o +the real compilers size and modification time +.IP o +any stderr output generated by the compiler + +.PP +These are hashed using md4 (a strong hash) and a cache file is formed +based on that hash result\&. When the same compilation is done a second +time ccache is able to supply the correct compiler output (including +all warnings etc) from the cache\&. +.PP +ccache has been carefully written to always produce exactly the same +compiler output that you would get without the cache\&. If you ever +discover a case where ccache changes the output of your compiler then +please let me know\&. +.PP +.SH "USING CCACHE WITH DISTCC" + +.PP +distcc is a very useful program for distributing compilation across a +range of compiler servers\&. It is often useful to combine distcc with +ccache, so that compiles that are done are sped up by distcc, but that +ccache avoids the compile completely where possible\&. +.PP +To use distcc with ccache I recommend using the CCACHE_PREFIX +option\&. You just need to set the environment variable CCACHE_PREFIX to +\(cq\&distcc\(cq\& and ccache will prefix the command line used with the +compiler with the command \(cq\&distcc\(cq\&\&. +.PP +.SH "SHARING A CACHE" + +.PP +A group of developers can increase the cache hit rate by sharing a +cache directory\&. The hard links however cause unwanted side effects, +as all links to a cached file share the file\(cq\&s modification timestamp\&. +This results in false dependencies to be triggered by timestamp\-based +build systems whenever another user links to an existing +file\&. Typically, users will see that their libraries and binaries are +relinked without reason\&. To share a cache without side effects, the +following conditions need to be met: +.PP +.IP o +Use the same \fBCCACHE_DIR\fP environment variable setting +.IP o +Unset the \fBCCACHE_HARDLINK\fP environment variable +.IP o +Make sure everyone sets the CCACHE_UMASK environment variable +to 002, this ensures that cached files are accessible to everyone in +the group\&. +.IP o +Make sure that all users have write permission in the entire +cache directory (and that you trust all users of the shared cache)\&. +.IP o +Make sure that the setgid bit is set on all directories in the +cache\&. This tells the filesystem to inherit group ownership for new +directories\&. The command \(dq\&chmod g+s `find $CCACHE_DIR \-type d`\(dq\& might +be useful for this\&. +.IP o +Set \fBCCACHE_NOCOMPRESS\fP for all users, if there are users with +versions of ccache that do not support compression\&. + +.PP +.SH "HISTORY" + +.PP +ccache was inspired by the compilercache shell script script written +by Erik Thiele and I would like to thank him for an excellent piece of +work\&. See +http://www\&.erikyyy\&.de/compilercache/ +for the Erik\(cq\&s scripts\&. +ccache\-swig is a port of the original ccache with support added for use +with SWIG\&. +.PP +I wrote ccache because I wanted to get a bit more speed out of a +compiler cache and I wanted to remove some of the limitations of the +shell\-script version\&. +.PP +.SH "DIFFERENCES FROM COMPILERCACHE" + +.PP +The biggest differences between Erik\(cq\&s compilercache script and ccache +are: +.IP o +ccache is written in C, which makes it a bit faster (calling out to +external programs is mostly what slowed down the scripts)\&. +.IP o +ccache can automatically find the real compiler +.IP o +ccache keeps statistics on hits/misses +.IP o +ccache can do automatic cache management +.IP o +ccache can cache compiler output that includes warnings\&. In many +cases this gives ccache a much higher cache hit rate\&. +.IP o +ccache can handle a much wider ranger of compiler options +.IP o +ccache avoids a double call to cpp on a cache miss + +.PP +.SH "CREDITS" + +.PP +Thanks to the following people for their contributions to ccache +.IP o +Erik Thiele for the original compilercache script +.IP o +Luciano Rocha for the idea of compiling the pre\-processor output +to avoid a 2nd cpp pass +.IP o +Paul Russell for many suggestions and the debian packaging + +.PP +.SH "AUTHOR" + +.PP +ccache was written by Andrew Tridgell +http://samba\&.org/~tridge/\&. +ccache was adapted to create ccache\-swig for use with SWIG by William Fulton\&. +.PP +If you wish to report a problem or make a suggestion then please email +the SWIG developers on the swig\-devel mailing list, see +http://www\&.swig\&.org/mail\&.html +.PP +ccache is released under the GNU General Public License version 2 or +later\&. Please see the file COPYING for license details\&. +.PP + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/ccache-swig.exe Binary file lib/swig/swigwin-2.0.11/CCache/ccache-swig.exe has changed diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/ccache.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/ccache.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1389 @@ +/* + a re-implementation of the compilercache scripts in C + + The idea is based on the shell-script compilercache by Erik Thiele <erikyyy@erikyyy.de> + + Copyright (C) Andrew Tridgell 2002 + Copyright (C) Martin Pool 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ccache.h" + +/* verbose mode */ +int ccache_verbose = 0; + +/* the base cache directory */ +char *cache_dir = NULL; + +/* the directory for temporary files */ +static char *temp_dir = NULL; + +/* the debug logfile name, if set */ +char *cache_logfile = NULL; + +/* the argument list after processing */ +static ARGS *stripped_args; + +/* the original argument list */ +static ARGS *orig_args; + +/* the output filename being compiled to */ +static char *output_file; + +/* the source file */ +static char *input_file; + +/* the name of the file containing the cached object code */ +static char *hashname; + +/* the extension of the file after pre-processing */ +static const char *i_extension; + +/* the name of the temporary pre-processor file */ +static char *i_tmpfile; + +/* are we compiling a .i or .ii file directly? */ +static int direct_i_file; + +/* the name of the cpp stderr file */ +static char *cpp_stderr; + +/* the name of the statistics file */ +char *stats_file = NULL; + +/* can we safely use the unification hashing backend? */ +static int enable_unify; + +/* should we strip -c when running the preprocessor only? */ +static int strip_c_option; + +/* customisation for using the SWIG compiler */ +static int swig; + +/* a list of supported file extensions, and the equivalent + extension for code that has been through the pre-processor +*/ +static struct { + char *extension; + char *i_extension; +} extensions[] = { + {"c", "i"}, + {"C", "ii"}, + {"m", "mi"}, + {"cc", "ii"}, + {"CC", "ii"}, + {"cpp", "ii"}, + {"CPP", "ii"}, + {"cxx", "ii"}, + {"CXX", "ii"}, + {"c++", "ii"}, + {"C++", "ii"}, + {"i", "i"}, + {"ii", "ii"}, + {NULL, NULL}}; + +/* + something went badly wrong - just execute the real compiler +*/ +static void failed(void) +{ + char *e; + + /* delete intermediate pre-processor file if needed */ + if (i_tmpfile) { + if (!direct_i_file) { + unlink(i_tmpfile); + } + free(i_tmpfile); + i_tmpfile = NULL; + } + + /* delete the cpp stderr file if necessary */ + if (cpp_stderr) { + unlink(cpp_stderr); + free(cpp_stderr); + cpp_stderr = NULL; + } + + /* strip any local args */ + args_strip(orig_args, "--ccache-"); + + if ((e=getenv("CCACHE_PREFIX"))) { + char *p = find_executable(e, MYNAME); + if (!p) { + cc_log("could not find executable (%s)\n", e); + perror(e); + exit(1); + } + args_add_prefix(orig_args, p); + } + + if (ccache_verbose) { + display_execute_args(orig_args->argv); + } + + if (swig) { + putenv("CCACHE_OUTFILES"); + } + +#ifndef _WIN32 + execv(orig_args->argv[0], orig_args->argv); + cc_log("execv returned (%s)!\n", strerror(errno)); + perror(orig_args->argv[0]); + exit(1); +#else + /* execv on Windows causes the 'non-regular' testcase to fail, so use Win32 API instead */ + { + PROCESS_INFORMATION pinfo; + STARTUPINFO sinfo; + BOOL ret; + DWORD exitcode; + char *args; + + ZeroMemory(&pinfo, sizeof(PROCESS_INFORMATION)); + ZeroMemory(&sinfo, sizeof(STARTUPINFO)); + sinfo.cb = sizeof(STARTUPINFO); + args = argvtos(orig_args->argv); + ret = CreateProcessA(orig_args->argv[0], args, NULL, NULL, TRUE, 0, NULL, NULL, + &sinfo, &pinfo); + if (!ret) { + exitcode = 1; + cc_log("CreateProcessA failed starting %s\n", orig_args->argv[0]); + perror_win32(orig_args->argv[0]); + } else { + WaitForSingleObject(pinfo.hProcess, INFINITE); + GetExitCodeProcess(pinfo.hProcess, &exitcode); + CloseHandle(pinfo.hProcess); + CloseHandle(pinfo.hThread); + } + free(args); + exit(exitcode); + } +#endif +} + + +/* return a string to be used to distinguish temporary files + this also tries to cope with NFS by adding the local hostname +*/ +static const char *tmp_string(void) +{ + static char *ret; + + if (!ret) { + char hostname[200]; + strcpy(hostname, "unknown"); +#if HAVE_GETHOSTNAME + gethostname(hostname, sizeof(hostname)-1); +#endif + hostname[sizeof(hostname)-1] = 0; + if (asprintf(&ret, "%s.%u", hostname, (unsigned)getpid()) == -1) { + fatal("could not allocate tmp_string"); + } + } + + return ret; +} + +/* update cached file sizes and count helper function for to_cache() */ +static void to_cache_stats_helper(struct stat *pstat, char *cached_filename, char *tmp_outfiles, int *files_size, int *cached_files_count) +{ +#if ENABLE_ZLIB + /* do an extra stat on the cache file for the size statistics */ + if (stat(cached_filename, pstat) != 0) { + cc_log("failed to stat cache files - %s\n", strerror(errno)); + stats_update(STATS_ERROR); + if (tmp_outfiles) { + unlink(tmp_outfiles); + } + failed(); + } +#else + (void)cached_filename; + (void)tmp_outfiles; +#endif + (*files_size) += file_size(pstat); + (*cached_files_count)++; +} + +/* run the real compiler and put the result in cache */ +static void to_cache(ARGS *args) +{ + char *path_stderr; + char *tmp_stdout, *tmp_stderr, *tmp_outfiles; + struct stat st1; + int status; + int cached_files_count = 0; + int files_size = 0; + + x_asprintf(&tmp_stdout, "%s/tmp.stdout.%s", temp_dir, tmp_string()); + x_asprintf(&tmp_stderr, "%s/tmp.stderr.%s", temp_dir, tmp_string()); + x_asprintf(&tmp_outfiles, "%s/tmp.outfiles.%s", temp_dir, tmp_string()); + + if (strip_c_option && !swig) { + args_add(stripped_args, "-c"); + } + + if (output_file) { + args_add(args, "-o"); + args_add(args, output_file); + } + + /* Turn off DEPENDENCIES_OUTPUT when running cc1, because + * otherwise it will emit a line like + * + * tmp.stdout.vexed.732.o: /home/mbp/.ccache/tmp.stdout.vexed.732.i + * + * unsetenv() is on BSD and Linux but not portable. */ + putenv("DEPENDENCIES_OUTPUT"); + + /* Give SWIG a filename for it to create and populate with a list of files that it generates */ + if (swig) { + char *ccache_outfiles; + x_asprintf(&ccache_outfiles, "CCACHE_OUTFILES=%s", tmp_outfiles); + unlink(tmp_outfiles); + if (getenv("CCACHE_OUTFILES") || putenv(ccache_outfiles) == -1) { + cc_log("CCACHE_OUTFILES env variable already set or could not be set\n"); + stats_update(STATS_ERROR); + failed(); + } + } + + if (getenv("CCACHE_CPP2")) { + args_add(args, input_file); + } else { + if (swig) { + args_add(args, "-nopreprocess"); + } + args_add(args, i_tmpfile); + } + status = execute(args->argv, tmp_stdout, tmp_stderr); + args_pop(args, 3); + + if (stat(tmp_stdout, &st1) != 0 || st1.st_size != 0) { + cc_log("compiler produced stdout for %s\n", input_file); + stats_update(STATS_STDOUT); + unlink(tmp_stdout); + unlink(tmp_stderr); + unlink(tmp_outfiles); + if (!swig) unlink(output_file); + failed(); + } + unlink(tmp_stdout); + + if (status != 0) { + int fd; + cc_log("compile of %s gave status = %d\n", input_file, status); + stats_update(STATS_STATUS); + + fd = open(tmp_stderr, O_RDONLY | O_BINARY); + if (fd != -1) { + if (cpp_stderr) { + /* we might have some stderr from cpp */ + int fd2 = open(cpp_stderr, O_RDONLY | O_BINARY); + if (fd2 != -1) { + copy_fd(fd2, 2); + close(fd2); + unlink(cpp_stderr); + cpp_stderr = NULL; + } + } + + /* we can use a quick method of + getting the failed output */ + copy_fd(fd, 2); + close(fd); + unlink(tmp_stderr); + if (i_tmpfile && !direct_i_file) { + unlink(i_tmpfile); + } + exit(status); + } + + unlink(tmp_stderr); + unlink(tmp_outfiles); + if (!swig) unlink(output_file); + failed(); + } else { + int hardlink = (getenv("CCACHE_NOCOMPRESS") != 0) && (getenv("CCACHE_HARDLINK") != 0); + if (swig) { + /* read the list of generated files and copy each of them into the cache */ + FILE *file; + file = fopen(tmp_outfiles, "r"); + if (file) { + char out_filename[FILENAME_MAX + 1]; + char out_filename_cache[FILENAME_MAX + 1]; + while (fgets(out_filename, FILENAME_MAX, file)) { + char *linefeed = strchr(out_filename, '\n'); + if (linefeed) { + char *potential_cr = linefeed - 1; + if (potential_cr >= out_filename && *potential_cr == '\r') + *potential_cr = 0; + *linefeed = 0; + + if (cached_files_count == 0) { + strcpy(out_filename_cache, hashname); + } else { + sprintf(out_filename_cache, "%s.%d", hashname, cached_files_count); + } + + if (commit_to_cache(out_filename, out_filename_cache, hardlink) != 0) { + fclose(file); + unlink(tmp_outfiles); + failed(); + } + to_cache_stats_helper(&st1, out_filename_cache, tmp_outfiles, &files_size, &cached_files_count); + } else { + cached_files_count = 0; + break; + } + } + fclose(file); + if (cached_files_count == 0) { + cc_log("failed to copy output files to cache - internal error\n"); + stats_update(STATS_ERROR); + unlink(tmp_outfiles); + failed(); + } + + /* also copy the (uncompressed) file containing the list of generated files into the cache */ + sprintf(out_filename_cache, "%s.outfiles", hashname); + if (stat(tmp_outfiles, &st1) != 0 || + safe_rename(tmp_outfiles, out_filename_cache) != 0) { + cc_log("failed to copy outfiles file to cache - %s\n", strerror(errno)); + stats_update(STATS_ERROR); + unlink(tmp_outfiles); + failed(); + } + to_cache_stats_helper(&st1, out_filename_cache, tmp_outfiles, &files_size, &cached_files_count); + unlink(tmp_outfiles); + } else { + cc_log("failed to open temp outfiles file - %s\n", strerror(errno)); + stats_update(STATS_ERROR); + failed(); + } + } else { + if (commit_to_cache(output_file, hashname, hardlink) != 0) { + failed(); + } + to_cache_stats_helper(&st1, hashname, 0, &files_size, &cached_files_count); + } + } + + x_asprintf(&path_stderr, "%s.stderr", hashname); + + if (stat(tmp_stderr, &st1) != 0 || + move_file(tmp_stderr, path_stderr) != 0) { + cc_log("failed to rename tmp files - %s\n", strerror(errno)); + stats_update(STATS_ERROR); + failed(); + } + + to_cache_stats_helper(&st1, path_stderr, 0, &files_size, &cached_files_count); + + cc_log("Placed %d files for %s into cache\n", cached_files_count, input_file); + stats_tocache(files_size, cached_files_count); + + free(tmp_stderr); + free(tmp_stdout); + free(tmp_outfiles); + free(path_stderr); +} + +/* find the hash for a command. The hash includes all argument lists, + plus the output from running the compiler with -E */ +static void find_hash(ARGS *args) +{ + int i; + char *path_stdout, *path_stderr; + char *hash_dir; + char *s; + struct stat st; + int status; + int nlevels = 2; + char *input_base; + char *tmp; + + if ((s = getenv("CCACHE_NLEVELS"))) { + nlevels = atoi(s); + if (nlevels < 1) nlevels = 1; + if (nlevels > 8) nlevels = 8; + } + + hash_start(); + + /* when we are doing the unifying tricks we need to include + the input file name in the hash to get the warnings right */ + if (enable_unify || swig) { + hash_string(input_file); + } + + if (swig) { + if (output_file) { + hash_string(output_file); + } + } else { + /* we have to hash the extension, as a .i file isn't treated the same + by the compiler as a .ii file */ + hash_string(i_extension); + } + + /* first the arguments */ + for (i=1;i<args->argc;i++) { + /* some arguments don't contribute to the hash. The + theory is that these arguments will change the + output of -E if they are going to have any effect + at all, or they only affect linking */ + if (i < args->argc-1) { + if (strcmp(args->argv[i], "-I") == 0 || + strcmp(args->argv[i], "-include") == 0 || + strcmp(args->argv[i], "-L") == 0 || + strcmp(args->argv[i], "-D") == 0 || + strcmp(args->argv[i], "-idirafter") == 0 || + strcmp(args->argv[i], "-isystem") == 0) { + i++; + continue; + } + } + if (strncmp(args->argv[i], "-I", 2) == 0 || + strncmp(args->argv[i], "-L", 2) == 0 || + strncmp(args->argv[i], "-D", 2) == 0 || + strncmp(args->argv[i], "-idirafter", 10) == 0 || + strncmp(args->argv[i], "-isystem", 8) == 0) { + continue; + } + + if (strncmp(args->argv[i], "--specs=", 8) == 0 && + stat(args->argv[i]+8, &st) == 0) { + /* if given a explicit specs file, then hash that file, but + don't include the path to it in the hash */ + hash_file(args->argv[i]+8); + continue; + } + + /* all other arguments are included in the hash */ + hash_string(args->argv[i]); + } + + /* the compiler driver size and date. This is a simple minded way + to try and detect compiler upgrades. It is not 100% reliable */ + if (stat(args->argv[0], &st) != 0) { + cc_log("Couldn't stat the compiler!? (argv[0]='%s')\n", args->argv[0]); + stats_update(STATS_COMPILER); + failed(); + } + + /* also include the hash of the compiler name - as some compilers + use hard links and behave differently depending on the real name */ + if (st.st_nlink > 1) { + hash_string(str_basename(args->argv[0])); + } + + hash_int(st.st_size); + hash_int(st.st_mtime); + + /* possibly hash the current working directory */ + if (getenv("CCACHE_HASHDIR")) { + char *cwd = gnu_getcwd(); + if (cwd) { + hash_string(cwd); + free(cwd); + } + } + + /* ~/hello.c -> tmp.hello.123.i + limit the basename to 10 + characters in order to cope with filesystem with small + maximum filename length limits */ + input_base = str_basename(input_file); + tmp = strchr(input_base, '.'); + if (tmp != NULL) { + *tmp = 0; + } + if (strlen(input_base) > 10) { + input_base[10] = 0; + } + + /* now the run */ + x_asprintf(&path_stdout, "%s/%s.tmp.%s.%s", temp_dir, + input_base, tmp_string(), + i_extension); + x_asprintf(&path_stderr, "%s/tmp.cpp_stderr.%s", temp_dir, tmp_string()); + + if (!direct_i_file) { + /* run cpp on the input file to obtain the .i */ + args_add(args, "-E"); + args_add(args, input_file); + status = execute(args->argv, path_stdout, path_stderr); + args_pop(args, 2); + } else { + /* we are compiling a .i or .ii file - that means we + can skip the cpp stage and directly form the + correct i_tmpfile */ + path_stdout = x_strdup(input_file); + if (create_empty_file(path_stderr) != 0) { + cc_log("failed to create empty stderr file\n"); + stats_update(STATS_ERROR); + failed(); + } + status = 0; + } + + if (status != 0) { + if (!direct_i_file) { + unlink(path_stdout); + } + unlink(path_stderr); + cc_log("the preprocessor gave %d\n", status); + stats_update(STATS_PREPROCESSOR); + failed(); + } + + /* if the compilation is with -g then we have to include the whole of the + preprocessor output, which means we are sensitive to line number + information. Otherwise we can discard line number info, which makes + us less sensitive to reformatting changes + + Note! I have now disabled the unification code by default + as it gives the wrong line numbers for warnings. Pity. + */ + if (!enable_unify) { + hash_file(path_stdout); + } else { + if (unify_hash(path_stdout) != 0) { + stats_update(STATS_ERROR); + failed(); + } + } + hash_file(path_stderr); + + i_tmpfile = path_stdout; + + if (!getenv("CCACHE_CPP2")) { + /* if we are using the CPP trick then we need to remember this stderr + data and output it just before the main stderr from the compiler + pass */ + cpp_stderr = path_stderr; + } else { + unlink(path_stderr); + free(path_stderr); + } + + /* we use a N level subdir for the cache path to reduce the impact + on filesystems which are slow for large directories + */ + s = hash_result(); + x_asprintf(&hash_dir, "%s/%c", cache_dir, s[0]); + x_asprintf(&stats_file, "%s/stats", hash_dir); + for (i=1; i<nlevels; i++) { + char *p; + if (create_dir(hash_dir) != 0) { + cc_log("failed to create %s\n", hash_dir); + stats_update(STATS_ERROR); + failed(); + } + x_asprintf(&p, "%s/%c", hash_dir, s[i]); + free(hash_dir); + hash_dir = p; + } + if (create_dir(hash_dir) != 0) { + cc_log("failed to create %s\n", hash_dir); + stats_update(STATS_ERROR); + failed(); + } + x_asprintf(&hashname, "%s/%s", hash_dir, s+nlevels); + free(hash_dir); +} + +/* + try to return the compile result from cache. If we can return from + cache then this function exits with the correct status code, + otherwise it returns */ +static void from_cache(int first) +{ + int fd_stderr, fd_cpp_stderr; + char *stderr_file; + struct stat st; + + x_asprintf(&stderr_file, "%s.stderr", hashname); + fd_stderr = open(stderr_file, O_RDONLY | O_BINARY); + if (fd_stderr == -1) { + /* it isn't in cache ... */ + free(stderr_file); + return; + } + + /* make sure the output is there too */ + if (stat(hashname, &st) != 0) { + close(fd_stderr); + unlink(stderr_file); + free(stderr_file); + return; + } + + /* the user might be disabling cache hits */ +#ifndef ENABLE_ZLIB + /* if the cache file is compressed we must recache */ + if ((first && getenv("CCACHE_RECACHE")) || + test_if_compressed(hashname) == 1) +#else + if (first && getenv("CCACHE_RECACHE")) +#endif + { + close(fd_stderr); + unlink(stderr_file); + free(stderr_file); + return; + } + + if (first) { + int hardlink; + int passfail = -1; + + /* update timestamps for LRU cleanup + also gives output_file a sensible mtime when hard-linking (for make) */ + x_utimes(stderr_file); + + hardlink = (getenv("CCACHE_HARDLINK") != 0); + + if (swig) { + /* read the list of generated files and copy each of them out of the cache */ + FILE *file; + char *outfiles; + x_asprintf(&outfiles, "%s.outfiles", hashname); + file = fopen(outfiles, "r"); + if (file) { + char out_filename[FILENAME_MAX + 1]; + char out_filename_cache[FILENAME_MAX + 1]; + int retrieved_files_count = 0; + x_utimes(outfiles); + while (fgets(out_filename, FILENAME_MAX, file)) { + char *linefeed = strchr(out_filename, '\n'); + if (linefeed) { + char *potential_cr = linefeed - 1; + if (potential_cr >= out_filename && *potential_cr == '\r') + *potential_cr = 0; + *linefeed = 0; + + if (retrieved_files_count == 0) { + strcpy(out_filename_cache, hashname); + } else { + sprintf(out_filename_cache, "%s.%d", hashname, retrieved_files_count); + } + + passfail = retrieve_from_cache(out_filename_cache, out_filename, hardlink); + if (passfail == -1) { + break; + } + + retrieved_files_count++; + } else { + cc_log("failed to copy output files from cache - internal error\n"); + stats_update(STATS_ERROR); + passfail = -1; + break; + } + } + if (retrieved_files_count == 0) { + cc_log("failed to copy output files from cache - internal error\n"); + stats_update(STATS_ERROR); + passfail = -1; + } + fclose(file); + } else { + cc_log("failed to open cached outfiles file - %s\n", strerror(errno)); + stats_update(STATS_ERROR); + } + } else { + passfail = retrieve_from_cache(hashname, output_file, hardlink); + } + + if (passfail == -1) { + close(fd_stderr); + unlink(stderr_file); + free(stderr_file); + return; + } + free(stderr_file); + } + + /* get rid of the intermediate preprocessor file */ + if (i_tmpfile) { + if (!direct_i_file) { + unlink(i_tmpfile); + } + free(i_tmpfile); + i_tmpfile = NULL; + } + + /* send the cpp stderr, if applicable */ + fd_cpp_stderr = open(cpp_stderr, O_RDONLY | O_BINARY); + if (fd_cpp_stderr != -1) { + copy_fd(fd_cpp_stderr, 2); + close(fd_cpp_stderr); + unlink(cpp_stderr); + free(cpp_stderr); + cpp_stderr = NULL; + } + + /* send the stderr */ + copy_fd(fd_stderr, 2); + close(fd_stderr); + + /* and exit with the right status code */ + if (first) { + cc_log("got cached result for %s\n", input_file); + stats_update(STATS_CACHED); + } + + exit(0); +} + +/* find the real compiler. We just search the PATH to find a executable of the + same name that isn't a link to ourselves */ +static void find_compiler(int argc, char **argv) +{ + char *base; + char *path; + + orig_args = args_init(argc, argv); + + base = str_basename(argv[0]); + + /* we might be being invoked like "ccache gcc -c foo.c" */ + if (strcmp(base, MYNAME) == 0) { + args_remove_first(orig_args); + free(base); + if (strchr(argv[1],'/') +#ifdef _WIN32 + || strchr(argv[1],'\\') +#endif + ) { + /* a full path was given */ + return; + } + base = str_basename(argv[1]); + } + + /* support user override of the compiler */ + if ((path=getenv("CCACHE_CC"))) { + base = x_strdup(path); + } + + orig_args->argv[0] = find_executable(base, MYNAME); + + /* can't find the compiler! */ + if (!orig_args->argv[0]) { + stats_update(STATS_COMPILER); + cc_log("could not find compiler (%s)\n", base); + perror(base); + exit(1); + } +} + + +/* check a filename for C/C++ extension. Return the pre-processor + extension */ +static const char *check_extension(const char *fname, int *direct_i) +{ + int i; + const char *p; + + if (direct_i) { + *direct_i = 0; + } + + if (swig) return "ii"; /* any file extension is acceptable as input for SWIG */ + + p = strrchr(fname, '.'); + if (!p) return NULL; + p++; + for (i=0; extensions[i].extension; i++) { + if (strcmp(p, extensions[i].extension) == 0) { + if (direct_i && strcmp(p, extensions[i].i_extension) == 0) { + *direct_i = 1; + } + p = getenv("CCACHE_EXTENSION"); + if (p) return p; + return extensions[i].i_extension; + } + } + return NULL; +} + + +/* + process the compiler options to form the correct set of options + for obtaining the preprocessor output +*/ +static void process_args(int argc, char **argv) +{ + int i; + int found_c_opt = 0; + int found_S_opt = 0; + struct stat st; + char *e; + /* is gcc being asked to output dependencies? */ + int generating_dependencies = 0; + /* is the dependency makefile name overridden with -MF? */ + int dependency_filename_specified = 0; + /* is the dependency makefile target name specified with -MQ or -MF? */ + int dependency_target_specified = 0; + + + stripped_args = args_init(0, NULL); + + args_add(stripped_args, argv[0]); + + /* -c not required for SWIG */ + if (swig) { + found_c_opt = 1; + } + + for (i=1; i<argc; i++) { + /* some options will never work ... */ + if (strcmp(argv[i], "-E") == 0) { + failed(); + } + + /* these are too hard */ + if (strcmp(argv[i], "-fbranch-probabilities")==0 || + strcmp(argv[i], "-fprofile-arcs") == 0 || + strcmp(argv[i], "-ftest-coverage") == 0 || + strcmp(argv[i], "--coverage") == 0 || + strcmp(argv[i], "-M") == 0 || + strcmp(argv[i], "-MM") == 0 || + strcmp(argv[i], "-x") == 0) { + cc_log("argument %s is unsupported\n", argv[i]); + stats_update(STATS_UNSUPPORTED); + failed(); + continue; + } + + /* we must have -c */ + if (strcmp(argv[i], "-c") == 0) { + if (!strip_c_option) { + args_add(stripped_args, argv[i]); + } + found_c_opt = 1; + continue; + } + + /* -S changes the default extension */ + if (strcmp(argv[i], "-S") == 0) { + args_add(stripped_args, argv[i]); + found_S_opt = 1; + continue; + } + + /* we need to work out where the output was meant to go */ + if (strcmp(argv[i], "-o") == 0) { + if (i == argc-1) { + cc_log("missing argument to %s\n", argv[i]); + stats_update(STATS_ARGS); + failed(); + } + output_file = argv[i+1]; + i++; + continue; + } + + /* alternate form of -o, with no space */ + if (!swig) { /* some of SWIG's arguments begin with -o */ + if (strncmp(argv[i], "-o", 2) == 0) { + output_file = &argv[i][2]; + continue; + } + } + + /* debugging is handled specially, so that we know if we + can strip line number info + */ + if (strncmp(argv[i], "-g", 2) == 0) { + args_add(stripped_args, argv[i]); + if (strcmp(argv[i], "-g0") != 0) { + enable_unify = 0; + } + continue; + } + + /* The user knows best: just swallow the next arg */ + if (strcmp(argv[i], "--ccache-skip") == 0) { + i++; + if (i == argc) { + failed(); + } + args_add(stripped_args, argv[i]); + continue; + } + + /* These options require special handling, because they + behave differently with gcc -E, when the output + file is not specified. */ + + if (strcmp(argv[i], "-MD") == 0 || strcmp(argv[i], "-MMD") == 0) { + generating_dependencies = 1; + } else if (strcmp(argv[i], "-MF") == 0) { + dependency_filename_specified = 1; + } else if (strcmp(argv[i], "-MQ") == 0 || strcmp(argv[i], "-MT") == 0) { + dependency_target_specified = 1; + } + + /* the input file is already preprocessed */ + if (swig && strcmp(argv[i], "-nopreprocess") == 0) { + direct_i_file = 1; + continue; + } + + /* options that take an argument */ + { + const char *opts[] = {"-I", "-include", "-imacros", "-iprefix", + "-iwithprefix", "-iwithprefixbefore", + "-L", "-D", "-U", "-x", "-MF", + "-MT", "-MQ", "-isystem", "-aux-info", + "--param", "-A", "-Xlinker", "-u", + "-idirafter", + NULL}; + int j; + for (j=0;opts[j];j++) { + if (strcmp(argv[i], opts[j]) == 0) { + if (i == argc-1) { + cc_log("missing argument to %s\n", + argv[i]); + stats_update(STATS_ARGS); + failed(); + } + + args_add(stripped_args, argv[i]); + args_add(stripped_args, argv[i+1]); + i++; + break; + } + } + if (opts[j]) continue; + } + + /* other options */ + if (argv[i][0] == '-') { + args_add(stripped_args, argv[i]); + continue; + } + + /* if an argument isn't a plain file then assume its + an option, not an input file. This allows us to + cope better with unusual compiler options */ + if (stat(argv[i], &st) != 0 || !S_ISREG(st.st_mode)) { + args_add(stripped_args, argv[i]); + continue; + } + + if (input_file) { + if (check_extension(argv[i], NULL)) { + cc_log("multiple input files (%s and %s)\n", + input_file, argv[i]); + stats_update(STATS_MULTIPLE); + } else if (!found_c_opt) { + cc_log("called for link with %s\n", argv[i]); + if (strstr(argv[i], "conftest.")) { + stats_update(STATS_CONFTEST); + } else { + stats_update(STATS_LINK); + } + } else { + cc_log("non C/C++ file %s\n", argv[i]); + stats_update(STATS_NOTC); + } + failed(); + } + + input_file = argv[i]; + } + + if (!input_file) { + cc_log("No input file found\n"); + stats_update(STATS_NOINPUT); + failed(); + } + + if (swig) { + i_extension = check_extension(input_file, NULL); + } else { + i_extension = check_extension(input_file, &direct_i_file); + } + if (i_extension == NULL) { + cc_log("Not a C/C++ file - %s\n", input_file); + stats_update(STATS_NOTC); + failed(); + } + + if (!found_c_opt) { + cc_log("No -c option found for %s\n", input_file); + /* I find that having a separate statistic for autoconf tests is useful, + as they are the dominant form of "called for link" in many cases */ + if (strstr(input_file, "conftest.")) { + stats_update(STATS_CONFTEST); + } else { + stats_update(STATS_LINK); + } + failed(); + } + + + /* don't try to second guess the compilers heuristics for stdout handling */ + if (output_file && strcmp(output_file, "-") == 0) { + stats_update(STATS_OUTSTDOUT); + failed(); + } + + if (!swig && !output_file) { + char *p; + output_file = x_strdup(input_file); + if ((p = strrchr(output_file, '/'))) { + output_file = p+1; + } + p = strrchr(output_file, '.'); + if (!p || !p[1]) { + cc_log("badly formed output_file %s\n", output_file); + stats_update(STATS_ARGS); + failed(); + } + p[1] = found_S_opt ? 's' : 'o'; + p[2] = 0; + } + + /* If dependencies are generated, configure the preprocessor */ + + if (generating_dependencies && output_file) { + if (!dependency_filename_specified) { + char *default_depfile_name = x_strdup(output_file); + char *p = strrchr(default_depfile_name, '.'); + + if (p) { + if (strlen(p) < 2) { + cc_log("badly formed dependency file %s\n", output_file); + stats_update(STATS_ARGS); + failed(); + return; + } + *p = 0; + } + else { + int len = p - default_depfile_name; + + p = x_malloc(len + 3); + strncpy(default_depfile_name, p, len - 1); + free(default_depfile_name); + default_depfile_name = p; + } + + strcat(default_depfile_name, ".d"); + args_add(stripped_args, "-MF"); + args_add(stripped_args, default_depfile_name); + } + + if (!dependency_target_specified) { + args_add(stripped_args, "-MT"); + args_add(stripped_args, output_file); + } + } + + /* cope with -o /dev/null */ + if (output_file && strcmp(output_file,"/dev/null") != 0 && stat(output_file, &st) == 0 && !S_ISREG(st.st_mode)) { + cc_log("Not a regular file %s\n", output_file); + stats_update(STATS_DEVICE); + failed(); + } + + if ((e=getenv("CCACHE_PREFIX"))) { + char *p = find_executable(e, MYNAME); + if (!p) { + cc_log("could not find executable (%s)\n", e); + stats_update(STATS_ENVIRONMMENT); + perror(e); + exit(1); + } + args_add_prefix(stripped_args, p); + } +} + +static void detect_swig() +{ + char *basename = str_basename(orig_args->argv[0]); + if (strstr(basename, "swig") || getenv("CCACHE_SWIG")) { + swig = 1; + } + free(basename); +} + +/* the main ccache driver function */ +static void ccache(int argc, char *argv[]) +{ + /* find the real compiler */ + find_compiler(argc, argv); + + /* use the real compiler if HOME is not set */ + if (!cache_dir) { + cc_log("Unable to determine home directory\n"); + cc_log("ccache is disabled\n"); + failed(); + } + + /* we might be disabled */ + if (getenv("CCACHE_DISABLE")) { + cc_log("ccache is disabled\n"); + failed(); + } + + if (getenv("CCACHE_STRIPC")) { + strip_c_option = 1; + } + + if (getenv("CCACHE_UNIFY")) { + enable_unify = 1; + } + + detect_swig(); + + /* process argument list, returning a new set of arguments for pre-processing */ + process_args(orig_args->argc, orig_args->argv); + + /* run with -E to find the hash */ + find_hash(stripped_args); + + /* if we can return from cache at this point then do */ + from_cache(1); + + if (getenv("CCACHE_READONLY")) { + cc_log("read-only set - doing real compile\n"); + failed(); + } + + /* run real compiler, sending output to cache */ + to_cache(stripped_args); + + /* return from cache */ + from_cache(0); + + /* oh oh! */ + cc_log("secondary from_cache failed!\n"); + stats_update(STATS_ERROR); + failed(); +} + + +static void usage(void) +{ + printf("%s, a compiler cache including support for SWIG. Version %s\n", MYNAME, CCACHE_VERSION); + printf("Copyright Andrew Tridgell, 2002\n\n"); + + printf("Usage:\n"); + printf("\t" MYNAME " [options]\n"); + printf("\t" MYNAME " compiler [compile options]\n"); + printf("\tcompiler [compile options] (via symbolic link)\n"); + printf("\nOptions:\n"); + + printf("-s show statistics summary\n"); + printf("-z zero statistics\n"); + printf("-c run a cache cleanup\n"); + printf("-C clear the cache completely\n"); + printf("-F <maxfiles> set maximum files in cache\n"); + printf("-M <maxsize> set maximum size of cache (use G, M or K)\n"); + printf("-h this help page\n"); + printf("-V print version number\n"); +} + +static void check_cache_dir(void) +{ + if (!cache_dir) { + fatal("Unable to determine home directory"); + } +} + +/* the main program when not doing a compile */ +static int ccache_main(int argc, char *argv[]) +{ + int c; + size_t v; + + while ((c = getopt(argc, argv, "hszcCF:M:V")) != -1) { + switch (c) { + case 'V': + printf("%s version %s\n", MYNAME, CCACHE_VERSION); + printf("Copyright Andrew Tridgell 2002\n"); + printf("Released under the GNU GPL v2 or later\n"); + exit(0); + + case 'h': + usage(); + exit(0); + + case 's': + check_cache_dir(); + stats_summary(); + break; + + case 'c': + check_cache_dir(); + cleanup_all(cache_dir); + printf("Cleaned cache\n"); + break; + + case 'C': + check_cache_dir(); + wipe_all(cache_dir); + printf("Cleared cache\n"); + break; + + case 'z': + check_cache_dir(); + stats_zero(); + printf("Statistics cleared\n"); + break; + + case 'F': + check_cache_dir(); + v = atoi(optarg); + if (stats_set_limits(v, -1) == 0) { + printf("Set cache file limit to %u\n", (unsigned)v); + } else { + printf("Could not set cache file limit.\n"); + exit(1); + } + break; + + case 'M': + check_cache_dir(); + v = value_units(optarg); + if (stats_set_limits(-1, v) == 0) { + printf("Set cache size limit to %uk\n", (unsigned)v); + } else { + printf("Could not set cache size limit.\n"); + exit(1); + } + break; + + default: + usage(); + exit(1); + } + } + + return 0; +} + + +/* Make a copy of stderr that will not be cached, so things like + distcc can send networking errors to it. */ +static void setup_uncached_err(void) +{ + char *buf; + int uncached_fd; + + uncached_fd = dup(2); + if (uncached_fd == -1) { + cc_log("dup(2) failed\n"); + stats_update(STATS_ERROR); + failed(); + } + + /* leak a pointer to the environment */ + x_asprintf(&buf, "UNCACHED_ERR_FD=%d", uncached_fd); + + if (putenv(buf) == -1) { + cc_log("putenv failed\n"); + stats_update(STATS_ERROR); + failed(); + } +} + + +int main(int argc, char *argv[]) +{ + char *p; + + cache_dir = getenv("CCACHE_DIR"); + if (!cache_dir) { + const char *home_directory = get_home_directory(); + if (home_directory) { + x_asprintf(&cache_dir, "%s/.ccache", home_directory); + } + } + + cache_logfile = getenv("CCACHE_LOGFILE"); + + if (getenv("CCACHE_VERBOSE")) { + ccache_verbose = 1; + } + + setup_uncached_err(); + + + /* the user might have set CCACHE_UMASK */ + p = getenv("CCACHE_UMASK"); + if (p) { + mode_t mask; + errno = 0; + mask = strtol(p, NULL, 8); + if (errno == 0) { + umask(mask); + } + } + + + /* check if we are being invoked as "ccache" */ + if (strlen(argv[0]) >= strlen(MYNAME) && + strcmp(argv[0] + strlen(argv[0]) - strlen(MYNAME), MYNAME) == 0) { + if (argc < 2) { + usage(); + exit(1); + } + /* if the first argument isn't an option, then assume we are + being passed a compiler name and options */ + if (argv[1][0] == '-') { + return ccache_main(argc, argv); + } + } + + /* make sure the cache dir exists */ + if (cache_dir && (create_dir(cache_dir) != 0)) { + fprintf(stderr,"ccache: failed to create %s (%s)\n", + cache_dir, strerror(errno)); + exit(1); + } + + temp_dir = getenv("CCACHE_TEMPDIR"); + if (!temp_dir) { + x_asprintf(&temp_dir, "%s/temp", cache_dir); + /* make sure temp dir exists if not supplied by user */ + if (temp_dir && create_dir(temp_dir) != 0) { + fprintf(stderr,"ccache: failed to create %s (%s)\n", + temp_dir, strerror(errno)); + exit(1); + } + } + + if (!getenv("CCACHE_READONLY")) { + if (create_cachedirtag(cache_dir) != 0) { + fprintf(stderr,"ccache: failed to create %s/CACHEDIR.TAG (%s)\n", + cache_dir, strerror(errno)); + exit(1); + } + } + + ccache(argc, argv); + return 1; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/ccache.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/ccache.h Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,207 @@ +#include "ccache_swig_config.h" + +#define CCACHE_VERSION SWIG_VERSION + +#ifndef _WIN32 +#include "config.h" +#else +#include <sys/locking.h> +#define PACKAGE_NAME "ccache-swig.exe" +#endif + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <errno.h> +#include <sys/stat.h> +#include <sys/types.h> + +#ifndef _WIN32 + #include <sys/wait.h> + #include <sys/mman.h> +#else +#define _WIN32_WINNT 0x0500 + #include <windows.h> + #include <shlobj.h> +#endif + +#include <sys/file.h> +#include <fcntl.h> +#include <time.h> +#include <string.h> +#include <ctype.h> +#include <utime.h> +#include <stdarg.h> +#include <dirent.h> +#include <limits.h> +#ifdef HAVE_PWD_H +#include <pwd.h> +#endif +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#endif + +#ifdef ENABLE_ZLIB +#include <zlib.h> +#endif + +#define STATUS_NOTFOUND 3 +#define STATUS_FATAL 4 +#define STATUS_NOCACHE 5 + +#define MYNAME PACKAGE_NAME + +#define LIMIT_MULTIPLE 0.8 + +/* default maximum cache size */ +#ifndef DEFAULT_MAXSIZE +#define DEFAULT_MAXSIZE (1000*1000) +#endif + +/* file copy mode */ +#ifdef ENABLE_ZLIB +#define COPY_UNCOMPRESSED 0 +#define COPY_FROM_CACHE 1 +#define COPY_TO_CACHE 2 +#endif + +enum stats { + STATS_NONE=0, + STATS_STDOUT, + STATS_STATUS, + STATS_ERROR, + STATS_TOCACHE, + STATS_PREPROCESSOR, + STATS_COMPILER, + STATS_MISSING, + STATS_CACHED, + STATS_ARGS, + STATS_LINK, + STATS_NUMFILES, + STATS_TOTALSIZE, + STATS_MAXFILES, + STATS_MAXSIZE, + STATS_NOTC, + STATS_DEVICE, + STATS_NOINPUT, + STATS_ENVIRONMMENT, + STATS_MULTIPLE, + STATS_CONFTEST, + STATS_UNSUPPORTED, + STATS_OUTSTDOUT, + + STATS_END +}; + +typedef unsigned uint32; + +#include "mdfour.h" + +void hash_start(void); +void hash_string(const char *s); +void hash_int(int x); +void hash_file(const char *fname); +char *hash_result(void); +void hash_buffer(const char *s, int len); + +void cc_log(const char *format, ...); +void fatal(const char *msg); + +void copy_fd(int fd_in, int fd_out); +int safe_rename(const char* oldpath, const char* newpath); +int move_file(const char *src, const char *dest); +int test_if_compressed(const char *filename); + +int commit_to_cache(const char *src, const char *dest, int hardlink); +int retrieve_from_cache(const char *src, const char *dest, int hardlink); + +int create_dir(const char *dir); +int create_cachedirtag(const char *dir); +void x_asprintf(char **ptr, const char *format, ...); +char *x_strdup(const char *s); +void *x_realloc(void *ptr, size_t size); +void *x_malloc(size_t size); +void traverse(const char *dir, void (*fn)(const char *, struct stat *)); +char *str_basename(const char *s); +char *dirname(char *s); +int lock_fd(int fd); +size_t file_size(struct stat *st); +int safe_open(const char *fname); +char *x_realpath(const char *path); +char *gnu_getcwd(void); +int create_empty_file(const char *fname); +const char *get_home_directory(void); +int x_utimes(const char *filename); +#ifdef _WIN32 +void perror_win32(LPTSTR pszFunction); +#endif + +void stats_update(enum stats stat); +void stats_zero(void); +void stats_summary(void); +void stats_tocache(size_t size, size_t numfiles); +void stats_read(const char *stats_file, unsigned counters[STATS_END]); +int stats_set_limits(long maxfiles, long maxsize); +size_t value_units(const char *s); +void display_size(unsigned v); +void stats_set_sizes(const char *dir, size_t num_files, size_t total_size); + +int unify_hash(const char *fname); + +#ifndef HAVE_VASPRINTF +int vasprintf(char **, const char *, va_list ); +#endif +#ifndef HAVE_ASPRINTF +int asprintf(char **ptr, const char *format, ...); +#endif + +#ifndef HAVE_SNPRINTF +int snprintf(char *,size_t ,const char *, ...); +#endif + +void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize, size_t minfiles); +void cleanup_all(const char *dir); +void wipe_all(const char *dir); + +#ifdef _WIN32 +char *argvtos(char **argv); +#endif +int execute(char **argv, + const char *path_stdout, + const char *path_stderr); +char *find_executable(const char *name, const char *exclude_name); +void display_execute_args(char **argv); + +typedef struct { + char **argv; + int argc; +} ARGS; + + +ARGS *args_init(int , char **); +void args_add(ARGS *args, const char *s); +void args_add_prefix(ARGS *args, const char *s); +void args_pop(ARGS *args, int n); +void args_strip(ARGS *args, const char *prefix); +void args_remove_first(ARGS *args); + +extern int ccache_verbose; + +#if HAVE_COMPAR_FN_T +#define COMPAR_FN_T __compar_fn_t +#else +typedef int (*COMPAR_FN_T)(const void *, const void *); +#endif + +/* work with silly DOS binary open */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif + +/* mkstemp() on some versions of cygwin don't handle binary files, so + override */ +/* Seems okay in Cygwin 1.7.0 +#ifdef __CYGWIN__ +#undef HAVE_MKSTEMP +#endif +*/ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/ccache.yo --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/ccache.yo Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,422 @@ +whenman( +COMMENT(html output not great if included when using html2doc) +manpage(ccache-swig)(1)()()() +) + +whenhtml(htmlcommand( + +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<title>ccache-swig(1) manpage</title> +<link rel="stylesheet" type="text/css" href="style.css"> +</head> + +<body bgcolor="#ffffff"> +<H1><a name="CCache"></a>Using SWIG with ccache - ccache-swig(1) manpage</H1> +<!-- INDEX --> +<div class="sectiontoc"> +<!-- INDEX --> + +)) + + +manpagename(ccache-swig)(a fast compiler cache) + +whenhtml(htmlcommand( +ccache-swig - a fast compiler cache +)) + +manpagesynopsis() + +ccache-swig [OPTION] + +ccache-swig <compiler> [COMPILER OPTIONS] + +<compiler> [COMPILER OPTIONS] + +manpagedescription() + +ccache-swig is a compiler cache. It speeds up re-compilation of C/C++/SWIG code +by caching previous compiles and detecting when the same compile is +being done again. ccache-swig is ccache plus support for SWIG. ccache +and ccache-swig are used interchangeably in this document. + +manpagesection(OPTIONS SUMMARY) + +Here is a summary of the options to ccache-swig. + +verb( +-s show statistics summary +-z zero statistics +-c run a cache cleanup +-C clear the cache completely +-F <n> set maximum files in cache +-M <n> set maximum size of cache (use G, M or K) +-h this help page +-V print version number +) + +manpageoptions() + +These options only apply when you invoke ccache as "ccache-swig". When +invoked as a compiler none of these options apply. In that case your +normal compiler options apply and you should refer to your compilers +documentation. + +startdit() +dit(bf(-h)) Print a options summary page + +dit(bf(-s)) Print the current statistics summary for the cache. The +statistics are stored spread across the subdirectories of the +cache. Using "ccache-swig -s" adds up the statistics across all +subdirectories and prints the totals. + +dit(bf(-z)) Zero the cache statistics. + +dit(bf(-V)) Print the ccache version number + +dit(bf(-c)) Clean the cache and re-calculate the cache file count and +size totals. Normally the -c option should not be necessary as ccache +keeps the cache below the specified limits at runtime and keeps +statistics up to date on each compile. This option is mostly useful +if you manually modify the cache contents or believe that the cache +size statistics may be inaccurate. + +dit(bf(-C)) Clear the entire cache, removing all cached files. + +dit(bf(-F <maxfiles>)) This sets the maximum number of files allowed in +the cache. The value is stored inside the cache directory and applies +to all future compiles. Due to the way the value is stored the actual +value used is always rounded down to the nearest multiple of 16. + +dit(bf(-M <maxsize>)) This sets the maximum cache size. You can specify +a value in gigabytes, megabytes or kilobytes by appending a G, M or K +to the value. The default is gigabytes. The actual value stored is +rounded down to the nearest multiple of 16 kilobytes. + +enddit() + +manpagesection(INSTALLATION) + +There are two ways to use ccache. You can either prefix your compile +commands with "ccache-swig" or you can create a symbolic link between +ccache-swig and the names of your compilers. The first method is most +convenient if you just want to try out ccache or wish to use it for +some specific projects. The second method is most useful for when you +wish to use ccache for all your compiles. + +To install for usage by the first method just copy ccache-swig to somewhere +in your path. + +To install for the second method do something like this: +verb( + cp ccache-swig /usr/local/bin/ + ln -s /usr/local/bin/ccache-swig /usr/local/bin/gcc + ln -s /usr/local/bin/ccache-swig /usr/local/bin/g++ + ln -s /usr/local/bin/ccache-swig /usr/local/bin/cc + ln -s /usr/local/bin/ccache-swig /usr/local/bin/swig +) +This will work as long as /usr/local/bin comes before the path to gcc +(which is usually in /usr/bin). After installing you may wish to run +"which gcc" to make sure that the correct link is being used. + +Note! Do not use a hard link, use a symbolic link. A hardlink will +cause "interesting" problems. + +manpagesection(EXTRA OPTIONS) + +When run as a compiler front end ccache usually just takes the same +command line options as the compiler you are using. The only exception +to this is the option '--ccache-skip'. That option can be used to tell +ccache that the next option is definitely not a input filename, and +should be passed along to the compiler as-is. + +The reason this can be important is that ccache does need to parse the +command line and determine what is an input filename and what is a +compiler option, as it needs the input filename to determine the name +of the resulting object file (among other things). The heuristic +ccache uses in this parse is that any string on the command line that +exists as a file is treated as an input file name (usually a C +file). By using --ccache-skip you can force an option to not be +treated as an input file name and instead be passed along to the +compiler as a command line option. + +manpagesection(ENVIRONMENT VARIABLES) + +ccache uses a number of environment variables to control operation. In +most cases you won't need any of these as the defaults will be fine. + +startdit() + +dit(bf(CCACHE_DIR)) the CCACHE_DIR environment variable specifies +where ccache will keep its cached compiler output. The default is +"$HOME/.ccache". + +dit(bf(CCACHE_TEMPDIR)) the CCACHE_TEMPDIR environment variable specifies +where ccache will put temporary files. The default is the same as +CCACHE_DIR. Note that the CCACHE_TEMPDIR path must be on the same +filesystem as the CCACHE_DIR path, so that renames of files between +the two directories can work. + +dit(bf(CCACHE_LOGFILE)) If you set the CCACHE_LOGFILE environment +variable then ccache will write some log information on cache hits +and misses in that file. This is useful for tracking down problems. + +dit(bf(CCACHE_VERBOSE)) If you set the CCACHE_VERBOSE environment +variable then ccache will display on stdout all the compiler invocations +that it makes. This can useful for debugging unexpected problems. + +dit(bf(CCACHE_PATH)) You can optionally set CCACHE_PATH to a colon +separated path where ccache will look for the real compilers. If you +don't do this then ccache will look for the first executable matching +the compiler name in the normal PATH that isn't a symbolic link to +ccache itself. + +dit(bf(CCACHE_CC)) You can optionally set CCACHE_CC to force the name +of the compiler to use. If you don't do this then ccache works it out +from the command line. + +dit(bf(CCACHE_PREFIX)) This option adds a prefix to the command line +that ccache runs when invoking the compiler. Also see the section +below on using ccache with distcc. + +dit(bf(CCACHE_DISABLE)) If you set the environment variable +CCACHE_DISABLE then ccache will just call the real compiler, +bypassing the cache completely. + +dit(bf(CCACHE_READONLY)) the CCACHE_READONLY environment variable +tells ccache to attempt to use existing cached object files, but not +to try to add anything new to the cache. If you are using this because +your CCACHE_DIR is read-only, then you may find that you also need to +set CCACHE_TEMPDIR as otherwise ccache will fail to create the +temporary files. + +dit(bf(CCACHE_CPP2)) If you set the environment variable CCACHE_CPP2 +then ccache will not use the optimisation of avoiding the 2nd call to +the pre-processor by compiling the pre-processed output that was used +for finding the hash in the case of a cache miss. This is primarily a +debugging option, although it is possible that some unusual compilers +will have problems with the intermediate filename extensions used in +this optimisation, in which case this option could allow ccache to be +used. + +dit(bf(CCACHE_NOCOMPRESS)) If you set the environment variable +CCACHE_NOCOMPRESS then there is no compression used on files that go +into the cache. However, this setting has no effect on how files are +retrieved from the cache, compressed results will still be usable. + +dit(bf(CCACHE_NOSTATS)) If you set the environment variable +CCACHE_NOSTATS then ccache will not update the statistics files on +each compile. + +dit(bf(CCACHE_NLEVELS)) The environment variable CCACHE_NLEVELS allows +you to choose the number of levels of hash in the cache directory. The +default is 2. The minimum is 1 and the maximum is 8. + +dit(bf(CCACHE_HARDLINK)) If you set the environment variable +CCACHE_HARDLINK then ccache will attempt to use hard links from the +cache directory when creating the compiler output rather than using a +file copy. Using hard links is faster, but can confuse programs like +'make' that rely on modification times. Hard links are never made for +compressed cache files. + +dit(bf(CCACHE_RECACHE)) This forces ccache to not use any cached +results, even if it finds them. New results are still cached, but +existing cache entries are ignored. + +dit(bf(CCACHE_UMASK)) This sets the umask for ccache and all child +processes (such as the compiler). This is mostly useful when you wish +to share your cache with other users. Note that this also affects the +file permissions set on the object files created from your +compilations. + +dit(bf(CCACHE_HASHDIR)) This tells ccache to hash the current working +directory when calculating the hash that is used to distinguish two +compiles. This prevents a problem with the storage of the current +working directory in the debug info of a object file, which can lead +ccache to give a cached object file that has the working directory in +the debug info set incorrectly. This option is off by default as the +incorrect setting of this debug info rarely causes problems. If you +strike problems with gdb not using the correct directory then enable +this option. + +dit(bf(CCACHE_UNIFY)) If you set the environment variable CCACHE_UNIFY +then ccache will use the C/C++ unifier when hashing the pre-processor +output if -g is not used in the compile. The unifier is slower than a +normal hash, so setting this environment variable loses a little bit +of speed, but it means that ccache can take advantage of not +recompiling when the changes to the source code consist of +reformatting only. Note that using CCACHE_UNIFY changes the hash, so +cached compiles with CCACHE_UNIFY set cannot be used when +CCACHE_UNIFY is not set and vice versa. The reason the unifier is off +by default is that it can give incorrect line number information in +compiler warning messages. + +dit(bf(CCACHE_EXTENSION)) Normally ccache tries to automatically +determine the extension to use for intermediate C pre-processor files +based on the type of file being compiled. Unfortunately this sometimes +doesn't work, for example when using the aCC compiler on HP-UX. On +systems like this you can use the CCACHE_EXTENSION option to override +the default. On HP-UX set this environment variable to "i" if you use +the aCC compiler. + +dit(bf(CCACHE_STRIPC)) If you set the environment variable +CCACHE_STRIPC then ccache will strip the -c option when invoking +the preprocessor. This option is primarily for the Sun Workshop +C++ compiler as without this option an unwarranted warning is displayed: +CC: Warning: "-E" redefines product from "object" to "source (stdout)" +when -E and -c is used together. + +dit(bf(CCACHE_SWIG)) When using SWIG as the compiler and it does not +have 'swig' in the executable name, then the CCACHE_SWIG environment +variable needs to be set in order for ccache to work correctly with +SWIG. The use of CCACHE_CPP2 is also recommended for SWIG due to some +preprocessor quirks, however, use of CCACHE_CPP2 can often be skipped +-- check your generated code with and without this option set. Known +problems are using preprocessor directives within %inline blocks and +the use of '#pragma SWIG'. + +enddit() + +manpagesection(CACHE SIZE MANAGEMENT) + +By default ccache has a one gigabyte limit on the cache size and no +maximum number of files. You can set a different limit using the +"ccache -M" and "ccache -F" options, which set the size and number of +files limits. + +When these limits are reached ccache will reduce the cache to 20% +below the numbers you specified in order to avoid doing the cache +clean operation too often. + +manpagesection(CACHE COMPRESSION) + +By default on most platforms ccache will compress all files it puts +into the cache +using the zlib compression. While this involves a negligible +performance slowdown, it significantly increases the number of files +that fit in the cache. You can turn off compression setting the +CCACHE_NOCOMPRESS environment variable. + +manpagesection(HOW IT WORKS) + +The basic idea is to detect when you are compiling exactly the same +code a 2nd time and use the previously compiled output. You detect +that it is the same code by forming a hash of: + +itemization( + it() the pre-processor output from running the compiler with -E + it() the command line options + it() the real compilers size and modification time + it() any stderr output generated by the compiler +) + +These are hashed using md4 (a strong hash) and a cache file is formed +based on that hash result. When the same compilation is done a second +time ccache is able to supply the correct compiler output (including +all warnings etc) from the cache. + +ccache has been carefully written to always produce exactly the same +compiler output that you would get without the cache. If you ever +discover a case where ccache changes the output of your compiler then +please let me know. + +manpagesection(USING CCACHE WITH DISTCC) + +distcc is a very useful program for distributing compilation across a +range of compiler servers. It is often useful to combine distcc with +ccache, so that compiles that are done are sped up by distcc, but that +ccache avoids the compile completely where possible. + +To use distcc with ccache I recommend using the CCACHE_PREFIX +option. You just need to set the environment variable CCACHE_PREFIX to +'distcc' and ccache will prefix the command line used with the +compiler with the command 'distcc'. + +manpagesection(SHARING A CACHE) + +A group of developers can increase the cache hit rate by sharing a +cache directory. The hard links however cause unwanted side effects, +as all links to a cached file share the file's modification timestamp. +This results in false dependencies to be triggered by timestamp-based +build systems whenever another user links to an existing +file. Typically, users will see that their libraries and binaries are +relinked without reason. To share a cache without side effects, the +following conditions need to be met: + +itemization( + it() Use the same bf(CCACHE_DIR) environment variable setting + it() Unset the bf(CCACHE_HARDLINK) environment variable + it() Make sure everyone sets the CCACHE_UMASK environment variable + to 002, this ensures that cached files are accessible to everyone in + the group. + it() Make sure that all users have write permission in the entire + cache directory (and that you trust all users of the shared cache). + it() Make sure that the setgid bit is set on all directories in the + cache. This tells the filesystem to inherit group ownership for new + directories. The command "chmod g+s `find $CCACHE_DIR -type d`" might + be useful for this. + it() Set bf(CCACHE_NOCOMPRESS) for all users, if there are users with + versions of ccache that do not support compression. +) + +manpagesection(HISTORY) + +ccache was inspired by the compilercache shell script script written +by Erik Thiele and I would like to thank him for an excellent piece of +work. See +url(http://www.erikyyy.de/compilercache/)(http://www.erikyyy.de/compilercache/) +for the Erik's scripts. +ccache-swig is a port of the original ccache with support added for use +with SWIG. + +I wrote ccache because I wanted to get a bit more speed out of a +compiler cache and I wanted to remove some of the limitations of the +shell-script version. + +manpagesection(DIFFERENCES FROM COMPILERCACHE) + +The biggest differences between Erik's compilercache script and ccache +are: +itemization( +it() ccache is written in C, which makes it a bit faster (calling out to + external programs is mostly what slowed down the scripts). +it() ccache can automatically find the real compiler +it() ccache keeps statistics on hits/misses +it() ccache can do automatic cache management +it() ccache can cache compiler output that includes warnings. In many + cases this gives ccache a much higher cache hit rate. +it() ccache can handle a much wider ranger of compiler options +it() ccache avoids a double call to cpp on a cache miss +) + +manpagesection(CREDITS) + +Thanks to the following people for their contributions to ccache +itemization( + it() Erik Thiele for the original compilercache script + it() Luciano Rocha for the idea of compiling the pre-processor output + to avoid a 2nd cpp pass + it() Paul Russell for many suggestions and the debian packaging +) + +manpageauthor() + +ccache was written by Andrew Tridgell +url(http://samba.org/~tridge/)(http://samba.org/~tridge/). +ccache was adapted to create ccache-swig for use with SWIG by William Fulton. + +If you wish to report a problem or make a suggestion then please email +the SWIG developers on the swig-devel mailing list, see +url(http://www.swig.org/mail.html)(http://www.swig.org/mail.html) + +ccache is released under the GNU General Public License version 2 or +later. Please see the file COPYING for license details. + +whenhtml(htmlcommand( + +</body> +</html> + +)) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/ccache_swig_config.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/ccache_swig_config.h.in Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1 @@ +#define SWIG_VERSION "@PACKAGE_VERSION@" diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/cleanup.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/cleanup.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,213 @@ +/* + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* + functions to cleanup the cache directory when it gets too large + */ + +#include "ccache.h" + +static struct files { + char *fname; + time_t mtime; + size_t size; +} **files; +static unsigned allocated; +static unsigned num_files; +static size_t total_size; +static size_t total_files; +static size_t size_threshold; +static size_t files_threshold; + +/* file comparison function to try to delete the oldest files first */ +static int files_compare(struct files **f1, struct files **f2) +{ + if ((*f2)->mtime == (*f1)->mtime) { + return strcmp((*f2)->fname, (*f1)->fname); + } + if ((*f2)->mtime > (*f1)->mtime) { + return -1; + } + return 1; +} + +/* this builds the list of files in the cache */ +static void traverse_fn(const char *fname, struct stat *st) +{ + char *p; + + if (!S_ISREG(st->st_mode)) return; + + p = str_basename(fname); + if (strcmp(p, "stats") == 0) { + free(p); + return; + } + free(p); + + if (num_files == allocated) { + allocated = 10000 + num_files*2; + files = (struct files **)x_realloc(files, + sizeof(struct files *)*allocated); + } + + files[num_files] = (struct files *)x_malloc(sizeof(struct files)); + files[num_files]->fname = x_strdup(fname); + files[num_files]->mtime = st->st_mtime; + files[num_files]->size = file_size(st) / 1024; + total_size += files[num_files]->size; + num_files++; +} + +/* sort the files we've found and delete the oldest ones until we are + below the thresholds */ +static void sort_and_clean(size_t minfiles) +{ + unsigned i; + size_t adjusted_minfiles = minfiles; + + if (num_files > 1) { + /* sort in ascending data order */ + qsort(files, num_files, sizeof(struct files *), + (COMPAR_FN_T)files_compare); + } + /* ensure newly cached files (minfiles) are kept - instead of matching + the filenames of those newly cached, a faster and simpler approach + assumes these are the most recent in the cache and if any other + cached files have an identical time stamp, they will also be kept - + this approach would not be needed if the cleanup was done at exit. */ + if (minfiles != 0 && minfiles < num_files) { + unsigned minfiles_index = num_files - minfiles; + time_t minfiles_time = files[minfiles_index]->mtime; + for (i=1; i<=minfiles_index; i++) { + if (files[minfiles_index-i]->mtime == minfiles_time) + adjusted_minfiles++; + else + break; + } + } + + /* delete enough files to bring us below the threshold */ + for (i=0;i<num_files; i++) { + if ((size_threshold==0 || total_size < size_threshold) && + (files_threshold==0 || (num_files-i) < files_threshold)) break; + + if (adjusted_minfiles != 0 && num_files-i <= adjusted_minfiles) + break; + + if (unlink(files[i]->fname) != 0 && errno != ENOENT) { + fprintf(stderr, "unlink %s - %s\n", + files[i]->fname, strerror(errno)); + continue; + } + + total_size -= files[i]->size; + } + + total_files = num_files - i; +} + +/* cleanup in one cache subdir */ +void cleanup_dir(const char *dir, size_t maxfiles, size_t maxsize, size_t minfiles) +{ + unsigned i; + + size_threshold = maxsize * LIMIT_MULTIPLE; + files_threshold = maxfiles * LIMIT_MULTIPLE; + + num_files = 0; + total_size = 0; + + /* build a list of files */ + traverse(dir, traverse_fn); + + /* clean the cache */ + sort_and_clean(minfiles); + + stats_set_sizes(dir, total_files, total_size); + + /* free it up */ + for (i=0;i<num_files;i++) { + free(files[i]->fname); + free(files[i]); + files[i] = NULL; + } + if (files) free(files); + allocated = 0; + files = NULL; + + num_files = 0; + total_size = 0; +} + +/* cleanup in all cache subdirs */ +void cleanup_all(const char *dir) +{ + unsigned counters[STATS_END]; + char *dname, *sfile; + int i; + + for (i=0;i<=0xF;i++) { + x_asprintf(&dname, "%s/%1x", dir, i); + x_asprintf(&sfile, "%s/%1x/stats", dir, i); + + memset(counters, 0, sizeof(counters)); + stats_read(sfile, counters); + + cleanup_dir(dname, + counters[STATS_MAXFILES], + counters[STATS_MAXSIZE], + 0); + free(dname); + free(sfile); + } +} + + +/* traverse function for wiping files */ +static void wipe_fn(const char *fname, struct stat *st) +{ + char *p; + + if (!S_ISREG(st->st_mode)) return; + + p = str_basename(fname); + if (strcmp(p, "stats") == 0) { + free(p); + return; + } + free(p); + + unlink(fname); +} + + +/* wipe all cached files in all subdirs */ +void wipe_all(const char *dir) +{ + char *dname; + int i; + + for (i=0;i<=0xF;i++) { + x_asprintf(&dname, "%s/%1x", dir, i); + traverse(dir, wipe_fn); + free(dname); + } + + /* and fix the counters */ + cleanup_all(dir); +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/config.h.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/config.h.in Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,118 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you would like to have zlib compression for ccache. */ +#undef ENABLE_ZLIB + +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + +/* */ +#undef HAVE_C99_VSNPRINTF + +/* */ +#undef HAVE_COMPAR_FN_T + +/* Define to 1 if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the `gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* Define to 1 if you have the `getpwuid' function. */ +#undef HAVE_GETPWUID + +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAVE_MKSTEMP + +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the <pwd.h> header file. */ +#undef HAVE_PWD_H + +/* Define to 1 if you have the `realpath' function. */ +#undef HAVE_REALPATH + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. + */ +#undef HAVE_SYS_DIR_H + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. + */ +#undef HAVE_SYS_NDIR_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `utimes' function. */ +#undef HAVE_UTIMES + +/* Define to 1 if you have the `vasprintf' function. */ +#undef HAVE_VASPRINTF + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Define _GNU_SOURCE so that we get all necessary prototypes */ +#undef _GNU_SOURCE diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/configure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/configure Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,5136 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for ccache-swig 0.0. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='ccache-swig' +PACKAGE_TARNAME='ccache-swig' +PACKAGE_VERSION='0.0' +PACKAGE_STRING='ccache-swig 0.0' +PACKAGE_BUGREPORT='' +PACKAGE_URL='' + +ac_unique_file="ccache.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='LTLIBOBJS +LIBOBJS +EGREP +GREP +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_zlib +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures ccache-swig 0.0 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/ccache-swig] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of ccache-swig 0.0:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-zlib enable zlib support for ccache compression + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +ccache-swig configure 0.0 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by ccache-swig $as_me 0.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # Get version from SWIG in ccache_swig_config.h.in + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring ccache" >&5 +$as_echo "$as_me: Configuring ccache" >&6;} + +ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + # for program_transform_name + + +$as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + +# If GCC, turn on warnings. +if test "x$GCC" = "xyes" +then + CFLAGS="$CFLAGS -Wall -W" +else + CFLAGS="$CFLAGS -O" +fi + + +ac_header_dirent=no +for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } +if eval \${$as_ac_Header+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <$ac_hdr> + +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_ac_Header=yes" +else + eval "$as_ac_Header=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$as_ac_Header + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +_ACEOF + +ac_header_dirent=$ac_hdr; break +fi + +done +# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. +if test $ac_header_dirent = dirent.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } +if ${ac_cv_search_opendir+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_opendir=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_opendir+:} false; then : + break +fi +done +if ${ac_cv_search_opendir+:} false; then : + +else + ac_cv_search_opendir=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +if ${ac_cv_header_time+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_time=yes +else + ac_cv_header_time=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } +if test $ac_cv_header_time = yes; then + +$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 +$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } +if ${ac_cv_header_sys_wait_h+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/wait.h> +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main () +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_sys_wait_h=yes +else + ac_cv_header_sys_wait_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 +$as_echo "$ac_cv_header_sys_wait_h" >&6; } +if test $ac_cv_header_sys_wait_h = yes; then + +$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in ctype.h strings.h stdlib.h string.h pwd.h sys/time.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_func in realpath snprintf vsnprintf vasprintf asprintf mkstemp +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in gethostname getpwuid +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +for ac_func in utimes +do : + ac_fn_c_check_func "$LINENO" "utimes" "ac_cv_func_utimes" +if test "x$ac_cv_func_utimes" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_UTIMES 1 +_ACEOF + +fi +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compar_fn_t in stdlib.h" >&5 +$as_echo_n "checking for compar_fn_t in stdlib.h... " >&6; } +if ${ccache_cv_COMPAR_FN_T+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +int +main () +{ + +void test_fn(void) { qsort(NULL, 0, 0, (__compar_fn_t)NULL); } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ccache_cv_COMPAR_FN_T=yes +else + ccache_cv_COMPAR_FN_T=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ccache_cv_COMPAR_FN_T" >&5 +$as_echo "$ccache_cv_COMPAR_FN_T" >&6; } +if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then + +$as_echo "#define HAVE_COMPAR_FN_T 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C99 vsnprintf" >&5 +$as_echo_n "checking for C99 vsnprintf... " >&6; } +if ${ccache_cv_HAVE_C99_VSNPRINTF+:} false; then : + $as_echo_n "(cached) " >&6 +else + +if test "$cross_compiling" = yes; then : + ccache_cv_HAVE_C99_VSNPRINTF=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <sys/types.h> +#include <stdarg.h> +void foo(const char *format, ...) { + va_list ap; + int len; + char buf[5]; + + va_start(ap, format); + len = vsnprintf(0, 0, format, ap); + va_end(ap); + if (len != 5) exit(1); + + if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); + + exit(0); +} +main() { foo("hello"); } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ccache_cv_HAVE_C99_VSNPRINTF=yes +else + ccache_cv_HAVE_C99_VSNPRINTF=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ccache_cv_HAVE_C99_VSNPRINTF" >&5 +$as_echo "$ccache_cv_HAVE_C99_VSNPRINTF" >&6; } +if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then + +$as_echo "#define HAVE_C99_VSNPRINTF 1" >>confdefs.h + +fi + +# Check whether --enable-zlib was given. +if test "${enable_zlib+set}" = set; then : + enableval=$enable_zlib; +else + enable_zlib=yes +fi + + +if test x"$enable_zlib" = x"yes"; then + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzdopen in -lz" >&5 +$as_echo_n "checking for gzdopen in -lz... " >&6; } +if ${ac_cv_lib_z_gzdopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gzdopen (); +int +main () +{ +return gzdopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_z_gzdopen=yes +else + ac_cv_lib_z_gzdopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzdopen" >&5 +$as_echo "$ac_cv_lib_z_gzdopen" >&6; } +if test "x$ac_cv_lib_z_gzdopen" = xyes; then : + LIBS="-lz $LIBS" + +$as_echo "#define ENABLE_ZLIB 1" >>confdefs.h + +fi + +fi + + +fi + +ac_config_files="$ac_config_files Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by ccache-swig $as_me 0.0, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +ccache-swig config.status 0.0 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/configure.ac Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,87 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT([ccache-swig], [0.0]) # Get version from SWIG in ccache_swig_config.h.in +AC_PREREQ(2.52) +AC_CONFIG_SRCDIR([ccache.h]) + +AC_MSG_NOTICE([Configuring ccache]) + +AC_CONFIG_HEADER(config.h) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_ARG_PROGRAM # for program_transform_name + +AC_DEFINE([_GNU_SOURCE], 1, + [Define _GNU_SOURCE so that we get all necessary prototypes]) + +# If GCC, turn on warnings. +if test "x$GCC" = "xyes" +then + CFLAGS="$CFLAGS -Wall -W" +else + CFLAGS="$CFLAGS -O" +fi + +AC_HEADER_DIRENT +AC_HEADER_TIME +AC_HEADER_SYS_WAIT + +AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h pwd.h sys/time.h) + +AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp) +AC_CHECK_FUNCS(gethostname getpwuid) +AC_CHECK_FUNCS(utimes) + +AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [ + AC_TRY_COMPILE( +[#include <stdlib.h>], +[ +void test_fn(void) { qsort(NULL, 0, 0, (__compar_fn_t)NULL); } +], + ccache_cv_COMPAR_FN_T=yes,ccache_cv_COMPAR_FN_T=no)]) +if test x"$ccache_cv_COMPAR_FN_T" = x"yes"; then + AC_DEFINE(HAVE_COMPAR_FN_T, 1, [ ]) +fi + +dnl Note: This could be replaced by AC_FUNC_SNPRINTF() in the autoconf macro archive +AC_CACHE_CHECK([for C99 vsnprintf],ccache_cv_HAVE_C99_VSNPRINTF,[ +AC_TRY_RUN([ +#include <sys/types.h> +#include <stdarg.h> +void foo(const char *format, ...) { + va_list ap; + int len; + char buf[5]; + + va_start(ap, format); + len = vsnprintf(0, 0, format, ap); + va_end(ap); + if (len != 5) exit(1); + + if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); + + exit(0); +} +main() { foo("hello"); } +], +ccache_cv_HAVE_C99_VSNPRINTF=yes,ccache_cv_HAVE_C99_VSNPRINTF=no,ccache_cv_HAVE_C99_VSNPRINTF=cross)]) +if test x"$ccache_cv_HAVE_C99_VSNPRINTF" = x"yes"; then + AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [ ]) +fi + +dnl Check for zlib. +dnl Note: This could be replaced by CHECK_ZLIB() in the autoconf macro archive +AC_ARG_ENABLE([zlib], + AS_HELP_STRING([--enable-zlib], [enable zlib support for ccache compression]),, + [enable_zlib=yes]) + +if test x"$enable_zlib" = x"yes"; then + AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, gzdopen, [LIBS="-lz $LIBS" + AC_DEFINE([ENABLE_ZLIB], 1, [Define to 1 if you would like to have zlib compression for ccache.]) ] )) +fi + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/NEWS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/NEWS Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,22 @@ +ccache (2.4-8) unstable; urgency=high + + zlib compression is now enabled by default in order to increase the amount + of object files that can fit in the cache. + + The impact on performance is supposed to be almost negligible + (see http://www.gustaebel.de/lars/ccache/). If you do want to disable + it however, simply export the CCACHE_NOCOMPRESS environment variable. + + Note that a zlib-enabled ccache will still read your existing + uncompressed cache. If you want to compress/uncompress your cache, + see the manage-cache.sh script under /usr/share/doc/ccache/examples/. + + -- Francois Marier <francois@debian.org> Sun, 20 May 2007 19:45:07 +1200 + +ccache (2.4-1) unstable; urgency=low + + * This release changes the hash input slighly, so you will probably find + that you will not get any hits against your existing cache when you + upgrade. + + -- Francois Marier <francois@debian.org> Sat, 11 Jun 2005 13:54:33 -0400 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/README.Debian --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/README.Debian Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,59 @@ +Installing ccache +----------------- + +The recommended way to use this with Debian is to either create "cc" +and "gcc" symlinks to /usr/bin/ccache in your private bin directory +(which must be before the real cc and gcc in your path), or use +CC="ccache gcc" on the make command line. + +Another option is to just prepend /usr/lib/ccache in your PATH +environment variable, like + + export PATH="/usr/lib/ccache:$PATH" + +Note that ccache works with both native and cross compilers. + +Ignoring whitespace +------------------- + +If you wish to set up ccache so that it ignores blank lines, have a +look at the CCACHE_UNIFY option. However, please note that this +option is off by default since the reported line numbers may not +match the source files anymore. + + +NFS Issues +---------- + +(from John Coiner <john.coiner@amd.com> on the ccache mailing list) + +When CCache creates a hardlinked output file, it calls utime() to update +the timestamp on the object, so that Make realizes that the object has +changed. + +On NFS, utime() has no coherency guarantee, AFAIK. When utime() runs on +host A, and our parallel implementation of Make is running on host B, +sometimes Make doesn't see the new timestamp soon enough -- and neglects +to relink the final binary. That's a one-way ticket to Silent Mysterious +Failure Town. + +Instead of relying on the object file timestamp, we create a dummy file +with a reliable timestamp: + +objs/foo.o objs/foo.o.built : + if ( ccache gcc -o foo.o -c foo.c ) ; \ + then touch objs/foo.o.built ; \ + else exit 1; \ + fi + +binary : objs/foo.o.built + gcc -o binary objs/foo.o + +NFS does make a coherency guarantee, that if a file is written and +close()d on host A, and subsequently open()ed on host B, that the second +open() will reflect all modifications and attributes from the close(). +Since Make does open() when checking timestamps, and the dummy file is +close()d when it's created, the binary will always relink after the +object is recompiled. + + -- Francois Marier <francois@debian.org> Sun, 20 May 2007 17:35:36 +1200 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/changelog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/changelog Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,221 @@ +ccache (2.4-15) unstable; urgency=low + + * Add a new patch which improve the consistency of timestamps on cached + objects to make sure clean-up is based on least recently used objects. + * Patch the set_limit call so that non-writable cache directories return + an error when attempting to size the max(files|size) (closes: #332527) + + -- Francois Marier <francois@debian.org> Sun, 13 Apr 2008 15:07:05 +1200 + +ccache (2.4-14) unstable; urgency=low + + * Mention the long options everywhere in the manpage + * Merge Gentoo patches: + - respect user's LDFLAGS + - use utimes() for timestamp if possible + + -- Francois Marier <francois@debian.org> Sun, 23 Mar 2008 16:30:11 +1300 + +ccache (2.4-13) unstable; urgency=low + + * Update CACHEDIR.TAG patch to avoid creating the tag file when the + CCACHE_READONLY environment variable is set. (closes: #464356) + * Mention the GNU-style long options in the manpage + + -- Francois Marier <francois@debian.org> Thu, 07 Feb 2008 10:50:42 +1300 + +ccache (2.4-12) unstable; urgency=low + + * Add symlink for gcc 4.3 (closes: #463590) + * Add support for the CACHEDIR.TAG spec, thanks to Karl Chen. + (see http://www.brynosaurus.com/cachedir/) + * Fix hyphens in manpage (lintian notice) + * Bump Standards-Version up to 3.7.3 (no changes) + * Bump debhelper compatibility to 6 + + -- Francois Marier <francois@debian.org> Sat, 02 Feb 2008 10:37:22 +1300 + +ccache (2.4-11) unstable; urgency=low + + * Add the collab-maint repo to debian/control + + -- Francois Marier <francois@debian.org> Tue, 20 Nov 2007 15:26:37 +1300 + +ccache (2.4-10) unstable; urgency=low + + * Document where the patches are from in debian/patches/CREDITS + * debian/rules: + - Fixed "make distclean" lintian warning + - Removed commented-out entries + * Set debhelper compatibility to 5 + * Add homepage field in debian/control + * Add symlinks for MinGW (closes: #445782) + * Bump the version to 5 in the debhelper dependency + + -- Francois Marier <francois@debian.org> Fri, 19 Oct 2007 16:04:37 +1300 + +ccache (2.4-9) unstable; urgency=low + + * Add a symlink for gcc 4.2 (closes: #431007) + * Fix dependencies when using -o (closes: #217713) + + -- Francois Marier <francois@debian.org> Sat, 30 Jun 2007 17:58:44 +1200 + +ccache (2.4-8) unstable; urgency=low + + * Enable zlib compression of the cache by default (closes: #409848). + Thanks to Sami Liedes for suggesting this. + * Disable ccache when profiling (closes: #215849). + Thanks to Ted Percival for the Patch. + * Fix NFS renaming issues and add instructions to the README. + Thanks to John Coiner and instructions. + * Put all patches in debian/patches and apply them at build time. + + -- Francois Marier <francois@debian.org> Sun, 20 May 2007 19:42:34 +1200 + +ccache (2.4-7) unstable; urgency=low + + * Use the real compiler when HOME is not set (closes: #396350) + * Include user script under doc/examples (closes: #392435) + Thanks to Behan Webster! + * Add support for GNU --long options (closes: #297126) + + -- Francois Marier <francois@debian.org> Sat, 18 Nov 2006 00:50:59 -0500 + +ccache (2.4-6) unstable; urgency=low + + * Include symlinks for gcc 4.1 (closes: #372838) + * Update watch file + + -- Francois Marier <francois@debian.org> Tue, 13 Jun 2006 22:17:37 -0400 + +ccache (2.4-5) unstable; urgency=low + + * Document the fact that cross-compiling is supported (closes: #349221) + * Bump Standards-Version up to 3.7.2 (no changes) + + -- Francois Marier <francois@debian.org> Sun, 4 Jun 2006 01:20:07 -0400 + +ccache (2.4-4) unstable; urgency=low + + * Mention another way to use ccache in README.Debian (thanks to Benjamin + Drieu for the suggestion) (closes: #267632) + * Update FSF address + * Fix watch file + + -- Francois Marier <francois@debian.org> Sat, 26 Nov 2005 00:15:13 -0500 + +ccache (2.4-3) unstable; urgency=low + + * Actually use the configuration flags in debian/rules + * Bump Standards-Version up to 3.6.2 (no changes) + + -- Francois Marier <francois@debian.org> Sun, 26 Jun 2005 13:33:19 -0400 + +ccache (2.4-2) unstable; urgency=low + + * Add gcc and g++ symlinks to /usr/lib/ccache (closes: #313490) + * Remove invalid entry from Depends + + -- Francois Marier <francois@debian.org> Wed, 15 Jun 2005 20:51:03 -0400 + +ccache (2.4-1) unstable; urgency=low + + * New maintainer (closes: #312867) + * New upstream version: (closes: #273753, #239640) + - New CCACHE_READONLY and CCACHE_TEMPDIR options + - Fixed handling of hard-linked compilers on AIX + - Fixed handling of HOME environment variable (closes: #299880) + - Show cache directory in stats output + * Fix copyright file + * Add 'distcc' to Suggests (closes: #269158) + * Add a note about whitespace in README.Debian (closes: #229116) + * Update rules to add symmlinks for gcc 3.4 & 4.0 (closes: #261177) + * Acknowledge NMUs (closes: #200185, #177129, #174417) + + -- Francois Marier <francois@debian.org> Sun, 12 Jun 2005 12:05:34 -0400 + +ccache (2.3-1.1) unstable; urgency=low + + * Non-maintainer upload during BSP + * Re-apply patch for + #200185 ccache: Incorrect symlinks in /usr/lib/ccache + (Closes: #200185) + + -- Frank Lichtenheld <djpig@debian.org> Fri, 19 Mar 2004 11:14:50 +0100 + +ccache (2.3-1) unstable; urgency=low + + * New upstream release: obsoletes existing caches. + * Tweak package description in arbitrary way (closes: #181721) + + -- Paul Russell <prussell@debian.org> Mon, 29 Sep 2003 02:53:20 +0200 + +ccache (2.2-2) unstable; urgency=low + + * Insert more symlinks in ccache dir (closes: #197468) + + -- Paul Russell <prussell@debian.org> Mon, 16 Jun 2003 10:52:50 +0100 + +ccache (2.2-1) unstable; urgency=low + + * New upstream release (closes: #150755) + * Insert more symlinks in ccache dir (closes: #144462) + + -- Paul Russell <prussell@debian.org> Mon, 17 Feb 2003 07:19:36 +0100 + +ccache (2.1.1-2) unstable; urgency=low + + * Restored /usr/lib/ccache symlinks (closes: #179393) + * Fixed manpage typo (closes: #179564) + * With thanks to Andreas Rottmann. + + -- Paul Russell <prussell@debian.org> Wed, 5 Feb 2003 10:01:10 +0100 + +ccache (2.1.1-1) unstable; urgency=low + + * NMU (with maintainer consent). + * New upstream release (closes: #174417, #177129). + * debian/control: + + Build-Depend on and use dephelper 4 (DH_COMPAT = 4). + + Bumped Standards-Version to 3.5.8. + + No full stop on short package description (fixes linda warning). + * debian/copright: + + Make lintian feel comfortable; fixes warnings: + - copyright-should-refer-to-common-license-file-for-gpl + - copyright-lists-upstream-authors-with-dh_make-boilerplate + * Built with g++ 3.2 :-). + + -- Andreas Rottmann <rotty@debian.org> Thu, 16 Jan 2003 11:42:38 +0100 + +ccache (1.9-1) unstable; urgency=low + + * New upstream release (closes: #144920) + + -- Paul Russell <prussell@debian.org> Mon, 13 May 2002 10:01:09 +0200 + +ccache (1.8-1) unstable; urgency=low + + * New upstream release (closes: #145401) + + -- Paul Russell <prussell@debian.org> Fri, 3 May 2002 02:26:32 +0200 + +ccache (1.7-1) unstable; urgency=low + + * New upstream release + * Install symlinks in /usr/lib/ccache (closes: #141337) + + -- Paul Russell <prussell@debian.org> Wed, 10 Apr 2002 17:51:21 +0200 + +ccache (1.4-1) unstable; urgency=low + + * New upstream release + + -- Paul Russell <prussell@debian.org> Wed, 3 Apr 2002 03:41:46 +0200 + +ccache (1.2-1) unstable; urgency=low + + * Initial Release. + + -- Paul Russell <prussell@debian.org> Sun, 31 Mar 2002 14:08:57 +0200 + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/compat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/compat Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1 @@ +6 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/control --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/control Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,20 @@ +Source: ccache +Section: devel +Priority: optional +Maintainer: Francois Marier <francois@debian.org> +Build-Depends: debhelper (>> 6), autotools-dev, zlib1g-dev +Standards-Version: 3.7.3 +Homepage: http://ccache.samba.org +Vcs-Svn: svn://svn.debian.org/svn/collab-maint/deb-maint/ccache/ +Vcs-Browser: http://svn.debian.org/wsvn/collab-maint/deb-maint/ccache/ + +Package: ccache +Architecture: any +Depends: ${shlibs:Depends} +Suggests: distcc +Description: Compiler results cacher, for fast recompiles + ccache is a compiler cache. It speeds up re-compilation of C/C++ code + by caching previous compiles and detecting when the same compile is + being done again. + . + This is similar to, but faster than, the compilercache package. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/copyright --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/copyright Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,29 @@ +This package was debianized by Paul Russell <prussell@debian.org> on +Sun, 31 Mar 2002 14:08:57 +0200. + +It was downloaded from http://ccache.samba.org/ftp/ccache/ + +The ccache-zlib patch was downloaded from http://www.gustaebel.de/lars/ccache/ + +Upstream Author: Andrew Tridgell <tridge@samba.org> + +Copyright: 2002-2005 Andrew Tridgell <tridge@samba.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA + +You are free to distribute this software under the terms of the GNU General +Public License. On Debian systems, the complete text of the GNU General +Public License can be found in /usr/share/common-licenses/GPL file. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/dirs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/dirs Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,3 @@ +usr/bin +usr/lib/ccache +usr/share/man/man1 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/docs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/docs Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1 @@ +README diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/examples --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/examples Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2 @@ +debian/update-ccache +manage-cache.sh diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/01_no_home.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/01_no_home.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,100 @@ +--- ccache.c ++++ ccache.c +@@ -836,6 +836,13 @@ + { + /* find the real compiler */ + find_compiler(argc, argv); ++ ++ /* use the real compiler if HOME is not set */ ++ if (!cache_dir) { ++ cc_log("Unable to determine home directory\n"); ++ cc_log("ccache is disabled\n"); ++ failed(); ++ } + + /* we might be disabled */ + if (getenv("CCACHE_DISABLE")) { +@@ -895,6 +902,13 @@ + printf("-V print version number\n"); + } + ++static void check_cache_dir(void) ++{ ++ if (!cache_dir) { ++ fatal("Unable to determine home directory"); ++ } ++} ++ + /* the main program when not doing a compile */ + static int ccache_main(int argc, char *argv[]) + { +@@ -914,31 +928,37 @@ + exit(0); + + case 's': ++ check_cache_dir(); + stats_summary(); + break; + + case 'c': ++ check_cache_dir(); + cleanup_all(cache_dir); + printf("Cleaned cache\n"); + break; + + case 'C': ++ check_cache_dir(); + wipe_all(cache_dir); + printf("Cleared cache\n"); + break; + + case 'z': ++ check_cache_dir(); + stats_zero(); + printf("Statistics cleared\n"); + break; + + case 'F': ++ check_cache_dir(); + v = atoi(optarg); + stats_set_limits(v, -1); + printf("Set cache file limit to %u\n", (unsigned)v); + break; + + case 'M': ++ check_cache_dir(); + v = value_units(optarg); + stats_set_limits(-1, v); + printf("Set cache size limit to %uk\n", (unsigned)v); +@@ -983,7 +1003,10 @@ + + cache_dir = getenv("CCACHE_DIR"); + if (!cache_dir) { +- x_asprintf(&cache_dir, "%s/.ccache", get_home_directory()); ++ const char *home_directory = get_home_directory(); ++ if (home_directory) { ++ x_asprintf(&cache_dir, "%s/.ccache", home_directory); ++ } + } + + temp_dir = getenv("CCACHE_TEMPDIR"); +@@ -1023,7 +1046,7 @@ + } + + /* make sure the cache dir exists */ +- if (create_dir(cache_dir) != 0) { ++ if (cache_dir && (create_dir(cache_dir) != 0)) { + fprintf(stderr,"ccache: failed to create %s (%s)\n", + cache_dir, strerror(errno)); + exit(1); +--- util.c ++++ util.c +@@ -448,7 +448,7 @@ + } + } + #endif +- fatal("Unable to determine home directory"); ++ cc_log("Unable to determine home directory"); + return NULL; + } + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/02_ccache-compressed.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/02_ccache-compressed.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1026 @@ +Index: ccache.1 +=================================================================== +RCS file: /home/cvsroot/lars/ccache/ccache.1,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.6 +diff -u -r1.1.1.1.2.1 -r1.6 +--- ccache.1 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ ccache.1 21 Nov 2004 18:19:28 -0000 1.6 +@@ -210,7 +210,8 @@ + CCACHE_HARDLINK then ccache will attempt to use hard links from the + cache directory when creating the compiler output rather than using a + file copy\&. Using hard links is faster, but can confuse programs like +-\&'make\&' that rely on modification times\&. ++\&'make\&' that rely on modification times\&. Hard links are never made for ++compressed cache files\&. + .IP + .IP "\fBCCACHE_RECACHE\fP" + This forces ccache to not use any cached +@@ -257,6 +258,11 @@ + the default\&. On HP-UX set this environment variable to "i" if you use + the aCC compiler\&. + .IP ++.IP "\fBCCACHE_NOCOMPRESS\fP" ++If you set the environment variable ++CCACHE_NOCOMPRESS then there is no compression used on files that go ++into the cache\&. ++.IP + .PP + .SH "CACHE SIZE MANAGEMENT" + .PP +@@ -269,6 +275,14 @@ + below the numbers you specified in order to avoid doing the cache + clean operation too often\&. + .PP ++.SH "CACHE COMPRESSION" ++.PP ++By default ccache will compress all files it puts into the cache ++using the zlib compression\&. While this involves a negligible ++performance slowdown, it significantly increases the number of files ++that fit in the cache\&. You can turn off compression setting the ++CCACHE_NOCOMPRESS environment variable\&. ++.PP + .SH "HOW IT WORKS" + .PP + The basic idea is to detect when you are compiling exactly the same +Index: ccache.c +=================================================================== +RCS file: /home/cvsroot/lars/ccache/ccache.c,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.9 +diff -u -r1.1.1.1.2.1 -r1.9 +--- ccache.c 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ ccache.c 21 Nov 2004 18:19:28 -0000 1.9 +@@ -199,7 +199,7 @@ + fd = open(tmp_stderr, O_RDONLY | O_BINARY); + if (fd != -1) { + if (strcmp(output_file, "/dev/null") == 0 || +- rename(tmp_hashname, output_file) == 0 || errno == ENOENT) { ++ move_file(tmp_hashname, output_file) == 0 || errno == ENOENT) { + if (cpp_stderr) { + /* we might have some stderr from cpp */ + int fd2 = open(cpp_stderr, O_RDONLY | O_BINARY); +@@ -231,14 +231,25 @@ + x_asprintf(&path_stderr, "%s.stderr", hashname); + + if (stat(tmp_stderr, &st1) != 0 || +- stat(tmp_hashname, &st2) != 0 || +- rename(tmp_hashname, hashname) != 0 || +- rename(tmp_stderr, path_stderr) != 0) { ++ stat(tmp_hashname, &st2) != 0 || ++ move_file(tmp_hashname, hashname) != 0 || ++ move_file(tmp_stderr, path_stderr) != 0) { + cc_log("failed to rename tmp files - %s\n", strerror(errno)); + stats_update(STATS_ERROR); + failed(); + } + ++#if ENABLE_ZLIB ++ /* do an extra stat on the cache files for ++ the size statistics */ ++ if (stat(path_stderr, &st1) != 0 || ++ stat(hashname, &st2) != 0) { ++ cc_log("failed to stat cache files - %s\n", strerror(errno)); ++ stats_update(STATS_ERROR); ++ failed(); ++ } ++#endif ++ + cc_log("Placed %s into cache\n", output_file); + stats_tocache(file_size(&st1) + file_size(&st2)); + +@@ -474,7 +485,13 @@ + } + + /* the user might be disabling cache hits */ ++#ifndef ENABLE_ZLIB ++ /* if the cache file is compressed we must recache */ ++ if ((first && getenv("CCACHE_RECACHE")) || ++ test_if_compressed(hashname) == 1) { ++#else + if (first && getenv("CCACHE_RECACHE")) { ++#endif + close(fd_stderr); + unlink(stderr_file); + free(stderr_file); +@@ -487,7 +504,9 @@ + ret = 0; + } else { + unlink(output_file); +- if (getenv("CCACHE_HARDLINK")) { ++ /* only make a hardlink if the cache file is uncompressed */ ++ if (getenv("CCACHE_HARDLINK") && ++ test_if_compressed(hashname) == 0) { + ret = link(hashname, output_file); + } else { + ret = copy_file(hashname, output_file); +Index: ccache.h +=================================================================== +RCS file: /home/cvsroot/lars/ccache/ccache.h,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.7 +diff -u -r1.1.1.1.2.1 -r1.7 +--- ccache.h 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ ccache.h 21 Nov 2004 18:19:28 -0000 1.7 +@@ -23,6 +23,10 @@ + #include <pwd.h> + #endif + ++#ifdef ENABLE_ZLIB ++#include <zlib.h> ++#endif ++ + #define STATUS_NOTFOUND 3 + #define STATUS_FATAL 4 + #define STATUS_NOCACHE 5 +@@ -36,6 +40,13 @@ + #define DEFAULT_MAXSIZE (1000*1000) + #endif + ++/* file copy mode */ ++#ifdef ENABLE_ZLIB ++#define COPY_UNCOMPRESSED 0 ++#define COPY_FROM_CACHE 1 ++#define COPY_TO_CACHE 2 ++#endif ++ + enum stats { + STATS_NONE=0, + STATS_STDOUT, +@@ -79,6 +90,8 @@ + + void copy_fd(int fd_in, int fd_out); + int copy_file(const char *src, const char *dest); ++int move_file(const char *src, const char *dest); ++int test_if_compressed(const char *filename); + + int create_dir(const char *dir); + void x_asprintf(char **ptr, const char *format, ...); +Index: ccache.yo +=================================================================== +RCS file: /home/cvsroot/lars/ccache/ccache.yo,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.5 +diff -u -r1.1.1.1.2.1 -r1.5 +--- ccache.yo 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ ccache.yo 21 Nov 2004 18:19:28 -0000 1.5 +@@ -169,6 +169,11 @@ + this optimisation, in which case this option could allow ccache to be + used. + ++dit(bf(CCACHE_NOCOMPRESS)) If you set the environment variable ++CCACHE_NOCOMPRESS then there is no compression used on files that go ++into the cache. However, this setting has no effect on how files are ++retrieved from the cache, compressed results will still be usable. ++ + dit(bf(CCACHE_NOSTATS)) If you set the environment variable + CCACHE_NOSTATS then ccache will not update the statistics files on + each compile. +@@ -181,7 +186,8 @@ + CCACHE_HARDLINK then ccache will attempt to use hard links from the + cache directory when creating the compiler output rather than using a + file copy. Using hard links is faster, but can confuse programs like +-'make' that rely on modification times. ++'make' that rely on modification times. Hard links are never made for ++compressed cache files. + + dit(bf(CCACHE_RECACHE)) This forces ccache to not use any cached + results, even if it finds them. New results are still cached, but +@@ -236,6 +242,14 @@ + below the numbers you specified in order to avoid doing the cache + clean operation too often. + ++manpagesection(CACHE COMPRESSION) ++ ++By default ccache will compress all files it puts into the cache ++using the zlib compression. While this involves a negligible ++performance slowdown, it significantly increases the number of files ++that fit in the cache. You can turn off compression setting the ++CCACHE_NOCOMPRESS environment variable. ++ + manpagesection(HOW IT WORKS) + + The basic idea is to detect when you are compiling exactly the same +@@ -294,6 +308,8 @@ + cache. This tells the filesystem to inherit group ownership for new + directories. The command "chmod g+s `find $CCACHE_DIR -type d`" might + be useful for this. ++ it() Set bf(CCACHE_NOCOMPRESS) for all users, if there are users with ++ versions of ccache that do not support compression. + ) + + manpagesection(HISTORY) +Index: config.h.in +=================================================================== +RCS file: /home/cvsroot/lars/ccache/config.h.in,v +retrieving revision 1.1.1.1 +retrieving revision 1.2 +diff -u -r1.1.1.1 -r1.2 +--- config.h.in 30 Apr 2004 13:13:41 -0000 1.1.1.1 ++++ config.h.in 4 May 2004 20:49:26 -0000 1.2 +@@ -98,3 +98,6 @@ + + /* Define _GNU_SOURCE so that we get all necessary prototypes */ + #undef _GNU_SOURCE ++ ++/* Define to 1 if you like to have zlib compression for the ccache. */ ++#undef ENABLE_ZLIB +Index: configure +=================================================================== +RCS file: /home/cvsroot/lars/ccache/configure,v +retrieving revision 1.1.1.1.2.1 +diff -u -r1.1.1.1.2.1 configure +--- configure 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ configure 21 Nov 2004 18:24:42 -0000 +@@ -836,6 +836,11 @@ + + cat <<\_ACEOF + ++Optional Features: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --enable-zlib enable zlib support for ccache compression ++ + Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags +@@ -936,7 +941,7 @@ + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi +- cd "$ac_popdir" ++ cd $ac_popdir + done + fi + +@@ -1859,7 +1864,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -1917,7 +1923,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2033,7 +2040,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2087,7 +2095,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2132,7 +2141,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2176,7 +2186,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2609,7 +2620,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2681,7 +2693,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2735,7 +2748,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2806,7 +2820,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2860,7 +2875,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2927,7 +2943,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -2997,7 +3014,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3078,7 +3096,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3248,7 +3267,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3319,7 +3339,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3509,7 +3530,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3611,7 +3633,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3676,7 +3699,8 @@ + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? +@@ -3775,6 +3799,229 @@ + + fi + ++# Check whether --enable-zlib or --disable-zlib was given. ++if test "${enable_zlib+set}" = set; then ++ enableval="$enable_zlib" ++ ++else ++ enable_zlib=yes ++fi; ++ ++if test x"$enable_zlib" = x"yes"; then ++ if test "${ac_cv_header_zlib_h+set}" = set; then ++ echo "$as_me:$LINENO: checking for zlib.h" >&5 ++echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 ++if test "${ac_cv_header_zlib_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 ++echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 ++else ++ # Is the header compilable? ++echo "$as_me:$LINENO: checking zlib.h usability" >&5 ++echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++#include <zlib.h> ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_header_compiler=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_header_compiler=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 ++echo "${ECHO_T}$ac_header_compiler" >&6 ++ ++# Is the header present? ++echo "$as_me:$LINENO: checking zlib.h presence" >&5 ++echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++#include <zlib.h> ++_ACEOF ++if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 ++ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } >/dev/null; then ++ if test -s conftest.err; then ++ ac_cpp_err=$ac_c_preproc_warn_flag ++ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag ++ else ++ ac_cpp_err= ++ fi ++else ++ ac_cpp_err=yes ++fi ++if test -z "$ac_cpp_err"; then ++ ac_header_preproc=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.$ac_ext ++echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 ++echo "${ECHO_T}$ac_header_preproc" >&6 ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in ++ yes:no: ) ++ { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 ++echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 ++echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} ++ ac_header_preproc=yes ++ ;; ++ no:yes:* ) ++ { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 ++echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} ++ { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 ++echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} ++ { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 ++echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} ++ { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 ++echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} ++ { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 ++echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} ++ { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 ++echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} ++ ( ++ cat <<\_ASBOX ++## ------------------------------------------ ## ++## Report this to the AC_PACKAGE_NAME lists. ## ++## ------------------------------------------ ## ++_ASBOX ++ ) | ++ sed "s/^/$as_me: WARNING: /" >&2 ++ ;; ++esac ++echo "$as_me:$LINENO: checking for zlib.h" >&5 ++echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 ++if test "${ac_cv_header_zlib_h+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_cv_header_zlib_h=$ac_header_preproc ++fi ++echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 ++echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 ++ ++fi ++if test $ac_cv_header_zlib_h = yes; then ++ echo "$as_me:$LINENO: checking for gzdopen in -lz" >&5 ++echo $ECHO_N "checking for gzdopen in -lz... $ECHO_C" >&6 ++if test "${ac_cv_lib_z_gzdopen+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lz $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char gzdopen (); ++int ++main () ++{ ++gzdopen (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_z_gzdopen=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_z_gzdopen=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzdopen" >&5 ++echo "${ECHO_T}$ac_cv_lib_z_gzdopen" >&6 ++if test $ac_cv_lib_z_gzdopen = yes; then ++ LIBS="-lz $LIBS"; cat >>confdefs.h <<\_ACEOF ++#define ENABLE_ZLIB 1 ++_ACEOF ++ ++fi ++ ++fi ++ ++ ++fi ++ + ac_config_files="$ac_config_files Makefile" + + cat >confcache <<\_ACEOF +@@ -4568,6 +4815,11 @@ + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + ++ if test x"$ac_file" != x-; then ++ { echo "$as_me:$LINENO: creating $ac_file" >&5 ++echo "$as_me: creating $ac_file" >&6;} ++ rm -f "$ac_file" ++ fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ +@@ -4606,12 +4858,6 @@ + fi;; + esac + done` || { (exit 1); exit 1; } +- +- if test x"$ac_file" != x-; then +- { echo "$as_me:$LINENO: creating $ac_file" >&5 +-echo "$as_me: creating $ac_file" >&6;} +- rm -f "$ac_file" +- fi + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +Index: configure.in +=================================================================== +RCS file: /home/cvsroot/lars/ccache/configure.in,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.4 +diff -u -r1.1.1.1.2.1 -r1.4 +--- configure.in 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ configure.in 21 Nov 2004 18:19:28 -0000 1.4 +@@ -68,5 +68,14 @@ + AC_DEFINE(HAVE_C99_VSNPRINTF, 1, [ ]) + fi + ++dnl Check for zlib. ++AC_ARG_ENABLE([zlib], ++ AS_HELP_STRING([--enable-zlib], [enable zlib support for ccache compression]),, ++ [enable_zlib=yes]) ++ ++if test x"$enable_zlib" = x"yes"; then ++ AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, gzdopen, LIBS="-lz $LIBS"; AC_DEFINE(ENABLE_ZLIB))) ++fi ++ + AC_CONFIG_FILES([Makefile]) + AC_OUTPUT +Index: util.c +=================================================================== +RCS file: /home/cvsroot/lars/ccache/util.c,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.11 +diff -u -r1.1.1.1.2.1 -r1.11 +--- util.c 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ util.c 21 Nov 2004 18:19:28 -0000 1.11 +@@ -44,6 +44,7 @@ + exit(1); + } + ++#ifndef ENABLE_ZLIB + /* copy all data from one file descriptor to another */ + void copy_fd(int fd_in, int fd_out) + { +@@ -57,6 +58,11 @@ + } + } + ++/* move a file using rename */ ++int move_file(const char *src, const char *dest) { ++ return rename(src, dest); ++} ++ + /* copy a file - used when hard links don't work + the copy is done via a temporary file and atomic rename + */ +@@ -120,6 +126,174 @@ + return 0; + } + ++#else /* ENABLE_ZLIB */ ++ ++/* copy all data from one file descriptor to another ++ possibly decompressing it ++*/ ++void copy_fd(int fd_in, int fd_out) { ++ char buf[10240]; ++ int n; ++ gzFile gz_in; ++ ++ gz_in = gzdopen(dup(fd_in), "rb"); ++ ++ if (!gz_in) { ++ fatal("Failed to copy fd"); ++ } ++ ++ while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) { ++ if (write(fd_out, buf, n) != n) { ++ fatal("Failed to copy fd"); ++ } ++ } ++} ++ ++static int _copy_file(const char *src, const char *dest, int mode) { ++ int fd_in, fd_out; ++ gzFile gz_in, gz_out = NULL; ++ char buf[10240]; ++ int n, ret; ++ char *tmp_name; ++ mode_t mask; ++ struct stat st; ++ ++ x_asprintf(&tmp_name, "%s.XXXXXX", dest); ++ ++ if (getenv("CCACHE_NOCOMPRESS")) { ++ mode = COPY_UNCOMPRESSED; ++ } ++ ++ /* open source file */ ++ fd_in = open(src, O_RDONLY); ++ if (fd_in == -1) { ++ return -1; ++ } ++ ++ gz_in = gzdopen(fd_in, "rb"); ++ if (!gz_in) { ++ close(fd_in); ++ return -1; ++ } ++ ++ /* open destination file */ ++ fd_out = mkstemp(tmp_name); ++ if (fd_out == -1) { ++ gzclose(gz_in); ++ free(tmp_name); ++ return -1; ++ } ++ ++ if (mode == COPY_TO_CACHE) { ++ /* The gzip file format occupies at least 20 bytes. So ++ it will always occupy an entire filesystem block, ++ even for empty files. ++ Since most stderr files will be empty, we turn off ++ compression in this case to save space. ++ */ ++ if (fstat(fd_in, &st) != 0) { ++ gzclose(gz_in); ++ close(fd_out); ++ free(tmp_name); ++ return -1; ++ } ++ if (file_size(&st) == 0) { ++ mode = COPY_UNCOMPRESSED; ++ } ++ } ++ ++ if (mode == COPY_TO_CACHE) { ++ gz_out = gzdopen(dup(fd_out), "wb"); ++ if (!gz_out) { ++ gzclose(gz_in); ++ close(fd_out); ++ free(tmp_name); ++ return -1; ++ } ++ } ++ ++ while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) { ++ if (mode == COPY_TO_CACHE) { ++ ret = gzwrite(gz_out, buf, n); ++ } else { ++ ret = write(fd_out, buf, n); ++ } ++ if (ret != n) { ++ gzclose(gz_in); ++ if (gz_out) { ++ gzclose(gz_out); ++ } ++ close(fd_out); ++ unlink(tmp_name); ++ free(tmp_name); ++ return -1; ++ } ++ } ++ ++ gzclose(gz_in); ++ if (gz_out) { ++ gzclose(gz_out); ++ } ++ ++ /* get perms right on the tmp file */ ++ mask = umask(0); ++ fchmod(fd_out, 0666 & ~mask); ++ umask(mask); ++ ++ /* the close can fail on NFS if out of space */ ++ if (close(fd_out) == -1) { ++ unlink(tmp_name); ++ free(tmp_name); ++ return -1; ++ } ++ ++ unlink(dest); ++ ++ if (rename(tmp_name, dest) == -1) { ++ unlink(tmp_name); ++ free(tmp_name); ++ return -1; ++ } ++ ++ free(tmp_name); ++ ++ return 0; ++} ++ ++/* move a file to the cache, compressing it */ ++int move_file(const char *src, const char *dest) { ++ int ret; ++ ++ ret = _copy_file(src, dest, COPY_TO_CACHE); ++ if (ret != -1) unlink(src); ++ return ret; ++} ++ ++/* copy a file from the cache, decompressing it */ ++int copy_file(const char *src, const char *dest) { ++ return _copy_file(src, dest, COPY_FROM_CACHE); ++} ++#endif /* ENABLE_ZLIB */ ++ ++/* test if a file is zlib compressed */ ++int test_if_compressed(const char *filename) { ++ FILE *f; ++ ++ f = fopen(filename, "rb"); ++ if (!f) { ++ return 0; ++ } ++ ++ /* test if file starts with 1F8B, which is zlib's ++ * magic number */ ++ if ((fgetc(f) != 0x1f) || (fgetc(f) != 0x8b)) { ++ fclose(f); ++ return 0; ++ } ++ ++ fclose(f); ++ return 1; ++} + + /* make sure a directory exists */ + int create_dir(const char *dir) +Index: manage-cache.sh +=================================================================== +RCS file: manage-cache.sh +diff -N manage-cache.sh +--- manage-cache.sh 1 Jan 1970 00:00:00 -0000 ++++ manage-cache.sh-cache.sh 12 May 2004 19:22:20 -0000 1.1 +@@ -0,0 +1,68 @@ ++#!/bin/bash ++# ++# 2004-05-12 lars@gustaebel.de ++ ++CCACHE_DIR=${CCACHE_DIR:-$HOME/.ccache} ++ ++echo "Do you want to compress or decompress the ccache in $CCACHE_DIR?" ++read -p "Type c or d: " mode ++ ++if [ "$mode" != "c" ] && [ "$mode" != "d" ] ++then ++ exit 1 ++fi ++ ++is_compressed() { ++ test "$(head -c 2 $1)" = $'\x1f\x8b' ++ return $? ++} ++ ++tmpfile=$(mktemp) ++ ++for dir in 0 1 2 3 4 5 6 7 8 9 a b c d e f ++do ++ # process ccache subdir ++ echo -n "$dir " ++ ++ # find cache files ++ find $CCACHE_DIR/$dir -type f -name '*-*' | ++ sort > $tmpfile ++ ++ oldsize=$(cat $CCACHE_DIR/$dir/stats | cut -d ' ' -f 13) ++ newsize=0 ++ ++ while read file ++ do ++ # empty files will be ignored since compressing ++ # them makes them bigger ++ test $(stat -c %s $file) -eq 0 && continue ++ ++ if [ $mode = c ] ++ then ++ if ! is_compressed $file ++ then ++ gzip $file ++ mv $file.gz $file ++ fi ++ else ++ if is_compressed $file ++ then ++ mv $file $file.gz ++ gzip -d $file.gz ++ fi ++ fi ++ ++ # calculate new size statistic for this subdir ++ let newsize=$newsize+$(stat -c "%B*%b" $file)/1024 ++ done < $tmpfile ++ ++ # update statistic file ++ read -a numbers < $CCACHE_DIR/$dir/stats ++ numbers[12]=$newsize ++ echo "${numbers[*]} " > $CCACHE_DIR/$dir/stats ++done ++echo ++ ++# clean up ++rm $tmpfile ++ +Index: Makefile.in +=================================================================== +RCS file: /home/cvsroot/lars/ccache/Makefile.in,v +retrieving revision 1.1.1.1.2.1 +retrieving revision 1.12 +diff -u -r1.1.1.1.2.1 -r1.12 +--- Makefile.in 21 Nov 2004 17:55:36 -0000 1.1.1.1.2.1 ++++ Makefile.in 21 Nov 2004 18:19:28 -0000 1.12 +@@ -11,6 +11,7 @@ + CFLAGS=@CFLAGS@ -I. + EXEEXT=@EXEEXT@ + ++LIBS= @LIBS@ + OBJS= ccache.o mdfour.o hash.o execute.o util.o args.o stats.o \ + cleanup.o snprintf.o unify.o + HEADERS = ccache.h mdfour.h +@@ -20,7 +21,7 @@ + docs: ccache.1 web/ccache-man.html + + ccache$(EXEEXT): $(OBJS) $(HEADERS) +- $(CC) $(CFLAGS) -o $@ $(OBJS) ++ $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) + + ccache.1: ccache.yo + -yodl2man -o ccache.1 ccache.yo diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/03_long_options.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/03_long_options.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,133 @@ +Index: ccache.c +=================================================================== +--- ccache.c (révision 7695) ++++ ccache.c (copie de travail) +@@ -22,6 +22,7 @@ + */ + + #include "ccache.h" ++#include <getopt.h> + + /* the base cache directory */ + char *cache_dir = NULL; +@@ -885,14 +886,14 @@ + printf("\tcompiler [compile options] (via symbolic link)\n"); + printf("\nOptions:\n"); + +- printf("-s show statistics summary\n"); +- printf("-z zero statistics\n"); +- printf("-c run a cache cleanup\n"); +- printf("-C clear the cache completely\n"); +- printf("-F <maxfiles> set maximum files in cache\n"); +- printf("-M <maxsize> set maximum size of cache (use G, M or K)\n"); +- printf("-h this help page\n"); +- printf("-V print version number\n"); ++ printf("-s, --show-stats show statistics summary\n"); ++ printf("-z, --zero-stats zero statistics\n"); ++ printf("-c, --cleanup run a cache cleanup\n"); ++ printf("-C, --clear clear the cache completely\n"); ++ printf("-F <n>, --max-files=<n> set maximum files in cache\n"); ++ printf("-M <n>, --max-size=<n> set maximum size of cache (use G, M or K)\n"); ++ printf("-h, --help this help page\n"); ++ printf("-V, --version print version number\n"); + } + + /* the main program when not doing a compile */ +@@ -901,7 +902,21 @@ + int c; + size_t v; + +- while ((c = getopt(argc, argv, "hszcCF:M:V")) != -1) { ++ static struct option long_options[] = ++ { ++ {"show-stats", no_argument, 0, 's'}, ++ {"zero-stats", no_argument, 0, 'z'}, ++ {"cleanup", no_argument, 0, 'c'}, ++ {"clear", no_argument, 0, 'C'}, ++ {"max-files", required_argument, 0, 'F'}, ++ {"max-size", required_argument, 0, 'M'}, ++ {"help", no_argument, 0, 'h'}, ++ {"version", no_argument, 0, 'V'}, ++ {0, 0, 0, 0} ++ }; ++ int option_index = 0; ++ ++ while ((c = getopt_long(argc, argv, "hszcCF:M:V", long_options, &option_index)) != -1) { + switch (c) { + case 'V': + printf("ccache version %s\n", CCACHE_VERSION); +Index: ccache.1 +=================================================================== +--- ccache.1 (révision 7695) ++++ ccache.1 (copie de travail) +@@ -23,14 +23,14 @@ + .nf + + +--s show statistics summary +--z zero statistics +--c run a cache cleanup +--C clear the cache completely +--F <maxfiles> set maximum files in cache +--M <maxsize> set maximum size of cache (use G, M or K) +--h this help page +--V print version number ++\-s, \-\-show-stats show statistics summary ++\-z, \-\-zero-stats zero statistics ++\-c, \-\-cleanup run a cache cleanup ++\-C, \-\-clear clear the cache completely ++\-F <n>, \-\-max-files=<n> set maximum files in cache ++\-M <n>, \-\-max-size=<n> set maximum size of cache (use G, M or K) ++\-h, \-\-help this help page ++\-V, \-\-version print version number + + .fi + +@@ -43,22 +43,22 @@ + normal compiler options apply and you should refer to your compilers + documentation\&. + .PP +-.IP "\fB-h\fP" ++.IP "\fB-h, --help\fP" + Print a options summary page + .IP +-.IP "\fB-s\fP" ++.IP "\fB-s, --show-stats\fP" + Print the current statistics summary for the cache\&. The + statistics are stored spread across the subdirectories of the + cache\&. Using "ccache -s" adds up the statistics across all + subdirectories and prints the totals\&. + .IP +-.IP "\fB-z\fP" ++.IP "\fB-z, --zero-stats\fP" + Zero the cache statistics\&. + .IP +-.IP "\fB-V\fP" ++.IP "\fB-V, --version\fP" + Print the ccache version number + .IP +-.IP "\fB-c\fP" ++.IP "\fB-c, --cleanup\fP" + Clean the cache and re-calculate the cache file count and + size totals\&. Normally the -c option should not be necessary as ccache + keeps the cache below the specified limits at runtime and keeps +@@ -66,16 +66,16 @@ + if you manually modify the cache contents or believe that the cache + size statistics may be inaccurate\&. + .IP +-.IP "\fB-C\fP" ++.IP "\fB-C, --clear\fP" + Clear the entire cache, removing all cached files\&. + .IP +-.IP "\fB-F maxfiles\fP" ++.IP "\fB-F <maxfiles>, --max-files=<maxfiles>\fP" + This sets the maximum number of files allowed in + the cache\&. The value is stored inside the cache directory and applies + to all future compiles\&. Due to the way the value is stored the actual + value used is always rounded down to the nearest multiple of 16\&. + .IP +-.IP "\fB-M maxsize\fP" ++.IP "\fB-M <maxsize>, --max-size=<maxsize>\fP" + This sets the maximum cache size\&. You can specify + a value in gigabytes, megabytes or kilobytes by appending a G, M or K + to the value\&. The default is gigabytes\&. The actual value stored is diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/04_ignore_profile.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/04_ignore_profile.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,13 @@ +diff -ru ccache-2.4/ccache.c ccache-2.4-tp/ccache.c +--- ccache.c 2007-05-20 03:14:19.000000000 +1000 ++++ ccache.c 2007-05-20 03:17:54.000000000 +1000 +@@ -641,6 +641,9 @@ + + /* these are too hard */ + if (strcmp(argv[i], "-fbranch-probabilities")==0 || ++ strcmp(argv[i], "-fprofile-arcs") == 0 || ++ strcmp(argv[i], "-ftest-coverage") == 0 || ++ strcmp(argv[i], "--coverage") == 0 || + strcmp(argv[i], "-M") == 0 || + strcmp(argv[i], "-MM") == 0 || + strcmp(argv[i], "-x") == 0) { diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/05_nfs_fix.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/05_nfs_fix.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,45 @@ +--- ccache.1.orig 2007-05-20 17:30:57.000000000 +1200 ++++ ccache.1 2007-05-20 17:31:27.000000000 +1200 +@@ -367,12 +367,6 @@ + .IP o + ccache avoids a double call to cpp on a cache miss + .PP +-.SH "BUGS" +-.PP +-When the cache is stored on an NFS filesystem, the filesystem must be +-exported with the \fBno_subtree_check\fP option to make renames between +-directories reliable\&. +-.PP + .SH "CREDITS" + .PP + Thanks to the following people for their contributions to ccache +--- util.c.patched 2007-05-20 18:19:11.000000000 +1200 ++++ util.c 2007-05-20 18:20:55.000000000 +1200 +@@ -58,9 +58,26 @@ + } + } + ++static int safe_rename(const char* oldpath, const char* newpath) ++{ ++ /* safe_rename is for creating entries in the cache. ++ ++ Works like rename(), but it never overwrites an existing ++ cache entry. This avoids corruption on NFS. */ ++ int status = link( oldpath, newpath ); ++ if( status == 0 || errno == EEXIST ) ++ { ++ return unlink( oldpath ); ++ } ++ else ++ { ++ return -1; ++ } ++} ++ + /* move a file using rename */ + int move_file(const char *src, const char *dest) { +- return rename(src, dest); ++ return safe_rename(src, dest); + } + + /* copy a file - used when hard links don't work diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/06_md.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/06_md.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,77 @@ +--- ccache.c Mon Sep 13 11:38:30 2004 ++++ ccache.c Thu Jun 21 22:17:32 2007 +@@ -627,6 +627,13 @@ static void process_args(int argc, char + int found_S_opt = 0; + struct stat st; + char *e; ++ /* is gcc being asked to output dependencies? */ ++ int generating_dependencies = 0; ++ /* is the dependency makefile name overridden with -MF? */ ++ int dependency_filename_specified = 0; ++ /* is the dependency makefile target name specified with -MQ or -MF? */ ++ int dependency_target_specified = 0; ++ + + stripped_args = args_init(0, NULL); + +@@ -702,6 +709,18 @@ static void process_args(int argc, char + continue; + } + ++ /* These options require special handling, because they ++ behave differently with gcc -E, when the output ++ file is not specified. */ ++ ++ if (strcmp(argv[i], "-MD") == 0 || strcmp(argv[i], "-MMD") == 0) { ++ generating_dependencies = 1; ++ } else if (strcmp(argv[i], "-MF") == 0) { ++ dependency_filename_specified = 1; ++ } else if (strcmp(argv[i], "-MQ") == 0 || strcmp(argv[i], "-MT") == 0) { ++ dependency_target_specified = 1; ++ } ++ + /* options that take an argument */ + { + const char *opts[] = {"-I", "-include", "-imacros", "-iprefix", +@@ -812,6 +831,41 @@ static void process_args(int argc, char + } + p[1] = found_S_opt ? 's' : 'o'; + p[2] = 0; ++ } ++ ++ /* If dependencies are generated, configure the preprocessor */ ++ ++ if (generating_dependencies && output_file) { ++ if (!dependency_filename_specified) { ++ char *default_depfile_name = x_strdup(output_file); ++ char *p = strrchr(default_depfile_name, '.'); ++ ++ if (p) { ++ if (strlen(p) < 2) { ++ stats_update(STATS_ARGS); ++ failed(); ++ return; ++ } ++ *p = 0; ++ } ++ else { ++ int len = p - default_depfile_name; ++ ++ p = x_malloc(len + 3); ++ strncpy(default_depfile_name, p, len - 1); ++ free(default_depfile_name); ++ default_depfile_name = p; ++ } ++ ++ strcat(default_depfile_name, ".d"); ++ args_add(stripped_args, "-MF"); ++ args_add(stripped_args, default_depfile_name); ++ } ++ ++ if (!dependency_target_specified) { ++ args_add(stripped_args, "-MT"); ++ args_add(stripped_args, output_file); ++ } + } + + /* cope with -o /dev/null */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/07_cachedirtag.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/07_cachedirtag.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,75 @@ +Index: ccache.c +=================================================================== +--- ccache.c (révision 7695) ++++ ccache.c (copie de travail) +@@ -1029,6 +1029,14 @@ + exit(1); + } + ++ if (!getenv("CCACHE_READONLY")) { ++ if (create_cachedirtag(cache_dir) != 0) { ++ fprintf(stderr,"ccache: failed to create %s/CACHEDIR.TAG (%s)\n", ++ cache_dir, strerror(errno)); ++ exit(1); ++ } ++ } ++ + ccache(argc, argv); + return 1; + } +Index: ccache.h +=================================================================== +--- ccache.h (révision 7695) ++++ ccache.h (copie de travail) +@@ -81,6 +81,7 @@ + int copy_file(const char *src, const char *dest); + + int create_dir(const char *dir); ++int create_cachedirtag(const char *dir); + void x_asprintf(char **ptr, const char *format, ...); + char *x_strdup(const char *s); + void *x_realloc(void *ptr, size_t size); +Index: util.c +=================================================================== +--- util.c (révision 7695) ++++ util.c (copie de travail) +@@ -138,6 +138,39 @@ + return 0; + } + ++char const CACHEDIR_TAG[] = ++ "Signature: 8a477f597d28d172789f06886806bc55\n" ++ "# This file is a cache directory tag created by ccache.\n" ++ "# For information about cache directory tags, see:\n" ++ "# http://www.brynosaurus.com/cachedir/\n"; ++ ++int create_cachedirtag(const char *dir) ++{ ++ char *filename; ++ struct stat st; ++ FILE *f; ++ x_asprintf(&filename, "%s/CACHEDIR.TAG", dir); ++ if (stat(filename, &st) == 0) { ++ if (S_ISREG(st.st_mode)) { ++ goto success; ++ } ++ errno = EEXIST; ++ goto error; ++ } ++ f = fopen(filename, "w"); ++ if (!f) goto error; ++ if (fwrite(CACHEDIR_TAG, sizeof(CACHEDIR_TAG)-1, 1, f) != 1) { ++ goto error; ++ } ++ if (fclose(f)) goto error; ++success: ++ free(filename); ++ return 0; ++error: ++ free(filename); ++ return 1; ++} ++ + /* + this is like asprintf() but dies if the malloc fails + note that we use vsnprintf in a rather poor way to make this more portable diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/08_manpage_hyphens.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/08_manpage_hyphens.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,89 @@ +Index: ccache.1 +=================================================================== +--- ccache.1 (révision 7695) ++++ ccache.1 (copie de travail) +@@ -49,7 +49,7 @@ + .IP "\fB-s\fP" + Print the current statistics summary for the cache\&. The + statistics are stored spread across the subdirectories of the +-cache\&. Using "ccache -s" adds up the statistics across all ++cache\&. Using "ccache \-s" adds up the statistics across all + subdirectories and prints the totals\&. + .IP + .IP "\fB-z\fP" +@@ -60,7 +60,7 @@ + .IP + .IP "\fB-c\fP" + Clean the cache and re-calculate the cache file count and +-size totals\&. Normally the -c option should not be necessary as ccache ++size totals\&. Normally the \-c option should not be necessary as ccache + keeps the cache below the specified limits at runtime and keeps + statistics up to date on each compile\&. This option is mostly useful + if you manually modify the cache contents or believe that the cache +@@ -100,9 +100,9 @@ + + + cp ccache /usr/local/bin/ +- ln -s /usr/local/bin/ccache /usr/local/bin/gcc +- ln -s /usr/local/bin/ccache /usr/local/bin/g++ +- ln -s /usr/local/bin/ccache /usr/local/bin/cc ++ ln \-s /usr/local/bin/ccache /usr/local/bin/gcc ++ ln \-s /usr/local/bin/ccache /usr/local/bin/g++ ++ ln \-s /usr/local/bin/ccache /usr/local/bin/cc + + .fi + +@@ -118,7 +118,7 @@ + .PP + When run as a compiler front end ccache usually just takes the same + command line options as the compiler you are using\&. The only exception +-to this is the option \&'--ccache-skip\&'\&. That option can be used to tell ++to this is the option \&'\-\-ccache-skip\&'\&. That option can be used to tell + ccache that the next option is definitely not a input filename, and + should be passed along to the compiler as-is\&. + .PP +@@ -128,7 +128,7 @@ + of the resulting object file (among other things)\&. The heuristic + ccache uses in this parse is that any string on the command line that + exists as a file is treated as an input file name (usually a C +-file)\&. By using --ccache-skip you can force an option to not be ++file)\&. By using \-\-ccache-skip you can force an option to not be + treated as an input file name and instead be passed along to the + compiler as a command line option\&. + .PP +@@ -238,7 +238,7 @@ + .IP "\fBCCACHE_UNIFY\fP" + If you set the environment variable CCACHE_UNIFY + then ccache will use the C/C++ unifier when hashing the pre-processor +-output if -g is not used in the compile\&. The unifier is slower than a ++output if \-g is not used in the compile\&. The unifier is slower than a + normal hash, so setting this environment variable loses a little bit + of speed, but it means that ccache can take advantage of not + recompiling when the changes to the source code consist of +@@ -262,7 +262,7 @@ + .PP + By default ccache has a one gigabyte limit on the cache size and no + maximum number of files\&. You can set a different limit using the +-"ccache -M" and "ccache -F" options, which set the size and number of ++"ccache \-M" and "ccache \-F" options, which set the size and number of + files limits\&. + .PP + When these limits are reached ccache will reduce the cache to 20% +@@ -276,7 +276,7 @@ + that it is the same code by forming a hash of: + .PP + .IP o +-the pre-processor output from running the compiler with -E ++the pre-processor output from running the compiler with \-E + .IP o + the command line options + .IP o +@@ -331,7 +331,7 @@ + .IP o + Make sure that the setgid bit is set on all directories in the + cache\&. This tells the filesystem to inherit group ownership for new +-directories\&. The command "chmod g+s `find $CCACHE_DIR -type d`" might ++directories\&. The command "chmod g+s `find $CCACHE_DIR \-type d`" might + be useful for this\&. + .PP + .SH "HISTORY" diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/09_respect_ldflags.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/09_respect_ldflags.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,11 @@ +--- Makefile.in.orig 2008-03-23 17:01:19.000000000 +1300 ++++ Makefile.in 2008-03-23 17:03:03.000000000 +1300 +@@ -21,7 +21,7 @@ + docs: ccache.1 web/ccache-man.html + + ccache$(EXEEXT): $(OBJS) $(HEADERS) +- $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) + + ccache.1: ccache.yo + -yodl2man -o ccache.1 ccache.yo diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/10_lru_cleanup.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/10_lru_cleanup.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,23 @@ +--- ccache.c (révision 8804) ++++ ccache.c (copie de travail) +@@ -481,6 +481,9 @@ + return; + } + ++ /* update timestamps for LRU cleanup ++ also gives output_file a sensible mtime when hard-linking (for make) */ ++ utime(hashname, NULL); + utime(stderr_file, NULL); + + if (strcmp(output_file, "/dev/null") == 0) { +@@ -513,10 +516,6 @@ + failed(); + } + } +- if (ret == 0) { +- /* update the mtime on the file so that make doesn't get confused */ +- utime(output_file, NULL); +- } + + /* get rid of the intermediate preprocessor file */ + if (i_tmpfile) { diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/11_utimes.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/11_utimes.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,85 @@ +--- ccache.c 2004-09-13 03:38:30.000000000 -0700 ++++ ccache.c 2006-06-09 16:29:16.695117780 -0700 +@@ -481,8 +481,13 @@ + + /* update timestamps for LRU cleanup + also gives output_file a sensible mtime when hard-linking (for make) */ ++#ifdef HAVE_UTIMES ++ utimes(hashname, NULL); ++ utimes(stderr_file, NULL); ++#else + utime(hashname, NULL); + utime(stderr_file, NULL); ++#endif + + if (strcmp(output_file, "/dev/null") == 0) { + ret = 0; +--- ccache.h 2004-09-13 03:38:30.000000000 -0700 ++++ ccache.h 2006-06-09 16:28:16.601658626 -0700 +@@ -22,6 +22,9 @@ + #ifdef HAVE_PWD_H + #include <pwd.h> + #endif ++#ifdef HAVE_SYS_TIME_H ++#include <sys/time.h> ++#endif + + #define STATUS_NOTFOUND 3 + #define STATUS_FATAL 4 +--- config.h.in 2003-09-27 21:48:17.000000000 -0700 ++++ config.h.in 2006-06-09 16:25:43.000000000 -0700 +@@ -19,6 +19,9 @@ + /* Define to 1 if you have the `gethostname' function. */ + #undef HAVE_GETHOSTNAME + ++/* Define to 1 if you have the `getpwuid' function. */ ++#undef HAVE_GETPWUID ++ + /* Define to 1 if you have the <inttypes.h> header file. */ + #undef HAVE_INTTYPES_H + +@@ -31,6 +34,9 @@ + /* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ + #undef HAVE_NDIR_H + ++/* Define to 1 if you have the <pwd.h> header file. */ ++#undef HAVE_PWD_H ++ + /* Define to 1 if you have the `realpath' function. */ + #undef HAVE_REALPATH + +@@ -60,6 +66,9 @@ + /* Define to 1 if you have the <sys/stat.h> header file. */ + #undef HAVE_SYS_STAT_H + ++/* Define to 1 if you have the <sys/time.h> header file. */ ++#undef HAVE_SYS_TIME_H ++ + /* Define to 1 if you have the <sys/types.h> header file. */ + #undef HAVE_SYS_TYPES_H + +@@ -69,6 +78,9 @@ + /* Define to 1 if you have the <unistd.h> header file. */ + #undef HAVE_UNISTD_H + ++/* Define to 1 if you have the `utimes' function. */ ++#undef HAVE_UTIMES ++ + /* Define to 1 if you have the `vasprintf' function. */ + #undef HAVE_VASPRINTF + +--- configure.in 2004-09-13 03:38:30.000000000 -0700 ++++ configure.in 2006-06-09 16:25:15.541288184 -0700 +@@ -27,10 +27,11 @@ + AC_HEADER_TIME + AC_HEADER_SYS_WAIT + +-AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h pwd.h) ++AC_CHECK_HEADERS(ctype.h strings.h stdlib.h string.h pwd.h sys/time.h) + + AC_CHECK_FUNCS(realpath snprintf vsnprintf vasprintf asprintf mkstemp) + AC_CHECK_FUNCS(gethostname getpwuid) ++AC_CHECK_FUNCS(utimes) + + AC_CACHE_CHECK([for compar_fn_t in stdlib.h],ccache_cv_COMPAR_FN_T, [ + AC_TRY_COMPILE( diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/12_cachesize_permissions.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/12_cachesize_permissions.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,83 @@ +--- stats.c (révision 8804) ++++ stats.c (copie de travail) +@@ -286,7 +286,7 @@ + + + /* set the per directory limits */ +-void stats_set_limits(long maxfiles, long maxsize) ++int stats_set_limits(long maxfiles, long maxsize) + { + int dir; + unsigned counters[STATS_END]; +@@ -298,7 +298,9 @@ + maxsize /= 16; + } + +- create_dir(cache_dir); ++ if (create_dir(cache_dir) != 0) { ++ return 1; ++ } + + /* set the limits in each directory */ + for (dir=0;dir<=0xF;dir++) { +@@ -306,7 +308,9 @@ + int fd; + + x_asprintf(&cdir, "%s/%1x", cache_dir, dir); +- create_dir(cdir); ++ if (create_dir(cdir) != 0) { ++ return 1; ++ } + x_asprintf(&fname, "%s/stats", cdir); + free(cdir); + +@@ -326,6 +330,8 @@ + } + free(fname); + } ++ ++ return 0; + } + + /* set the per directory sizes */ +--- ccache.c (révision 8804) ++++ ccache.c (copie de travail) +@@ -935,15 +934,23 @@ + case 'F': + check_cache_dir(); + v = atoi(optarg); +- stats_set_limits(v, -1); +- printf("Set cache file limit to %u\n", (unsigned)v); ++ if (stats_set_limits(v, -1) == 0) { ++ printf("Set cache file limit to %u\n", (unsigned)v); ++ } else { ++ printf("Could not set cache file limit.\n"); ++ exit(1); ++ } + break; + + case 'M': + check_cache_dir(); + v = value_units(optarg); +- stats_set_limits(-1, v); +- printf("Set cache size limit to %uk\n", (unsigned)v); ++ if (stats_set_limits(-1, v) == 0) { ++ printf("Set cache size limit to %uk\n", (unsigned)v); ++ } else { ++ printf("Could not set cache size limit.\n"); ++ exit(1); ++ } + break; + + default: +--- ccache.h (révision 8804) ++++ ccache.h (copie de travail) +@@ -101,7 +101,7 @@ + void stats_summary(void); + void stats_tocache(size_t size); + void stats_read(const char *stats_file, unsigned counters[STATS_END]); +-void stats_set_limits(long maxfiles, long maxsize); ++int stats_set_limits(long maxfiles, long maxsize); + size_t value_units(const char *s); + void display_size(unsigned v); + void stats_set_sizes(const char *dir, size_t num_files, size_t total_size); diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/13_html_links.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/13_html_links.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,33 @@ +--- web/index.html~ 2004-09-13 13:38:30.000000000 +0300 ++++ web/index.html 2004-09-26 01:04:38.458008118 +0300 +@@ -29,10 +29,10 @@ + <li>fixed handling of HOME environment variable + </ul> + +-See the <a href="/ccache/ccache-man.html">manual page</a> for details ++See the <a href="ccache-man.html">manual page</a> for details + on the new options.<p> + +-You can get this release from the <a href="/ftp/ccache/">download directory</a> ++You can get this release from the <a href="http://ccache.samba.org/ftp/ccache/">download directory</a> + + <p>NOTE! This release changes the hash input slighly, so you will + probably find that you will not get any hits against your existing +@@ -87,7 +87,7 @@ + + <h2>Documentation</h2> + +-See the <a href="/ccache/ccache-man.html">manual page</a> ++See the <a href="ccache-man.html">manual page</a> + + + <h2>Performance</h2> +@@ -116,7 +116,7 @@ + <h2>Download</h2> + + You can download the latest release from the <a +-href="/ftp/ccache/">download directory</a>.<p> ++href="http://ccache.samba.org/ftp/ccache/">download directory</a>.<p> + + For the bleeding edge, you can fetch ccache via CVS or + rsync. To fetch via cvs use the following command: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/14_hardlink_doc.diff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/14_hardlink_doc.diff Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,48 @@ +Index: ccache.1 +=================================================================== +RCS file: /cvsroot/ccache/ccache.1,v +retrieving revision 1.26 +diff -u -r1.26 ccache.1 +--- ccache.1 24 Nov 2005 21:10:08 -0000 1.26 ++++ ccache.1 21 Jul 2007 21:03:32 -0000 +@@ -330,7 +330,7 @@ + .IP o + Use the same \fBCCACHE_DIR\fP environment variable setting + .IP o +-Set the \fBCCACHE_NOLINK\fP environment variable ++Unset the \fBCCACHE_HARDLINK\fP environment variable + .IP o + Make sure everyone sets the CCACHE_UMASK environment variable + to 002, this ensures that cached files are accessible to everyone in +Index: ccache.yo +=================================================================== +RCS file: /cvsroot/ccache/ccache.yo,v +retrieving revision 1.27 +diff -u -r1.27 ccache.yo +--- ccache.yo 24 Nov 2005 21:54:09 -0000 1.27 ++++ ccache.yo 21 Jul 2007 21:03:32 -0000 +@@ -289,7 +289,7 @@ + + itemize( + it() Use the same bf(CCACHE_DIR) environment variable setting +- it() Set the bf(CCACHE_NOLINK) environment variable ++ it() Unset the bf(CCACHE_HARDLINK) environment variable + it() Make sure everyone sets the CCACHE_UMASK environment variable + to 002, this ensures that cached files are accessible to everyone in + the group. +Index: web/ccache-man.html +=================================================================== +RCS file: /cvsroot/ccache/web/ccache-man.html,v +retrieving revision 1.25 +diff -u -r1.25 ccache-man.html +--- web/ccache-man.html 13 Sep 2004 10:38:17 -0000 1.25 ++++ web/ccache-man.html 21 Jul 2007 21:03:32 -0000 +@@ -256,7 +256,7 @@ + following conditions need to be met: + <p><ul> + <li > Use the same <strong>CCACHE_DIR</strong> environment variable setting +- <li > Set the <strong>CCACHE_NOLINK</strong> environment variable ++ <li > Unset the <strong>CCACHE_HARDLINK</strong> environment variable + <li > Make sure everyone sets the CCACHE_UMASK environment variable + to 002, this ensures that cached files are accessible to everyone in + the group. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/patches/CREDITS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/patches/CREDITS Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,47 @@ +01_no_home.diff: + Francois Marier <francois@debian.org> + Made especially for the Debian package. + +02_ccache_compressed.diff: + Lars Gust�bel <lars@gustaebel.de> + http://www.gustaebel.de/lars/ccache/ (downloaded on 2007-05-20) + +03_long_options.diff: + Francois Marier <francois@debian.org> + Made especially for the Debian package. + +04_ignore_profile.diff: + Ted Percival <ted@midg3t.net> + http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=20;filename=ccache-profile.patch;att=1;bug=215849 + +05_nfs_fix.diff: + John Coiner <john.coiner@amd.com> + http://lists.samba.org/archive/ccache/2007q1/000265.html + +06_md.diff: + Andrea Bittau <a.bittau@cs.ucl.ac.uk> + http://darkircop.org/ccache/ccache-2.4-md.patch (downloaded on 2007-06-30) + +07_cachedirtag.diff: + Karl Chen <quarl@cs.berkeley.edu> + http://lists.samba.org/archive/ccache/2008q1/000316.html (downloaded on 2008-02-02) + +08_manpage_hyphens.diff: + Francois Marier <francois@debian.org> + Made especially for the Debian package. + +09_respect_ldflags.diff: + Lisa Seelye <lisa@gentoo.org> + http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/ccache/files/ccache-2.4-respectflags.patch?rev=1.1&view=markup + +10_lru_cleanup.diff: + RW <fbsd06@mlists.homeunix.com> + http://lists.samba.org/archive/ccache/2008q2/000339.html (downloaded on 2008-04-11) + +11_utimes.diff: + Robin H. Johnson <robbat2@gentoo.org> + http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/ccache/files/ccache-2.4-utimes.patch?rev=1.1&view=markup + +12_cachesize_permissions.diff: + Francois Marier <francois@debian.org> + Made especially for the Debian package to fix http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=332527 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/rules --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/rules Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,141 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# These are used for cross-compiling and for saving the configure script +# from having to guess our platform (since we know it already) +export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) + confflags += --build $(DEB_HOST_GNU_TYPE) +else + confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) +endif + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) + CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + INSTALL_PROGRAM += -s +endif + +config.status: configure + dh_testdir + + # Apply Debian specific patches + cp $(CURDIR)/ccache.c $(CURDIR)/ccache.c.unpatched + cp $(CURDIR)/util.c $(CURDIR)/util.c.unpatched + cp $(CURDIR)/ccache.1 $(CURDIR)/ccache.1.unpatched + cp $(CURDIR)/ccache.h $(CURDIR)/ccache.h.unpatched + cp $(CURDIR)/ccache.yo $(CURDIR)/ccache.yo.unpatched + cp $(CURDIR)/config.h.in $(CURDIR)/config.h.in.unpatched + cp $(CURDIR)/configure $(CURDIR)/configure.unpatched + cp $(CURDIR)/configure.in $(CURDIR)/configure.in.unpatched + cp $(CURDIR)/Makefile.in $(CURDIR)/Makefile.in.unpatched + if test ! -f patch-stamp; then \ + for patch in $(CURDIR)/debian/patches/*.diff ;\ + do \ + echo APPLYING PATCH\: $${patch##*/};\ + patch -p0 < $$patch ;\ + done ;\ + touch patch-stamp ;\ + fi + chmod +x $(CURDIR)/manage-cache.sh + + ./configure $(confflags) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + +build: build-stamp + +build-stamp: config.status + dh_testdir + + $(MAKE) + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Unapply patches + -test -r $(CURDIR)/ccache.c.unpatched && mv $(CURDIR)/ccache.c.unpatched $(CURDIR)/ccache.c + -test -r $(CURDIR)/util.c.unpatched && mv $(CURDIR)/util.c.unpatched $(CURDIR)/util.c + -test -r $(CURDIR)/ccache.1.unpatched && mv $(CURDIR)/ccache.1.unpatched $(CURDIR)/ccache.1 + -test -r $(CURDIR)/ccache.h.unpatched && mv $(CURDIR)/ccache.h.unpatched $(CURDIR)/ccache.h + -test -r $(CURDIR)/ccache.yo.unpatched && mv $(CURDIR)/ccache.yo.unpatched $(CURDIR)/ccache.yo + -test -r $(CURDIR)/config.h.in.unpatched && mv $(CURDIR)/config.h.in.unpatched $(CURDIR)/config.h.in + -test -r $(CURDIR)/configure.unpatched && mv $(CURDIR)/configure.unpatched $(CURDIR)/configure + -test -r $(CURDIR)/configure.in.unpatched && mv $(CURDIR)/configure.in.unpatched $(CURDIR)/configure.in + -test -r $(CURDIR)/Makefile.in.unpatched && mv $(CURDIR)/Makefile.in.unpatched $(CURDIR)/Makefile.in + -rm -f $(CURDIR)/manage-cache.sh + -rm -f patch-stamp + + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + + # Update config.sub and config.guess + -test -r /usr/share/misc/config.sub && \ + cp -f /usr/share/misc/config.sub config.sub + -test -r /usr/share/misc/config.guess && \ + cp -f /usr/share/misc/config.guess config.guess + + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/ccache. + $(MAKE) install prefix=$(CURDIR)/debian/ccache/usr + + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-gcc + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-g++ + set -e; for ver in 2.95 3.0 3.2 3.3 3.4 4.0 4.1 4.2 4.3; do \ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-gcc-$$ver; \ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/gcc-$$ver; \ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/$(DEB_BUILD_GNU_TYPE)-g++-$$ver; \ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/g++-$$ver; \ + done + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/cc + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/c++ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/gcc + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/g++ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-c++ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-cc + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-g++ + ln -s ../../bin/ccache $(CURDIR)/debian/ccache/usr/lib/ccache/i586-mingw32msvc-gcc + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu + dh_installcron + dh_installman + dh_installinfo + dh_installchangelogs + dh_link + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/update-ccache --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/update-ccache Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Update compiler links to ccache (in /usr/local/bin) +# +# The idea is that /usr/local/bin is ahead of /usr/bin in your PATH, so adding +# the link /usr/local/bin/cc -> /usr/bin/ccache means that it is run instead of +# /usr/bin/cc +# +# Written by: Behan Webster <behanw@websterwood.com> +# + +DIRECTORY=/usr/local/bin +CCACHE=/usr/bin/ccache +CCDIR=/usr/lib/ccache + +usage() { + echo "Usage: `basename $0` [--directory <dir>] [--remove]" + exit 0 +} + +while [ $# -gt 0 ] ; do + case "$1" in + -d*|--d*|--directory) DIRECTORY=$2; shift; shift;; + -h*|--h*|--help) usage;; + -r*|--r*|--remove) REMOVE=1; shift;; + -t*|--t*|--test) TEST=echo; shift;; + esac +done + +for FILE in `cd $CCDIR; ls` ; do + LINK=$DIRECTORY/$FILE + if [ -z "$REMOVE" ] ; then + # Add link + $TEST ln -fs $CCACHE $LINK + else + # Remove link + if [ -L "$LINK" ] ; then + $TEST rm -f $LINK + fi + fi +done + +# vim: sw=4 ts=4 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/debian/watch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/debian/watch Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2 @@ +version=2 +http://samba.org/ftp/ccache/ccache-(.*)\.tar\.gz diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/execute.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/execute.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,286 @@ +/* + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ccache.h" + +#ifdef _WIN32 +char *argvtos(char **argv) +{ + int i, len; + char *ptr, *str; + + for (i = 0, len = 0; argv[i]; i++) { + len += strlen(argv[i]) + 3; + } + + str = ptr = (char *)malloc(len + 1); + if (str == NULL) + return NULL; + + for (i = 0; argv[i]; i++) { + len = strlen(argv[i]); + *ptr++ = '"'; + memcpy(ptr, argv[i], len); + ptr += len; + *ptr++ = '"'; + *ptr++ = ' '; + } + *ptr = 0; + + return str; +} +#endif + +/* + execute a compiler backend, capturing all output to the given paths + the full path to the compiler to run is in argv[0] +*/ +int execute(char **argv, + const char *path_stdout, + const char *path_stderr) +{ +#ifdef _WIN32 + +#if 1 + PROCESS_INFORMATION pinfo; + STARTUPINFO sinfo; + BOOL ret; + DWORD exitcode; + char *args; + HANDLE fd_out, fd_err; + SECURITY_ATTRIBUTES sa = {sizeof(SECURITY_ATTRIBUTES), NULL, TRUE}; + + /* TODO: needs moving after possible exit() below, but before stdout is redirected */ + if (ccache_verbose) { + display_execute_args(argv); + } + + fd_out = CreateFile(path_stdout, GENERIC_WRITE, 0, &sa, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + if (fd_out == INVALID_HANDLE_VALUE) { + return STATUS_NOCACHE; + } + + fd_err = CreateFile(path_stderr, GENERIC_WRITE, 0, &sa, CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, NULL); + if (fd_err == INVALID_HANDLE_VALUE) { + return STATUS_NOCACHE; + } + + ZeroMemory(&pinfo, sizeof(PROCESS_INFORMATION)); + ZeroMemory(&sinfo, sizeof(STARTUPINFO)); + + sinfo.cb = sizeof(STARTUPINFO); + sinfo.hStdError = fd_err; + sinfo.hStdOutput = fd_out; + sinfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE); + sinfo.dwFlags |= STARTF_USESTDHANDLES; + + args = argvtos(argv); + + ret = CreateProcessA(argv[0], args, NULL, NULL, TRUE, 0, NULL, NULL, + &sinfo, &pinfo); + + free(args); + CloseHandle(fd_out); + CloseHandle(fd_err); + + if (ret == 0) + return -1; + + WaitForSingleObject(pinfo.hProcess, INFINITE); + GetExitCodeProcess(pinfo.hProcess, &exitcode); + CloseHandle(pinfo.hProcess); + CloseHandle(pinfo.hThread); + + return exitcode; +#else /* possibly slightly faster */ + /* needs fixing to quote commandline options to handle spaces in CCACHE_DIR etc */ + int status = -2; + int fd, std_od = -1, std_ed = -1; + + /* TODO: needs moving after possible exit() below, but before stdout is redirected */ + if (ccache_verbose) { + display_execute_args(argv); + } + + unlink(path_stdout); + std_od = _dup(1); + fd = _open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666); + if (fd == -1) { + exit(STATUS_NOCACHE); + } + _dup2(fd, 1); + _close(fd); + + unlink(path_stderr); + fd = _open(path_stderr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666); + std_ed = _dup(2); + if (fd == -1) { + exit(STATUS_NOCACHE); + } + _dup2(fd, 2); + _close(fd); + + /* Spawn process (_exec* familly doesn't return) */ + status = _spawnv(_P_WAIT, argv[0], (const char **)argv); + + /* Restore descriptors */ + if (std_od != -1) _dup2(std_od, 1); + if (std_ed != -1) _dup2(std_ed, 2); + _flushall(); + + return (status>0); + +#endif + +#else + pid_t pid; + int status; + + pid = fork(); + if (pid == -1) fatal("Failed to fork"); + + if (pid == 0) { + int fd; + + /* TODO: needs moving after possible exit() below, but before stdout is redirected */ + if (ccache_verbose) { + display_execute_args(argv); + } + + unlink(path_stdout); + fd = open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666); + if (fd == -1) { + exit(STATUS_NOCACHE); + } + dup2(fd, 1); + close(fd); + + unlink(path_stderr); + fd = open(path_stderr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666); + if (fd == -1) { + exit(STATUS_NOCACHE); + } + dup2(fd, 2); + close(fd); + + exit(execv(argv[0], argv)); + } + + if (waitpid(pid, &status, 0) != pid) { + fatal("waitpid failed"); + } + + if (WEXITSTATUS(status) == 0 && WIFSIGNALED(status)) { + return -1; + } + + return WEXITSTATUS(status); +#endif +} + + +/* + find an executable by name in $PATH. Exclude any that are links to exclude_name +*/ +char *find_executable(const char *name, const char *exclude_name) +{ +#if _WIN32 + (void)exclude_name; + DWORD ret; + char namebuf[MAX_PATH]; + + ret = SearchPathA(getenv("CCACHE_PATH"), name, ".exe", + sizeof(namebuf), namebuf, NULL); + if (ret != 0) { + return x_strdup(namebuf); + } + + return NULL; +#else + char *path; + char *tok; + struct stat st1, st2; + + if (*name == '/') { + return x_strdup(name); + } + + path = getenv("CCACHE_PATH"); + if (!path) { + path = getenv("PATH"); + } + if (!path) { + cc_log("no PATH variable!?\n"); + stats_update(STATS_ENVIRONMMENT); + return NULL; + } + + path = x_strdup(path); + + /* search the path looking for the first compiler of the right name + that isn't us */ + for (tok=strtok(path,":"); tok; tok = strtok(NULL, ":")) { + char *fname; + x_asprintf(&fname, "%s/%s", tok, name); + /* look for a normal executable file */ + if (access(fname, X_OK) == 0 && + lstat(fname, &st1) == 0 && + stat(fname, &st2) == 0 && + S_ISREG(st2.st_mode)) { + /* if its a symlink then ensure it doesn't + point at something called exclude_name */ + if (S_ISLNK(st1.st_mode)) { + char *buf = x_realpath(fname); + if (buf) { + char *p = str_basename(buf); + if (strcmp(p, exclude_name) == 0) { + /* its a link to "ccache" ! */ + free(p); + free(buf); + continue; + } + free(buf); + free(p); + } + } + + /* found it! */ + free(path); + return fname; + } + free(fname); + } + + return NULL; +#endif +} + +void display_execute_args(char **argv) +{ + if (argv) { + printf("ccache executing: "); + while (*argv) { + printf("%s ", *argv); + ++argv; + } + printf("\n"); + fflush(stdout); + } +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/hash.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/hash.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,80 @@ +/* + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* + simple front-end functions to mdfour code +*/ + +#include "ccache.h" + +static struct mdfour md; + +void hash_buffer(const char *s, int len) +{ + mdfour_update(&md, (unsigned char *)s, len); +} + +void hash_start(void) +{ + mdfour_begin(&md); +} + +void hash_string(const char *s) +{ + hash_buffer(s, strlen(s)); +} + +void hash_int(int x) +{ + hash_buffer((char *)&x, sizeof(x)); +} + +/* add contents of a file to the hash */ +void hash_file(const char *fname) +{ + char buf[1024]; + int fd, n; + + fd = open(fname, O_RDONLY|O_BINARY); + if (fd == -1) { + cc_log("Failed to open %s\n", fname); + fatal("hash_file"); + } + + while ((n = read(fd, buf, sizeof(buf))) > 0) { + hash_buffer(buf, n); + } + close(fd); +} + +/* return the hash result as a static string */ +char *hash_result(void) +{ + unsigned char sum[16]; + static char ret[53]; + int i; + + hash_buffer(NULL, 0); + mdfour_result(&md, sum); + + for (i=0;i<16;i++) { + sprintf(&ret[i*2], "%02x", (unsigned)sum[i]); + } + sprintf(&ret[i*2], "-%u", (unsigned)md.totalN); + + return ret; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/install-sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/install-sh Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,238 @@ +#! /bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/mdfour.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/mdfour.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,284 @@ +/* + a implementation of MD4 designed for use in the SMB authentication protocol + Copyright (C) Andrew Tridgell 1997-1998. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ccache.h" + +/* NOTE: This code makes no attempt to be fast! + + It assumes that a int is at least 32 bits long +*/ + +static struct mdfour *m; + +#define MASK32 (0xffffffff) + +#define F(X,Y,Z) ((((X)&(Y)) | ((~(X))&(Z)))) +#define G(X,Y,Z) ((((X)&(Y)) | ((X)&(Z)) | ((Y)&(Z)))) +#define H(X,Y,Z) (((X)^(Y)^(Z))) +#define lshift(x,s) (((((x)<<(s))&MASK32) | (((x)>>(32-(s)))&MASK32))) + +#define ROUND1(a,b,c,d,k,s) a = lshift((a + F(b,c,d) + M[k])&MASK32, s) +#define ROUND2(a,b,c,d,k,s) a = lshift((a + G(b,c,d) + M[k] + 0x5A827999)&MASK32,s) +#define ROUND3(a,b,c,d,k,s) a = lshift((a + H(b,c,d) + M[k] + 0x6ED9EBA1)&MASK32,s) + +/* this applies md4 to 64 byte chunks */ +static void mdfour64(uint32 *M) +{ + uint32 AA, BB, CC, DD; + uint32 A,B,C,D; + + A = m->A; B = m->B; C = m->C; D = m->D; + AA = A; BB = B; CC = C; DD = D; + + ROUND1(A,B,C,D, 0, 3); ROUND1(D,A,B,C, 1, 7); + ROUND1(C,D,A,B, 2, 11); ROUND1(B,C,D,A, 3, 19); + ROUND1(A,B,C,D, 4, 3); ROUND1(D,A,B,C, 5, 7); + ROUND1(C,D,A,B, 6, 11); ROUND1(B,C,D,A, 7, 19); + ROUND1(A,B,C,D, 8, 3); ROUND1(D,A,B,C, 9, 7); + ROUND1(C,D,A,B, 10, 11); ROUND1(B,C,D,A, 11, 19); + ROUND1(A,B,C,D, 12, 3); ROUND1(D,A,B,C, 13, 7); + ROUND1(C,D,A,B, 14, 11); ROUND1(B,C,D,A, 15, 19); + + + ROUND2(A,B,C,D, 0, 3); ROUND2(D,A,B,C, 4, 5); + ROUND2(C,D,A,B, 8, 9); ROUND2(B,C,D,A, 12, 13); + ROUND2(A,B,C,D, 1, 3); ROUND2(D,A,B,C, 5, 5); + ROUND2(C,D,A,B, 9, 9); ROUND2(B,C,D,A, 13, 13); + ROUND2(A,B,C,D, 2, 3); ROUND2(D,A,B,C, 6, 5); + ROUND2(C,D,A,B, 10, 9); ROUND2(B,C,D,A, 14, 13); + ROUND2(A,B,C,D, 3, 3); ROUND2(D,A,B,C, 7, 5); + ROUND2(C,D,A,B, 11, 9); ROUND2(B,C,D,A, 15, 13); + + ROUND3(A,B,C,D, 0, 3); ROUND3(D,A,B,C, 8, 9); + ROUND3(C,D,A,B, 4, 11); ROUND3(B,C,D,A, 12, 15); + ROUND3(A,B,C,D, 2, 3); ROUND3(D,A,B,C, 10, 9); + ROUND3(C,D,A,B, 6, 11); ROUND3(B,C,D,A, 14, 15); + ROUND3(A,B,C,D, 1, 3); ROUND3(D,A,B,C, 9, 9); + ROUND3(C,D,A,B, 5, 11); ROUND3(B,C,D,A, 13, 15); + ROUND3(A,B,C,D, 3, 3); ROUND3(D,A,B,C, 11, 9); + ROUND3(C,D,A,B, 7, 11); ROUND3(B,C,D,A, 15, 15); + + A += AA; B += BB; + C += CC; D += DD; + + A &= MASK32; B &= MASK32; + C &= MASK32; D &= MASK32; + + m->A = A; m->B = B; m->C = C; m->D = D; +} + +static void copy64(uint32 *M, const unsigned char *in) +{ + int i; + + for (i=0;i<16;i++) + M[i] = (in[i*4+3]<<24) | (in[i*4+2]<<16) | + (in[i*4+1]<<8) | (in[i*4+0]<<0); +} + +static void copy4(unsigned char *out,uint32 x) +{ + out[0] = x&0xFF; + out[1] = (x>>8)&0xFF; + out[2] = (x>>16)&0xFF; + out[3] = (x>>24)&0xFF; +} + +void mdfour_begin(struct mdfour *md) +{ + md->A = 0x67452301; + md->B = 0xefcdab89; + md->C = 0x98badcfe; + md->D = 0x10325476; + md->totalN = 0; + md->tail_len = 0; +} + + +static void mdfour_tail(const unsigned char *in, int n) +{ + unsigned char buf[128]; + uint32 M[16]; + uint32 b; + + m->totalN += n; + + b = m->totalN * 8; + + memset(buf, 0, 128); + if (n) memcpy(buf, in, n); + buf[n] = 0x80; + + if (n <= 55) { + copy4(buf+56, b); + copy64(M, buf); + mdfour64(M); + } else { + copy4(buf+120, b); + copy64(M, buf); + mdfour64(M); + copy64(M, buf+64); + mdfour64(M); + } +} + +void mdfour_update(struct mdfour *md, const unsigned char *in, int n) +{ + uint32 M[16]; + + m = md; + + if (in == NULL) { + mdfour_tail(md->tail, md->tail_len); + return; + } + + if (md->tail_len) { + int len = 64 - md->tail_len; + if (len > n) len = n; + memcpy(md->tail+md->tail_len, in, len); + md->tail_len += len; + n -= len; + in += len; + if (md->tail_len == 64) { + copy64(M, md->tail); + mdfour64(M); + m->totalN += 64; + md->tail_len = 0; + } + } + + while (n >= 64) { + copy64(M, in); + mdfour64(M); + in += 64; + n -= 64; + m->totalN += 64; + } + + if (n) { + memcpy(md->tail, in, n); + md->tail_len = n; + } +} + + +void mdfour_result(struct mdfour *md, unsigned char *out) +{ + m = md; + + copy4(out, m->A); + copy4(out+4, m->B); + copy4(out+8, m->C); + copy4(out+12, m->D); +} + + +void mdfour(unsigned char *out, const unsigned char *in, int n) +{ + struct mdfour md; + mdfour_begin(&md); + mdfour_update(&md, in, n); + mdfour_update(&md, NULL, 0); + mdfour_result(&md, out); +} + +#ifdef TEST_MDFOUR +static void file_checksum1(char *fname) +{ + int fd, i; + struct mdfour md; + unsigned char buf[1024], sum[16]; + unsigned chunk; + + fd = open(fname,O_RDONLY|O_BINARY); + if (fd == -1) { + perror("fname"); + exit(1); + } + + chunk = 1 + random() % (sizeof(buf) - 1); + + mdfour_begin(&md); + + while (1) { + int n = read(fd, buf, chunk); + if (n >= 0) { + mdfour_update(&md, buf, n); + } + if (n < chunk) break; + } + + close(fd); + + mdfour_update(&md, NULL, 0); + + mdfour_result(&md, sum); + + for (i=0;i<16;i++) + printf("%02x", sum[i]); + printf("\n"); +} + +#if 0 +#include "../md4.h" + +static void file_checksum2(char *fname) +{ + int fd, i; + MDstruct md; + unsigned char buf[64], sum[16]; + + fd = open(fname,O_RDONLY|O_BINARY); + if (fd == -1) { + perror("fname"); + exit(1); + } + + MDbegin(&md); + + while (1) { + int n = read(fd, buf, sizeof(buf)); + if (n <= 0) break; + MDupdate(&md, buf, n*8); + } + + if (!md.done) { + MDupdate(&md, buf, 0); + } + + close(fd); + + memcpy(sum, md.buffer, 16); + + for (i=0;i<16;i++) + printf("%02x", sum[i]); + printf("\n"); +} +#endif + + int main(int argc, char *argv[]) +{ + file_checksum1(argv[1]); +#if 0 + file_checksum2(argv[1]); +#endif + return 0; +} +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/mdfour.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/mdfour.h Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,36 @@ +/* + Unix SMB/Netbios implementation. + Version 1.9. + a implementation of MD4 designed for use in the SMB authentication protocol + Copyright (C) Andrew Tridgell 1997-1998. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +struct mdfour { + uint32 A, B, C, D; + uint32 totalN; + unsigned char tail[64]; + unsigned tail_len; +}; + +void mdfour_begin(struct mdfour *md); +void mdfour_update(struct mdfour *md, const unsigned char *in, int n); +void mdfour_result(struct mdfour *md, unsigned char *out); +void mdfour(unsigned char *out, const unsigned char *in, int n); + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/packaging/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/packaging/README Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,5 @@ +These packaging files are contributd by users of ccache. I do not +maintain them, and they may well need updating before you use them. + +I don't distribute binary packages of ccache myself, but if you wish +to add ccache to a distribution then that's OK diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/packaging/ccache.spec --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/packaging/ccache.spec Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,37 @@ +Summary: Compiler Cache +Name: ccache +Version: 2.3 +Release: 1 +Group: Development/Languages +License: GPL +URL: http://ccache.samba.org/ +Source: ccache-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +ccache caches gcc output files + +%prep +%setup -q + +%build +%configure +make + +install -d -m 0755 $RPM_BUILD_ROOT%{_bindir} +install -m 0755 ccache $RPM_BUILD_ROOT%{_bindir} +install -d -m 0755 $RPM_BUILD_ROOT%{_mandir}/man1 +install -m 0644 ccache.1 $RPM_BUILD_ROOT%{_mandir}/man1 + +%files +%defattr(-,root,root) +%doc README +%{_mandir}/man1/ccache.1* +%{_bindir}/ccache + +%clean +[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT + +%changelog +* Mon Apr 01 2002 Peter Jones <pjones@redhat.com> +- Created the package diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/snprintf.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/snprintf.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,962 @@ +/* + * Copyright Patrick Powell 1995 + * This code is based on code written by Patrick Powell (papowell@astart.com) + * It may be used for any purpose as long as this notice remains intact + * on all source code distributions + */ + +/************************************************************** + * Original: + * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 + * A bombproof version of doprnt (dopr) included. + * Sigh. This sort of thing is always nasty do deal with. Note that + * the version here does not include floating point... + * + * snprintf() is used instead of sprintf() as it does limit checks + * for string length. This covers a nasty loophole. + * + * The other functions are there to prevent NULL pointers from + * causing nast effects. + * + * More Recently: + * Brandon Long <blong@fiction.net> 9/15/96 for mutt 0.43 + * This was ugly. It is still ugly. I opted out of floating point + * numbers, but the formatter understands just about everything + * from the normal C string format, at least as far as I can tell from + * the Solaris 2.5 printf(3S) man page. + * + * Brandon Long <blong@fiction.net> 10/22/97 for mutt 0.87.1 + * Ok, added some minimal floating point support, which means this + * probably requires libm on most operating systems. Don't yet + * support the exponent (e,E) and sigfig (g,G). Also, fmtint() + * was pretty badly broken, it just wasn't being exercised in ways + * which showed it, so that's been fixed. Also, formated the code + * to mutt conventions, and removed dead code left over from the + * original. Also, there is now a builtin-test, just compile with: + * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm + * and run snprintf for results. + * + * Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i + * The PGP code was using unsigned hexadecimal formats. + * Unfortunately, unsigned formats simply didn't work. + * + * Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8 + * The original code assumed that both snprintf() and vsnprintf() were + * missing. Some systems only have snprintf() but not vsnprintf(), so + * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF. + * + * Andrew Tridgell (tridge@samba.org) Oct 1998 + * fixed handling of %.0f + * added test for HAVE_LONG_DOUBLE + * + * tridge@samba.org, idra@samba.org, April 2001 + * got rid of fcvt code (twas buggy and made testing harder) + * added C99 semantics + * + **************************************************************/ + +#ifndef NO_CONFIG_H /* for some tests */ +#include "config.h" +#endif + +#ifdef HAVE_STRING_H +#include <string.h> +#endif + +#ifdef HAVE_STRINGS_H +#include <strings.h> +#endif +#ifdef HAVE_CTYPE_H +#include <ctype.h> +#endif +#include <sys/types.h> +#include <stdarg.h> +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF) +/* only include stdio.h if we are not re-defining snprintf or vsnprintf */ +#include <stdio.h> + /* make the compiler happy with an empty file */ + void dummy_snprintf(void) {} +#else + +#ifdef HAVE_LONG_DOUBLE +#define LDOUBLE long double +#else +#define LDOUBLE double +#endif + +#ifdef HAVE_LONG_LONG +#define LLONG long long +#else +#define LLONG long +#endif + +static size_t dopr(char *buffer, size_t maxlen, const char *format, + va_list args); +static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max); +static void fmtint(char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags); +static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags); +static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); + +/* + * dopr(): poor man's version of doprintf + */ + +/* format read states */ +#define DP_S_DEFAULT 0 +#define DP_S_FLAGS 1 +#define DP_S_MIN 2 +#define DP_S_DOT 3 +#define DP_S_MAX 4 +#define DP_S_MOD 5 +#define DP_S_CONV 6 +#define DP_S_DONE 7 + +/* format flags - Bits */ +#define DP_F_MINUS (1 << 0) +#define DP_F_PLUS (1 << 1) +#define DP_F_SPACE (1 << 2) +#define DP_F_NUM (1 << 3) +#define DP_F_ZERO (1 << 4) +#define DP_F_UP (1 << 5) +#define DP_F_UNSIGNED (1 << 6) + +/* Conversion Flags */ +#define DP_C_SHORT 1 +#define DP_C_LONG 2 +#define DP_C_LDOUBLE 3 +#define DP_C_LLONG 4 + +#define char_to_int(p) ((p)- '0') +#ifndef MAX +#define MAX(p,q) (((p) >= (q)) ? (p) : (q)) +#endif + +static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args) +{ + char ch; + LLONG value; + LDOUBLE fvalue; + char *strvalue; + int min; + int max; + int state; + int flags; + int cflags; + size_t currlen; + + state = DP_S_DEFAULT; + currlen = flags = cflags = min = 0; + max = -1; + ch = *format++; + + while (state != DP_S_DONE) { + if (ch == '\0') + state = DP_S_DONE; + + switch(state) { + case DP_S_DEFAULT: + if (ch == '%') + state = DP_S_FLAGS; + else + dopr_outch (buffer, &currlen, maxlen, ch); + ch = *format++; + break; + case DP_S_FLAGS: + switch (ch) { + case '-': + flags |= DP_F_MINUS; + ch = *format++; + break; + case '+': + flags |= DP_F_PLUS; + ch = *format++; + break; + case ' ': + flags |= DP_F_SPACE; + ch = *format++; + break; + case '#': + flags |= DP_F_NUM; + ch = *format++; + break; + case '0': + flags |= DP_F_ZERO; + ch = *format++; + break; + default: + state = DP_S_MIN; + break; + } + break; + case DP_S_MIN: + if (isdigit((unsigned char)ch)) { + min = 10*min + char_to_int (ch); + ch = *format++; + } else if (ch == '*') { + min = va_arg (args, int); + ch = *format++; + state = DP_S_DOT; + } else { + state = DP_S_DOT; + } + break; + case DP_S_DOT: + if (ch == '.') { + state = DP_S_MAX; + ch = *format++; + } else { + state = DP_S_MOD; + } + break; + case DP_S_MAX: + if (isdigit((unsigned char)ch)) { + if (max < 0) + max = 0; + max = 10*max + char_to_int (ch); + ch = *format++; + } else if (ch == '*') { + max = va_arg (args, int); + ch = *format++; + state = DP_S_MOD; + } else { + state = DP_S_MOD; + } + break; + case DP_S_MOD: + switch (ch) { + case 'h': + cflags = DP_C_SHORT; + ch = *format++; + break; + case 'l': + cflags = DP_C_LONG; + ch = *format++; + if (ch == 'l') { /* It's a long long */ + cflags = DP_C_LLONG; + ch = *format++; + } + break; + case 'L': + cflags = DP_C_LDOUBLE; + ch = *format++; + break; + default: + break; + } + state = DP_S_CONV; + break; + case DP_S_CONV: + switch (ch) { + case 'd': + case 'i': + if (cflags == DP_C_SHORT) + value = va_arg (args, int); + else if (cflags == DP_C_LONG) + value = va_arg (args, long int); + else if (cflags == DP_C_LLONG) + value = va_arg (args, LLONG); + else + value = va_arg (args, int); + fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + break; + case 'o': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned int); + else if (cflags == DP_C_LONG) + value = (long)va_arg (args, unsigned long int); + else if (cflags == DP_C_LLONG) + value = (long)va_arg (args, unsigned LLONG); + else + value = (long)va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); + break; + case 'u': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned int); + else if (cflags == DP_C_LONG) + value = (long)va_arg (args, unsigned long int); + else if (cflags == DP_C_LLONG) + value = (LLONG)va_arg (args, unsigned LLONG); + else + value = (long)va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + break; + case 'X': + flags |= DP_F_UP; + case 'x': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned int); + else if (cflags == DP_C_LONG) + value = (long)va_arg (args, unsigned long int); + else if (cflags == DP_C_LLONG) + value = (LLONG)va_arg (args, unsigned LLONG); + else + value = (long)va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); + break; + case 'f': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, LDOUBLE); + else + fvalue = va_arg (args, double); + /* um, floating point? */ + fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + break; + case 'E': + flags |= DP_F_UP; + case 'e': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, LDOUBLE); + else + fvalue = va_arg (args, double); + break; + case 'G': + flags |= DP_F_UP; + case 'g': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, LDOUBLE); + else + fvalue = va_arg (args, double); + break; + case 'c': + dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); + break; + case 's': + strvalue = va_arg (args, char *); + if (!strvalue) strvalue = "(NULL)"; + if (max == -1) { + max = strlen(strvalue); + } + if (min > 0 && max >= 0 && min > max) max = min; + fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); + break; + case 'p': + strvalue = (char *)va_arg(args, void *); + fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); + break; + case 'n': + if (cflags == DP_C_SHORT) { + short int *num; + num = va_arg (args, short int *); + *num = currlen; + } else if (cflags == DP_C_LONG) { + long int *num; + num = va_arg (args, long int *); + *num = (long int)currlen; + } else if (cflags == DP_C_LLONG) { + LLONG *num; + num = va_arg (args, LLONG *); + *num = (LLONG)currlen; + } else { + int *num; + num = va_arg (args, int *); + *num = currlen; + } + break; + case '%': + dopr_outch (buffer, &currlen, maxlen, ch); + break; + case 'w': + /* not supported yet, treat as next char */ + ch = *format++; + break; + default: + /* Unknown, skip */ + break; + } + ch = *format++; + state = DP_S_DEFAULT; + flags = cflags = min = 0; + max = -1; + break; + case DP_S_DONE: + break; + default: + /* hmm? */ + break; /* some picky compilers need this */ + } + } + if (maxlen != 0) { + if (currlen < maxlen - 1) + buffer[currlen] = '\0'; + else if (maxlen > 0) + buffer[maxlen - 1] = '\0'; + } + + return currlen; +} + +static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max) +{ + int padlen, strln; /* amount to pad */ + int cnt = 0; + +#ifdef DEBUG_SNPRINTF + printf("fmtstr min=%d max=%d s=[%s]\n", min, max, value); +#endif + if (value == 0) { + value = "<NULL>"; + } + + for (strln = 0; value[strln]; ++strln); /* strlen */ + padlen = min - strln; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justify */ + + while ((padlen > 0) && (cnt < max)) { + dopr_outch (buffer, currlen, maxlen, ' '); + --padlen; + ++cnt; + } + while (*value && (cnt < max)) { + dopr_outch (buffer, currlen, maxlen, *value++); + ++cnt; + } + while ((padlen < 0) && (cnt < max)) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++padlen; + ++cnt; + } +} + +/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ + +static void fmtint(char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags) +{ + int signvalue = 0; + unsigned long uvalue; + char convert[20]; + int place = 0; + int spadlen = 0; /* amount to space pad */ + int zpadlen = 0; /* amount to zero pad */ + int caps = 0; + + if (max < 0) + max = 0; + + uvalue = value; + + if(!(flags & DP_F_UNSIGNED)) { + if( value < 0 ) { + signvalue = '-'; + uvalue = -value; + } else { + if (flags & DP_F_PLUS) /* Do a sign (+/i) */ + signvalue = '+'; + else if (flags & DP_F_SPACE) + signvalue = ' '; + } + } + + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ + + do { + convert[place++] = + (caps? "0123456789ABCDEF":"0123456789abcdef") + [uvalue % (unsigned)base ]; + uvalue = (uvalue / (unsigned)base ); + } while(uvalue && (place < 20)); + if (place == 20) place--; + convert[place] = 0; + + zpadlen = max - place; + spadlen = min - MAX (max, place) - (signvalue ? 1 : 0); + if (zpadlen < 0) zpadlen = 0; + if (spadlen < 0) spadlen = 0; + if (flags & DP_F_ZERO) { + zpadlen = MAX(zpadlen, spadlen); + spadlen = 0; + } + if (flags & DP_F_MINUS) + spadlen = -spadlen; /* Left Justifty */ + +#ifdef DEBUG_SNPRINTF + printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", + zpadlen, spadlen, min, max, place); +#endif + + /* Spaces */ + while (spadlen > 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + --spadlen; + } + + /* Sign */ + if (signvalue) + dopr_outch (buffer, currlen, maxlen, signvalue); + + /* Zeros */ + if (zpadlen > 0) { + while (zpadlen > 0) { + dopr_outch (buffer, currlen, maxlen, '0'); + --zpadlen; + } + } + + /* Digits */ + while (place > 0) + dopr_outch (buffer, currlen, maxlen, convert[--place]); + + /* Left Justified spaces */ + while (spadlen < 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++spadlen; + } +} + +static LDOUBLE abs_val(LDOUBLE value) +{ + LDOUBLE result = value; + + if (value < 0) + result = -value; + + return result; +} + +static LDOUBLE POW10(int exp) +{ + LDOUBLE result = 1; + + while (exp) { + result *= 10; + exp--; + } + + return result; +} + +static LLONG ROUND(LDOUBLE value) +{ + LLONG intpart; + + intpart = (LLONG)value; + value = value - intpart; + if (value >= 0.5) intpart++; + + return intpart; +} + +/* a replacement for modf that doesn't need the math library. Should + be portable, but slow */ +static double my_modf(double x0, double *iptr) +{ + int i; + long l; + double x = x0; + double f = 1.0; + + for (i=0;i<100;i++) { + l = (long)x; + if (l <= (x+1) && l >= (x-1)) break; + x *= 0.1; + f *= 10.0; + } + + if (i == 100) { + /* yikes! the number is beyond what we can handle. What do we do? */ + (*iptr) = 0; + return 0; + } + + if (i != 0) { + double i2; + double ret; + + ret = my_modf(x0-l*f, &i2); + (*iptr) = l*f + i2; + return ret; + } + + (*iptr) = l; + return x - (*iptr); +} + + +static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, + LDOUBLE fvalue, int min, int max, int flags) +{ + int signvalue = 0; + double ufvalue; + char iconvert[311]; + char fconvert[311]; + int iplace = 0; + int fplace = 0; + int padlen = 0; /* amount to pad */ + int zpadlen = 0; + int caps = 0; + int index; + double intpart; + double fracpart; + double temp; + + /* + * AIX manpage says the default is 0, but Solaris says the default + * is 6, and sprintf on AIX defaults to 6 + */ + if (max < 0) + max = 6; + + ufvalue = abs_val (fvalue); + + if (fvalue < 0) { + signvalue = '-'; + } else { + if (flags & DP_F_PLUS) { /* Do a sign (+/i) */ + signvalue = '+'; + } else { + if (flags & DP_F_SPACE) + signvalue = ' '; + } + } + +#if 0 + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ +#endif + +#if 0 + if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */ +#endif + + /* + * Sorry, we only support 16 digits past the decimal because of our + * conversion method + */ + if (max > 16) + max = 16; + + /* We "cheat" by converting the fractional part to integer by + * multiplying by a factor of 10 + */ + + temp = ufvalue; + my_modf(temp, &intpart); + + fracpart = ROUND((POW10(max)) * (ufvalue - intpart)); + + if (fracpart >= POW10(max)) { + intpart++; + fracpart -= POW10(max); + } + + + /* Convert integer part */ + do { + temp = intpart; + my_modf(intpart*0.1, &intpart); + temp = temp*0.1; + index = (int) ((temp -intpart +0.05)* 10.0); + /* index = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */ + /* printf ("%llf, %f, %x\n", temp, intpart, index); */ + iconvert[iplace++] = + (caps? "0123456789ABCDEF":"0123456789abcdef")[index]; + } while (intpart && (iplace < 311)); + if (iplace == 311) iplace--; + iconvert[iplace] = 0; + + /* Convert fractional part */ + if (fracpart) + { + do { + temp = fracpart; + my_modf(fracpart*0.1, &fracpart); + temp = temp*0.1; + index = (int) ((temp -fracpart +0.05)* 10.0); + /* index = (int) ((((temp/10) -fracpart) +0.05) *10); */ + /* printf ("%lf, %lf, %ld\n", temp, fracpart, index); */ + fconvert[fplace++] = + (caps? "0123456789ABCDEF":"0123456789abcdef")[index]; + } while(fracpart && (fplace < 311)); + if (fplace == 311) fplace--; + } + fconvert[fplace] = 0; + + /* -1 for decimal point, another -1 if we are printing a sign */ + padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); + zpadlen = max - fplace; + if (zpadlen < 0) zpadlen = 0; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justifty */ + + if ((flags & DP_F_ZERO) && (padlen > 0)) { + if (signvalue) { + dopr_outch (buffer, currlen, maxlen, signvalue); + --padlen; + signvalue = 0; + } + while (padlen > 0) { + dopr_outch (buffer, currlen, maxlen, '0'); + --padlen; + } + } + while (padlen > 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + --padlen; + } + if (signvalue) + dopr_outch (buffer, currlen, maxlen, signvalue); + + while (iplace > 0) + dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); + +#ifdef DEBUG_SNPRINTF + printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); +#endif + + /* + * Decimal point. This should probably use locale to find the correct + * char to print out. + */ + if (max > 0) { + dopr_outch (buffer, currlen, maxlen, '.'); + + while (fplace > 0) + dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); + } + + while (zpadlen > 0) { + dopr_outch (buffer, currlen, maxlen, '0'); + --zpadlen; + } + + while (padlen < 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++padlen; + } +} + +static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) +{ + if (*currlen < maxlen) { + buffer[(*currlen)] = c; + } + (*currlen)++; +} + +/* yes this really must be a ||. Don't muck with this (tridge) */ +#if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF) + int vsnprintf (char *str, size_t count, const char *fmt, va_list args) +{ + return dopr(str, count, fmt, args); +} +#endif + +/* yes this really must be a ||. Don't muck wiith this (tridge) + * + * The logic for these two is that we need our own definition if the + * OS *either* has no definition of *sprintf, or if it does have one + * that doesn't work properly according to the autoconf test. Perhaps + * these should really be smb_snprintf to avoid conflicts with buggy + * linkers? -- mbp + */ +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_SNPRINTF) + int snprintf(char *str,size_t count,const char *fmt,...) +{ + size_t ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf(str, count, fmt, ap); + va_end(ap); + return ret; +} +#endif + +#endif + +#ifndef HAVE_VASPRINTF + int vasprintf(char **ptr, const char *format, va_list ap) +{ + int ret; + + ret = vsnprintf(0, 0, format, ap); + if (ret <= 0) return ret; + + (*ptr) = (char *)malloc(ret+1); + if (!*ptr) return -1; + ret = vsnprintf(*ptr, ret+1, format, ap); + + return ret; +} +#endif + + +#ifndef HAVE_ASPRINTF + int asprintf(char **ptr, const char *format, ...) +{ + va_list ap; + int ret; + + *ptr = 0; + va_start(ap, format); + ret = vasprintf(ptr, format, ap); + va_end(ap); + + return ret; +} +#endif + +#ifndef HAVE_VSYSLOG +#ifdef HAVE_SYSLOG + void vsyslog (int facility_priority, char *format, va_list arglist) +{ + char *msg = 0; + vasprintf(&msg, format, arglist); + if (!msg) + return; + syslog(facility_priority, "%s", msg); + free(msg); +} +#endif /* HAVE_SYSLOG */ +#endif /* HAVE_VSYSLOG */ + +#ifdef TEST_SNPRINTF + + int sprintf(char *str,const char *fmt,...); + + int main (void) +{ + char buf1[1024]; + char buf2[1024]; + char *fp_fmt[] = { + "%1.1f", + "%-1.5f", + "%1.5f", + "%123.9f", + "%10.5f", + "% 10.5f", + "%+22.9f", + "%+4.9f", + "%01.3f", + "%4f", + "%3.1f", + "%3.2f", + "%.0f", + "%f", + "-16.16f", + 0 + }; + double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996, + 0.9996, 1.996, 4.136, 0}; + char *int_fmt[] = { + "%-1.5d", + "%1.5d", + "%123.9d", + "%5.5d", + "%10.5d", + "% 10.5d", + "%+22.33d", + "%01.3d", + "%4d", + "%d", + 0 + }; + long int_nums[] = { -1, 134, 91340, 341, 0203, 0}; + char *str_fmt[] = { + "10.5s", + "5.10s", + "10.1s", + "0.10s", + "10.0s", + "1.10s", + "%s", + "%.1s", + "%.10s", + "%10s", + 0 + }; + char *str_vals[] = {"hello", "a", "", "a longer string", 0}; + int x, y; + int fail = 0; + int num = 0; + + printf ("Testing snprintf format codes against system sprintf...\n"); + + for (x = 0; fp_fmt[x] ; x++) { + for (y = 0; fp_nums[y] != 0 ; y++) { + int l1 = snprintf(0, 0, fp_fmt[x], fp_nums[y]); + int l2 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]); + sprintf (buf2, fp_fmt[x], fp_nums[y]); + if (strcmp (buf1, buf2)) { + printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", + fp_fmt[x], buf1, buf2); + fail++; + } + if (l1 != l2) { + printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, fp_fmt[x]); + fail++; + } + num++; + } + } + + for (x = 0; int_fmt[x] ; x++) { + for (y = 0; int_nums[y] != 0 ; y++) { + int l1 = snprintf(0, 0, int_fmt[x], int_nums[y]); + int l2 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]); + sprintf (buf2, int_fmt[x], int_nums[y]); + if (strcmp (buf1, buf2)) { + printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", + int_fmt[x], buf1, buf2); + fail++; + } + if (l1 != l2) { + printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, int_fmt[x]); + fail++; + } + num++; + } + } + + for (x = 0; str_fmt[x] ; x++) { + for (y = 0; str_vals[y] != 0 ; y++) { + int l1 = snprintf(0, 0, str_fmt[x], str_vals[y]); + int l2 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]); + sprintf (buf2, str_fmt[x], str_vals[y]); + if (strcmp (buf1, buf2)) { + printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", + str_fmt[x], buf1, buf2); + fail++; + } + if (l1 != l2) { + printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, str_fmt[x]); + fail++; + } + num++; + } + } + + printf ("%d tests failed out of %d.\n", fail, num); + + printf("seeing how many digits we support\n"); + { + double v0 = 0.12345678901234567890123456789012345678901; + for (x=0; x<100; x++) { + snprintf(buf1, sizeof(buf1), "%1.1f", v0*pow(10, x)); + sprintf(buf2, "%1.1f", v0*pow(10, x)); + if (strcmp(buf1, buf2)) { + printf("we seem to support %d digits\n", x-1); + break; + } + } + } + + return 0; +} +#endif /* SNPRINTF_TEST */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/stats.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/stats.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,362 @@ +/* + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* + routines to handle the stats files + + the stats file is stored one per cache subdirectory to make this more + scalable + */ + +#include "ccache.h" + +extern char *stats_file; +extern char *cache_dir; + +#define STATS_VERSION 1 + +#define FLAG_NOZERO 1 /* don't zero with the -z option */ +#define FLAG_ALWAYS 2 /* always show, even if zero */ + +static struct { + enum stats stat; + char *message; + void (*fn)(unsigned ); + unsigned flags; +} stats_info[] = { + { STATS_CACHED, "cache hit ", NULL, FLAG_ALWAYS }, + { STATS_TOCACHE, "cache miss ", NULL, FLAG_ALWAYS }, + { STATS_LINK, "called for link ", NULL, 0 }, + { STATS_MULTIPLE, "multiple source files ", NULL, 0 }, + { STATS_STDOUT, "compiler produced stdout ", NULL, 0 }, + { STATS_STATUS, "compile failed ", NULL, 0 }, + { STATS_ERROR, "ccache internal error ", NULL, 0 }, + { STATS_PREPROCESSOR, "preprocessor error ", NULL, 0 }, + { STATS_COMPILER, "couldn't find the compiler ", NULL, 0 }, + { STATS_MISSING, "cache file missing ", NULL, 0 }, + { STATS_ARGS, "bad compiler arguments ", NULL, 0 }, + { STATS_NOTC, "not a C/C++ file ", NULL, 0 }, + { STATS_CONFTEST, "autoconf compile/link ", NULL, 0 }, + { STATS_UNSUPPORTED, "unsupported compiler option ", NULL, 0 }, + { STATS_OUTSTDOUT, "output to stdout ", NULL, 0 }, + { STATS_DEVICE, "output to a non-regular file ", NULL, 0 }, + { STATS_NOINPUT, "no input file ", NULL, 0 }, + { STATS_ENVIRONMMENT, "error due to bad env variable ", NULL, 0 }, + { STATS_NUMFILES, "files in cache ", NULL, FLAG_NOZERO|FLAG_ALWAYS }, + { STATS_TOTALSIZE, "cache size ", display_size , FLAG_NOZERO|FLAG_ALWAYS }, + { STATS_MAXFILES, "max files ", NULL, FLAG_NOZERO }, + { STATS_MAXSIZE, "max cache size ", display_size, FLAG_NOZERO }, + { STATS_NONE, NULL, NULL, 0 } +}; + +/* parse a stats file from a buffer - adding to the counters */ +static void parse_stats(unsigned counters[STATS_END], char *buf) +{ + int i; + char *p, *p2; + + p = buf; + for (i=0;i<STATS_END;i++) { + counters[i] += strtol(p, &p2, 10); + if (!p2 || p2 == p) break; + p = p2; + } +} + +/* write out a stats file */ +static void write_stats(int fd, unsigned counters[STATS_END]) +{ + int i; + int len = 0; + char buf[1024]; + + for (i=0;i<STATS_END;i++) { + len += snprintf(buf+len, sizeof(buf)-(len+1), "%u ", counters[i]); + if (len >= (int)sizeof(buf)-1) fatal("stats too long?!"); + } + len += snprintf(buf+len, sizeof(buf)-(len+1), "\n"); + if (len >= (int)sizeof(buf)-1) fatal("stats too long?!"); + + lseek(fd, 0, SEEK_SET); + if (write(fd, buf, len) == -1) fatal("could not write stats"); +} + + +/* fill in some default stats values */ +static void stats_default(unsigned counters[STATS_END]) +{ + counters[STATS_MAXSIZE] += DEFAULT_MAXSIZE / 16; +} + +/* read in the stats from one dir and add to the counters */ +static void stats_read_fd(int fd, unsigned counters[STATS_END]) +{ + char buf[1024]; + int len; + len = read(fd, buf, sizeof(buf)-1); + if (len <= 0) { + stats_default(counters); + return; + } + buf[len] = 0; + parse_stats(counters, buf); +} + +/* update the stats counter for this compile */ +static void stats_update_size(enum stats stat, size_t size, size_t numfiles) +{ + int fd; + unsigned counters[STATS_END]; + int need_cleanup = 0; + + if (getenv("CCACHE_NOSTATS")) return; + + if (!stats_file) { + if (!cache_dir) return; + x_asprintf(&stats_file, "%s/stats", cache_dir); + } + + /* open safely to try to prevent symlink races */ + fd = safe_open(stats_file); + + /* still can't get it? don't bother ... */ + if (fd == -1) return; + + memset(counters, 0, sizeof(counters)); + + if (lock_fd(fd) != 0) return; + + /* read in the old stats */ + stats_read_fd(fd, counters); + + /* update them */ + counters[stat]++; + + /* on a cache miss we up the file count and size */ + if (stat == STATS_TOCACHE) { + counters[STATS_NUMFILES] += numfiles; + counters[STATS_TOTALSIZE] += size; + } + + /* and write them out */ + write_stats(fd, counters); + close(fd); + + /* we might need to cleanup if the cache has now got too big */ + if (counters[STATS_MAXFILES] != 0 && + counters[STATS_NUMFILES] > counters[STATS_MAXFILES]) { + need_cleanup = 1; + } + if (counters[STATS_MAXSIZE] != 0 && + counters[STATS_TOTALSIZE] > counters[STATS_MAXSIZE]) { + need_cleanup = 1; + } + + if (need_cleanup) { + char *p = dirname(stats_file); + cleanup_dir(p, counters[STATS_MAXFILES], counters[STATS_MAXSIZE], + numfiles); + free(p); + } +} + +/* record a cache miss */ +void stats_tocache(size_t size, size_t numfiles) +{ + /* convert size to kilobytes */ + size = size / 1024; + + stats_update_size(STATS_TOCACHE, size, numfiles); +} + +/* update a normal stat */ +void stats_update(enum stats stat) +{ + stats_update_size(stat, 0, 0); +} + +/* read in the stats from one dir and add to the counters */ +void stats_read(const char *stats_file, unsigned counters[STATS_END]) +{ + int fd; + + fd = open(stats_file, O_RDONLY|O_BINARY); + if (fd == -1) { + stats_default(counters); + return; + } + lock_fd(fd); + stats_read_fd(fd, counters); + close(fd); +} + +/* sum and display the total stats for all cache dirs */ +void stats_summary(void) +{ + int dir, i; + unsigned counters[STATS_END]; + + memset(counters, 0, sizeof(counters)); + + /* add up the stats in each directory */ + for (dir=-1;dir<=0xF;dir++) { + char *fname; + + if (dir == -1) { + x_asprintf(&fname, "%s/stats", cache_dir); + } else { + x_asprintf(&fname, "%s/%1x/stats", cache_dir, dir); + } + + stats_read(fname, counters); + free(fname); + + /* oh what a nasty hack ... */ + if (dir == -1) { + counters[STATS_MAXSIZE] = 0; + } + + } + + printf("cache directory %s\n", cache_dir); + + /* and display them */ + for (i=0;stats_info[i].message;i++) { + enum stats stat = stats_info[i].stat; + + if (counters[stat] == 0 && + !(stats_info[i].flags & FLAG_ALWAYS)) { + continue; + } + + printf("%s ", stats_info[i].message); + if (stats_info[i].fn) { + stats_info[i].fn(counters[stat]); + printf("\n"); + } else { + printf("%8u\n", counters[stat]); + } + } +} + +/* zero all the stats structures */ +void stats_zero(void) +{ + int dir, fd; + unsigned i; + char *fname; + unsigned counters[STATS_END]; + + x_asprintf(&fname, "%s/stats", cache_dir); + unlink(fname); + free(fname); + + for (dir=0;dir<=0xF;dir++) { + x_asprintf(&fname, "%s/%1x/stats", cache_dir, dir); + fd = safe_open(fname); + if (fd == -1) { + free(fname); + continue; + } + memset(counters, 0, sizeof(counters)); + lock_fd(fd); + stats_read_fd(fd, counters); + for (i=0;stats_info[i].message;i++) { + if (!(stats_info[i].flags & FLAG_NOZERO)) { + counters[stats_info[i].stat] = 0; + } + } + write_stats(fd, counters); + close(fd); + free(fname); + } +} + + +/* set the per directory limits */ +int stats_set_limits(long maxfiles, long maxsize) +{ + int dir; + unsigned counters[STATS_END]; + + if (maxfiles != -1) { + maxfiles /= 16; + } + if (maxsize != -1) { + maxsize /= 16; + } + + if (create_dir(cache_dir) != 0) { + return 1; + } + + /* set the limits in each directory */ + for (dir=0;dir<=0xF;dir++) { + char *fname, *cdir; + int fd; + + x_asprintf(&cdir, "%s/%1x", cache_dir, dir); + if (create_dir(cdir) != 0) { + return 1; + } + x_asprintf(&fname, "%s/stats", cdir); + free(cdir); + + memset(counters, 0, sizeof(counters)); + fd = safe_open(fname); + if (fd != -1) { + lock_fd(fd); + stats_read_fd(fd, counters); + if (maxfiles != -1) { + counters[STATS_MAXFILES] = maxfiles; + } + if (maxsize != -1) { + counters[STATS_MAXSIZE] = maxsize; + } + write_stats(fd, counters); + close(fd); + } + free(fname); + } + + return 0; +} + +/* set the per directory sizes */ +void stats_set_sizes(const char *dir, size_t num_files, size_t total_size) +{ + int fd; + unsigned counters[STATS_END]; + char *stats_file; + + create_dir(dir); + x_asprintf(&stats_file, "%s/stats", dir); + + memset(counters, 0, sizeof(counters)); + + fd = safe_open(stats_file); + if (fd != -1) { + lock_fd(fd); + stats_read_fd(fd, counters); + counters[STATS_NUMFILES] = num_files; + counters[STATS_TOTALSIZE] = total_size; + write_stats(fd, counters); + close(fd); + } + + free(stats_file); +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/test.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/test.sh Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,452 @@ +#!/bin/sh + +# a simple test suite for ccache +# tridge@samba.org + +if test -n "$CC"; then + COMPILER="$CC" +else + COMPILER=cc +fi + +if test -n "$SWIG"; then + SWIG="$SWIG" +else + SWIG=swig +fi + +CCACHE=../ccache-swig +TESTDIR=test.$$ + +test_failed() { + reason="$1" + echo $1 + $CCACHE -s + cd .. + rm -rf $TESTDIR + echo TEST FAILED + exit 1 +} + +randcode() { + outfile="$1" + nlines=$2 + i=0; + ( + while [ $i -lt $nlines ]; do + echo "int foo$nlines$i(int x) { return x; }" + i=`expr $i + 1` + done + ) >> "$outfile" +} + +genswigcode() { + outfile="$1" + nlines=$2 + i=0; + ( + echo "%module swigtest$2;" + while [ $i -lt $nlines ]; do + echo "int foo$nlines$i(int x);" + echo "struct Bar$nlines$i { int y; };" + i=`expr $i + 1` + done + ) >> "$outfile" +} + + +getstat() { + stat="$1" + value=`$CCACHE -s | grep "$stat" | cut -c34-40` + echo $value +} + +checkstat() { + stat="$1" + expected_value="$2" + value=`getstat "$stat"` +# echo "exp: $expected_value got: $value $testname" + if [ "$expected_value" != "$value" ]; then + test_failed "SUITE: $testsuite TEST: $testname - Expected $stat to be $expected_value got $value" + fi +} + + +basetests() { + echo "starting testsuite $testsuite" + rm -rf "$CCACHE_DIR" + checkstat 'cache hit' 0 + checkstat 'cache miss' 0 + + j=1 + rm -f *.c + while [ $j -lt 32 ]; do + randcode test$j.c $j + j=`expr $j + 1` + done + + testname="BASIC" + $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 0 + checkstat 'cache miss' 1 + + testname="BASIC2" + $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 1 + checkstat 'cache miss' 1 + + testname="debug" + $CCACHE_COMPILE -c test1.c -g + checkstat 'cache hit' 1 + checkstat 'cache miss' 2 + + testname="debug2" + $CCACHE_COMPILE -c test1.c -g + checkstat 'cache hit' 2 + checkstat 'cache miss' 2 + + testname="output" + $CCACHE_COMPILE -c test1.c -o foo.o + checkstat 'cache hit' 3 + checkstat 'cache miss' 2 + + testname="link" + $CCACHE_COMPILE test1.c -o test 2> /dev/null + checkstat 'called for link' 1 + + testname="multiple" + $CCACHE_COMPILE -c test1.c test2.c + checkstat 'multiple source files' 1 + + testname="find" + $CCACHE blahblah -c test1.c 2> /dev/null + checkstat "couldn't find the compiler" 1 + + testname="bad" + $CCACHE_COMPILE -c test1.c -I 2> /dev/null + checkstat 'bad compiler arguments' 1 + + testname="c/c++" + ln -f test1.c test1.ccc + $CCACHE_COMPILE -c test1.ccc 2> /dev/null + checkstat 'not a C/C++ file' 1 + + testname="unsupported" + $CCACHE_COMPILE -M foo -c test1.c > /dev/null 2>&1 + checkstat 'unsupported compiler option' 1 + + testname="stdout" + $CCACHE echo foo -c test1.c > /dev/null + checkstat 'compiler produced stdout' 1 + + testname="non-regular" + mkdir testd + $CCACHE_COMPILE -o testd -c test1.c > /dev/null 2>&1 + rm -rf testd + checkstat 'output to a non-regular file' 1 + + testname="no-input" + $CCACHE_COMPILE -c -O2 2> /dev/null + checkstat 'no input file' 1 + + + testname="CCACHE_DISABLE" + CCACHE_DISABLE=1 $CCACHE_COMPILE -c test1.c 2> /dev/null + checkstat 'cache hit' 3 + $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 4 + + testname="CCACHE_CPP2" + CCACHE_CPP2=1 $CCACHE_COMPILE -c test1.c -O -O + checkstat 'cache hit' 4 + checkstat 'cache miss' 3 + + CCACHE_CPP2=1 $CCACHE_COMPILE -c test1.c -O -O + checkstat 'cache hit' 5 + checkstat 'cache miss' 3 + + testname="CCACHE_NOSTATS" + CCACHE_NOSTATS=1 $CCACHE_COMPILE -c test1.c -O -O + checkstat 'cache hit' 5 + checkstat 'cache miss' 3 + + testname="CCACHE_RECACHE" + CCACHE_RECACHE=1 $CCACHE_COMPILE -c test1.c -O -O + checkstat 'cache hit' 5 + checkstat 'cache miss' 4 + + # strictly speaking should be 6 - RECACHE causes a double counting! + checkstat 'files in cache' 8 + $CCACHE -c > /dev/null + checkstat 'files in cache' 6 + + + testname="CCACHE_HASHDIR" + CCACHE_HASHDIR=1 $CCACHE_COMPILE -c test1.c -O -O + checkstat 'cache hit' 5 + checkstat 'cache miss' 5 + + CCACHE_HASHDIR=1 $CCACHE_COMPILE -c test1.c -O -O + checkstat 'cache hit' 6 + checkstat 'cache miss' 5 + + checkstat 'files in cache' 8 + + testname="comments" + echo '/* a silly comment */' > test1-comment.c + cat test1.c >> test1-comment.c + $CCACHE_COMPILE -c test1-comment.c + rm -f test1-comment* + checkstat 'cache hit' 6 + checkstat 'cache miss' 6 + + testname="CCACHE_UNIFY" + CCACHE_UNIFY=1 $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 6 + checkstat 'cache miss' 7 + mv test1.c test1-saved.c + echo '/* another comment */' > test1.c + cat test1-saved.c >> test1.c + CCACHE_UNIFY=1 $CCACHE_COMPILE -c test1.c + mv test1-saved.c test1.c + checkstat 'cache hit' 7 + checkstat 'cache miss' 7 + + testname="cache-size" + for f in *.c; do + $CCACHE_COMPILE -c $f + done + checkstat 'cache hit' 8 + checkstat 'cache miss' 37 + checkstat 'files in cache' 72 + $CCACHE -F 48 -c > /dev/null + if [ `getstat 'files in cache'` -gt 48 ]; then + test_failed '-F test failed' + fi + + testname="cpp call" + $CCACHE_COMPILE -c test1.c -E > test1.i + checkstat 'cache hit' 8 + checkstat 'cache miss' 37 + + testname="direct .i compile" + $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 8 + checkstat 'cache miss' 38 + + $CCACHE_COMPILE -c test1.i + checkstat 'cache hit' 9 + checkstat 'cache miss' 38 + + $CCACHE_COMPILE -c test1.i + checkstat 'cache hit' 10 + checkstat 'cache miss' 38 + + # removed these tests as some compilers (including newer versions of gcc) + # determine which language to use based on .ii/.i extension, and C++ may + # not be installed +# testname="direct .ii file" +# mv test1.i test1.ii +# $CCACHE_COMPILE -c test1.ii +# checkstat 'cache hit' 10 +# checkstat 'cache miss' 39 + +# $CCACHE_COMPILE -c test1.ii +# checkstat 'cache hit' 11 +# checkstat 'cache miss' 39 + + testname="stripc" # This test might not be portable + CCACHE_STRIPC=1 $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 10 + checkstat 'cache miss' 39 + + CCACHE_STRIPC=1 $CCACHE_COMPILE -c test1.c + checkstat 'cache hit' 11 + checkstat 'cache miss' 39 + + testname="zero-stats" + $CCACHE -z > /dev/null + checkstat 'cache hit' 0 + checkstat 'cache miss' 0 + + testname="clear" + $CCACHE -C > /dev/null + checkstat 'files in cache' 0 + + + rm -f test1.c +} + +swigtests() { + echo "starting swig testsuite $testsuite" + rm -rf "$CCACHE_DIR" + checkstat 'cache hit' 0 + checkstat 'cache miss' 0 + + j=1 + rm -f *.i + genswigcode testswig1.i 1 + + testname="BASIC" + $CCACHE_COMPILE -java testswig1.i + checkstat 'cache hit' 0 + checkstat 'cache miss' 1 + + checkstat 'files in cache' 6 + + testname="BASIC2" + $CCACHE_COMPILE -java testswig1.i + checkstat 'cache hit' 1 + checkstat 'cache miss' 1 + + testname="output" + $CCACHE_COMPILE -java testswig1.i -o foo_wrap.c + checkstat 'cache hit' 1 + checkstat 'cache miss' 2 + + testname="bad" + $CCACHE_COMPILE -java testswig1.i -I 2> /dev/null + checkstat 'bad compiler arguments' 1 + + testname="stdout" + $CCACHE_COMPILE -v -java testswig1.i > /dev/null + checkstat 'compiler produced stdout' 1 + + testname="non-regular" + mkdir testd + $CCACHE_COMPILE -o testd -java testswig1.i > /dev/null 2>&1 + rm -rf testd + checkstat 'output to a non-regular file' 1 + + testname="no-input" + $CCACHE_COMPILE -java 2> /dev/null + checkstat 'no input file' 1 + + + testname="CCACHE_DISABLE" + CCACHE_DISABLE=1 $CCACHE_COMPILE -java testswig1.i 2> /dev/null + checkstat 'cache hit' 1 + $CCACHE_COMPILE -java testswig1.i + checkstat 'cache hit' 2 + + testname="CCACHE_CPP2" + CCACHE_CPP2=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 2 + checkstat 'cache miss' 3 + + CCACHE_CPP2=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 3 + checkstat 'cache miss' 3 + + testname="CCACHE_NOSTATS" + CCACHE_NOSTATS=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 3 + checkstat 'cache miss' 3 + + testname="CCACHE_RECACHE" + CCACHE_RECACHE=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 3 + checkstat 'cache miss' 4 + + # strictly speaking should be 3x6=18 instead of 4x6=24 - RECACHE causes a double counting! + checkstat 'files in cache' 24 + $CCACHE -c > /dev/null + checkstat 'files in cache' 18 + + + testname="CCACHE_HASHDIR" + CCACHE_HASHDIR=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 3 + checkstat 'cache miss' 5 + + CCACHE_HASHDIR=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 4 + checkstat 'cache miss' 5 + + checkstat 'files in cache' 24 + + testname="cpp call" + $CCACHE_COMPILE -java -E testswig1.i > testswig1-preproc.i + checkstat 'cache hit' 4 + checkstat 'cache miss' 5 + + testname="direct .i compile" + $CCACHE_COMPILE -java testswig1.i + checkstat 'cache hit' 5 + checkstat 'cache miss' 5 + + # No cache hit due to different input file name, -nopreprocess should not be given twice to SWIG + $CCACHE_COMPILE -java -nopreprocess testswig1-preproc.i + checkstat 'cache hit' 5 + checkstat 'cache miss' 6 + + $CCACHE_COMPILE -java -nopreprocess testswig1-preproc.i + checkstat 'cache hit' 6 + checkstat 'cache miss' 6 + + testname="stripc" + CCACHE_STRIPC=1 $CCACHE_COMPILE -java -O -O testswig1.i + checkstat 'cache hit' 7 + checkstat 'cache miss' 6 + + CCACHE_STRIPC=1 $CCACHE_COMPILE -java -O -O -O testswig1.i + checkstat 'cache hit' 7 + checkstat 'cache miss' 7 + + rm -f testswig1-preproc.i + rm -f testswig1.i +} + +###### +# main program +rm -rf $TESTDIR +mkdir $TESTDIR +cd $TESTDIR || exit 1 +CCACHE_DIR="ccache dir" # with space in directory name (like Windows default) +mkdir "$CCACHE_DIR" +export CCACHE_DIR + +testsuite="base" +CCACHE_COMPILE="$CCACHE $COMPILER" +basetests +CCACHE_COMPILE="$CCACHE $SWIG" +swigtests + +if test -z "$NOSOFTLINKSTEST"; then + testsuite="link" + ln -s $CCACHE $COMPILER + CCACHE_COMPILE="./$COMPILER" + basetests + rm "./$COMPILER" + ln -s $CCACHE $SWIG + CCACHE_COMPILE="./$SWIG" + swigtests + rm "./$SWIG" +else + echo "skipping testsuite link" +fi + +testsuite="hardlink" +CCACHE_COMPILE="env CCACHE_NOCOMPRESS=1 CCACHE_HARDLINK=1 $CCACHE $COMPILER" +basetests +CCACHE_COMPILE="env CCACHE_NOCOMPRESS=1 CCACHE_HARDLINK=1 $CCACHE $SWIG" +swigtests + +testsuite="cpp2" +CCACHE_COMPILE="env CCACHE_CPP2=1 $CCACHE $COMPILER" +basetests +CCACHE_COMPILE="env CCACHE_CPP2=1 $CCACHE $SWIG" +swigtests + +testsuite="nlevels4" +CCACHE_COMPILE="env CCACHE_NLEVELS=4 $CCACHE $COMPILER" +basetests + +testsuite="nlevels1" +CCACHE_COMPILE="env CCACHE_NLEVELS=1 $CCACHE $COMPILER" +basetests + +cd .. +rm -rf $TESTDIR +echo test done - OK +exit 0 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/unify.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/unify.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,307 @@ +/* + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ +/* + C/C++ unifier + + the idea is that changes that don't affect the resulting C code + should not change the hash. This is achieved by folding white-space + and other non-semantic fluff in the input into a single unified format. + + This unifier was design to match the output of the unifier in + compilercache, which is flex based. The major difference is that + this unifier is much faster (about 2x) and more forgiving of + syntactic errors. Continuing on syntactic errors is important to + cope with C/C++ extensions in the local compiler (for example, + inline assembly systems). +*/ + +#include "ccache.h" + +static char *s_tokens[] = { + "...", ">>=", "<<=", "+=", "-=", "*=", "/=", "%=", "&=", "^=", + "|=", ">>", "<<", "++", "--", "->", "&&", "||", "<=", ">=", + "==", "!=", ";", "{", "<%", "}", "%>", ",", ":", "=", + "(", ")", "[", "<:", "]", ":>", ".", "&", "!", "~", + "-", "+", "*", "/", "%", "<", ">", "^", "|", "?", + 0 +}; + +#define C_ALPHA 1 +#define C_SPACE 2 +#define C_TOKEN 4 +#define C_QUOTE 8 +#define C_DIGIT 16 +#define C_HEX 32 +#define C_FLOAT 64 +#define C_SIGN 128 + +static struct { + unsigned char type; + unsigned char num_toks; + char *toks[7]; +} tokens[256]; + +/* build up the table used by the unifier */ +static void build_table(void) +{ + unsigned char c; + int i; + static int done; + + if (done) return; + done = 1; + + memset(tokens, 0, sizeof(tokens)); + for (c=0;c<128;c++) { + if (isalpha(c) || c == '_') tokens[c].type |= C_ALPHA; + if (isdigit(c)) tokens[c].type |= C_DIGIT; + if (isspace(c)) tokens[c].type |= C_SPACE; + if (isxdigit(c)) tokens[c].type |= C_HEX; + } + tokens['\''].type |= C_QUOTE; + tokens['"'].type |= C_QUOTE; + tokens['l'].type |= C_FLOAT; + tokens['L'].type |= C_FLOAT; + tokens['f'].type |= C_FLOAT; + tokens['F'].type |= C_FLOAT; + tokens['U'].type |= C_FLOAT; + tokens['u'].type |= C_FLOAT; + + tokens['-'].type |= C_SIGN; + tokens['+'].type |= C_SIGN; + + for (i=0;s_tokens[i];i++) { + c = s_tokens[i][0]; + tokens[c].type |= C_TOKEN; + tokens[c].toks[tokens[c].num_toks] = s_tokens[i]; + tokens[c].num_toks++; + } +} + +/* buffer up characters before hashing them */ +static void pushchar(unsigned char c) +{ + static unsigned char buf[64]; + static int len; + + if (c == 0) { + if (len > 0) { + hash_buffer((char *)buf, len); + len = 0; + } + hash_buffer(NULL, 0); + return; + } + + buf[len++] = c; + if (len == 64) { + hash_buffer((char *)buf, len); + len = 0; + } +} + +/* hash some C/C++ code after unifying */ +static void unify(unsigned char *p, size_t size) +{ + size_t ofs; + unsigned char q; + int i; + + build_table(); + + for (ofs=0; ofs<size;) { + if (p[ofs] == '#') { + if ((size-ofs) > 2 && p[ofs+1] == ' ' && isdigit(p[ofs+2])) { + do { + ofs++; + } while (ofs < size && p[ofs] != '\n'); + ofs++; + } else { + do { + pushchar(p[ofs]); + ofs++; + } while (ofs < size && p[ofs] != '\n'); + pushchar('\n'); + ofs++; + } + continue; + } + + if (tokens[p[ofs]].type & C_ALPHA) { + do { + pushchar(p[ofs]); + ofs++; + } while (ofs < size && + (tokens[p[ofs]].type & (C_ALPHA|C_DIGIT))); + pushchar('\n'); + continue; + } + + if (tokens[p[ofs]].type & C_DIGIT) { + do { + pushchar(p[ofs]); + ofs++; + } while (ofs < size && + ((tokens[p[ofs]].type & C_DIGIT) || p[ofs] == '.')); + if (ofs < size && (p[ofs] == 'x' || p[ofs] == 'X')) { + do { + pushchar(p[ofs]); + ofs++; + } while (ofs < size && (tokens[p[ofs]].type & C_HEX)); + } + if (ofs < size && (p[ofs] == 'E' || p[ofs] == 'e')) { + pushchar(p[ofs]); + ofs++; + while (ofs < size && + (tokens[p[ofs]].type & (C_DIGIT|C_SIGN))) { + pushchar(p[ofs]); + ofs++; + } + } + while (ofs < size && (tokens[p[ofs]].type & C_FLOAT)) { + pushchar(p[ofs]); + ofs++; + } + pushchar('\n'); + continue; + } + + if (tokens[p[ofs]].type & C_SPACE) { + do { + ofs++; + } while (ofs < size && (tokens[p[ofs]].type & C_SPACE)); + continue; + } + + if (tokens[p[ofs]].type & C_QUOTE) { + q = p[ofs]; + pushchar(p[ofs]); + do { + ofs++; + while (ofs < size-1 && p[ofs] == '\\') { + pushchar(p[ofs]); + pushchar(p[ofs+1]); + ofs+=2; + } + pushchar(p[ofs]); + } while (ofs < size && p[ofs] != q); + pushchar('\n'); + ofs++; + continue; + } + + if (tokens[p[ofs]].type & C_TOKEN) { + q = p[ofs]; + for (i=0;i<tokens[q].num_toks;i++) { + unsigned char *s = (unsigned char *)tokens[q].toks[i]; + int len = strlen((char *)s); + if (size >= ofs+len && memcmp(&p[ofs], s, len) == 0) { + int j; + for (j=0;s[j];j++) { + pushchar(s[j]); + ofs++; + } + pushchar('\n'); + break; + } + } + if (i < tokens[q].num_toks) { + continue; + } + } + + pushchar(p[ofs]); + pushchar('\n'); + ofs++; + } + pushchar(0); +} + + +/* hash a file that consists of preprocessor output, but remove any line + number information from the hash +*/ +int unify_hash(const char *fname) +{ +#ifdef _WIN32 + HANDLE file; + HANDLE section; + DWORD filesize_low; + char *map; + int ret = -1; + + file = CreateFileA(fname, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, 0, NULL); + if (file != INVALID_HANDLE_VALUE) { + filesize_low = GetFileSize(file, NULL); + if (!(filesize_low == INVALID_FILE_SIZE && GetLastError() != NO_ERROR)) { + section = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL); + CloseHandle(file); + if (section != NULL) { + map = MapViewOfFile(section, FILE_MAP_READ, 0, 0, 0); + CloseHandle(section); + if (map != NULL) + ret = 0; + } + } + } + + if (ret == -1) { + cc_log("Failed to open preprocessor output %s\n", fname); + stats_update(STATS_PREPROCESSOR); + return -1; + } + + /* pass it through the unifier */ + unify((unsigned char *)map, filesize_low); + + UnmapViewOfFile(map); + + return 0; +#else + int fd; + struct stat st; + char *map; + + fd = open(fname, O_RDONLY|O_BINARY); + if (fd == -1 || fstat(fd, &st) != 0) { + cc_log("Failed to open preprocessor output %s\n", fname); + stats_update(STATS_PREPROCESSOR); + return -1; + } + + /* we use mmap() to make it easy to handle arbitrarily long + lines in preprocessor output. I have seen lines of over + 100k in length, so this is well worth it */ + map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + if (map == (char *)-1) { + cc_log("Failed to mmap %s\n", fname); + stats_update(STATS_PREPROCESSOR); + return -1; + } + close(fd); + + /* pass it through the unifier */ + unify((unsigned char *)map, st.st_size); + + munmap(map, st.st_size); + + return 0; +#endif +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/util.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/util.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,884 @@ +/* + Copyright (C) Andrew Tridgell 2002 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "ccache.h" + +static FILE *logfile; + +/* log a message to the CCACHE_LOGFILE location */ +void cc_log(const char *format, ...) +{ + va_list ap; + extern char *cache_logfile; + + if (!cache_logfile) return; + + if (!logfile) logfile = fopen(cache_logfile, "a"); + if (!logfile) return; + + va_start(ap, format); + vfprintf(logfile, format, ap); + va_end(ap); + fflush(logfile); +} + +/* something went badly wrong! */ +void fatal(const char *msg) +{ + cc_log("FATAL: %s\n", msg); + exit(1); +} + +int safe_rename(const char* oldpath, const char* newpath) +{ + /* safe_rename is for creating entries in the cache. + + Works like rename(), but it never overwrites an existing + cache entry. This avoids corruption on NFS. */ +#ifndef _WIN32 + int status = link(oldpath, newpath); + if( status == 0 || errno == EEXIST ) +#else + int status = CreateHardLinkA(newpath, oldpath, NULL) ? 0 : -1; + if( status == 0 || GetLastError() == ERROR_ALREADY_EXISTS ) +#endif + { + return unlink( oldpath ); + } + else + { + return -1; + } +} + +#ifndef ENABLE_ZLIB +/* copy all data from one file descriptor to another */ +void copy_fd(int fd_in, int fd_out) +{ + char buf[10240]; + int n; + + while ((n = read(fd_in, buf, sizeof(buf))) > 0) { + if (write(fd_out, buf, n) != n) { + fatal("Failed to copy fd"); + } + } +} + +#ifndef HAVE_MKSTEMP +/* cheap and nasty mkstemp replacement */ +int mkstemp(char *template) +{ + mktemp(template); + return open(template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600); +} +#endif + +/* move a file using rename */ +int move_file(const char *src, const char *dest) { + return safe_rename(src, dest); +} + +/* copy a file - used when hard links don't work + the copy is done via a temporary file and atomic rename +*/ +static int copy_file(const char *src, const char *dest) +{ + int fd1, fd2; + char buf[10240]; + int n; + char *tmp_name; + mode_t mask; + + x_asprintf(&tmp_name, "%s.XXXXXX", dest); + + fd1 = open(src, O_RDONLY|O_BINARY); + if (fd1 == -1) { + free(tmp_name); + return -1; + } + + fd2 = mkstemp(tmp_name); + if (fd2 == -1) { + close(fd1); + free(tmp_name); + return -1; + } + + while ((n = read(fd1, buf, sizeof(buf))) > 0) { + if (write(fd2, buf, n) != n) { + close(fd2); + close(fd1); + unlink(tmp_name); + free(tmp_name); + return -1; + } + } + + close(fd1); + + /* get perms right on the tmp file */ +#ifndef _WIN32 + mask = umask(0); + fchmod(fd2, 0666 & ~mask); + umask(mask); +#else + (void)mask; +#endif + + /* the close can fail on NFS if out of space */ + if (close(fd2) == -1) { + unlink(tmp_name); + free(tmp_name); + return -1; + } + + unlink(dest); + + if (rename(tmp_name, dest) == -1) { + unlink(tmp_name); + free(tmp_name); + return -1; + } + + free(tmp_name); + + return 0; +} + +/* copy a file to the cache */ +static int copy_file_to_cache(const char *src, const char *dest) { + return copy_file(src, dest); +} + +/* copy a file from the cache */ +static int copy_file_from_cache(const char *src, const char *dest) { + return copy_file(src, dest); +} + +#else /* ENABLE_ZLIB */ + +/* copy all data from one file descriptor to another + possibly decompressing it +*/ +void copy_fd(int fd_in, int fd_out) { + char buf[10240]; + int n; + gzFile gz_in; + + gz_in = gzdopen(dup(fd_in), "rb"); + + if (!gz_in) { + fatal("Failed to copy fd"); + } + + while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) { + if (write(fd_out, buf, n) != n) { + fatal("Failed to copy fd"); + } + } +} + +static int _copy_file(const char *src, const char *dest, int mode) { + int fd_in, fd_out; + gzFile gz_in, gz_out = NULL; + char buf[10240]; + int n, ret; + char *tmp_name; + mode_t mask; + struct stat st; + + x_asprintf(&tmp_name, "%s.XXXXXX", dest); + + if (getenv("CCACHE_NOCOMPRESS")) { + mode = COPY_UNCOMPRESSED; + } + + /* open source file */ + fd_in = open(src, O_RDONLY); + if (fd_in == -1) { + return -1; + } + + gz_in = gzdopen(fd_in, "rb"); + if (!gz_in) { + close(fd_in); + return -1; + } + + /* open destination file */ + fd_out = mkstemp(tmp_name); + if (fd_out == -1) { + gzclose(gz_in); + free(tmp_name); + return -1; + } + + if (mode == COPY_TO_CACHE) { + /* The gzip file format occupies at least 20 bytes. So + it will always occupy an entire filesystem block, + even for empty files. + Since most stderr files will be empty, we turn off + compression in this case to save space. + */ + if (fstat(fd_in, &st) != 0) { + gzclose(gz_in); + close(fd_out); + free(tmp_name); + return -1; + } + if (file_size(&st) == 0) { + mode = COPY_UNCOMPRESSED; + } + } + + if (mode == COPY_TO_CACHE) { + gz_out = gzdopen(dup(fd_out), "wb"); + if (!gz_out) { + gzclose(gz_in); + close(fd_out); + free(tmp_name); + return -1; + } + } + + while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) { + if (mode == COPY_TO_CACHE) { + ret = gzwrite(gz_out, buf, n); + } else { + ret = write(fd_out, buf, n); + } + if (ret != n) { + gzclose(gz_in); + if (gz_out) { + gzclose(gz_out); + } + close(fd_out); + unlink(tmp_name); + free(tmp_name); + return -1; + } + } + + gzclose(gz_in); + if (gz_out) { + gzclose(gz_out); + } + + /* get perms right on the tmp file */ + mask = umask(0); + fchmod(fd_out, 0666 & ~mask); + umask(mask); + + /* the close can fail on NFS if out of space */ + if (close(fd_out) == -1) { + unlink(tmp_name); + free(tmp_name); + return -1; + } + + unlink(dest); + + if (rename(tmp_name, dest) == -1) { + unlink(tmp_name); + free(tmp_name); + return -1; + } + + free(tmp_name); + + return 0; +} + +/* move a file to the cache, compressing it */ +int move_file(const char *src, const char *dest) { + int ret; + + ret = _copy_file(src, dest, COPY_TO_CACHE); + if (ret != -1) unlink(src); + return ret; +} + +/* copy a file to the cache, compressing it */ +static int copy_file_to_cache(const char *src, const char *dest) { + return _copy_file(src, dest, COPY_TO_CACHE); +} + +/* copy a file from the cache, decompressing it */ +static int copy_file_from_cache(const char *src, const char *dest) { + return _copy_file(src, dest, COPY_FROM_CACHE); +} +#endif /* ENABLE_ZLIB */ + +/* test if a file is zlib compressed */ +int test_if_compressed(const char *filename) { + FILE *f; + + f = fopen(filename, "rb"); + if (!f) { + return 0; + } + + /* test if file starts with 1F8B, which is zlib's + * magic number */ + if ((fgetc(f) != 0x1f) || (fgetc(f) != 0x8b)) { + fclose(f); + return 0; + } + + fclose(f); + return 1; +} + +/* copy file to the cache with error checking taking into account compression and hard linking if desired */ +int commit_to_cache(const char *src, const char *dest, int hardlink) +{ + int ret = -1; + struct stat st; + if (stat(src, &st) == 0) { + unlink(dest); + if (hardlink) { +#ifdef _WIN32 + ret = CreateHardLinkA(dest, src, NULL) ? 0 : -1; +#else + ret = link(src, dest); +#endif + } + if (ret == -1) { + ret = copy_file_to_cache(src, dest); + if (ret == -1) { + cc_log("failed to commit %s -> %s (%s)\n", src, dest, strerror(errno)); + stats_update(STATS_ERROR); + } + } + } else { + cc_log("failed to put %s in the cache (%s)\n", src, strerror(errno)); + stats_update(STATS_ERROR); + } + return ret; +} + +/* copy file out of the cache with error checking taking into account compression and hard linking if desired */ +int retrieve_from_cache(const char *src, const char *dest, int hardlink) +{ + int ret = 0; + + x_utimes(src); + + if (strcmp(dest, "/dev/null") == 0) { + ret = 0; + } else { + unlink(dest); + /* only make a hardlink if the cache file is uncompressed */ + if (hardlink && test_if_compressed(src) == 0) { +#ifdef _WIN32 + ret = CreateHardLinkA(dest, src, NULL) ? 0 : -1; +#else + ret = link(src, dest); +#endif + } else { + ret = copy_file_from_cache(src, dest); + } + } + + /* the cached file might have been deleted by some external process */ + if (ret == -1 && errno == ENOENT) { + cc_log("hashfile missing for %s\n", dest); + stats_update(STATS_MISSING); + return -1; + } + + if (ret == -1) { + ret = copy_file_from_cache(src, dest); + if (ret == -1) { + cc_log("failed to retrieve %s -> %s (%s)\n", src, dest, strerror(errno)); + stats_update(STATS_ERROR); + return -1; + } + } + return ret; +} + +/* make sure a directory exists */ +int create_dir(const char *dir) +{ + struct stat st; + if (stat(dir, &st) == 0) { + if (S_ISDIR(st.st_mode)) { + return 0; + } + errno = ENOTDIR; + return 1; + } +#ifdef _WIN32 + if (mkdir(dir) != 0 && errno != EEXIST) { + return 1; + } +#else + if (mkdir(dir, 0777) != 0 && errno != EEXIST) { + return 1; + } +#endif + return 0; +} + +char const CACHEDIR_TAG[] = + "Signature: 8a477f597d28d172789f06886806bc55\n" + "# This file is a cache directory tag created by ccache.\n" + "# For information about cache directory tags, see:\n" + "# http://www.brynosaurus.com/cachedir/\n"; + +int create_cachedirtag(const char *dir) +{ + char *filename; + struct stat st; + FILE *f; + x_asprintf(&filename, "%s/CACHEDIR.TAG", dir); + if (stat(filename, &st) == 0) { + if (S_ISREG(st.st_mode)) { + goto success; + } + errno = EEXIST; + goto error; + } + f = fopen(filename, "w"); + if (!f) goto error; + if (fwrite(CACHEDIR_TAG, sizeof(CACHEDIR_TAG)-1, 1, f) != 1) { + goto error; + } + if (fclose(f)) goto error; +success: + free(filename); + return 0; +error: + free(filename); + return 1; +} + +/* + this is like asprintf() but dies if the malloc fails + note that we use vsnprintf in a rather poor way to make this more portable +*/ +void x_asprintf(char **ptr, const char *format, ...) +{ + va_list ap; + + *ptr = NULL; + va_start(ap, format); + if (vasprintf(ptr, format, ap) == -1) { + fatal("out of memory in x_asprintf"); + } + va_end(ap); + + if (!ptr) fatal("out of memory in x_asprintf"); +} + +/* + this is like strdup() but dies if the malloc fails +*/ +char *x_strdup(const char *s) +{ + char *ret; + ret = strdup(s); + if (!ret) { + fatal("out of memory in strdup\n"); + } + return ret; +} + +/* + this is like malloc() but dies if the malloc fails +*/ +void *x_malloc(size_t size) +{ + void *ret; + ret = malloc(size); + if (!ret) { + fatal("out of memory in malloc\n"); + } + return ret; +} + +/* + this is like realloc() but dies if the malloc fails +*/ +void *x_realloc(void *ptr, size_t size) +{ + void *p2; +#if 1 + /* Avoid invalid read in memcpy below */ + p2 = realloc(ptr, size); + if (!p2) { + fatal("out of memory in x_realloc"); + } +#else + if (!ptr) return x_malloc(size); + p2 = malloc(size); + if (!p2) { + fatal("out of memory in x_realloc"); + } + if (ptr) { + /* Note invalid read as the memcpy reads beyond the memory allocated by ptr */ + memcpy(p2, ptr, size); + free(ptr); + } +#endif + return p2; +} + + +/* + revsusive directory traversal - used for cleanup + fn() is called on all files/dirs in the tree + */ +void traverse(const char *dir, void (*fn)(const char *, struct stat *)) +{ + DIR *d; + struct dirent *de; + + d = opendir(dir); + if (!d) return; + + while ((de = readdir(d))) { + char *fname; + struct stat st; + + if (strcmp(de->d_name,".") == 0) continue; + if (strcmp(de->d_name,"..") == 0) continue; + + if (strlen(de->d_name) == 0) continue; + + x_asprintf(&fname, "%s/%s", dir, de->d_name); +#ifdef _WIN32 + if (stat(fname, &st)) +#else + if (lstat(fname, &st)) +#endif + { + if (errno != ENOENT) { + perror(fname); + } + free(fname); + continue; + } + + if (S_ISDIR(st.st_mode)) { + traverse(fname, fn); + } + + fn(fname, &st); + free(fname); + } + + closedir(d); +} + + +/* return the base name of a file - caller frees */ +char *str_basename(const char *s) +{ + char *p = strrchr(s, '/'); + if (p) { + s = (p+1); + } + +#ifdef _WIN32 + p = strrchr(s, '\\'); + + if (p) { + s = (p+1); + } +#endif + + return x_strdup(s); +} + +/* return the dir name of a file - caller frees */ +char *dirname(char *s) +{ + char *p; + s = x_strdup(s); + p = strrchr(s, '/'); +#ifdef _WIN32 + p = strrchr(s, '\\'); +#endif + if (p) { + *p = 0; + } + return s; +} + +/* + http://www.ecst.csuchico.edu/~beej/guide/ipc/flock.html + http://cvs.php.net/viewvc.cgi/php-src/win32/flock.c?revision=1.2&view=markup + Should return 0 for success, >0 otherwise + */ +int lock_fd(int fd) +{ +#ifdef _WIN32 +# if 1 + return _locking(fd, _LK_NBLCK, 1); +# else + HANDLE fl = (HANDLE)_get_osfhandle(fd); + OVERLAPPED o; + memset(&o, 0, sizeof(o)); + return (LockFileEx(fl, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &o)) + ? 0 : GetLastError(); +# endif +#else + struct flock fl; + int ret; + + fl.l_type = F_WRLCK; + fl.l_whence = SEEK_SET; + fl.l_start = 0; + fl.l_len = 1; + fl.l_pid = 0; + + /* not sure why we would be getting a signal here, + but one user claimed it is possible */ + do { + ret = fcntl(fd, F_SETLKW, &fl); + } while (ret == -1 && errno == EINTR); + return ret; +#endif +} + +/* return size on disk of a file */ +size_t file_size(struct stat *st) +{ +#ifdef _WIN32 + return (st->st_size + 1023) & ~1023; +#else + size_t size = st->st_blocks * 512; + if ((size_t)st->st_size > size) { + /* probably a broken stat() call ... */ + size = (st->st_size + 1023) & ~1023; + } + return size; +#endif +} + + +/* a safe open/create for read-write */ +int safe_open(const char *fname) +{ + int fd = open(fname, O_RDWR|O_BINARY); + if (fd == -1 && errno == ENOENT) { + fd = open(fname, O_RDWR|O_CREAT|O_EXCL|O_BINARY, 0666); + if (fd == -1 && errno == EEXIST) { + fd = open(fname, O_RDWR|O_BINARY); + } + } + return fd; +} + +/* display a kilobyte unsigned value in M, k or G */ +void display_size(unsigned v) +{ + if (v > 1024*1024) { + printf("%8.1f Gbytes", v/((double)(1024*1024))); + } else if (v > 1024) { + printf("%8.1f Mbytes", v/((double)(1024))); + } else { + printf("%8u Kbytes", v); + } +} + +/* return a value in multiples of 1024 give a string that can end + in K, M or G +*/ +size_t value_units(const char *s) +{ + char m; + double v = atof(s); + m = s[strlen(s)-1]; + switch (m) { + case 'G': + case 'g': + default: + v *= 1024*1024; + break; + case 'M': + case 'm': + v *= 1024; + break; + case 'K': + case 'k': + v *= 1; + break; + } + return (size_t)v; +} + + +/* + a sane realpath() function, trying to cope with stupid path limits and + a broken API +*/ +char *x_realpath(const char *path) +{ +#ifdef _WIN32 + char namebuf[MAX_PATH]; + DWORD ret; + + ret = GetFullPathNameA(path, sizeof(namebuf), namebuf, NULL); + if (ret == 0 || ret >= sizeof(namebuf)) { + return NULL; + } + + return x_strdup(namebuf); +#else + int maxlen; + char *ret, *p; +#ifdef PATH_MAX + maxlen = PATH_MAX; +#elif defined(MAXPATHLEN) + maxlen = MAXPATHLEN; +#elif defined(_PC_PATH_MAX) + maxlen = pathconf(path, _PC_PATH_MAX); +#endif + if (maxlen < 4096) maxlen = 4096; + + ret = x_malloc(maxlen); + +#if HAVE_REALPATH + p = realpath(path, ret); +#else + /* yes, there are such systems. This replacement relies on + the fact that when we call x_realpath we only care about symlinks */ + { + int len = readlink(path, ret, maxlen-1); + if (len == -1) { + free(ret); + return NULL; + } + ret[len] = 0; + p = ret; + } +#endif + if (p) { + p = x_strdup(p); + free(ret); + return p; + } + free(ret); + return NULL; +#endif +} + +/* a getcwd that will returns an allocated buffer */ +char *gnu_getcwd(void) +{ + unsigned size = 128; + + while (1) { + char *buffer = (char *)x_malloc(size); + if (getcwd(buffer, size) == buffer) { + return buffer; + } + free(buffer); + if (errno != ERANGE) { + return 0; + } + size *= 2; + } +} + +/* create an empty file */ +int create_empty_file(const char *fname) +{ + int fd; + + fd = open(fname, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666); + if (fd == -1) { + return -1; + } + close(fd); + return 0; +} + +/* + return current users home directory or die +*/ +const char *get_home_directory(void) +{ +#ifdef _WIN32 + static char home_path[MAX_PATH] = {0}; + HRESULT ret; + + /* we already have the path */ + if (home_path[0] != 0) { + return home_path; + } + + /* get the path to "Application Data" folder */ + ret = SHGetFolderPathA(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, home_path); + if (SUCCEEDED(ret)) { + return home_path; + } + + fprintf(stderr, "ccache: Unable to determine home directory\n"); + return NULL; +#else + const char *p = getenv("HOME"); + if (p) { + return p; + } +#ifdef HAVE_GETPWUID + { + struct passwd *pwd = getpwuid(getuid()); + if (pwd) { + return pwd->pw_dir; + } + } +#endif + fatal("Unable to determine home directory"); + return NULL; +#endif +} + +int x_utimes(const char *filename) +{ +#ifdef HAVE_UTIMES + return utimes(filename, NULL); +#else + return utime(filename, NULL); +#endif +} + +#ifdef _WIN32 +/* perror for Win32 API calls, using GetLastError() instead of errno */ +void perror_win32(LPTSTR pszFunction) +{ + LPTSTR pszMessage; + DWORD dwLastError = GetLastError(); + + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + dwLastError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&pszMessage, + 0, NULL ); + + fprintf(stderr, "%s: %s\n", pszFunction, pszMessage); + LocalFree(pszMessage); +} +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/CCache/web/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/CCache/web/index.html Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,158 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> +<HTML> +<HEAD> +<TITLE>ccache</TITLE> +</HEAD> +<BODY BGCOLOR="#ffffff" TEXT="#000000" VLINK="#292555" LINK="#292555" ALINK="#cc0033"> +<h2>ccache</h2> + +ccache is a compiler cache. It acts as a caching pre-processor to +C/C++ compilers, using the -E compiler switch and a hash to detect +when a compilation can be satisfied from cache. This often results in +a 5 to 10 times speedup in common compilations.<p> + +The idea came from Erik Thiele wrote the original <a +href="http://compilercache.sourceforge.net/">compilercache</a> program +as a bourne shell script. ccache is a re-implementation of Erik's idea +in C with more features and better performance.<p> + +<h2>Latest release</h2> + +The latest release is ccache 2.4. + +<ul> +<li>Added CCACHE_READONLY option +<li>Added CCACHE_TEMPDIR option +<li>fixed handling of hard-linked compilers on AIX +<li>added O_BINARY support, to try and support win32 compiles +<li>show cache directory in stats output +<li>fixed handling of HOME environment variable +</ul> + +See the <a href="ccache-man.html">manual page</a> for details +on the new options.<p> + +You can get this release from the <a href="http://ccache.samba.org/ftp/ccache/">download directory</a> + +<p>NOTE! This release changes the hash input slighly, so you will +probably find that you will not get any hits against your existing +cache when you upgrade. + +<h2>Why bother?</h2> + +Why bother with a compiler cache? If you ever run "make clean; make" +then you can probably benefit from ccache. It is very common for +developers to do a clean build of a project for a whole host of +reasons, and this throws away all the information from your previous +compiles.<p> + +By using ccache you can get exactly the same effect as "make clean; +make" but much faster. It also helps a lot when doing RPM builds, +as RPM can make doing incremental builds tricky.<p> + +I put the effort into writing ccache for 2 reasons. The first is the +Samba build farm +(<a href="http://build.samba.org/">http://build.samba.org/</a>) +which constantly does clean builds of Samba on about 30 machines after each +CVS commit. On some of those machines the build took over an hour. By +using ccache we get the same effect as clean builds but about 6 times +faster.<p> + +The second reason is the autobuild system I used to run for +Quantum. That system builds our whole Linux based OS from scratch +after every CVS commit to catch compilation problems quickly. Using +ccache those builds are much faster. + +<h2>Is it safe?</h2> + +Yes. The most important aspect of a compiler cache is to <b>always</b> +produce exactly the same output that the real compiler would +produce. The includes providing exactly the same object files and +exactly the same compiler warnings that would be produced if you use +the real compiler. The only way you should be able to tell that you +are using ccache is the speed.<p> + +I have coded ccache very carefully to try to provide these guarantees. + +<h2>Features</h2> + +<ul> +<li> keeps statistics on hits/misses +<li> automatic cache size management +<li> can cache compiles that generate warnings +<li> easy installation +<li> very low overhead +<li> uses hard links where possible to avoid copies +</ul> + +<h2>Documentation</h2> + +See the <a href="ccache-man.html">manual page</a> + + +<h2>Performance</h2> + +Here are some results for compiling Samba on my Linux laptop. I have +also included the results of using Erik's compilercache program +(version 1.0.10) for comparison.<p> + +<table border=1> +<tr><th> </th> <th> ccache</th> <th> compilercache</th> </tr> +<tr><td>normal </td> <td align=right>13m 4s </td><td align=right>13m 4s</td> </tr> +<tr><td>uncached </td> <td align=right>13m 15s </td><td align=right>15m 41s</td> </tr> +<tr><td>cached </td> <td align=right>2m 45s </td><td align=right>4m 26s</td> </tr> +</table> + +<h2>How to use it</h2> + +You can use ccache in two ways. The first is just to prefix your +compile commands with "ccache". For example, you could change the +"CC=gcc" line in your Makefile to be "CC=ccache gcc".<p> + +Alternatively, you can create symbolic links from your compilers name +to ccache. This allows you to use ccache without any changes to your +build system. + +<h2>Download</h2> + +You can download the latest release from the <a +href="http://ccache.samba.org/ftp/ccache/">download directory</a>.<p> + +For the bleeding edge, you can fetch ccache via CVS or +rsync. To fetch via cvs use the following command: + +<pre> + cvs -d :pserver:cvs@pserver.samba.org:/cvsroot co ccache +</pre> + +To fetch via rsync use this command: + +<pre> + rsync -Pavz samba.org::ftp/unpacked/ccache . +</pre> + +<h2>Related projects</h2> + +Here are some related programs you may find interesting + +<ul> +<li> <a href="http://distcc.samba.org/">distcc</a> - a distributed compilation system +<li> <a href="http://cachecc1.sourceforge.net/">cachecc1</a> - a gcc specific cache +<li> <a href="http://sourceforge.net/projects/gocache/">gocache</a> - a cross platform compiler cache +</ul> +<p> + +<h2>Mailing list</h2> + +<p>A <a href="http://lists.samba.org/mailman/listinfo/ccache/">mailing +list</a> is available for discussion of ccache. + + +<hr> +<tiny> +<a href="http://samba.org/~tridge/">Andrew Tridgell</a><br> +<a href="mailto:bugs@ccache.samba.org">bugs@ccache.samba.org</a> +</tiny> + +</BODY> +</HTML> diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/COPYRIGHT --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/COPYRIGHT Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,104 @@ +SWIG Copyright and Authors +-------------------------- + +Copyright (c) 1995-2011 The SWIG Developers +Copyright (c) 2005-2006 Arizona Board of Regents (University of Arizona). +Copyright (c) 1998-2005 University of Chicago. +Copyright (c) 1995-1998 The University of Utah and the Regents of the University of California + +Portions also copyrighted by: + Network Applied Communication Laboratory, Inc + Information-technology Promotion Agency, Japan + +Active SWIG Developers: + William Fulton (wsf@fultondesigns.co.uk) (SWIG core, Java, C#, Windows, Cygwin) + Olly Betts (olly@survex.com) (PHP) + Joseph Wang (joequant@gmail.com) (R) + Xavier Delacour (xavier.delacour@gmail.com) (Octave) + David Nadlinger (code@klickverbot.at) (D) + +Past SWIG developers and major contributors include: + Dave Beazley (dave-swig@dabeaz.com) (SWIG core, Python, Tcl, Perl) + Henning Thielemann (swig@henning-thielemann.de) (Modula3) + Matthias Köppe (mkoeppe@mail.math.uni-magdeburg.de) (Guile, MzScheme) + Luigi Ballabio (luigi.ballabio@fastwebnet.it) (STL wrapping) + Mikel Bancroft (mikel@franz.com) (Allegro CL) + Surendra Singhi (efuzzyone@netscape.net) (CLISP, CFFI) + Marcelo Matus (mmatus@acms.arizona.edu) (SWIG core, Python, UTL[python,perl,tcl,ruby]) + Art Yerkes (ayerkes@speakeasy.net) (Ocaml) + Lyle Johnson (lyle@users.sourceforge.net) (Ruby) + Charlie Savage (cfis@interserv.com) (Ruby) + Thien-Thi Nguyen (ttn@glug.org) (build/test/misc) + Richard Palmer (richard@magicality.org) (PHP) + Sam Liddicott - Ananova Ltd (saml@liddicott.com) (PHP) + Tim Hockin - Sun Microsystems (thockin@sun.com) (PHP) + Kevin Ruland (PHP) + Shibukawa Yoshiki (Japanese Translation) + Jason Stewart (jason@openinformatics.com) (Perl5) + Loic Dachary (Perl5) + David Fletcher (Perl5) + Gary Holt (Perl5) + Masaki Fukushima (Ruby) + Scott Michel (scottm@cs.ucla.edu) (Java directors) + Tiger Feng (songyanf@cs.uchicago.edu) (SWIG core) + Mark Rose (mrose@stm.lbl.gov) (Directors) + Jonah Beckford (beckford@usermail.com) (CHICKEN) + Ahmon Dancy (dancy@franz.com) (Allegro CL) + Dirk Gerrits (Allegro CL) + Neil Cawse (C#) + Harco de Hilster (Java) + Alexey Dyachenko (dyachenko@fromru.com) (Tcl) + Bob Techentin (Tcl) + Martin Froehlich <MartinFroehlich@ACM.org> (Guile) + Marcio Luis Teixeira <marciot@holly.colostate.edu> (Guile) + Duncan Temple Lang (R) + Miklos Vajna <vmiklos@frugalware.org> (PHP directors) + Mark Gossage (mark@gossage.cjb.net) (Lua) + Raman Gopalan (ramangopalan@gmail.com) (eLua) + Gonzalo Garramuno (ggarra@advancedsl.com.ar) (Ruby, Ruby's UTL) + John Lenz (Guile, MzScheme updates, Chicken module, runtime system) + Ian Lance Taylor (Go) + Vadim Zeitlin (PCRE) + Stefan Zager (szager@gmail.com) (Python) + +Past contributors include: + James Michael DuPont, Clark McGrew, Dustin Mitchell, Ian Cooke, Catalin Dumitrescu, Baran + Kovuk, Oleg Tolmatcev, Tal Shalif, Lluis Padro, Chris Seatory, Igor Bely, Robin Dunn, + Edward Zimmermann, David Ascher, Dominique Dumont, Pier Giorgio Esposito, Hasan Baran Kovuk, + Klaus Wiederänders, Richard Beare, Hans Oesterholt. + (See CHANGES and CHANGES.current and the bug tracker for a more complete list). + +Past students: + Songyan Feng (Chicago). + Xinghua Shi (Chicago). + Jing Cao (Chicago). + Aquinas Hobor (Chicago). + +Historically, the following people contributed to early versions of SWIG. +Peter Lomdahl, Brad Holian, Shujia Zhou, Niels Jensen, and Tim Germann +at Los Alamos National Laboratory were the first users. Patrick +Tullmann at the University of Utah suggested the idea of automatic +documentation generation. John Schmidt and Kurtis Bleeker at the +University of Utah tested out the early versions. Chris Johnson +supported SWIG's developed at the University of Utah. John Buckman, +Larry Virden, and Tom Schwaller provided valuable input on the first +releases and improving the portability of SWIG. David Fletcher and +Gary Holt have provided a great deal of input on improving SWIG's +Perl5 implementation. Kevin Butler contributed the first Windows NT +port. + +Early bug reports and patches: +Adam Hupp, Arthur Smyles, Brad Clements, Brett Williams, Buck Hodges, +Burkhard Kloss, Chia-Liang Kao, Craig Files, Dennis Marsa, Dieter Baron, +Drake Diedrich, Fleur Diana Dragan, Gary Pennington, Geoffrey Hort, Gerald Williams, +Greg Anderson, Greg Kochanski, Greg Troxel, Henry Rowley, Irina Kotlova, +Israel Taller, James Bailey, Jim Fulton, Joel Reed, Jon Travis, +Junio Hamano, Justin Heyes-Jones, Karl Forner, Keith Davidson, +Krzysztof Kozminski, Larry Virden, Luke J Crook, Magnus Ljung, Marc Zonzon, +Mark Howson, Micahel Scharf, Michel Sanner, Mike Romberg, Mike Simons, +Mike Weiblen, Paul Brannan, Ram Bhamidipaty, Reinhard Fobbe, Rich Wales, +Richard Salz, Roy Lecates, Rudy Albachten, Scott Drummonds +Scott Michel, Shaun Lowry, Steve Galser, Tarn Weisner Burton, +Thomas Weidner, Tony Seward, Uwe Steinmann, Vadim Chugunov, Wyss Clemens, +Zhong Ren. + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/LICENSE --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/LICENSE Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,22 @@ +SWIG is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. See the LICENSE-GPL file for +the full terms of the GNU General Public license version 3. + +Portions of SWIG are also licensed under the terms of the licenses +in the file LICENSE-UNIVERSITIES. You must observe the terms of +these licenses, as well as the terms of the GNU General Public License, +when you distribute SWIG. + +The SWIG library and examples, under the Lib and Examples top level +directories, are distributed under the following terms: + + You may copy, modify, distribute, and make derivative works based on + this software, in source code or object code form, without + restriction. If you distribute the software to others, you may do + so according to the terms of your choice. This software is offered as + is, without warranty of any kind. + +See the COPYRIGHT file for a list of contributors to SWIG and their +copyright notices. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/LICENSE-GPL --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/LICENSE-GPL Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + <program> Copyright (C) <year> <name of author> + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +<http://www.gnu.org/licenses/>. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +<http://www.gnu.org/philosophy/why-not-lgpl.html>. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/LICENSE-UNIVERSITIES --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/LICENSE-UNIVERSITIES Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,95 @@ +SWIG is distributed under the following terms: + +I. + +Copyright (c) 1995-1998 +The University of Utah and the Regents of the University of California +All Rights Reserved + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that +(1) The above copyright notice and the following two paragraphs +appear in all copies of the source code and (2) redistributions +including binaries reproduces these notices in the supporting +documentation. Substantial modifications to this software may be +copyrighted by their authors and need not follow the licensing terms +described here, provided that the new terms are clearly indicated in +all files where they apply. + +IN NO EVENT SHALL THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, THE +UNIVERSITY OF UTAH OR DISTRIBUTORS OF THIS SOFTWARE BE LIABLE TO ANY +PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, +EVEN IF THE AUTHORS OR ANY OF THE ABOVE PARTIES HAVE BEEN ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +THE AUTHOR, THE UNIVERSITY OF CALIFORNIA, AND THE UNIVERSITY OF UTAH +SPECIFICALLY DISCLAIM ANY WARRANTIES,INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND +THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE MAINTENANCE, +SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + + +II. + +This software includes contributions that are Copyright (c) 1998-2005 +University of Chicago. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. Redistributions +in binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. Neither the name of +the University of Chicago nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF CHICAGO AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF +CHICAGO OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +III. + +This software includes contributions that are Copyright (c) 2005-2006 +Arizona Board of Regents (University of Arizona). +All Rights Reserved + +Permission is hereby granted, without written agreement and without +license or royalty fees, to use, copy, modify, and distribute this +software and its documentation for any purpose, provided that +(1) The above copyright notice and the following paragraph +appear in all copies of the source code and (2) redistributions +including binaries reproduces these notices in the supporting +documentation. Substantial modifications to this software may be +copyrighted by their authors and need not follow the licensing terms +described here, provided that the new terms are clearly indicated in +all files where they apply. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY OF ARIZONA AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF +ARIZONA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/allkw.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/allkw.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,32 @@ +#ifndef __Lib_allkw_swg__ +#define __Lib_allkw_swg__ + + +/* + Include all the known keyword warnings. Very useful for adding test + files to the test-suite, or check if your own library is ok for all + the swig supported languages. + + Use as + + swig -Wallkw ... + + If you add a new language, remember to create a separete languagekw.swg + file, and add it here. + +*/ + +%include <chicken/chickenkw.swg> +%include <csharp/csharpkw.swg> +%include <d/dkw.swg> +%include <java/javakw.swg> +%include <php/phpkw.swg> +%include <pike/pikekw.swg> +%include <python/pythonkw.swg> +%include <ocaml/ocamlkw.swg> +%include <ruby/rubykw.swg> +%include <tcl/tclkw.swg> +%include <perl5/perlkw.swg> + + +#endif //__Lib_allkw_swg__ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/attribute.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/attribute.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,21 @@ +/* ----------------------------------------------------------------------------- + * attribute.i + * + * SWIG library file for implementing attributes. + * ----------------------------------------------------------------------------- */ + +/* we use a simple exception warning here */ +%{ +#include <stdio.h> +%} +#define %attribute_exception(code,msg) printf("%s\n",msg) + +#ifndef %arg +#define %arg(x...) x +#endif + +#ifndef %mangle +#define %mangle(Type...) #@Type +#endif + +%include <typemaps/attribute.swg> diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/carrays.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/carrays.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,116 @@ +/* ----------------------------------------------------------------------------- + * carrays.i + * + * SWIG library file containing macros that can be used to manipulate simple + * pointers as arrays. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * %array_functions(TYPE,NAME) + * + * Generates functions for creating and accessing elements of a C array + * (as pointers). Creates the following functions: + * + * TYPE *new_NAME(int nelements) + * void delete_NAME(TYPE *); + * TYPE NAME_getitem(TYPE *, int index); + * void NAME_setitem(TYPE *, int index, TYPE value); + * + * ----------------------------------------------------------------------------- */ + +%define %array_functions(TYPE,NAME) +%{ +static TYPE *new_##NAME(int nelements) { %} +#ifdef __cplusplus +%{ return new TYPE[nelements]; %} +#else +%{ return (TYPE *) calloc(nelements,sizeof(TYPE)); %} +#endif +%{} + +static void delete_##NAME(TYPE *ary) { %} +#ifdef __cplusplus +%{ delete [] ary; %} +#else +%{ free(ary); %} +#endif +%{} + +static TYPE NAME##_getitem(TYPE *ary, int index) { + return ary[index]; +} +static void NAME##_setitem(TYPE *ary, int index, TYPE value) { + ary[index] = value; +} +%} + +TYPE *new_##NAME(int nelements); +void delete_##NAME(TYPE *ary); +TYPE NAME##_getitem(TYPE *ary, int index); +void NAME##_setitem(TYPE *ary, int index, TYPE value); + +%enddef + + +/* ----------------------------------------------------------------------------- + * %array_class(TYPE,NAME) + * + * Generates a class wrapper around a C array. The class has the following + * interface: + * + * struct NAME { + * NAME(int nelements); + * ~NAME(); + * TYPE getitem(int index); + * void setitem(int index, TYPE value); + * TYPE * cast(); + * static NAME *frompointer(TYPE *t); + * } + * + * ----------------------------------------------------------------------------- */ + +%define %array_class(TYPE,NAME) +%{ +typedef TYPE NAME; +%} +typedef struct { + /* Put language specific enhancements here */ +} NAME; + +%extend NAME { + +#ifdef __cplusplus +NAME(int nelements) { + return new TYPE[nelements]; +} +~NAME() { + delete [] self; +} +#else +NAME(int nelements) { + return (TYPE *) calloc(nelements,sizeof(TYPE)); +} +~NAME() { + free(self); +} +#endif + +TYPE getitem(int index) { + return self[index]; +} +void setitem(int index, TYPE value) { + self[index] = value; +} +TYPE * cast() { + return self; +} +static NAME *frompointer(TYPE *t) { + return (NAME *) t; +} + +}; + +%types(NAME = TYPE); + +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/cdata.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/cdata.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,81 @@ +/* ----------------------------------------------------------------------------- + * cdata.i + * + * SWIG library file containing macros for manipulating raw C data as strings. + * ----------------------------------------------------------------------------- */ + +%{ +typedef struct SWIGCDATA { + char *data; + int len; +} SWIGCDATA; +%} + +/* ----------------------------------------------------------------------------- + * Typemaps for returning binary data + * ----------------------------------------------------------------------------- */ + +#if SWIGGUILE +%typemap(out) SWIGCDATA { + $result = scm_from_locale_stringn($1.data,$1.len); +} +%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH); +#elif SWIGCHICKEN +%typemap(out) SWIGCDATA { + C_word *string_space = C_alloc(C_SIZEOF_STRING($1.len)); + $result = C_string(&string_space, $1.len, $1.data); +} +%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH); +#elif SWIGPHP +%typemap(out) SWIGCDATA { + ZVAL_STRINGL($result, $1.data, $1.len, 1); +} +%typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH); +#else +%echo "cdata.i module not supported." +#endif + + +/* ----------------------------------------------------------------------------- + * %cdata(TYPE [, NAME]) + * + * Convert raw C data to a binary string. + * ----------------------------------------------------------------------------- */ + +%define %cdata(TYPE,NAME...) + +%insert("header") { +#if #NAME == "" +static SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements) { +#else +static SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements) { +#endif + SWIGCDATA d; + d.data = (char *) ptr; +#if #TYPE != "void" + d.len = nelements*sizeof(TYPE); +#else + d.len = nelements; +#endif + return d; +} +} + +%typemap(default) int nelements "$1 = 1;" + +#if #NAME == "" +SWIGCDATA cdata_##TYPE(TYPE *ptr, int nelements); +#else +SWIGCDATA cdata_##NAME(TYPE *ptr, int nelements); +#endif +%enddef + +%typemap(default) int nelements; + +%rename(cdata) ::cdata_void(void *ptr, int nelements); + +%cdata(void); + +/* Memory move function. Due to multi-argument typemaps this appears to be wrapped as +void memmove(void *data, const char *s); */ +void memmove(void *data, const void *indata, int inlen); diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/cmalloc.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/cmalloc.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,110 @@ +/* ----------------------------------------------------------------------------- + * cmalloc.i + * + * SWIG library file containing macros that can be used to create objects using + * the C malloc function. + * ----------------------------------------------------------------------------- */ + +%{ +#include <stdlib.h> +%} + +/* %malloc(TYPE [, NAME = TYPE]) + %calloc(TYPE [, NAME = TYPE]) + %realloc(TYPE [, NAME = TYPE]) + %free(TYPE [, NAME = TYPE]) + %allocators(TYPE [,NAME = TYPE]) + + Creates functions for allocating/reallocating memory. + + TYPE *malloc_NAME(int nbytes = sizeof(TYPE); + TYPE *calloc_NAME(int nobj=1, int size=sizeof(TYPE)); + TYPE *realloc_NAME(TYPE *ptr, int nbytes); + void free_NAME(TYPE *ptr); + +*/ + +%define %malloc(TYPE,NAME...) +#if #NAME != "" +%rename(malloc_##NAME) ::malloc(int nbytes); +#else +%rename(malloc_##TYPE) ::malloc(int nbytes); +#endif + +#if #TYPE != "void" +%typemap(default) int nbytes "$1 = (int) sizeof(TYPE);" +#endif +TYPE *malloc(int nbytes); +%typemap(default) int nbytes; +%enddef + +%define %calloc(TYPE,NAME...) +#if #NAME != "" +%rename(calloc_##NAME) ::calloc(int nobj, int sz); +#else +%rename(calloc_##TYPE) ::calloc(int nobj, int sz); +#endif +#if #TYPE != "void" +%typemap(default) int sz "$1 = (int) sizeof(TYPE);" +#else +%typemap(default) int sz "$1 = 1;" +#endif +%typemap(default) int nobj "$1 = 1;" +TYPE *calloc(int nobj, int sz); +%typemap(default) int sz; +%typemap(default) int nobj; +%enddef + +%define %realloc(TYPE,NAME...) +%insert("header") { +#if #NAME != "" +TYPE *realloc_##NAME(TYPE *ptr, int nitems) +#else +TYPE *realloc_##TYPE(TYPE *ptr, int nitems) +#endif +{ +#if #TYPE != "void" +return (TYPE *) realloc(ptr, nitems*sizeof(TYPE)); +#else +return (TYPE *) realloc(ptr, nitems); +#endif +} +} +#if #NAME != "" +TYPE *realloc_##NAME(TYPE *ptr, int nitems); +#else +TYPE *realloc_##TYPE(TYPE *ptr, int nitems); +#endif +%enddef + +%define %free(TYPE,NAME...) +#if #NAME != "" +%rename(free_##NAME) ::free(TYPE *ptr); +#else +%rename(free_##TYPE) ::free(TYPE *ptr); +#endif +void free(TYPE *ptr); +%enddef + +%define %sizeof(TYPE,NAME...) +#if #NAME != "" +%constant int sizeof_##NAME = sizeof(TYPE); +#else +%constant int sizeof_##TYPE = sizeof(TYPE); +#endif +%enddef + +%define %allocators(TYPE,NAME...) +%malloc(TYPE,NAME) +%calloc(TYPE,NAME) +%realloc(TYPE,NAME) +%free(TYPE,NAME) +#if #TYPE != "void" +%sizeof(TYPE,NAME) +#endif +%enddef + + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/constraints.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/constraints.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,224 @@ +/* ----------------------------------------------------------------------------- + * constraints.i + * + * SWIG constraints library. + * + * SWIG library file containing typemaps for implementing various kinds of + * constraints. Depends upon the SWIG exception library for generating + * errors in a language-independent manner. + * ----------------------------------------------------------------------------- */ + +#ifdef AUTODOC +%text %{ +%include <constraints.i> + +This library provides support for applying constraints to function +arguments. Using a constraint, you can restrict arguments to be +positive numbers, non-NULL pointers, and so on. The following +constraints are available : + + Number POSITIVE - Positive number (not zero) + Number NEGATIVE - Negative number (not zero) + Number NONZERO - Nonzero number + Number NONNEGATIVE - Positive number (including zero) + Number NONPOSITIVE - Negative number (including zero) + Pointer NONNULL - Non-NULL pointer + Pointer ALIGN8 - 8-byte aligned pointer + Pointer ALIGN4 - 4-byte aligned pointer + Pointer ALIGN2 - 2-byte aligned pointer + +To use the constraints, you need to "apply" them to specific +function arguments in your code. This is done using the %apply +directive. For example : + + %apply Number NONNEGATIVE { double nonneg }; + double sqrt(double nonneg); // Name of argument must match + + %apply Pointer NONNULL { void *ptr }; + void *malloc(int POSITIVE); // May return a NULL pointer + void free(void *ptr); // May not accept a NULL pointer + +Any function argument of the type you specify with the %apply directive +will be checked with the appropriate constraint. Multiple types may +be specified as follows : + + %apply Pointer NONNULL { void *, Vector *, List *, double *}; + +In this case, all of the types listed would be checked for non-NULL +pointers. + +The common datatypes of int, short, long, unsigned int, unsigned long, +unsigned short, unsigned char, signed char, float, and double can be +checked without using the %apply directive by simply using the +constraint name as the parameter name. For example : + + double sqrt(double NONNEGATIVE); + double log(double POSITIVE); + +If you have used typedef to change type-names, you can also do this : + + %apply double { Real }; // Make everything defined for doubles + // work for Reals. + Real sqrt(Real NONNEGATIVE); + Real log(Real POSITIVE); + +%} +#endif + +%include <exception.i> + +#ifdef SWIGCSHARP +// Required attribute for C# exception handling +#define SWIGCSHARPCANTHROW , canthrow=1 +#else +#define SWIGCSHARPCANTHROW +#endif + + +// Positive numbers + +%typemap(check SWIGCSHARPCANTHROW) + int POSITIVE, + short POSITIVE, + long POSITIVE, + unsigned int POSITIVE, + unsigned short POSITIVE, + unsigned long POSITIVE, + signed char POSITIVE, + unsigned char POSITIVE, + float POSITIVE, + double POSITIVE, + Number POSITIVE +{ + if ($1 <= 0) { + SWIG_exception(SWIG_ValueError,"Expected a positive value."); + } +} + +// Negative numbers + +%typemap(check SWIGCSHARPCANTHROW) + int NEGATIVE, + short NEGATIVE, + long NEGATIVE, + unsigned int NEGATIVE, + unsigned short NEGATIVE, + unsigned long NEGATIVE, + signed char NEGATIVE, + unsigned char NEGATIVE, + float NEGATIVE, + double NEGATIVE, + Number NEGATIVE +{ + if ($1 >= 0) { + SWIG_exception(SWIG_ValueError,"Expected a negative value."); + } +} + +// Nonzero numbers + +%typemap(check SWIGCSHARPCANTHROW) + int NONZERO, + short NONZERO, + long NONZERO, + unsigned int NONZERO, + unsigned short NONZERO, + unsigned long NONZERO, + signed char NONZERO, + unsigned char NONZERO, + float NONZERO, + double NONZERO, + Number NONZERO +{ + if ($1 == 0) { + SWIG_exception(SWIG_ValueError,"Expected a nonzero value."); + } +} + +// Nonnegative numbers + +%typemap(check SWIGCSHARPCANTHROW) + int NONNEGATIVE, + short NONNEGATIVE, + long NONNEGATIVE, + unsigned int NONNEGATIVE, + unsigned short NONNEGATIVE, + unsigned long NONNEGATIVE, + signed char NONNEGATIVE, + unsigned char NONNEGATIVE, + float NONNEGATIVE, + double NONNEGATIVE, + Number NONNEGATIVE +{ + if ($1 < 0) { + SWIG_exception(SWIG_ValueError,"Expected a non-negative value."); + } +} + +// Nonpositive numbers + +%typemap(check SWIGCSHARPCANTHROW) + int NONPOSITIVE, + short NONPOSITIVE, + long NONPOSITIVE, + unsigned int NONPOSITIVE, + unsigned short NONPOSITIVE, + unsigned long NONPOSITIVE, + signed char NONPOSITIVE, + unsigned char NONPOSITIVE, + float NONPOSITIVE, + double NONPOSITIVE, + Number NONPOSITIVE +{ + if ($1 > 0) { + SWIG_exception(SWIG_ValueError,"Expected a non-positive value."); + } +} + +// Non-NULL pointer + +%typemap(check SWIGCSHARPCANTHROW) + void * NONNULL, + Pointer NONNULL +{ + if (!$1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } +} + +// Aligned pointers + +%typemap(check SWIGCSHARPCANTHROW) + void * ALIGN8, + Pointer ALIGN8 +{ + unsigned long long tmp; + tmp = (unsigned long long) $1; + if (tmp & 7) { + SWIG_exception(SWIG_ValueError,"Pointer must be 8-byte aligned."); + } +} + +%typemap(check SWIGCSHARPCANTHROW) + void * ALIGN4, + Pointer ALIGN4 +{ + unsigned long long tmp; + tmp = (unsigned long long) $1; + if (tmp & 3) { + SWIG_exception(SWIG_ValueError,"Pointer must be 4-byte aligned."); + } +} + +%typemap(check SWIGCSHARPCANTHROW) + void * ALIGN2, + Pointer ALIGN2 +{ + unsigned long long tmp; + tmp = (unsigned long long) $1; + if (tmp & 1) { + SWIG_exception(SWIG_ValueError,"Pointer must be 2-byte aligned."); + } +} + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/cpointer.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/cpointer.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,180 @@ +/* ----------------------------------------------------------------------------- + * cpointer.i + * + * SWIG library file containing macros that can be used to manipulate simple + * pointer objects. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * %pointer_class(type,name) + * + * Places a simple proxy around a simple type like 'int', 'float', or whatever. + * The proxy provides this interface: + * + * class type { + * public: + * type(); + * ~type(); + * type value(); + * void assign(type value); + * }; + * + * Example: + * + * %pointer_class(int, intp); + * + * int add(int *x, int *y) { return *x + *y; } + * + * In python (with proxies) + * + * >>> a = intp() + * >>> a.assign(10) + * >>> a.value() + * 10 + * >>> b = intp() + * >>> b.assign(20) + * >>> print add(a,b) + * 30 + * + * As a general rule, this macro should not be used on class/structures that + * are already defined in the interface. + * ----------------------------------------------------------------------------- */ + + +%define %pointer_class(TYPE, NAME) +%{ +typedef TYPE NAME; +%} + +typedef struct { +} NAME; + +%extend NAME { +#ifdef __cplusplus +NAME() { + return new TYPE(); +} +~NAME() { + if ($self) delete $self; +} +#else +NAME() { + return (TYPE *) calloc(1,sizeof(TYPE)); +} +~NAME() { + if ($self) free($self); +} +#endif +} + +%extend NAME { + +void assign(TYPE value) { + *$self = value; +} +TYPE value() { + return *$self; +} +TYPE * cast() { + return $self; +} +static NAME * frompointer(TYPE *t) { + return (NAME *) t; +} + +} + +%types(NAME = TYPE); + +%enddef + +/* ----------------------------------------------------------------------------- + * %pointer_functions(type,name) + * + * Create functions for allocating/deallocating pointers. This can be used + * if you don't want to create a proxy class or if the pointer is complex. + * + * %pointer_functions(int, intp) + * + * int add(int *x, int *y) { return *x + *y; } + * + * In python (with proxies) + * + * >>> a = copy_intp(10) + * >>> intp_value(a) + * 10 + * >>> b = new_intp() + * >>> intp_assign(b,20) + * >>> print add(a,b) + * 30 + * >>> delete_intp(a) + * >>> delete_intp(b) + * + * ----------------------------------------------------------------------------- */ + +%define %pointer_functions(TYPE,NAME) +%{ +static TYPE *new_##NAME() { %} +#ifdef __cplusplus +%{ return new TYPE(); %} +#else +%{ return (TYPE *) calloc(1,sizeof(TYPE)); %} +#endif +%{} + +static TYPE *copy_##NAME(TYPE value) { %} +#ifdef __cplusplus +%{ return new TYPE(value); %} +#else +%{ TYPE *obj = (TYPE *) calloc(1,sizeof(TYPE)); + *obj = value; + return obj; %} +#endif +%{} + +static void delete_##NAME(TYPE *obj) { %} +#ifdef __cplusplus +%{ if (obj) delete obj; %} +#else +%{ if (obj) free(obj); %} +#endif +%{} + +static void NAME ##_assign(TYPE *obj, TYPE value) { + *obj = value; +} + +static TYPE NAME ##_value(TYPE *obj) { + return *obj; +} +%} + +TYPE *new_##NAME(); +TYPE *copy_##NAME(TYPE value); +void delete_##NAME(TYPE *obj); +void NAME##_assign(TYPE *obj, TYPE value); +TYPE NAME##_value(TYPE *obj); + +%enddef + +/* ----------------------------------------------------------------------------- + * %pointer_cast(type1,type2,name) + * + * Generates a pointer casting function. + * ----------------------------------------------------------------------------- */ + +%define %pointer_cast(TYPE1,TYPE2,NAME) +%inline %{ +TYPE2 NAME(TYPE1 x) { + return (TYPE2) x; +} +%} +%enddef + + + + + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/cstring.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/cstring.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,12 @@ +/* ----------------------------------------------------------------------------- + * cstring.i + * ----------------------------------------------------------------------------- */ + +%echo "cstring.i not implemented for this target" +#define SWIG_CSTRING_UNIMPL + +/* old name keep for compatibility */ +#define _CSTRING_UNIMPL + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/cwstring.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/cwstring.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,11 @@ +/* ----------------------------------------------------------------------------- + * cwstring.i + * ----------------------------------------------------------------------------- */ + +%echo "cwstring.i not implemented for this target" +#define SWIG_CWSTRING_UNIMPL + + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/exception.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/exception.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,304 @@ +/* ----------------------------------------------------------------------------- + * exception.i + * + * SWIG library file providing language independent exception handling + * ----------------------------------------------------------------------------- */ + +#if defined(SWIGUTL) +#error "This version of exception.i should not be used" +#endif + + +%insert("runtime") "swigerrors.swg" + + +#ifdef SWIGPHP +%{ +#include "zend_exceptions.h" +#define SWIG_exception(code, msg) { zend_throw_exception(NULL, (char*)msg, code TSRMLS_CC); } +%} +#endif + +#ifdef SWIGGUILE +%{ + SWIGINTERN void SWIG_exception_ (int code, const char *msg, + const char *subr) { +#define ERROR(scmerr) \ + scm_error(scm_from_locale_string((char *) (scmerr)), \ + (char *) subr, (char *) msg, \ + SCM_EOL, SCM_BOOL_F) +#define MAP(swigerr, scmerr) \ + case swigerr: \ + ERROR(scmerr); \ + break + switch (code) { + MAP(SWIG_MemoryError, "swig-memory-error"); + MAP(SWIG_IOError, "swig-io-error"); + MAP(SWIG_RuntimeError, "swig-runtime-error"); + MAP(SWIG_IndexError, "swig-index-error"); + MAP(SWIG_TypeError, "swig-type-error"); + MAP(SWIG_DivisionByZero, "swig-division-by-zero"); + MAP(SWIG_OverflowError, "swig-overflow-error"); + MAP(SWIG_SyntaxError, "swig-syntax-error"); + MAP(SWIG_ValueError, "swig-value-error"); + MAP(SWIG_SystemError, "swig-system-error"); + default: + ERROR("swig-error"); + } +#undef ERROR +#undef MAP + } + +#define SWIG_exception(a,b) SWIG_exception_(a, b, FUNC_NAME) +%} +#endif + +#ifdef SWIGMZSCHEME + +%{ +SWIGINTERN void SWIG_exception_ (int code, const char *msg) { +#define ERROR(errname) \ + scheme_signal_error(errname " (%s)", msg); +#define MAP(swigerr, errname) \ + case swigerr: \ + ERROR(errname); \ + break + switch (code) { + MAP(SWIG_MemoryError, "swig-memory-error"); + MAP(SWIG_IOError, "swig-io-error"); + MAP(SWIG_RuntimeError, "swig-runtime-error"); + MAP(SWIG_IndexError, "swig-index-error"); + MAP(SWIG_TypeError, "swig-type-error"); + MAP(SWIG_DivisionByZero, "swig-division-by-zero"); + MAP(SWIG_OverflowError, "swig-overflow-error"); + MAP(SWIG_SyntaxError, "swig-syntax-error"); + MAP(SWIG_ValueError, "swig-value-error"); + MAP(SWIG_SystemError, "swig-system-error"); + default: + ERROR("swig-error"); + } +#undef ERROR +#undef MAP + } + +#define SWIG_exception(a,b) SWIG_exception_(a, b) +%} +#endif + +#ifdef SWIGJAVA +%{ +SWIGINTERN void SWIG_JavaException(JNIEnv *jenv, int code, const char *msg) { + SWIG_JavaExceptionCodes exception_code = SWIG_JavaUnknownError; + switch(code) { + case SWIG_MemoryError: + exception_code = SWIG_JavaOutOfMemoryError; + break; + case SWIG_IOError: + exception_code = SWIG_JavaIOException; + break; + case SWIG_SystemError: + case SWIG_RuntimeError: + exception_code = SWIG_JavaRuntimeException; + break; + case SWIG_OverflowError: + case SWIG_IndexError: + exception_code = SWIG_JavaIndexOutOfBoundsException; + break; + case SWIG_DivisionByZero: + exception_code = SWIG_JavaArithmeticException; + break; + case SWIG_SyntaxError: + case SWIG_ValueError: + case SWIG_TypeError: + exception_code = SWIG_JavaIllegalArgumentException; + break; + case SWIG_UnknownError: + default: + exception_code = SWIG_JavaUnknownError; + break; + } + SWIG_JavaThrowException(jenv, exception_code, msg); +} +%} + +#define SWIG_exception(code, msg)\ +{ SWIG_JavaException(jenv, code, msg); return $null; } +#endif // SWIGJAVA + +#ifdef SWIGOCAML +%{ +#define OCAML_MSG_BUF_LEN 1024 +SWIGINTERN void SWIG_exception_(int code, const char *msg) { + char msg_buf[OCAML_MSG_BUF_LEN]; + sprintf( msg_buf, "Exception(%d): %s\n", code, msg ); + failwith( msg_buf ); +} +#define SWIG_exception(a,b) SWIG_exception_((a),(b)) +%} +#endif + + +#ifdef SWIGCHICKEN +%{ +SWIGINTERN void SWIG_exception_(int code, const char *msg) { + C_word *a; + C_word scmmsg; + C_word list; + + a = C_alloc (C_SIZEOF_STRING (strlen (msg)) + C_SIZEOF_LIST(2)); + scmmsg = C_string2 (&a, (char *) msg); + list = C_list(&a, 2, C_fix(code), scmmsg); + SWIG_ThrowException(list); +} +#define SWIG_exception(a,b) SWIG_exception_((a),(b)) +%} +#endif + +#ifdef SWIGCSHARP +%{ +SWIGINTERN void SWIG_CSharpException(int code, const char *msg) { + if (code == SWIG_ValueError) { + SWIG_CSharpExceptionArgumentCodes exception_code = SWIG_CSharpArgumentOutOfRangeException; + SWIG_CSharpSetPendingExceptionArgument(exception_code, msg, 0); + } else { + SWIG_CSharpExceptionCodes exception_code = SWIG_CSharpApplicationException; + switch(code) { + case SWIG_MemoryError: + exception_code = SWIG_CSharpOutOfMemoryException; + break; + case SWIG_IndexError: + exception_code = SWIG_CSharpIndexOutOfRangeException; + break; + case SWIG_DivisionByZero: + exception_code = SWIG_CSharpDivideByZeroException; + break; + case SWIG_IOError: + exception_code = SWIG_CSharpIOException; + break; + case SWIG_OverflowError: + exception_code = SWIG_CSharpOverflowException; + break; + case SWIG_RuntimeError: + case SWIG_TypeError: + case SWIG_SyntaxError: + case SWIG_SystemError: + case SWIG_UnknownError: + default: + exception_code = SWIG_CSharpApplicationException; + break; + } + SWIG_CSharpSetPendingException(exception_code, msg); + } +} +%} + +#define SWIG_exception(code, msg)\ +{ SWIG_CSharpException(code, msg); return $null; } +#endif // SWIGCSHARP + +#ifdef SWIGLUA + +%{ +#define SWIG_exception(a,b)\ +{ lua_pushfstring(L,"%s:%s",#a,b);SWIG_fail; } +%} + +#endif // SWIGLUA + +#ifdef SWIGD +%{ +SWIGINTERN void SWIG_DThrowException(int code, const char *msg) { + SWIG_DExceptionCodes exception_code; + switch(code) { + case SWIG_IndexError: + exception_code = SWIG_DNoSuchElementException; + break; + case SWIG_IOError: + exception_code = SWIG_DIOException; + break; + case SWIG_ValueError: + exception_code = SWIG_DIllegalArgumentException; + break; + case SWIG_DivisionByZero: + case SWIG_MemoryError: + case SWIG_OverflowError: + case SWIG_RuntimeError: + case SWIG_TypeError: + case SWIG_SyntaxError: + case SWIG_SystemError: + case SWIG_UnknownError: + default: + exception_code = SWIG_DException; + break; + } + SWIG_DSetPendingException(exception_code, msg); +} +%} + +#define SWIG_exception(code, msg)\ +{ SWIG_DThrowException(code, msg); return $null; } +#endif // SWIGD + +#ifdef __cplusplus +/* + You can use the SWIG_CATCH_STDEXCEPT macro with the %exception + directive as follows: + + %exception { + try { + $action + } + catch (my_except& e) { + ... + } + SWIG_CATCH_STDEXCEPT // catch std::exception + catch (...) { + SWIG_exception(SWIG_UnknownError, "Unknown exception"); + } + } +*/ +%{ +#include <stdexcept> +%} +%define SWIG_CATCH_STDEXCEPT + /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception(SWIG_SystemError, e.what() ); + } +%enddef +%define SWIG_CATCH_UNKNOWN + catch (std::exception& e) { + SWIG_exception(SWIG_SystemError, e.what() ); + } + catch (...) { + SWIG_exception(SWIG_UnknownError, "unknown exception"); + } +%enddef + +/* rethrow the unknown exception */ + +#if defined(SWIGCSHARP) || defined(SWIGD) +%typemap(throws,noblock=1, canthrow=1) (...) { + SWIG_exception(SWIG_RuntimeError,"unknown exception"); +} +#else +%typemap(throws,noblock=1) (...) { + SWIG_exception(SWIG_RuntimeError,"unknown exception"); +} +#endif + +#endif /* __cplusplus */ + +/* exception.i ends here */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/intrusive_ptr.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/intrusive_ptr.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,82 @@ +// Allow for different namespaces for shared_ptr / intrusive_ptr - they could be boost or std or std::tr1 +// For example for std::tr1, use: +// #define SWIG_SHARED_PTR_NAMESPACE std +// #define SWIG_SHARED_PTR_SUBNAMESPACE tr1 +// #define SWIG_INTRUSIVE_PTR_NAMESPACE boost +// #define SWIG_INTRUSIVE_PTR_SUBNAMESPACE + +#if !defined(SWIG_INTRUSIVE_PTR_NAMESPACE) +# define SWIG_INTRUSIVE_PTR_NAMESPACE boost +#endif + +#if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE) +# define SWIG_INTRUSIVE_PTR_QNAMESPACE SWIG_INTRUSIVE_PTR_NAMESPACE::SWIG_INTRUSIVE_PTR_SUBNAMESPACE +#else +# define SWIG_INTRUSIVE_PTR_QNAMESPACE SWIG_INTRUSIVE_PTR_NAMESPACE +#endif + +namespace SWIG_INTRUSIVE_PTR_NAMESPACE { +#if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE) + namespace SWIG_INTRUSIVE_PTR_SUBNAMESPACE { +#endif + template <class T> class intrusive_ptr { + }; +#if defined(SWIG_INTRUSIVE_PTR_SUBNAMESPACE) + } +#endif +} + +%fragment("SWIG_intrusive_deleter", "header") { +template<class T> struct SWIG_intrusive_deleter { + void operator()(T *p) { + if (p) + intrusive_ptr_release(p); + } +}; +} + +%fragment("SWIG_null_deleter", "header") { +struct SWIG_null_deleter { + void operator() (void const *) const { + } +}; +%#define SWIG_NO_NULL_DELETER_0 , SWIG_null_deleter() +%#define SWIG_NO_NULL_DELETER_1 +} + +// Workaround empty first macro argument bug +#define SWIGEMPTYHACK +// Main user macro for defining intrusive_ptr typemaps for both const and non-const pointer types +%define %intrusive_ptr(TYPE...) +%feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > } +SWIG_INTRUSIVE_PTR_TYPEMAPS(SWIGEMPTYHACK, TYPE) +SWIG_INTRUSIVE_PTR_TYPEMAPS(const, TYPE) +%enddef + +%define %intrusive_ptr_no_wrap(TYPE...) +%feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > } +SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(SWIGEMPTYHACK, TYPE) +SWIG_INTRUSIVE_PTR_TYPEMAPS_NO_WRAP(const, TYPE) +%enddef + +// Legacy macros +%define SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE...) +#warning "SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE) is deprecated. Please use %intrusive_ptr(TYPE) instead." +%intrusive_ptr(TYPE) +%enddef + +%define SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...) +#warning "SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %intrusive_ptr(TYPE) instead." +%intrusive_ptr(TYPE) +%enddef + +%define SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE...) +#warning "SWIG_INTRUSIVE_PTR_NO_WRAP(PROXYCLASS, TYPE) is deprecated. Please use %intrusive_ptr_no_wrap(TYPE) instead." +%intrusive_ptr_no_wrap(TYPE) +%enddef + +%define SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE...) +#warning "SWIG_INTRUSIVE_PTR_DERIVED_NO_WRAP(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %intrusive_ptr_no_wrap(TYPE) instead." +%intrusive_ptr_no_wrap(TYPE) +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/inttypes.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/inttypes.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,91 @@ +/* ----------------------------------------------------------------------------- + * inttypes.i + * + * SWIG library file for ISO C99 types: 7.8 Format conversion of integer types <inttypes.h> + * ----------------------------------------------------------------------------- */ + +%{ +#include <inttypes.h> +%} + +%include <stdint.i> +%include <wchar.i> + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef SWIGWORDSIZE64 + + /* We have to define the `uintmax_t' type using `ldiv_t'. */ + typedef struct + { + long int quot; /* Quotient. */ + long int rem; /* Remainder. */ + } imaxdiv_t; + +#else + + /* We have to define the `uintmax_t' type using `lldiv_t'. */ + typedef struct + { + long long int quot; /* Quotient. */ + long long int rem; /* Remainder. */ + } imaxdiv_t; + +#endif + + /* Compute absolute value of N. */ + extern intmax_t imaxabs (intmax_t n); + + /* Return the `imaxdiv_t' representation of the value of NUMER over DENOM. */ + extern imaxdiv_t imaxdiv (intmax_t numer, intmax_t denom); + + /* Like `strtol' but convert to `intmax_t'. */ + extern intmax_t strtoimax (const char *nptr, char **endptr, int base); + + /* Like `strtoul' but convert to `uintmax_t'. */ + extern uintmax_t strtoumax (const char *nptr, char ** endptr, int base); + +#ifdef SWIG_WCHAR + /* Like `wcstol' but convert to `intmax_t'. */ + extern intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base); + + /* Like `wcstoul' but convert to `uintmax_t'. */ + extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t ** endptr, int base); +#endif + +#ifdef SWIGWORDSIZE64 + + /* Like `strtol' but convert to `intmax_t'. */ + extern intmax_t strtoimax (const char *nptr, char **endptr, int base); + + /* Like `strtoul' but convert to `uintmax_t'. */ + extern uintmax_t strtoumax (const char *nptr, char **endptr,int base); + +#ifdef SWIG_WCHAR + /* Like `wcstol' but convert to `intmax_t'. */ + extern intmax_t wcstoimax (const wchar_t *nptr, wchar_t **endptr, int base); + + /* Like `wcstoul' but convert to `uintmax_t'. */ + extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base); +#endif + +#else /* SWIGWORDSIZE32 */ + + /* Like `strtol' but convert to `intmax_t'. */ + extern intmax_t strtoimax (const char *nptr, char **endptr, int base); + + /* Like `strtoul' but convert to `uintmax_t'. */ + extern uintmax_t strtoumax (const char *nptr, char **endptr, int base); + +#ifdef SWIG_WCHAR + /* Like `wcstol' but convert to `intmax_t'. */ + extern uintmax_t wcstoumax (const wchar_t *nptr, wchar_t **endptr, int base); +#endif + +#endif /* SWIGWORDSIZE32 */ + +#ifdef __cplusplus +} +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/linkruntime.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/linkruntime.c Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,22 @@ +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +static void *ptr = 0; +SWIGEXPORT void * +SWIG_ReturnGlobalTypeList(void *t) { + if (!ptr && !t) ptr = t; + return ptr; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/_std_common.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/_std_common.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,93 @@ +/* ----------------------------------------------------------------------------- + * _std_common.i + * + * std::helpers for LUA + * ----------------------------------------------------------------------------- */ + +%include <std_except.i> // the general exceptions + +/* +The basic idea here, is instead of trying to feed SWIG all the +horribly templated STL code, to give it a neatened version. + +These %defines cover some of the more common methods +so the class declarations become just a set of %defines + +*/ + +/* #define for basic container features +note: I allow front(), back() & pop_back() to throw exceptions +upon empty containers, rather than coredump +(as we haven't defined the methods, we can use %extend to add with +new features) + +*/ +%define %STD_CONTAINER_METHODS(CLASS,T) +public: + CLASS(); + CLASS(const CLASS&); + unsigned int size() const; + unsigned int max_size() const; + bool empty() const; + void clear(); + %extend { // the extra stuff which must be checked + T front()const throw (std::out_of_range){ // only read front & back + if (self->empty()) + throw std::out_of_range("in "#CLASS"::front()"); + return self->front(); + } + T back()const throw (std::out_of_range){ // not write to them + if (self->empty()) + throw std::out_of_range("in "#CLASS"::back()"); + return self->back(); + } + } +%enddef + +/* push/pop for front/back +also note: front & back are read only methods, not used for writing +*/ +%define %STD_FRONT_ACCESS_METHODS(CLASS,T) +public: + void push_front(const T& val); + %extend { // must check this + void pop_front() throw (std::out_of_range){ + if (self->empty()) + throw std::out_of_range("in "#CLASS"::pop_front()"); + self->pop_back(); + } + } +%enddef + +%define %STD_BACK_ACCESS_METHODS(CLASS,T) +public: + void push_back(const T& val); + %extend { // must check this + void pop_back() throw (std::out_of_range){ + if (self->empty()) + throw std::out_of_range("in "#CLASS"::pop_back()"); + self->pop_back(); + } + } +%enddef + +/* +Random access methods +*/ +%define %STD_RANDOM_ACCESS_METHODS(CLASS,T) + %extend // this is a extra bit of SWIG code + { + // [] is replaced by __getitem__ & __setitem__ + // simply throws a string, which causes a lua error + T __getitem__(unsigned int idx) throw (std::out_of_range){ + if (idx>=self->size()) + throw std::out_of_range("in "#CLASS"::__getitem__()"); + return (*self)[idx]; + } + void __setitem__(unsigned int idx,const T& val) throw (std::out_of_range){ + if (idx>=self->size()) + throw std::out_of_range("in "#CLASS"::__setitem__()"); + (*self)[idx]=val; + } + }; +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/carrays.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/carrays.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,8 @@ +/* Small change to the standard carrays.i +renaming the field to __getitem & __setitem +for operator[] access +*/ +%rename(__getitem) *::getitem; // the v=X[i] (get operator) +%rename(__setitem) *::setitem; // the X[i]=v (set operator) + +%include <../carrays.i> diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/factory.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/factory.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,23 @@ +/* + A modification of factory.swg from the generic UTL library. +*/ + +%include <typemaps/swigmacros.swg> + +%define %_factory_dispatch(Type) +if (!dcast) { + Type *dobj = dynamic_cast<Type *>($1); + if (dobj) { + dcast = 1; + SWIG_NewPointerObj(L, dobj, $descriptor(Type *), $owner); SWIG_arg++; + } +}%enddef + +%define %factory(Method,Types...) +%typemap(out) Method { + int dcast = 0; + %formacro(%_factory_dispatch, Types) + if (!dcast) { + SWIG_NewPointerObj(L, $1, $descriptor, $owner); SWIG_arg++; + } +}%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/lua.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/lua.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,232 @@ +/* ----------------------------------------------------------------------------- + * lua.swg + * + * SWIG Configuration File for Lua. + * This file is parsed by SWIG before reading any other interface file. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * includes + * ----------------------------------------------------------------------------- */ + +%include <luatypemaps.swg> /* The typemaps */ +%include <luaruntime.swg> /* The runtime stuff */ + +//%include <typemaps/swigmacros.swg> +/* ----------------------------------------------------------------------------- + * constants typemaps + * ----------------------------------------------------------------------------- */ +// this basically adds to a table of constants +%typemap(consttab) int, unsigned int, short, unsigned short, long, unsigned long, unsigned char, signed char, bool, enum SWIGTYPE + {SWIG_LUA_CONSTTAB_INT("$symname", $value)} + +%typemap(consttab) float, double + {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} + +%typemap(consttab) long long, unsigned long long, signed long long + {SWIG_LUA_CONSTTAB_FLOAT("$symname", $value)} + +%typemap(consttab) const long long&, const unsigned long long&, const signed long long& + {SWIG_LUA_CONSTTAB_FLOAT("$symname", *$value)} + +%typemap(consttab) char *, const char *, char [], const char [] + {SWIG_LUA_CONSTTAB_STRING("$symname", $value)} + +// note: char is treated as a seperate special type +// signed char & unsigned char are numbers +%typemap(consttab) char + {SWIG_LUA_CONSTTAB_CHAR("$symname", $value)} + +%typemap(consttab) long long, unsigned long long + {SWIG_LUA_CONSTTAB_STRING("$symname", "$value")} + +%typemap(consttab) SWIGTYPE *, SWIGTYPE *const, SWIGTYPE &, SWIGTYPE [] + { SWIG_LUA_POINTER, (char *)"$symname", 0, 0, (void *)$value, &$1_descriptor} + +// member function pointers +%typemap(consttab) SWIGTYPE (CLASS::*) + { SWIG_LUA_BINARY, (char *)"$symname", sizeof($type), 0, (void *)&$value, &$1_descriptor} + + +/* ----------------------------------------------------------------------------- + * Overloaded operator support + * ----------------------------------------------------------------------------- */ +// lua calls the + operator '__add' +// python likes to call it '__add__' +// Assuming most SWIGers will probably use the __add__ if they extend their classes +// we have two sets of renames +// one to rename the operator+() to __add() +// (this lets SWIG rename the operator overloads) +// another is to rename __add__() to __add() +// (this means that people who wrote SWIG code to do that add will also work) + +#ifdef __cplusplus +// this is extra renaming for lua +// not all operators are supported, so only those that are, are listed +%rename(__add) *::operator+; +%rename(__sub) *::operator-; +%rename(__mul) *::operator*; +%rename(__div) *::operator/; +%rename(__unm) *::operator-(); +%rename(__unm) *::operator-() const; + +%rename(__eq) *::operator==; +%ignore *::operator!=; // note: Lua does not have a notequal operator + // it just uses 'not (a==b)' +%rename(__lt) *::operator<; +%ignore *::operator>; // ditto less than vs greater than +%rename(__le) *::operator<=; +%ignore *::operator>=; // ditto less than vs greater than +%ignore *::operator!; // does not support not + +%rename(__call) *::operator(); // the fn call operator + +// lua does not support overloading of: +// logical/bitwise operators +// assign operator +// +=,-=,*=, etc +// therefore ignoring them for now +// it also doesn't support non class operators +// eg friends or XX operator+(XX,XX) +// also ignoring +// note: some of these might be better to rename, but not doing that for now +%ignore *::operator&&; %ignore operator&&; +%ignore *::operator||; %ignore operator||; +%ignore *::operator+=; +%ignore *::operator-=; +%ignore *::operator*=; +%ignore *::operator/=; +%ignore *::operator%=; +%ignore *::operator++; %ignore *::operator--; + +%ignore *::operator=; // note: this might be better to rename to assign() or similar + +%ignore operator+; +%ignore operator-; +%ignore operator*; +%ignore operator/; +%ignore operator%; +%ignore operator[]; +%ignore operator>; %ignore operator>=; +%ignore operator<; %ignore operator<=; +%ignore operator==; %ignore operator!=; + + +// renaming the python operators to be compatible with lua +// this means that if a developer has written a fn __add__() +// it will be used for the lua + +%rename(__add) *::__add__; +%rename(__sub) *::__sub__; +%rename(__mul) *::__mul__; +%rename(__div) *::__div__; +%rename(__unm) *::__neg__; // lua calls unary minus,'unm' not 'neg' +%rename(__tostring) *::__str__; // both map to __tostring +%rename(__tostring) *::__repr__; // both map to __tostring + + +%rename(__pow) *::__pow__; // lua power '^' operator +%rename(__concat) *::__concat__; // lua concat '..' operator +%rename(__eq) *::__eq__; +%rename(__lt) *::__lt__; +%rename(__le) *::__le__; +%rename(__call) *::__call__; // the fn call operator() + +// the [] operator has two parts, the get & the set +%rename(__getitem) *::__getitem__; // the v=X[i] (get operator) +%rename(__setitem) *::__setitem__; // the X[i]=v (set operator) + + +#endif + + +/* ------------------------------------------------------------ + * Exceptions + * ------------------------------------------------------------ */ +/* Confession: I don't really like C++ exceptions +The python/lua ones are great, but C++ ones I don't like +(mainly because I cannot get the stack trace out of it) +Therefore I have not bothered to try doing much in this + +Therefore currently its just enough to get a few test cases running ok + +note: if you wish to throw anything related to std::exception +use %include <std_except.i> instead +*/ + +// number as number+error +%typemap(throws) int,unsigned int,signed int, + long,unsigned long,signed long, + short,unsigned short,signed short, + float,double, + long long,unsigned long long, + unsigned char, signed char, + int&,unsigned int&,signed int&, + long&,unsigned long&,signed long&, + short&,unsigned short&,signed short&, + float&,double&, + long long&,unsigned long long&, + unsigned char&, signed char& +%{lua_pushnumber(L,(lua_Number)$1);SWIG_fail; %} + +%typemap(throws) bool,bool& +%{lua_pushboolean(L,(int)($1==true));SWIG_fail; %} + +// enum as number+error +%typemap(throws) enum SWIGTYPE +%{lua_pushnumber(L,(lua_Number)(int)$1);SWIG_fail; %} + +// strings are just sent as errors +%typemap(throws) char *, const char * +%{lua_pushstring(L,$1);SWIG_fail;%} + +// char is changed to a string +%typemap(throws) char +%{lua_pushfstring(L,"%c",$1);SWIG_fail;%} + +/* +Throwing object is a serious problem: +Assuming some code throws a 'FooBar' +There are a few options: +- return a pointer to it: but its unclear how long this will last for. +- return a copy of it: but not all objects are copyable + (see exception_partial_info in the test suite for a case where you cannot do this) +- convert to a string & throw that + it's not so useful, but it works (this is more lua like). +The third option (though not nice) is used +For a more useful solution: see std_except for more details +*/ + +// basic typemap for structs, classes, pointers & references +// convert to string and error +%typemap(throws) SWIGTYPE +%{(void)$1; /* ignore it */ +lua_pushfstring(L,"object exception:%s",SWIG_TypePrettyName($1_descriptor)); +SWIG_fail;%} + +// code to make a copy of the object and return this +// if you have a function which throws a FooBar & you want SWIG to return a copy of the object as its error +// then use one of the below +// %apply SWIGTYPE EXCEPTION_BY_VAL {FooBar}; +// %apply SWIGTYPE& EXCEPTION_BY_VAL {FooBar&}; // note: need & twice +%typemap(throws) SWIGTYPE EXCEPTION_BY_VAL +%{SWIG_NewPointerObj(L,(void *)new $1_ltype(($1_ltype &) $1),$&1_descriptor,1); +SWIG_fail;%} + +// similar for object reference +// note: swig typemaps seem a little confused around here, therefore we use $basetype +%typemap(throws) SWIGTYPE& EXCEPTION_BY_VAL +%{SWIG_NewPointerObj(L,(void *)new $basetype($1),$1_descriptor,1); +SWIG_fail;%} + + +// note: no support for object pointers +// its not clear how long the pointer is valid for, therefore not supporting it + +/* ----------------------------------------------------------------------------- + * extras + * ----------------------------------------------------------------------------- */ +// this %define is to allow insertion of lua source code into the wrapper file +#define %luacode %insert("luacode") + + +/* ------------------------------ end lua.swg ------------------------------ */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/lua_fnptr.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/lua_fnptr.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,125 @@ +/* ----------------------------------------------------------------------------- + * lua_fnptr.i + * + * SWIG Library file containing the main typemap code to support Lua modules. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * Basic function pointer support + * ----------------------------------------------------------------------------- */ +/* +The structure: SWIGLUA_FN provides a simple (local only) wrapping for a function. + +For example if you wanted to have a C/C++ function take a lua function as a parameter. +You could declare it as: + int my_func(int a, int b, SWIGLUA_FN fn); +note: it should be passed by value, not byref or as a pointer. + +The SWIGLUA_FN holds a pointer to the lua_State, and the stack index where the function is held. +The macro SWIGLUA_FN_GET() will put a copy of the lua function at the top of the stack. +After that its fairly simple to write the rest of the code (assuming know how to use lua), +just push the parameters, call the function and return the result. + + int my_func(int a, int b, SWIGLUA_FN fn) + { + SWIGLUA_FN_GET(fn); + lua_pushnumber(fn.L,a); + lua_pushnumber(fn.L,b); + lua_call(fn.L,2,1); // 2 in, 1 out + return luaL_checknumber(fn.L,-1); + } + +SWIG will automatically performs the wrapping of the arguments in and out. + +However: if you wish to store the function between calls, look to the SWIGLUA_REF below. + +*/ +// this is for the C code only, we don't want SWIG to wrapper it for us. +%{ +typedef struct{ + lua_State* L; /* the state */ + int idx; /* the index on the stack */ +}SWIGLUA_FN; + +#define SWIGLUA_FN_GET(fn) {lua_pushvalue(fn.L,fn.idx);} +%} + +// the actual typemap +%typemap(in,checkfn="lua_isfunction") SWIGLUA_FN +%{ $1.L=L; $1.idx=$input; %} + +/* ----------------------------------------------------------------------------- + * Storing lua object support + * ----------------------------------------------------------------------------- */ +/* +The structure: SWIGLUA_REF provides a mechanism to store object (usually functions) +between calls to the interpreter. + +For example if you wanted to have a C/C++ function take a lua function as a parameter. +Then call it later, You could declare it as: + SWIGLUA_REF myref; + void set_func(SWIGLUA_REF ref); + SWIGLUA_REF get_func(); + void call_func(int val); +note: it should be passed by value, not byref or as a pointer. + +The SWIGLUA_REF holds a pointer to the lua_State, and an integer reference to the object. +Because it holds a permanent ref to an object, the SWIGLUA_REF must be handled with a bit more care. +It should be initialised to {0,0}. The function swiglua_ref_set() should be used to set it. +swiglua_ref_clear() should be used to clear it when not in use, and swiglua_ref_get() to get the +data back. + +Note: the typemap does not check that the object is in fact a function, +if you need that you must add it yourself. + + + int my_func(int a, int b, SWIGLUA_FN fn) + { + SWIGLUA_FN_GET(fn); + lua_pushnumber(fn.L,a); + lua_pushnumber(fn.L,b); + lua_call(fn.L,2,1); // 2 in, 1 out + return luaL_checknumber(fn.L,-1); + } + +SWIG will automatically performs the wrapping of the arguments in and out. + +However: if you wish to store the function between calls, look to the SWIGLUA_REF below. + +*/ + +%{ +typedef struct{ + lua_State* L; /* the state */ + int ref; /* a ref in the lua global index */ +}SWIGLUA_REF; + + +void swiglua_ref_clear(SWIGLUA_REF* pref){ + if (pref->L!=0 && pref->ref!=LUA_NOREF && pref->ref!=LUA_REFNIL){ + luaL_unref(pref->L,LUA_REGISTRYINDEX,pref->ref); + } + pref->L=0; pref->ref=0; +} + +void swiglua_ref_set(SWIGLUA_REF* pref,lua_State* L,int idx){ +// swiglua_ref_clear(pref); /* just in case */ + pref->L=L; + lua_pushvalue(L,idx); /* copy obj to top */ + pref->ref=luaL_ref(L,LUA_REGISTRYINDEX); /* remove obj from top & put into registry */ +} + +void swiglua_ref_get(SWIGLUA_REF* pref){ + if (pref->L!=0) + lua_rawgeti(pref->L,LUA_REGISTRYINDEX,pref->ref); +} + +%} + +%typemap(in) SWIGLUA_REF +%{ swiglua_ref_set(&$1,L,$input); %} + +%typemap(out) SWIGLUA_REF +%{ if ($1.L!=0) {swiglua_ref_get(&$1);} else {lua_pushnil(L);} + SWIG_arg++; %} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/luarun.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/luarun.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1140 @@ +/* ----------------------------------------------------------------------------- + * luarun.swg + * + * This file contains the runtime support for Lua modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lua.h" +#include "lauxlib.h" +#include <stdlib.h> /* for malloc */ +#include <assert.h> /* for a few sanity tests */ + +/* ----------------------------------------------------------------------------- + * Lua flavors + * ----------------------------------------------------------------------------- */ + +#define SWIG_LUA_FLAVOR_LUA 1 +#define SWIG_LUA_FLAVOR_ELUA 2 +#define SWIG_LUA_FLAVOR_ELUAC 3 + +#if !defined(SWIG_LUA_TARGET) +# error SWIG_LUA_TARGET not defined +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) +# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) +#else /* SWIG_LUA_FLAVOR_LUA */ +# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 +# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 +# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} +# define LSTRVAL LRO_STRVAL +#endif + +/* ----------------------------------------------------------------------------- + * compatibility defines + * ----------------------------------------------------------------------------- */ + +/* History of Lua C API length functions: In Lua 5.0 (and before?) + there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", + but a compatibility define of "lua_strlen" was added. In Lua 5.2, + this function was again renamed, to "lua_rawlen" (to emphasize that + it doesn't call the "__len" metamethod), and the compatibility + define of lua_strlen was removed. All SWIG uses have been updated + to "lua_rawlen", and we add our own defines of that here for older + versions of Lua. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +# define lua_rawlen lua_strlen +#elif LUA_VERSION_NUM == 501 +# define lua_rawlen lua_objlen +#endif + + +/* lua_pushglobaltable is the recommended "future-proof" way to get + the global table for Lua 5.2 and later. Here we define + lua_pushglobaltable ourselves for Lua versions before 5.2. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) +#endif + + +/* -------------------------------------------------------------------------- + * Helper functions for error handling + * -------------------------------------------------------------------------- */ + +/* Push the string STR on the Lua stack, like lua_pushstring, but + prefixed with the the location of the innermost Lua call-point + (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pusherrstring (lua_State *L, const char *str) +{ + luaL_where (L, 1); + lua_pushstring (L, str); + lua_concat (L, 2); +} + +/* Push a formatted string generated from FMT and following args on + the Lua stack, like lua_pushfstring, but prefixed with the the + location of the innermost Lua call-point (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); +} + + +/* ----------------------------------------------------------------------------- + * global swig types + * ----------------------------------------------------------------------------- */ +/* Constant table */ +#define SWIG_LUA_INT 1 +#define SWIG_LUA_FLOAT 2 +#define SWIG_LUA_STRING 3 +#define SWIG_LUA_POINTER 4 +#define SWIG_LUA_BINARY 5 +#define SWIG_LUA_CHAR 6 + +/* Structure for variable linking table */ +typedef struct { + const char *name; + lua_CFunction get; + lua_CFunction set; +} swig_lua_var_info; + +/* Constant information structure */ +typedef struct { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_lua_const_info; + +typedef struct { + const char *name; + lua_CFunction method; +} swig_lua_method; + +typedef struct { + const char *name; + lua_CFunction getmethod; + lua_CFunction setmethod; +} swig_lua_attribute; + +// Can be used to create namespaces. Currently used to +// wrap class static methods/variables/constants +typedef struct { + const char *name; + swig_lua_method *ns_methods; + swig_lua_attribute *ns_attributes; + swig_lua_const_info *ns_constants; +} swig_lua_namespace; + +typedef struct swig_lua_class { + const char *name; + swig_type_info **type; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; + swig_lua_attribute *attributes; + swig_lua_namespace cls_static; + struct swig_lua_class **bases; + const char **base_names; +} swig_lua_class; + +/* this is the struct for wrapping all pointers in SwigLua +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + void *ptr; +} swig_lua_userdata; + +/* this is the struct for wrapping arbitrary packed binary data +(currently it is only used for member function pointers) +the data ordering is similar to swig_lua_userdata, but it is currently not possible +to tell the two structures apart within SWIG, other than by looking at the type +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + char data[1]; /* arbitary amount of data */ +} swig_lua_rawdata; + +/* Common SWIG API */ +#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) +#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) + +/* Runtime API */ +#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) +#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) +#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* + +/* Contract support */ +#define SWIG_contract_assert(expr, msg) \ + if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else + + +/* helper #defines */ +#define SWIG_fail {goto fail;} +#define SWIG_fail_arg(func_name,argnum,type) \ + {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ + func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ + goto fail;} +#define SWIG_fail_ptr(func_name,argnum,type) \ + SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") +#define SWIG_check_num_args(func_name,a,b) \ + if (lua_gettop(L)<a || lua_gettop(L)>b) \ + {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ + goto fail;} + + +#define SWIG_Lua_get_table(L,n) \ + (lua_pushstring(L, n), lua_rawget(L,-2)) + +#define SWIG_Lua_add_function(L,n,f) \ + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) + +/* special helper for allowing 'nil' for usertypes */ +#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) + +#ifdef __cplusplus +/* Special helper for member function pointers +it gets the address, casts it, then dereferences it */ +//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) +#endif + +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State* L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} + +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: modules + * ----------------------------------------------------------------------------- */ + +/* this function is called when trying to set an immutable. +default action is to print an error. +This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ +SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) +{ +/* there should be 1 param passed in: the new value */ +#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE + lua_pop(L,1); /* remove it */ + luaL_error(L,"This variable is immutable"); +#endif + return 0; /* should not return anything */ +} + +/* the module.get method used for getting linked data */ +SWIGINTERN int SWIG_Lua_module_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute + printf("SWIG_Lua_module_get %p(%s) '%s'\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2)); +*/ + /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,1)); /* just in case */ +#else + assert(lua_istable(L,1)); /* default Lua action */ +#endif + lua_getmetatable(L,1); /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,-1)); /* just in case */ +#else + assert(lua_istable(L,-1)); +#endif + SWIG_Lua_get_table(L,".get"); /* get the .get table */ + lua_remove(L,3); /* remove metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + if (lua_isrotable(L,-1)) +#else + if (lua_istable(L,-1)) +#endif + { + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,3); /* remove .get */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); + return 1; + } + lua_pop(L,1); /* remove the top */ + } + lua_pop(L,1); /* remove the .get */ + lua_pushnil(L); /* return a nil */ + return 1; +} + +/* the module.set method used for setting linked data */ +SWIGINTERN int SWIG_Lua_module_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,1)); /* just in case */ +#else + assert(lua_istable(L,1)); /* default Lua action */ +#endif + lua_getmetatable(L,1); /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,-1)); /* just in case */ +#else + assert(lua_istable(L,-1)); +#endif + SWIG_Lua_get_table(L,".set"); /* get the .set table */ + lua_remove(L,4); /* remove metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + if (lua_isrotable(L,-1)) +#else + if (lua_istable(L,-1)) +#endif + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,4); /* remove .set */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) + else { + return 0; // Exits stoically if an invalid key is initialized. + } +#endif + } + lua_settop(L,3); /* reset back to start */ + /* we now have the table, key & new value, so just set directly */ + lua_rawset(L,1); /* add direct */ + return 0; +} + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* registering a module in lua. Pushes the module table on the stack. */ +SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) +{ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushstring(L,name); + lua_newtable(L); /* the table */ + /* add meta table */ + lua_newtable(L); /* the meta table */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); + lua_pushstring(L,".get"); + lua_newtable(L); /* the .get table */ + lua_rawset(L,-3); /* add .get into metatable */ + lua_pushstring(L,".set"); + lua_newtable(L); /* the .set table */ + lua_rawset(L,-3); /* add .set into metatable */ + lua_setmetatable(L,-2); /* sets meta table in module */ +#ifdef SWIG_LUA_MODULE_GLOBAL + /* If requested, install the module directly into the global namespace. */ + lua_rawset(L,-3); /* add module into parent */ + SWIG_Lua_get_table(L,name); /* get the table back out */ +#else + /* Do not install the module table as global name. The stack top has + the module table with the name below. We pop the top and replace + the name with it. */ + lua_replace(L,-2); +#endif +} + +/* ending the register */ +SWIGINTERN void SWIG_Lua_module_end(lua_State* L) +{ + lua_pop(L,1); /* tidy stack (remove module) */ +} + +/* adding a linked variable to the module */ +SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + lua_getmetatable(L,-1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) /* if there is a set fn */ + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } + lua_pop(L,1); /* tidy stack (remove meta) */ +} +#endif + +/* adding a function module */ +SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) +{ + SWIG_Lua_add_function(L,name,fn); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: namespaces + * ----------------------------------------------------------------------------- */ + +SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute +*/ + assert(lua_istable(L,-2)); /* just in case */ + lua_getmetatable(L,-2); + assert(lua_istable(L,-1)); + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + return 0; +} + +SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + + assert(lua_istable(L,1)); + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + return 0; +} + +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration +SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration + +/* helper function - register namespace methods and attributes into namespace */ +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns) +{ + int i = 0; + assert(lua_istable(L,-1)); + /* There must be table at the top of the stack */ + SWIG_Lua_InstallConstants(L, ns->ns_constants); + + lua_getmetatable(L,-1); + + /* add fns */ + for(i=0;ns->ns_attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); + } + + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method); + } + lua_pop(L,1); + + /* clear stack - remove metatble */ + lua_pop(L,1); + +} + +/* helper function. creates namespace table and add it to module table */ +SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) +{ + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */ + lua_checkstack(L,5); + lua_pushstring(L, ns->name); + lua_newtable(L); /* namespace itself */ + lua_newtable(L); /* metatable for namespace */ + + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); + + lua_setmetatable(L,-2); /* set metatable */ + lua_rawset(L,-3); /* add namespace to module table */ +} +/* ----------------------------------------------------------------------------- + * global variable support code: classes + * ----------------------------------------------------------------------------- */ + +/* the class.get method, performs the lookup of class attributes */ +SWIGINTERN int SWIG_Lua_class_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute +*/ + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; /* sorry not known */ +} + +/* the class.set method, performs the lookup of class attributes */ +SWIGINTERN int SWIG_Lua_class_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2), + lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + + assert(lua_isuserdata(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* userdata */ + lua_pushvalue(L,3); /* value */ + lua_call(L,2,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_pushvalue(L,3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; +} + +/* the class.destruct method called by the interpreter */ +SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + swig_lua_class* clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; +} + +/* the class.__tostring method called by the interpreter and print */ +SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L) +{ +/* there should be 1 param passed in + (1) userdata (not the metatable) */ + assert(lua_isuserdata(L,1)); /* just in case */ + unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + lua_getfield(L, -1, ".type"); + const char* className = lua_tostring(L, -1); + + char output[256]; + sprintf(output, "<%s userdata: %lX>", className, userData); + + lua_pushstring(L, (const char*)output); + return 1; +} + +/* to manually disown some userdata */ +SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + + usr->own = 0; /* clear our ownership */ + return 0; +} + +/* Constructor proxy. Used when class name entry in module is not class constructor, +but special table instead. */ +SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L) +{ + /* unlimited number of parameters + First one is our proxy table and we should remove it + Other we should pass to real constructor + */ + assert(lua_istable(L,1)); + lua_pushstring(L,".constructor"); + lua_rawget(L,1); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} + +/* gets the swig class registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) +{ + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + lua_rawset(L,LUA_REGISTRYINDEX); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } +} + +/* helper fn to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) +{ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ +} + +/* helper add a variable to a registered class */ +SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } +} + +/* helper to recursively add class static details (static attributes, operations and constants) */ +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss) +{ + int i = 0; + /* The class namespace table must be on the top of the stack */ + assert(lua_istable(L,-1)); + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_static_details(L,clss->bases[i]); + } + + SWIG_Lua_add_namespace_details(L, &clss->cls_static); +} + +/* helper to recursively add class details (attributes & operations) */ +SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) +{ + int i; + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_details(L,clss->bases[i]); + } + /* add fns */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + these look ANY method which start with "__" and assume they + are operator overloads & add them to the metatable + (this might mess up is someone defines a method __gc (the destructor)*/ + for(i=0;clss->methods[i].name;i++){ + if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + } +} + +/* set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) +{ + int i=0; + swig_module_info* module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +/* Register class static methods,attributes etc as well as constructor proxy */ +SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss) +{ + lua_checkstack(L,5); /* just in case */ + assert(lua_istable(L,-1)); /* just in case */ + assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */ + + SWIG_Lua_namespace_register(L,&clss->cls_static); + + SWIG_Lua_get_table(L,clss->name); // Get namespace table back + assert(lua_istable(L,-1)); /* just in case */ + + /* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + { + SWIG_Lua_add_function(L,".constructor", clss->constructor); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy); + lua_pop(L,1); + } + + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_class_static_details(L, clss); + + /* clear stack */ + lua_pop(L,1); +} + +/* performs the entire class registration process */ +SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) +{ + SWIG_Lua_class_register_static(L,clss); + + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->name); /* get the name */ + lua_newtable(L); /* create the metatable */ + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->name); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + /* add manual disown method */ + SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add tostring method for better output */ + SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ + + SWIG_Lua_get_class_metatable(L,clss->name); + SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ +} + +/* ----------------------------------------------------------------------------- + * Class/structure conversion fns + * ----------------------------------------------------------------------------- */ + +/* helper to add metatable to new lua object */ +SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) +{ + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } +} + +/* pushes a new object into the lua stack */ +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) +{ + swig_lua_userdata* usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +#endif +} + +/* takes a object from the lua stack & converts it into an object of the correct type + (if possible) */ +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) +{ + swig_lua_userdata* usr; + swig_cast_info *cast; + if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ + { + usr->own=0; + } + if (!type) /* special cast void*, no casting fn */ + { + *ptr=usr->ptr; + return SWIG_OK; /* ok */ + } + cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ + if (cast) + { + int newmemory = 0; + *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + return SWIG_OK; /* ok */ + } + } + return SWIG_ERROR; /* error */ +} + +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, + int argnum,const char* func_name){ + void* result; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ + luaL_error (L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + } + return result; +} + +/* pushes a packed userdata. user for member fn pointers only */ +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + assert(ptr); /* not acceptable to pass in a NULL value */ + raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ + raw->type=type; + raw->own=0; + memcpy(raw->data,ptr,size); /* copy the data */ + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +} + +/* converts a packed userdata. user for member fn pointers only */ +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ + if (!raw) return SWIG_ERROR; /* error */ + if (type==0 || type==raw->type) /* void* or identical type */ + { + memcpy(ptr,raw->data,size); /* copy it */ + return SWIG_OK; /* ok */ + } + return SWIG_ERROR; /* error */ +} + +/* a function to get the typestring of a piece of data */ +SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) +{ + swig_lua_userdata* usr; + if (lua_isuserdata(L,tp)) + { + usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ + if (usr && usr->type && usr->type->str) + return usr->type->str; + return "userdata (unknown type)"; + } + return lua_typename(L,lua_type(L,tp)); +} + +/* lua callable function to get the userdata's type */ +SWIGRUNTIME int SWIG_Lua_type(lua_State* L) +{ + lua_pushstring(L,SWIG_Lua_typename(L,1)); + return 1; +} + +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) +{ + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* ----------------------------------------------------------------------------- + * global variable support code: class/struct typemap functions + * ----------------------------------------------------------------------------- */ + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* Install Constants */ +SWIGINTERN void +SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { + int i; + for (i = 0; constants[i].type; i++) { + switch(constants[i].type) { + case SWIG_LUA_INT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_FLOAT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].dvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_CHAR: + lua_pushstring(L,constants[i].name); + lua_pushfstring(L,"%c",(char)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_STRING: + lua_pushstring(L,constants[i].name); + lua_pushstring(L,(char *) constants[i].pvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_POINTER: + lua_pushstring(L,constants[i].name); + SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); + lua_rawset(L,-3); + break; + case SWIG_LUA_BINARY: + lua_pushstring(L,constants[i].name); + SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); + lua_rawset(L,-3); + break; + default: + break; + } + } +} +#endif + +/* ----------------------------------------------------------------------------- + * executing lua code from within the wrapper + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ +#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) +#endif +/* Executes a C string in Lua which is a really simple way of calling lua from C +Unfortunately lua keeps changing its APIs, so we need a conditional compile +In lua 5.0.X its lua_dostring() +In lua 5.1.X its luaL_dostring() +*/ +SWIGINTERN int +SWIG_Lua_dostring(lua_State *L, const char* str) { + int ok,top; + if (str==0 || str[0]==0) return 0; /* nothing to do */ + top=lua_gettop(L); /* save stack */ +#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) + ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ +#else + ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ +#endif + if (ok!=0) { + SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); + } + lua_settop(L,top); /* restore the stack */ + return ok; +} + +#ifdef __cplusplus +} +#endif + +/* ------------------------------ end luarun.swg ------------------------------ */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/luaruntime.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/luaruntime.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,95 @@ +/* ----------------------------------------------------------------------------- + * luaruntime.swg + * + * all the runtime code for . + * ----------------------------------------------------------------------------- */ + +%runtime "swigrun.swg"; /* Common C API type-checking code */ +%runtime "luarun.swg"; /* Lua runtime stuff */ + +%insert(initbeforefunc) "swiginit.swg" + +%insert(initbeforefunc) %{ + +/* Forward declaration of where the user's %init{} gets inserted */ +void SWIG_init_user(lua_State* L ); + +#ifdef __cplusplus +extern "C" { +#endif +/* this is the initialization function + added at the very end of the code + the function is always called SWIG_init, but an earlier #define will rename it +*/ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) +LUALIB_API int SWIG_init(lua_State* L) +#else +SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ +#endif +{ +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ + int i; + /* start with global table */ + lua_pushglobaltable (L); + /* SWIG's internal initalisation */ + SWIG_InitializeModule((void*)L); + SWIG_PropagateClientData(); +#endif + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) + /* add a global fn */ + SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); + /* begin the module (its a table with the same name as the module) */ + SWIG_Lua_module_begin(L,SWIG_name); + /* add commands/functions */ + for (i = 0; swig_commands[i].name; i++){ + SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); + } + /* add variables */ + for (i = 0; swig_variables[i].name; i++){ + SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); + } +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* set up base class pointers (the hierarchy) */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } + /* additional registration structs & classes in lua */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } +#endif + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) + /* constants */ + SWIG_Lua_InstallConstants(L,swig_constants); +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* invoke user-specific initialization */ + SWIG_init_user(L); + /* end module */ + /* Note: We do not clean up the stack here (Lua will do this for us). At this + point, we have the globals table and out module table on the stack. Returning + one value makes the module table the result of the require command. */ + return 1; +#else + return 0; +#endif +} + +#ifdef __cplusplus +} +#endif + +%} + +/* Note: the initialization function is closed after all code is generated */ + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/luatypemaps.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/luatypemaps.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,389 @@ +/* ----------------------------------------------------------------------------- + * luatypemaps.swg + * + * basic typemaps for Lua. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * standard typemaps + * ----------------------------------------------------------------------------- */ +/* NEW LANGUAGE NOTE: + the 'checkfn' param is something that I added for typemap(in) + it is an optional fn call to check the type of the lua object + the fn call must be of the form + int checkfn(lua_State *L, int index); + and return 1/0 depending upon if this is the correct type + For the typemap(out), an additional SWIG_arg parameter must be incremented + to reflect the number of values returned (normally SWIG_arg++; will do) +*/ +// numbers +%typemap(in,checkfn="lua_isnumber") int, short, long, + signed char, float, double +%{$1 = ($type)lua_tonumber(L, $input);%} + +// additional check for unsigned numbers, to not permit negative input +%typemap(in,checkfn="lua_isnumber") unsigned int, + unsigned short, unsigned long, unsigned char +%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative") +$1 = ($type)lua_tonumber(L, $input);%} + +%typemap(out) int,short,long, + unsigned int,unsigned short,unsigned long, + signed char,unsigned char, + float,double +%{ lua_pushnumber(L, (lua_Number) $1); SWIG_arg++;%} + +// we must also provide typemaps for primitives by const reference: +// given a function: +// int intbyref(const int& i); +// SWIG assumes that this code will need a pointer to int to be passed in +// (this might be ok for objects by const ref, but not for numeric primitives) +// therefore we add a set of typemaps to fix this (for both in & out) +%typemap(in,checkfn="lua_isnumber") const int&($basetype temp) +%{ temp=($basetype)lua_tonumber(L,$input); $1=&temp;%} + +%typemap(in,checkfn="lua_isnumber") const unsigned int&($basetype temp) +%{SWIG_contract_assert((lua_tonumber(L,$input)>=0),"number must not be negative") +temp=($basetype)lua_tonumber(L,$input); $1=&temp;%} + +%typemap(out) const int&, const unsigned int& +%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} + +// for the other numbers we can just use an apply statement to cover them +%apply const int & {const short&,const long&,const signed char&, + const float&,const double&}; + +%apply const unsigned int & {const unsigned short&,const unsigned long&, + const unsigned char&}; + +/* enums have to be handled slightly differently + VC++ .net will not allow a cast from lua_Number(double) to enum directly. +*/ +%typemap(in,checkfn="lua_isnumber") enum SWIGTYPE +%{$1 = ($type)(int)lua_tonumber(L, $input);%} + +%typemap(out) enum SWIGTYPE +%{ lua_pushnumber(L, (lua_Number)(int)($1)); SWIG_arg++;%} + +// and const refs +%typemap(in,checkfn="lua_isnumber") const enum SWIGTYPE &($basetype temp) +%{ temp=($basetype)(int)lua_tonumber(L,$input); $1=&temp;%} +%typemap(out) const enum SWIGTYPE & +%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} + + +// boolean (which is a special type in lua) +// note: lua_toboolean() returns 1 or 0 +// note: 1 & 0 are not booleans in lua, only true & false +%typemap(in,checkfn="lua_isboolean") bool +%{$1 = (lua_toboolean(L, $input)!=0);%} + +%typemap(out) bool +%{ lua_pushboolean(L,(int)($1!=0)); SWIG_arg++;%} + +// for const bool&, SWIG treats this as a const bool* so we must dereference it +%typemap(in,checkfn="lua_isboolean") const bool& (bool temp) +%{temp=(lua_toboolean(L, $input)!=0); + $1=&temp;%} + +%typemap(out) const bool& +%{ lua_pushboolean(L,(int)((*$1)!=0)); SWIG_arg++;%} + +// strings (char * and char[]) +%fragment("SWIG_lua_isnilstring", "header") { +SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) { + int ret = lua_isstring(L, idx); + if (!ret) + ret = lua_isnil(L, idx); + return ret; +} +} + +%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char *, char * +%{$1 = ($ltype)lua_tostring(L, $input);%} + +%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char[ANY], char[ANY] +%{$1 = ($ltype)lua_tostring(L, $input);%} + +%typemap(out) const char *, char * +%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} + +%typemap(out) const char[ANY], char[ANY] +%{ lua_pushstring(L,(const char *)$1); SWIG_arg++;%} + +// char's +// currently treating chars as small strings, not as numbers +// (however signed & unsigned char's are numbers...) +%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") char +%{$1 = (lua_tostring(L, $input))[0];%} + +%typemap(out) char +%{ lua_pushfstring(L,"%c",$1); SWIG_arg++;%} + +// by const ref +%typemap(in,checkfn="SWIG_lua_isnilstring",fragment="SWIG_lua_isnilstring") const char& (char temp) +%{temp = (lua_tostring(L, $input))[0]; $1=&temp;%} + +%typemap(out) const char& +%{ lua_pushfstring(L,"%c",*$1); SWIG_arg++;%} + +// pointers and references +// under SWIG rules, it is ok, to have a pass in a lua nil, +// it should be converted to a SWIG NULL. +// This will only be allowed for pointers & arrays, not refs or by value +// the checkfn lua_isuserdata will only work for userdata +// the checkfn SWIG_isptrtype will work for both userdata and nil +%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE*,SWIGTYPE[] +%{ + if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ + SWIG_fail_ptr("$symname",$argnum,$descriptor); + } +%} + +%typemap(in,checkfn="lua_isuserdata") SWIGTYPE& +%{ + if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,$disown))){ + SWIG_fail_ptr("$symname",$argnum,$descriptor); + } +%} + +// out is simple +%typemap(out) SWIGTYPE*,SWIGTYPE& +%{SWIG_NewPointerObj(L,$1,$descriptor,$owner); SWIG_arg++; %} + +// dynamic casts +// this uses the SWIG_TypeDynamicCast() which relies on RTTI to find out what the pointer really is +// the we return it as the correct type +%typemap(out) SWIGTYPE *DYNAMIC, + SWIGTYPE &DYNAMIC +{ + swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1); + SWIG_NewPointerObj(L,(void*)$1,ty,$owner); SWIG_arg++; +} + + +// passing objects by value +// SWIG_ConvertPtr wants an object pointer (the $<ype argp) +// then dereferences it to get the object +%typemap(in,checkfn="lua_isuserdata") SWIGTYPE ($<ype argp) +%{ + if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&argp,$&descriptor,0))){ + SWIG_fail_ptr("$symname",$argnum,$&descriptor); + } + $1 = *argp; +%} + +// Also needed for object ptrs by const ref +// eg A* const& ref_pointer(A* const& a); +// found in mixed_types.i +%typemap(in,checkfn="lua_isuserdata") SWIGTYPE *const&($*ltype temp) +%{temp=($*ltype)SWIG_MustGetPtr(L,$input,$*descriptor,0,$argnum,"$symname"); +$1=($1_ltype)&temp;%} + +%typemap(out) SWIGTYPE *const& +%{SWIG_NewPointerObj(L,*$1,$*descriptor,$owner); SWIG_arg++; %} + + +// DISOWN-ing typemaps +// if you have an object pointer which must be disowned, use this typemap +// eg. for void destroy_foo(Foo* toDie); +// use %apply SWIGTYPE* DISOWN {Foo* toDie}; +// you could just use %delobject, but this is more flexible +%typemap(in,checkfn="SWIG_isptrtype") SWIGTYPE* DISOWN,SWIGTYPE DISOWN[] +%{ if (!SWIG_IsOK(SWIG_ConvertPtr(L,$input,(void**)&$1,$descriptor,SWIG_POINTER_DISOWN))){ + SWIG_fail_ptr("$symname",$argnum,$descriptor); + } +%} + + +// Primitive types--return by value +// must make a new object, copy the data & return the new object +// Note: the brackets are {...} and not %{..%}, because we want them to be included in the wrapper +// this is because typemap(out) does not support local variables, like in typemap(in) does +// and we need the $&1_ltype resultptr; to be declared +#ifdef __cplusplus +%typemap(out) SWIGTYPE +{ + $&1_ltype resultptr = new $1_ltype((const $1_ltype &) $1); + SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; +} +#else +%typemap(out) SWIGTYPE +{ + $&1_ltype resultptr; + resultptr = ($&1_ltype) malloc(sizeof($1_type)); + memmove(resultptr, &$1, sizeof($1_type)); + SWIG_NewPointerObj(L,(void *) resultptr,$&1_descriptor,1); SWIG_arg++; +} +#endif + +// member function pointer +// a member fn ptr is not 4 bytes like a normal pointer, but 8 bytes (at least on mingw) +// so the standard wrapping cannot be done +// nor can you cast a member function pointer to a void* (obviously) +// therefore a special wrapping functions SWIG_ConvertMember() & SWIG_NewMemberObj() were written +#ifdef __cplusplus +%typemap(in,checkfn="lua_isuserdata") SWIGTYPE (CLASS::*) +%{ + if (!SWIG_IsOK(SWIG_ConvertMember(L,$input,(void*)(&$1),sizeof($type),$descriptor))) + SWIG_fail_ptr("$symname",$argnum,$descriptor); +%} + +%typemap(out) SWIGTYPE (CLASS::*) +%{ + SWIG_NewMemberObj(L,(void*)(&$1),sizeof($type),$descriptor); SWIG_arg++; +%} +#endif + + +// void (must be empty without the SWIG_arg++) +%typemap(out) void ""; + +/* void* is a special case +A function void fn(void*) should take any kind of pointer as a parameter (just like C/C++ does) +but if its an output, then it should be wrapped like any other SWIG object (using default typemap) +*/ +%typemap(in,checkfn="SWIG_isptrtype") void* +%{$1=($1_ltype)SWIG_MustGetPtr(L,$input,0,0,$argnum,"$symname");%} + +/* long long is another special case: +as lua only supports one numeric type (lua_Number), we will just +cast it to that & accept the loss of precision. +An alternative solution would be a long long struct or class +with the relevant operators. +*/ +%apply long {long long, signed long long, unsigned long long}; +%apply const long& {const long long&, const signed long long&, const unsigned long long&}; + +/* It is possible to also pass a lua_State* into a function, so +void fn(int a, float b, lua_State* s) is wrappable as +> fn(1,4.3) -- note: the state is implicitly passed in +*/ +%typemap(in, numinputs=0) lua_State* +%{$1 = L;%} + + + +/* ----------------------------------------------------------------------------- + * typecheck rules + * ----------------------------------------------------------------------------- */ +/* These are needed for the overloaded functions +These define the detection routines which will spot what +parameters match which function +*/ + +// unfortunately lua only considers one type of number +// so all numbers (int,float,double) match +// you could add an advanced fn to get type & check if its integral +%typecheck(SWIG_TYPECHECK_INTEGER) + int, short, long, + unsigned int, unsigned short, unsigned long, + signed char, unsigned char, + long long, unsigned long long, signed long long, + const int &, const short &, const long &, + const unsigned int &, const unsigned short &, const unsigned long &, + const signed char&, const unsigned char&, + const long long &, const unsigned long long &, + enum SWIGTYPE, const enum SWIGTYPE&, + float, double, const float &, const double& +{ + $1 = lua_isnumber(L,$input); +} + +%typecheck(SWIG_TYPECHECK_BOOL) + bool, const bool & +{ + $1 = lua_isboolean(L,$input); +} + +// special check for a char (string of length 1) +%typecheck(SWIG_TYPECHECK_CHAR,fragment="SWIG_lua_isnilstring") char, const char& { + $1 = SWIG_lua_isnilstring(L,$input) && (lua_rawlen(L,$input)==1); +} + +%typecheck(SWIG_TYPECHECK_STRING,fragment="SWIG_lua_isnilstring") char *, char[] { + $1 = SWIG_lua_isnilstring(L,$input); +} + +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *, SWIGTYPE [] { + void *ptr; + if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { + $1 = 0; + } else { + $1 = 1; + } +} + +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE & { + void *ptr; + if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $1_descriptor, 0)) { + $1 = 0; + } else { + $1 = 1; + } +} + +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE { + void *ptr; + if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $&1_descriptor, 0)) { + $1 = 0; + } else { + $1 = 1; + } +} + +%typecheck(SWIG_TYPECHECK_VOIDPTR) void * { + void *ptr; + if (SWIG_isptrtype(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, 0, 0)) { + $1 = 0; + } else { + $1 = 1; + } +} + +// Also needed for object pointers by const ref +// eg const A* ref_pointer(A* const& a); +// found in mixed_types.i +%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const& +{ + void *ptr; + if (lua_isuserdata(L,$input)==0 || SWIG_ConvertPtr(L,$input, (void **) &ptr, $*descriptor, 0)) { + $1 = 0; + } else { + $1 = 1; + } +} + +/* ----------------------------------------------------------------------------- + * Others + * ----------------------------------------------------------------------------- */ + +// Array reference typemaps +%apply SWIGTYPE & { SWIGTYPE ((&)[ANY]) } + +/* const pointers */ +%apply SWIGTYPE * { SWIGTYPE *const } + +// size_t (which is just a unsigned long) +%apply unsigned long { size_t }; +%apply const unsigned long & { const size_t & }; + + +/* ----------------------------------------------------------------------------- + * Specials + * ----------------------------------------------------------------------------- */ +// swig::LANGUAGE_OBJ was added to allow containers of native objects +// however its rather difficult to do this in lua, as you cannot hold pointers +// to native objects (they are held in the interpreter) +// therefore for now: just ignoring this feature +#ifdef __cplusplus +%ignore swig::LANGUAGE_OBJ; + +//%inline %{ +%{ +namespace swig { +typedef struct{} LANGUAGE_OBJ; +} +%} + +#endif // __cplusplus diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_common.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_common.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,5 @@ +%include <std_except.i> + +%apply size_t { std::size_t }; +%apply const size_t& { const std::size_t& }; + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_deque.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_deque.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1 @@ +%include <std/_std_deque.i> diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_except.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_except.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,40 @@ +/* ----------------------------------------------------------------------------- + * Typemaps used by the STL wrappers that throw exceptions. + * These typemaps are used when methods are declared with an STL exception + * specification, such as: + * size_t at() const throw (std::out_of_range); + * + * std_except.i + * ----------------------------------------------------------------------------- */ + +%{ +#include <stdexcept> +%} +%include <exception.i> + +namespace std +{ + %ignore exception; // not sure if I should ignore this... + class exception + { + public: + exception() throw() { } + virtual ~exception() throw(); + virtual const char* what() const throw(); + }; +} + +// normally objects which are thrown are returned to the interpreter as errors +// (which potentially may have problems if they are not copied) +// therefore all classes based upon std::exception are converted to their strings & returned as errors +%typemap(throws) std::bad_exception "SWIG_exception(SWIG_RuntimeError, $1.what());" +%typemap(throws) std::domain_error "SWIG_exception(SWIG_ValueError, $1.what());" +%typemap(throws) std::exception "SWIG_exception(SWIG_SystemError, $1.what());" +%typemap(throws) std::invalid_argument "SWIG_exception(SWIG_ValueError, $1.what());" +%typemap(throws) std::length_error "SWIG_exception(SWIG_IndexError, $1.what());" +%typemap(throws) std::logic_error "SWIG_exception(SWIG_RuntimeError, $1.what());" +%typemap(throws) std::out_of_range "SWIG_exception(SWIG_IndexError, $1.what());" +%typemap(throws) std::overflow_error "SWIG_exception(SWIG_OverflowError, $1.what());" +%typemap(throws) std::range_error "SWIG_exception(SWIG_IndexError, $1.what());" +%typemap(throws) std::runtime_error "SWIG_exception(SWIG_RuntimeError, $1.what());" +%typemap(throws) std::underflow_error "SWIG_exception(SWIG_RuntimeError, $1.what());" diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_map.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_map.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,60 @@ +/* ----------------------------------------------------------------------------- + * std_map.i + * + * SWIG typemaps for std::map + * ----------------------------------------------------------------------------- */ + +%include <std_common.i> + +// ------------------------------------------------------------------------ +// std::map +// ------------------------------------------------------------------------ + +%{ +#include <map> +#include <algorithm> +#include <stdexcept> +%} + +// exported class + +namespace std { + + template<class K, class T> class map { + // add typemaps here + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef K key_type; + typedef T mapped_type; + map(); + map(const map<K,T> &); + + unsigned int size() const; + bool empty() const; + void clear(); + %extend { + const T& get(const K& key) throw (std::out_of_range) { + std::map<K,T >::iterator i = self->find(key); + if (i != self->end()) + return i->second; + else + throw std::out_of_range("key not found"); + } + void set(const K& key, const T& x) { + (*self)[key] = x; + } + void del(const K& key) throw (std::out_of_range) { + std::map<K,T >::iterator i = self->find(key); + if (i != self->end()) + self->erase(i); + else + throw std::out_of_range("key not found"); + } + bool has_key(const K& key) { + std::map<K,T >::iterator i = self->find(key); + return i != self->end(); + } + } + }; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_pair.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_pair.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,42 @@ +/* ----------------------------------------------------------------------------- + * std_pair.i + * + * std::pair typemaps for LUA + * ----------------------------------------------------------------------------- */ + +%{ +#include <utility> +%} +/* +A really cut down version of the pair class. + +this is not useful on its own - it needs a %template definition with it + +eg. +namespace std { + %template(IntPair) pair<int, int>; + %template(make_IntPair) make_pair<int, int>; +} + + +*/ + + + +namespace std { + template <class T, class U > struct pair { + typedef T first_type; + typedef U second_type; + + pair(); + pair(T first, U second); + pair(const pair& p); + + T first; + U second; + }; + + template <class T, class U > + pair<T,U> make_pair(const T&,const U&); + +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_string.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_string.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,127 @@ +/* ----------------------------------------------------------------------------- + * std_string.i + * + * std::string typemaps for LUA + * ----------------------------------------------------------------------------- */ + +%{ +#include <string> +%} + +/* +Only std::string and const std::string& are typemapped +they are converted to the Lua strings automatically + +std::string& and std::string* are not +they must be explicitly managed (see below) + +eg. + +std::string test_value(std::string x) { + return x; +} + +can be used as + +s="hello world" +s2=test_value(s) +assert(s==s2) +*/ + +namespace std { + +%naturalvar string; + +/* +Bug report #1526022: +Lua strings and std::string can contain embedded zero bytes +Therefore a standard out typemap should not be: + lua_pushstring(L,$1.c_str()); +but + lua_pushlstring(L,$1.data(),$1.size()); + +Similarly for getting the string + $1 = (char*)lua_tostring(L, $input); +becomes + $1.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); + +Not using: lua_tolstring() as this is only found in Lua 5.1 & not 5.0.2 +*/ + +%typemap(in,checkfn="lua_isstring") string +%{$1.assign(lua_tostring(L,$input),lua_rawlen(L,$input));%} + +%typemap(out) string +%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_arg++;%} + +%typemap(in,checkfn="lua_isstring") const string& ($*1_ltype temp) +%{temp.assign(lua_tostring(L,$input),lua_rawlen(L,$input)); $1=&temp;%} + +%typemap(out) const string& +%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} + +// for throwing of any kind of string, string ref's and string pointers +// we convert all to lua strings +%typemap(throws) string, string&, const string& +%{ lua_pushlstring(L,$1.data(),$1.size()); SWIG_fail;%} + +%typemap(throws) string*, const string* +%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_fail;%} + +%typecheck(SWIG_TYPECHECK_STRING) string, const string& { + $1 = lua_isstring(L,$input); +} + +/* +std::string& can be wrapped, but you must inform SWIG if it is in or out + +eg: +void fn(std::string& str); +Is this an in/out/inout value? + +Therefore you need the usual +%apply (std::string& INOUT) {std::string& str}; +or +%apply std::string& INOUT {std::string& str}; +typemaps to tell SWIG what to do. +*/ + +%typemap(in) string &INPUT=const string &; +%typemap(in, numinputs=0) string &OUTPUT ($*1_ltype temp) +%{ $1 = &temp; %} +%typemap(argout) string &OUTPUT +%{ lua_pushlstring(L,$1->data(),$1->size()); SWIG_arg++;%} +%typemap(in) string &INOUT =const string &; +%typemap(argout) string &INOUT = string &OUTPUT; + +/* +A really cut down version of the string class + +This provides basic mapping of lua strings <-> std::string +and little else +(the std::string has a lot of unneeded functions anyway) + +note: no fn's taking the const string& +as this is overloaded by the const char* version +*/ + + class string { + public: + string(); + string(const char*); + //string(const string&); + unsigned int size() const; + unsigned int length() const; + bool empty() const; + // no support for operator[] + const char* c_str()const; + const char* data()const; + // assign does not return a copy of this object + // (no point in a scripting language) + void assign(const char*); + //void assign(const string&); + // no support for all the other features + // it's probably better to do it in lua + }; +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/std_vector.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/std_vector.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,131 @@ +/* ----------------------------------------------------------------------------- + * std_vector.i + * + * std::vector typemaps for LUA + * ----------------------------------------------------------------------------- */ + +%{ +#include <vector> +%} +%include <std_except.i> // the general exceptions +/* +A really cut down version of the vector class. + +Note: this does not match the true std::vector class +but instead is an approximate, so that SWIG knows how to wrapper it. +(Eg, all access is by value, not ref, as SWIG turns refs to pointers) + +And no support for iterators & insert/erase + +It would be useful to have a vector<->Lua table conversion routine + +*/ +namespace std { + + template<class T> + class vector { + public: + vector(); + vector(unsigned int); + vector(const vector&); + vector(unsigned int,T); + unsigned int size() const; + unsigned int max_size() const; + bool empty() const; + void clear(); + void push_back(T val); + void pop_back(); + T front()const; // only read front & back + T back()const; // not write to them + // operator [] given later: + + %extend // this is a extra bit of SWIG code + { + // [] is replaced by __getitem__ & __setitem__ + // simply throws a string, which causes a lua error + T __getitem__(unsigned int idx) throw (std::out_of_range) + { + if (idx>=self->size()) + throw std::out_of_range("in vector::__getitem__()"); + return (*self)[idx]; + } + void __setitem__(unsigned int idx,T val) throw (std::out_of_range) + { + if (idx>=self->size()) + throw std::out_of_range("in vector::__setitem__()"); + (*self)[idx]=val; + } + }; + }; + +} + +/* +Vector<->LuaTable fns +These look a bit like the array<->LuaTable fns +but are templated, not %defined +(you must have template support for STL) + +*/ +/* +%{ +// reads a table into a vector of numbers +// lua numbers will be cast into the type required (rounding may occur) +// return 0 if non numbers found in the table +// returns new'ed ptr if ok +template<class T> +std::vector<T>* SWIG_read_number_vector(lua_State* L,int index) +{ + int i=0; + std::vector<T>* vec=new std::vector<T>(); + while(1) + { + lua_rawgeti(L,index,i+1); + if (!lua_isnil(L,-1)) + { + lua_pop(L,1); + break; // finished + } + if (!lua_isnumber(L,-1)) + { + lua_pop(L,1); + delete vec; + return 0; // error + } + vec->push_back((T)lua_tonumber(L,-1)); + lua_pop(L,1); + ++i; + } + return vec; // ok +} +// writes a vector of numbers out as a lua table +template<class T> +int SWIG_write_number_vector(lua_State* L,std::vector<T> *vec) +{ + lua_newtable(L); + for(int i=0;i<vec->size();++i) + { + lua_pushnumber(L,(double)((*vec)[i])); + lua_rawseti(L,-2,i+1);// -1 is the number, -2 is the table + } +} +%} + +// then the typemaps + +%define SWIG_TYPEMAP_NUM_VECTOR(T) + +// in +%typemap(in) std::vector<T> *INPUT +%{ $1 = SWIG_read_number_vector<T>(L,$input); + if (!$1) SWIG_fail;%} + +%typemap(freearg) std::vector<T> *INPUT +%{ delete $1;%} + +// out +%typemap(argout) std::vector<T> *OUTPUT +%{ SWIG_write_number_vector(L,$1); SWIG_arg++; %} + +%enddef +*/ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/stl.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/stl.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,10 @@ +/* ----------------------------------------------------------------------------- + * stl.i + * ----------------------------------------------------------------------------- */ + +%include <std_common.i> +%include <std_string.i> +%include <std_vector.i> +%include <std_map.i> +%include <std_pair.i> + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/typemaps.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/typemaps.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,564 @@ +/* ----------------------------------------------------------------------------- + * typemaps.swg + * + * SWIG Library file containing the main typemap code to support Lua modules. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * Basic inout typemaps + * ----------------------------------------------------------------------------- */ +/* +These provide the basic ability for passing in & out of standard numeric data types +(int,long,float,double, etc) + +The basic code looks like this: + +%typemap(in,checkfn="lua_isnumber") int *INPUT(int temp), int &INPUT(int temp) +%{ temp = (int)lua_tonumber(L,$input); + $1 = &temp; %} + +%typemap(in, numinputs=0) int *OUTPUT (int temp) +%{ $1 = &temp; %} + +%typemap(argout) int *OUTPUT +%{ lua_pushnumber(L, (double) *$1); SWIG_arg++;%} + +%typemap(in) int *INOUT = int *INPUT; +%typemap(argout) int *INOUT = int *OUTPUT; + +However the code below is a mixture of #defines & such, so nowhere as easy to read + +To make you code work correctly its not just a matter of %including this file +You also have to give SWIG the hints on which to use where + +eg +extern int add_pointer(int* a1,int* a2); // a1 & a2 are pointer values to be added +extern void swap(int* s1, int* s2); // does the swap + +You will need to either change the argument names +extern int add_pointer(int* INPUT,int* INPUT); + +or provide a %apply statement + +%apply int* INOUT{ int *s1, int *s2 }; + // if SWIG sees int* s1, int* s2, assume they are inout params +*/ + + +%define SWIG_NUMBER_TYPEMAP(TYPE) +%typemap(in,checkfn="lua_isnumber") TYPE *INPUT($*ltype temp), TYPE &INPUT($*ltype temp) +%{ temp = ($*ltype)lua_tonumber(L,$input); + $1 = &temp; %} +%typemap(in, numinputs=0) TYPE *OUTPUT ($*ltype temp) +%{ $1 = &temp; %} +%typemap(argout) TYPE *OUTPUT +%{ lua_pushnumber(L, (lua_Number) *$1); SWIG_arg++;%} +%typemap(in) TYPE *INOUT = TYPE *INPUT; +%typemap(argout) TYPE *INOUT = TYPE *OUTPUT; +%typemap(in) TYPE &OUTPUT = TYPE *OUTPUT; +%typemap(argout) TYPE &OUTPUT = TYPE *OUTPUT; +%typemap(in) TYPE &INOUT = TYPE *INPUT; +%typemap(argout) TYPE &INOUT = TYPE *OUTPUT; +// const version (the $*ltype is the basic number without ptr or const's) +%typemap(in,checkfn="lua_isnumber") const TYPE *INPUT($*ltype temp) +%{ temp = ($*ltype)lua_tonumber(L,$input); + $1 = &temp; %} +%enddef + +// now the code +SWIG_NUMBER_TYPEMAP(unsigned char); SWIG_NUMBER_TYPEMAP(signed char); + +SWIG_NUMBER_TYPEMAP(short); SWIG_NUMBER_TYPEMAP(unsigned short); SWIG_NUMBER_TYPEMAP(signed short); +SWIG_NUMBER_TYPEMAP(int); SWIG_NUMBER_TYPEMAP(unsigned int); SWIG_NUMBER_TYPEMAP(signed int); +SWIG_NUMBER_TYPEMAP(long); SWIG_NUMBER_TYPEMAP(unsigned long); SWIG_NUMBER_TYPEMAP(signed long); +SWIG_NUMBER_TYPEMAP(float); +SWIG_NUMBER_TYPEMAP(double); +SWIG_NUMBER_TYPEMAP(enum SWIGTYPE); +// also for long longs's +SWIG_NUMBER_TYPEMAP(long long); SWIG_NUMBER_TYPEMAP(unsigned long long); SWIG_NUMBER_TYPEMAP(signed long long); + +// note we dont do char, as a char* is probably a string not a ptr to a single char + +// similar for booleans +%typemap(in,checkfn="lua_isboolean") bool *INPUT(bool temp), bool &INPUT(bool temp) +%{ temp = (lua_toboolean(L,$input)!=0); + $1 = &temp; %} + +%typemap(in, numinputs=0) bool *OUTPUT (bool temp),bool &OUTPUT (bool temp) +%{ $1 = &temp; %} + +%typemap(argout) bool *OUTPUT,bool &OUTPUT +%{ lua_pushboolean(L, (int)((*$1)!=0)); SWIG_arg++;%} + +%typemap(in) bool *INOUT = bool *INPUT; +%typemap(argout) bool *INOUT = bool *OUTPUT; +%typemap(in) bool &INOUT = bool &INPUT; +%typemap(argout) bool &INOUT = bool &OUTPUT; + +/* ----------------------------------------------------------------------------- + * Basic Array typemaps + * ----------------------------------------------------------------------------- */ +/* +I have no idea why this kind of code does not exist in SWIG as standard, +but here is it. +This code will convert to/from 1D numeric arrays. +In order to reduce code bloat, there are a few macros +and quite a few functions defined +(unfortunately this makes it a lot less clear) + +assuming we have functions +void process_array(int arr[3]); // nice fixed size array +void process_var_array(float arr[],int len); // variable sized array +void process_var_array_inout(double* arr,int len); // variable sized array + // data passed in & out +void process_enum_inout_array_var(enum Days *arrinout, int len); // using enums +void return_array_5(int arrout[5]); // out array only + +in order to wrap them correctly requires a typemap + +// inform SWIG of the correct typemap +// For fixed length, you must specify it as <type> INPUT[ANY] +%apply (int INPUT[ANY]) {(int arr[3])}; +// variable length arrays are just the same +%apply (float INPUT[],int) {(float arr[],int len)}; +// it is also ok, to map the TYPE* instead of a TYPE[] +%apply (double *INOUT,int) {(double arr*,int len)}; +// for the enum's you must use enum SWIGTYPE +%apply (enum SWIGTYPE *INOUT,int) {(enum Days *arrinout, int len)}; +// fixed length out if also fine +%apply (int OUTPUT[ANY]) {(int arrout[5])}; + +Generally, you could use %typemap(...)=... +but the %apply is neater & easier + +a few things of note: +* all Lua tables are indexed from 1, all C/C++ arrays are indexed from 0 + therefore t={6,5,3} -- t[1]==6, t[2]==5, t[3]==3 + when passed to process_array(int arr[3]) becomes + arr[0]==6, arr[1]==5, arr[2]==3 +* for OUTPUT arrays, no array need be passed in, the fn will return a Lua table + so for the above mentioned return_array_5() would look like + arr=return_array_5() -- no parameters passed in +* for INOUT arrays, a table must be passed in, and a new table will be returned + (this is consistent with the way that numbers are processed) + if you want just use + arr={...} + arr=process_var_array_inout(arr) -- arr is replaced by the new version + +The following are not yet supported: +* variable length output only array (inout works ok) +* multidimensional arrays +* arrays of objects/structs +* arrays of pointers + +*/ + +/* +The internals of the array management stuff +helper fns/macros +SWIG_ALLOC_ARRAY(TYPE,LEN) // returns a typed array TYPE[LEN] +SWIG_FREE_ARRAY(PTR) // delete the ptr (if not zero) + +// counts the specified table & gets the size +// integer version +int SWIG_itable_size(lua_State* L, int index); +// other version +int SWIG_table_size(lua_State* L, int index); + +SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE) +// this fn declares up 4 functions for helping to read/write tables +// these can then be called by the macros ... +// all assume the table is an integer indexes from 1 +// but the C array is a indexed from 0 + // created a fixed size array, reads the specified table + // and then fills the array with numbers + // returns ptr to the array if ok, or 0 for error + // (also pushes a error message to the stack) +TYPE* SWIG_get_NAME_num_array_fixed(lua_State* L, int index, int size); + // as per SWIG_get_NAME_num_array_fixed() + // but reads the entire table & creates an array of the correct size + // (if the table is empty, it returns an error rather than a zero length array) +TYPE* SWIG_get_NAME_num_array_var(lua_State* L, int index, int* size); + // writes a table to Lua with all the specified numbers +void SWIG_write_NAME_num_array(lua_State* L,TYPE *array,int size); + // read the specified table, and fills the array with numbers + // returns 1 of ok (only fails if it doesnt find numbers) + // helper fn (called by SWIG_get_NAME_num_array_*() fns) +int SWIG_read_NAME_num_array(lua_State* L,int index,TYPE *array,int size); + +*/ + +/* Reported that you don't need to check for NULL for delete & free +There probably is some compiler that its not true for, so the code is left here just in case. +#ifdef __cplusplus +#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] +#define SWIG_FREE_ARRAY(PTR) if(PTR){delete[] PTR;} +#else +#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) +#define SWIG_FREE_ARRAY(PTR) if(PTR){free(PTR);} +#endif +*/ +%{ +#ifdef __cplusplus /* generic alloc/dealloc fns*/ +#define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN] +#define SWIG_FREE_ARRAY(PTR) delete[] PTR +#else +#define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE)) +#define SWIG_FREE_ARRAY(PTR) free(PTR) +#endif +/* counting the size of arrays:*/ +SWIGINTERN int SWIG_itable_size(lua_State* L, int index) +{ + int n=0; + while(1){ + lua_rawgeti(L,index,n+1); + if (lua_isnil(L,-1))break; + ++n; + lua_pop(L,1); + } + lua_pop(L,1); + return n; +} + +SWIGINTERN int SWIG_table_size(lua_State* L, int index) +{ + int n=0; + lua_pushnil(L); /* first key*/ + while (lua_next(L, index) != 0) { + ++n; + lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/ + } + return n; +} + +/* super macro to declare array typemap helper fns */ +#define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\ + SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\ + int i;\ + for (i = 0; i < size; i++) {\ + lua_rawgeti(L,index,i+1);\ + if (lua_isnumber(L,-1)){\ + array[i] = (TYPE)lua_tonumber(L,-1);\ + } else {\ + lua_pop(L,1);\ + return 0;\ + }\ + lua_pop(L,1);\ + }\ + return 1;\ + }\ + SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\ + TYPE *array;\ + if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\ + SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\ + return 0;\ + }\ + array=SWIG_ALLOC_ARRAY(TYPE,size);\ + if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\ + SWIG_Lua_pusherrstring(L,"table must contain numbers");\ + SWIG_FREE_ARRAY(array);\ + return 0;\ + }\ + return array;\ + }\ + SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\ + {\ + TYPE *array;\ + if (!lua_istable(L,index)) {\ + SWIG_Lua_pusherrstring(L,"expected a table");\ + return 0;\ + }\ + *size=SWIG_itable_size(L,index);\ + if (*size<1){\ + SWIG_Lua_pusherrstring(L,"table appears to be empty");\ + return 0;\ + }\ + array=SWIG_ALLOC_ARRAY(TYPE,*size);\ + if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\ + SWIG_Lua_pusherrstring(L,"table must contain numbers");\ + SWIG_FREE_ARRAY(array);\ + return 0;\ + }\ + return array;\ + }\ + SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\ + int i;\ + lua_newtable(L);\ + for (i = 0; i < size; i++){\ + lua_pushnumber(L,(lua_Number)array[i]);\ + lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \ + }\ + } +%} + +/* +This is one giant macro to define the typemaps & the helpers +for array handling +*/ +%define SWIG_TYPEMAP_NUM_ARR(NAME,TYPE) +%{SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE);%} + +// fixed size array's +%typemap(in) TYPE INPUT[ANY] +%{ $1 = SWIG_get_##NAME##_num_array_fixed(L,$input,$1_dim0); + if (!$1) SWIG_fail;%} + +%typemap(freearg) TYPE INPUT[ANY] +%{ SWIG_FREE_ARRAY($1);%} + +// variable size array's +%typemap(in) (TYPE *INPUT,int) +%{ $1 = SWIG_get_##NAME##_num_array_var(L,$input,&$2); + if (!$1) SWIG_fail;%} + +%typemap(freearg) (TYPE *INPUT,int) +%{ SWIG_FREE_ARRAY($1);%} + +// out fixed arrays +%typemap(in,numinputs=0) TYPE OUTPUT[ANY] +%{ $1 = SWIG_ALLOC_ARRAY(TYPE,$1_dim0); %} + +%typemap(argout) TYPE OUTPUT[ANY] +%{ SWIG_write_##NAME##_num_array(L,$1,$1_dim0); SWIG_arg++; %} + +%typemap(freearg) TYPE OUTPUT[ANY] +%{ SWIG_FREE_ARRAY($1); %} + +// inout fixed arrays +%typemap(in) TYPE INOUT[ANY]=TYPE INPUT[ANY]; +%typemap(argout) TYPE INOUT[ANY]=TYPE OUTPUT[ANY]; +%typemap(freearg) TYPE INOUT[ANY]=TYPE INPUT[ANY]; +// inout variable arrays +%typemap(in) (TYPE *INOUT,int)=(TYPE *INPUT,int); +%typemap(argout) (TYPE *INOUT,int) +%{ SWIG_write_##NAME##_num_array(L,$1,$2); SWIG_arg++; %} +%typemap(freearg) (TYPE *INOUT,int)=(TYPE *INPUT,int); + +// TODO out variable arrays (is there a standard form for such things?) + +// referencing so that (int *INPUT,int) and (int INPUT[],int) are the same +%typemap(in) (TYPE INPUT[],int)=(TYPE *INPUT,int); +%typemap(freearg) (TYPE INPUT[],int)=(TYPE *INPUT,int); + +%enddef + +// the following line of code +// declares the C helper fns for the array typemaps +// as well as defining typemaps for +// fixed len arrays in & out, & variable length arrays in + +SWIG_TYPEMAP_NUM_ARR(schar,signed char); +SWIG_TYPEMAP_NUM_ARR(uchar,unsigned char); +SWIG_TYPEMAP_NUM_ARR(int,int); +SWIG_TYPEMAP_NUM_ARR(uint,unsigned int); +SWIG_TYPEMAP_NUM_ARR(short,short); +SWIG_TYPEMAP_NUM_ARR(ushort,unsigned short); +SWIG_TYPEMAP_NUM_ARR(long,long); +SWIG_TYPEMAP_NUM_ARR(ulong,unsigned long); +SWIG_TYPEMAP_NUM_ARR(float,float); +SWIG_TYPEMAP_NUM_ARR(double,double); + +// again enums are a problem so they need their own type +// we use the int conversion routine & recast it +%typemap(in) enum SWIGTYPE INPUT[ANY] +%{ $1 = ($ltype)SWIG_get_int_num_array_fixed(L,$input,$1_dim0); + if (!$1) SWIG_fail;%} + +%typemap(freearg) enum SWIGTYPE INPUT[ANY] +%{ SWIG_FREE_ARRAY($1);%} + +// variable size arrays +%typemap(in) (enum SWIGTYPE *INPUT,int) +%{ $1 = ($ltype)SWIG_get_int_num_array_var(L,$input,&$2); + if (!$1) SWIG_fail;%} + +%typemap(freearg) (enum SWIGTYPE *INPUT,int) +%{ SWIG_FREE_ARRAY($1);%} + +// out fixed arrays +%typemap(in,numinputs=0) enum SWIGTYPE OUTPUT[ANY] +%{ $1 = SWIG_ALLOC_ARRAY(enum SWIGTYPE,$1_dim0); %} + +%typemap(argout) enum SWIGTYPE OUTPUT[ANY] +%{ SWIG_write_int_num_array(L,(int*)$1,$1_dim0); SWIG_arg++; %} + +%typemap(freearg) enum SWIGTYPE OUTPUT[ANY] +%{ SWIG_FREE_ARRAY($1); %} + +// inout fixed arrays +%typemap(in) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; +%typemap(argout) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE OUTPUT[ANY]; +%typemap(freearg) enum SWIGTYPE INOUT[ANY]=enum SWIGTYPE INPUT[ANY]; +// inout variable arrays +%typemap(in) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); +%typemap(argout) (enum SWIGTYPE *INOUT,int) +%{ SWIG_write_int_num_array(L,(int*)$1,$2); SWIG_arg++; %} +%typemap(freearg) (enum SWIGTYPE *INOUT,int)=(enum SWIGTYPE *INPUT,int); + + +/* Surprisingly pointer arrays are easier: +this is because all ptr arrays become void** +so only a few fns are needed & a few casts + +The function defined are + // created a fixed size array, reads the specified table + // and then fills the array with pointers (checking the type) + // returns ptr to the array if ok, or 0 for error + // (also pushes a error message to the stack) +void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type); + // as per SWIG_get_ptr_array_fixed() + // but reads the entire table & creates an array of the correct size + // (if the table is empty, it returns an error rather than a zero length array) +void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type); + // writes a table to Lua with all the specified pointers + // all pointers have the ownership value 'own' (normally 0) +void SWIG_write_ptr_array(lua_State* L,void **array,int size,int own); + // read the specified table, and fills the array with ptrs + // returns 1 of ok (only fails if it doesn't find correct type of ptrs) + // helper fn (called by SWIG_get_ptr_array_*() fns) +int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type); + +The key thing to remember is that it is assumed that there is no +modification of pointers ownership in the arrays + +eg A fn: +void pointers_in(TYPE* arr[],int len); +will make copies of the pointer into a temp array and then pass it into the fn +Lua does not remember that this fn held the pointers, so it is not safe to keep +these pointers until later + +eg A fn: +void pointers_out(TYPE* arr[3]); +will return a table containing three pointers +however these pointers are NOT owned by Lua, merely borrowed +so if the C/C++ frees then Lua is not aware + +*/ + +%{ +SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){ + int i; + for (i = 0; i < size; i++) { + lua_rawgeti(L,index,i+1); + if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){ + lua_pop(L,1); + return 0; + } + lua_pop(L,1); + } + return 1; +} +SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){ + void **array; + if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) { + SWIG_Lua_pushferrstring(L,"expected a table of size %d",size); + return 0; + } + array=SWIG_ALLOC_ARRAY(void*,size); + if (!SWIG_read_ptr_array(L,index,array,size,type)){ + SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); + SWIG_FREE_ARRAY(array); + return 0; + } + return array; +} +SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){ + void **array; + if (!lua_istable(L,index)) { + SWIG_Lua_pusherrstring(L,"expected a table"); + return 0; + } + *size=SWIG_itable_size(L,index); + if (*size<1){ + SWIG_Lua_pusherrstring(L,"table appears to be empty"); + return 0; + } + array=SWIG_ALLOC_ARRAY(void*,*size); + if (!SWIG_read_ptr_array(L,index,array,*size,type)){ + SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name); + SWIG_FREE_ARRAY(array); + return 0; + } + return array; +} +SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){ + int i; + lua_newtable(L); + for (i = 0; i < size; i++){ + SWIG_NewPointerObj(L,array[i],type,own); + lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ + } +} +%} + +// fixed size array's +%typemap(in) SWIGTYPE* INPUT[ANY] +%{ $1 = ($ltype)SWIG_get_ptr_array_fixed(L,$input,$1_dim0,$*1_descriptor); + if (!$1) SWIG_fail;%} + +%typemap(freearg) SWIGTYPE* INPUT[ANY] +%{ SWIG_FREE_ARRAY($1);%} + +// variable size array's +%typemap(in) (SWIGTYPE **INPUT,int) +%{ $1 = ($ltype)SWIG_get_ptr_array_var(L,$input,&$2,$*1_descriptor); + if (!$1) SWIG_fail;%} + +%typemap(freearg) (SWIGTYPE **INPUT,int) +%{ SWIG_FREE_ARRAY($1);%} + +// out fixed arrays +%typemap(in,numinputs=0) SWIGTYPE* OUTPUT[ANY] +%{ $1 = SWIG_ALLOC_ARRAY($*1_type,$1_dim0); %} + +%typemap(argout) SWIGTYPE* OUTPUT[ANY] +%{ SWIG_write_ptr_array(L,(void**)$1,$1_dim0,$*1_descriptor,0); SWIG_arg++; %} + +%typemap(freearg) SWIGTYPE* OUTPUT[ANY] +%{ SWIG_FREE_ARRAY($1); %} + +// inout fixed arrays +%typemap(in) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; +%typemap(argout) SWIGTYPE* INOUT[ANY]=SWIGTYPE* OUTPUT[ANY]; +%typemap(freearg) SWIGTYPE* INOUT[ANY]=SWIGTYPE* INPUT[ANY]; +// inout variable arrays +%typemap(in) (SWIGTYPE** INOUT,int)=(SWIGTYPE** INPUT,int); +%typemap(argout) (SWIGTYPE** INOUT,int) +%{ SWIG_write_ptr_array(L,(void**)$1,$2,$*1_descriptor,0); SWIG_arg++; %} +%typemap(freearg) (SWIGTYPE**INOUT,int)=(SWIGTYPE**INPUT,int); + +/* ----------------------------------------------------------------------------- + * Pointer-Pointer typemaps + * ----------------------------------------------------------------------------- */ +/* +This code is to deal with the issue for pointer-pointer's +In particular for factory methods. + +for example take the following code segment: + +struct iMath; // some structure +int Create_Math(iMath** pptr); // its factory (assume it mallocs) + +to use it you might have the following C code: + +iMath* ptr; +int ok; +ok=Create_Math(&ptr); +// do things with ptr +//... +free(ptr); + +With the following SWIG code +%apply SWIGTYPE** OUTPUT{iMath **pptr }; + +You can get natural wrapping in Lua as follows: +ok,ptr=Create_Math() -- ptr is a iMath* which is returned with the int +ptr=nil -- the iMath* will be GC'ed as normal +*/ + +%typemap(in,numinputs=0) SWIGTYPE** OUTPUT ($*ltype temp) +%{ temp = ($*ltype)0; + $1 = &temp; %} +%typemap(argout) SWIGTYPE** OUTPUT +%{SWIG_NewPointerObj(L,*$1,$*descriptor,1); SWIG_arg++; %} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/lua/wchar.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/lua/wchar.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,42 @@ +/* ----------------------------------------------------------------------------- + * wchar.i + * + * Typemaps for the wchar_t type + * These are mapped to a Lua string and are passed around by value. + * ----------------------------------------------------------------------------- */ + +// note: only support for pointer right now, not fixed length strings +// TODO: determine how long a const wchar_t* is so we can write wstr2str() +// & do the output typemap + +%{ +#include <stdlib.h> + +wchar_t* str2wstr(const char *str, int len) +{ + wchar_t* p; + if (str==0 || len<1) return 0; + p=(wchar *)malloc((len+1)*sizeof(wchar_t)); + if (p==0) return 0; + if (mbstowcs(p, str, len)==-1) + { + free(p); + return 0; + } + p[len]=0; + return p; +} +%} + +%typemap(in, checkfn="SWIG_lua_isnilstring", fragment="SWIG_lua_isnilstring") wchar_t * +%{ +$1 = str2wstr(lua_tostring( L, $input ),lua_rawlen( L, $input )); +if ($1==0) {SWIG_Lua_pushferrstring(L,"Error in converting to wchar (arg %d)",$input);goto fail;} +%} + +%typemap(freearg) wchar_t * +%{ +free($1); +%} + +%typemap(typecheck) wchar_t * = char *; diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/math.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/math.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,82 @@ +/* ----------------------------------------------------------------------------- + * math.i + * + * SWIG library file for floating point operations. + * ----------------------------------------------------------------------------- */ + +%module math +%{ +#include <math.h> +%} + +extern double cos(double x); +/* Cosine of x */ + +extern double sin(double x); +/* Sine of x */ + +extern double tan(double x); +/* Tangent of x */ + +extern double acos(double x); +/* Inverse cosine in range [-PI/2,PI/2], x in [-1,1]. */ + +extern double asin(double x); +/* Inverse sine in range [0,PI], x in [-1,1]. */ + +extern double atan(double x); +/* Inverse tangent in range [-PI/2,PI/2]. */ + +extern double atan2(double y, double x); +/* Inverse tangent of y/x in range [-PI,PI]. */ + +extern double cosh(double x); +/* Hyperbolic cosine of x */ + +extern double sinh(double x); +/* Hyperbolic sine of x */ + +extern double tanh(double x); +/* Hyperbolic tangent of x */ + +extern double exp(double x); +/* Natural exponential function e^x */ + +extern double log(double x); +/* Natural logarithm ln(x), x > 0 */ + +extern double log10(double x); +/* Base 10 logarithm, x > 0 */ + +extern double pow(double x, double y); +/* Power function x^y. */ + +extern double sqrt(double x); +/* Square root. x >= 0 */ + +extern double fabs(double x); +/* Absolute value of x */ + +extern double ceil(double x); +/* Smallest integer not less than x, as a double */ + +extern double floor(double x); +/* Largest integer not greater than x, as a double */ + +extern double fmod(double x, double y); +/* Floating-point remainder of x/y, with the same sign as x. */ + +#define M_E 2.7182818284590452354 +#define M_LOG2E 1.4426950408889634074 +#define M_LOG10E 0.43429448190325182765 +#define M_LN2 0.69314718055994530942 +#define M_LN10 2.30258509299404568402 +#define M_PI 3.14159265358979323846 +#define M_PI_2 1.57079632679489661923 +#define M_PI_4 0.78539816339744830962 +#define M_1_PI 0.31830988618379067154 +#define M_2_PI 0.63661977236758134308 +#define M_2_SQRTPI 1.12837916709551257390 +#define M_SQRT2 1.41421356237309504880 +#define M_SQRT1_2 0.70710678118654752440 + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/pointer.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/pointer.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,11 @@ +/* ----------------------------------------------------------------------------- + * pointer.i + * ----------------------------------------------------------------------------- */ + + +%echo "pointer.i is deprecated. Use cpointer.i instead." +%echo "See http://www.swig.org/Doc1.3/Library.html" + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/runtime.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/runtime.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,38 @@ +/* -----------------------------------------------------------------------------* + Standard SWIG API for use inside user code. + + Don't include this file directly, run the command + swig -python -external-runtime + Also, read the Modules chapter of the SWIG Manual. + + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_MODULE_CLIENTDATA_TYPE + +SWIGRUNTIMEINLINE swig_type_info * +SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) { + swig_module_info *module = SWIG_GetModule(clientdata); + return SWIG_TypeQueryModule(module, module, name); +} + +SWIGRUNTIMEINLINE swig_type_info * +SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) { + swig_module_info *module = SWIG_GetModule(clientdata); + return SWIG_MangledTypeQueryModule(module, module, name); +} + +#else + +SWIGRUNTIMEINLINE swig_type_info * +SWIG_TypeQuery(const char *name) { + swig_module_info *module = SWIG_GetModule(NULL); + return SWIG_TypeQueryModule(module, module, name); +} + +SWIGRUNTIMEINLINE swig_type_info * +SWIG_MangledTypeQuery(const char *name) { + swig_module_info *module = SWIG_GetModule(NULL); + return SWIG_MangledTypeQueryModule(module, module, name); +} + +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/shared_ptr.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/shared_ptr.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,64 @@ +// This is a helper file for shared_ptr and should not be included directly. + +// The main implementation detail in using this smart pointer of a type is to customise the code generated +// to use a pointer to the smart pointer of the type, rather than the usual pointer to the underlying type. +// So for some type T, shared_ptr<T> * is used rather than T *. + +// shared_ptr namespaces could be boost or std or std::tr1 +// For example for std::tr1, use: +// #define SWIG_SHARED_PTR_NAMESPACE std +// #define SWIG_SHARED_PTR_SUBNAMESPACE tr1 + +#if !defined(SWIG_SHARED_PTR_NAMESPACE) +# define SWIG_SHARED_PTR_NAMESPACE boost +#endif + +#if defined(SWIG_SHARED_PTR_SUBNAMESPACE) +# define SWIG_SHARED_PTR_QNAMESPACE SWIG_SHARED_PTR_NAMESPACE::SWIG_SHARED_PTR_SUBNAMESPACE +#else +# define SWIG_SHARED_PTR_QNAMESPACE SWIG_SHARED_PTR_NAMESPACE +#endif + +namespace SWIG_SHARED_PTR_NAMESPACE { +#if defined(SWIG_SHARED_PTR_SUBNAMESPACE) + namespace SWIG_SHARED_PTR_SUBNAMESPACE { +#endif + template <class T> class shared_ptr { + }; +#if defined(SWIG_SHARED_PTR_SUBNAMESPACE) + } +#endif +} + +%fragment("SWIG_null_deleter", "header") { +struct SWIG_null_deleter { + void operator() (void const *) const { + } +}; +%#define SWIG_NO_NULL_DELETER_0 , SWIG_null_deleter() +%#define SWIG_NO_NULL_DELETER_1 +%#define SWIG_NO_NULL_DELETER_SWIG_POINTER_NEW +%#define SWIG_NO_NULL_DELETER_SWIG_POINTER_OWN +} + + +// Workaround empty first macro argument bug +#define SWIGEMPTYHACK +// Main user macro for defining shared_ptr typemaps for both const and non-const pointer types +%define %shared_ptr(TYPE...) +%feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > } +SWIG_SHARED_PTR_TYPEMAPS(SWIGEMPTYHACK, TYPE) +SWIG_SHARED_PTR_TYPEMAPS(const, TYPE) +%enddef + +// Legacy macros +%define SWIG_SHARED_PTR(PROXYCLASS, TYPE...) +#warning "SWIG_SHARED_PTR(PROXYCLASS, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead." +%shared_ptr(TYPE) +%enddef + +%define SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE...) +#warning "SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE) is deprecated. Please use %shared_ptr(TYPE) instead." +%shared_ptr(TYPE) +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/README Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,22 @@ +/* ----------------------------------------------------------------------------- + * C++ STD + STL + * ----------------------------------------------------------------------------- */ + +std_common.i general common code +std_container.i general container code +std_basic_string.i basic string +std_char_traits.i char traits +std_complex.i complex +std_deque.i deque +std_except.i exceptions +std_ios.i ios +std_iostream.i istream/ostream +std_list.i list +std_map.i map +std_multimap.i multimap +std_multiset.i multiset +std_pair.i pair +std_set.i set +std_streambuf.i streambuf +std_vector.i vector +std_vectora.i vector + allocator diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/_std_deque.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/_std_deque.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,139 @@ +/* ----------------------------------------------------------------------------- + * _std_deque.i + * + * This file contains a generic definition of std::deque along with + * some helper functions. Specific language modules should include + * this file to generate wrappers. + * ----------------------------------------------------------------------------- */ + +%include <std_except.i> + +%{ +#include <deque> +#include <stdexcept> +%} + + +/* This macro defines all of the standard methods for a deque. This + is defined as a macro to simplify the task of specialization. For + example, + + template<> class deque<int> { + public: + %std_deque_methods(int); + }; +*/ + +%define %std_deque_methods_noempty(T) + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + + deque(); + deque(unsigned int size, const T& value=T()); + deque(const deque<T> &); + ~deque(); + + void assign(unsigned int n, const T& value); + void swap(deque<T> &x); + unsigned int size() const; + unsigned int max_size() const; + void resize(unsigned int n, T c = T()); + const_reference front(); + const_reference back(); + void push_front(const T& x); + void push_back(const T& x); + void pop_front(); + void pop_back(); + void clear(); + + /* Some useful extensions */ + %extend { + const_reference getitem(int i) throw (std::out_of_range) { + int size = int(self->size()); + if (i<0) i += size; + if (i>=0 && i<size) + return (*self)[i]; + else + throw std::out_of_range("deque index out of range"); + } + void setitem(int i, const T& x) throw (std::out_of_range) { + int size = int(self->size()); + if (i<0) i+= size; + if (i>=0 && i<size) + (*self)[i] = x; + else + throw std::out_of_range("deque index out of range"); + } + void delitem(int i) throw (std::out_of_range) { + int size = int(self->size()); + if (i<0) i+= size; + if (i>=0 && i<size) { + self->erase(self->begin()+i); + } else { + throw std::out_of_range("deque index out of range"); + } + } + std::deque<T> getslice(int i, int j) { + int size = int(self->size()); + if (i<0) i = size+i; + if (j<0) j = size+j; + if (i<0) i = 0; + if (j>size) j = size; + std::deque<T > tmp(j-i); + std::copy(self->begin()+i,self->begin()+j,tmp.begin()); + return tmp; + } + void setslice(int i, int j, const std::deque<T>& v) { + int size = int(self->size()); + if (i<0) i = size+i; + if (j<0) j = size+j; + if (i<0) i = 0; + if (j>size) j = size; + if (int(v.size()) == j-i) { + std::copy(v.begin(),v.end(),self->begin()+i); + } else { + self->erase(self->begin()+i,self->begin()+j); + if (i+1 <= size) + self->insert(self->begin()+i+1,v.begin(),v.end()); + else + self->insert(self->end(),v.begin(),v.end()); + } + } + void delslice(int i, int j) { + int size = int(self->size()); + if (i<0) i = size+i; + if (j<0) j = size+j; + if (i<0) i = 0; + if (j>size) j = size; + self->erase(self->begin()+i,self->begin()+j); + } + }; +%enddef + +#ifdef SWIGPHP +%define %std_deque_methods(T) + %extend { + bool is_empty() const { + return self->empty(); + } + }; + %std_deque_methods_noempty(T) +%enddef +#else +%define %std_deque_methods(T) + bool empty() const; + %std_deque_methods_noempty(T) +%enddef +#endif + +namespace std { + template<class T> class deque { + public: + %std_deque_methods(T); + }; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_alloc.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_alloc.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,77 @@ +namespace std +{ + /** + * @brief The "standard" allocator, as per [20.4]. + * + * The private _Alloc is "SGI" style. (See comments at the top + * of stl_alloc.h.) + * + * The underlying allocator behaves as follows. + * - __default_alloc_template is used via two typedefs + * - "__single_client_alloc" typedef does no locking for threads + * - "__alloc" typedef is threadsafe via the locks + * - __new_alloc is used for memory requests + * + * (See @link Allocators allocators info @endlink for more.) + */ + template<typename _Tp> + class allocator + { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp* pointer; + typedef const _Tp* const_pointer; + typedef _Tp& reference; + typedef const _Tp& const_reference; + typedef _Tp value_type; + + template<typename _Tp1> + struct rebind; + + allocator() throw(); + + allocator(const allocator&) throw(); + template<typename _Tp1> + allocator(const allocator<_Tp1>&) throw(); + ~allocator() throw(); + + + pointer + address(reference __x) const; + + + const_pointer + address(const_reference __x) const; + + + // NB: __n is permitted to be 0. The C++ standard says nothing + // about what the return value is when __n == 0. + _Tp* + allocate(size_type __n, const void* = 0); + + // __p is not permitted to be a null pointer. + void + deallocate(pointer __p, size_type __n); + + size_type + max_size() const throw(); + + void construct(pointer __p, const _Tp& __val); + void destroy(pointer __p); + }; + + template<> + class allocator<void> + { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef void* pointer; + typedef const void* const_pointer; + typedef void value_type; + + template<typename _Tp1> + struct rebind; + }; +} // namespace std diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_basic_string.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_basic_string.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,270 @@ +%include <exception.i> +%include <std_container.i> +%include <std_alloc.i> +%include <std_char_traits.i> + + +%{ +#include <string> +%} + +namespace std +{ + %naturalvar basic_string; +} + + +namespace std { + + template <class _CharT, class _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > + class basic_string + { +#if !defined(SWIG_STD_MODERN_STL) || defined(SWIG_STD_NOMODERN_STL) + %ignore push_back; + %ignore clear; + %ignore compare; + %ignore append; +#endif + + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _CharT value_type; + typedef value_type reference; + typedef value_type const_reference; + typedef _Alloc allocator_type; + + static const size_type npos; + +#ifdef SWIG_EXPORT_ITERATOR_METHODS + class iterator; + class reverse_iterator; + class const_iterator; + class const_reverse_iterator; +#endif + + + %traits_swigtype(_CharT); + %fragment(SWIG_Traits_frag(_CharT)); + + + basic_string(const _CharT* __s, size_type __n); + + // Capacity: + + size_type length() const; + + size_type max_size() const; + + size_type capacity() const; + + void reserve(size_type __res_arg = 0); + + + // Modifiers: + + basic_string& + append(const basic_string& __str); + + basic_string& + append(const basic_string& __str, size_type __pos, size_type __n); + + basic_string& + append(const _CharT* __s, size_type __n); + + basic_string& + append(size_type __n, _CharT __c); + + basic_string& + assign(const basic_string& __str); + + basic_string& + assign(const basic_string& __str, size_type __pos, size_type __n); + + basic_string& + assign(const _CharT* __s, size_type __n); + + basic_string& + insert(size_type __pos1, const basic_string& __str); + + basic_string& + insert(size_type __pos1, const basic_string& __str, + size_type __pos2, size_type __n); + + basic_string& + insert(size_type __pos, const _CharT* __s, size_type __n); + + basic_string& + insert(size_type __pos, size_type __n, _CharT __c); + + basic_string& + erase(size_type __pos = 0, size_type __n = npos); + + basic_string& + replace(size_type __pos, size_type __n, const basic_string& __str); + + basic_string& + replace(size_type __pos1, size_type __n1, const basic_string& __str, + size_type __pos2, size_type __n2); + + basic_string& + replace(size_type __pos, size_type __n1, const _CharT* __s, + size_type __n2); + + basic_string& + replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c); + + + size_type + copy(_CharT* __s, size_type __n, size_type __pos = 0) const; + + // String operations: + const _CharT* c_str() const; + + size_type + find(const _CharT* __s, size_type __pos, size_type __n) const; + + size_type + find(const basic_string& __str, size_type __pos = 0) const; + + size_type + find(_CharT __c, size_type __pos = 0) const; + + size_type + rfind(const basic_string& __str, size_type __pos = npos) const; + + size_type + rfind(const _CharT* __s, size_type __pos, size_type __n) const; + + size_type + rfind(_CharT __c, size_type __pos = npos) const; + + size_type + find_first_of(const basic_string& __str, size_type __pos = 0) const; + + size_type + find_first_of(const _CharT* __s, size_type __pos, size_type __n) const; + + size_type + find_first_of(_CharT __c, size_type __pos = 0) const; + + size_type + find_last_of(const basic_string& __str, size_type __pos = npos) const; + + size_type + find_last_of(const _CharT* __s, size_type __pos, size_type __n) const; + + size_type + find_last_of(_CharT __c, size_type __pos = npos) const; + + size_type + find_first_not_of(const basic_string& __str, size_type __pos = 0) const; + + size_type + find_first_not_of(const _CharT* __s, size_type __pos, + size_type __n) const; + + size_type + find_first_not_of(_CharT __c, size_type __pos = 0) const; + + size_type + find_last_not_of(const basic_string& __str, size_type __pos = npos) const; + + size_type + find_last_not_of(const _CharT* __s, size_type __pos, + size_type __n) const; + + size_type + find_last_not_of(_CharT __c, size_type __pos = npos) const; + + basic_string + substr(size_type __pos = 0, size_type __n = npos) const; + + int + compare(const basic_string& __str) const; + + int + compare(size_type __pos, size_type __n, const basic_string& __str) const; + + int + compare(size_type __pos1, size_type __n1, const basic_string& __str, + size_type __pos2, size_type __n2) const; + + + %ignore pop_back(); + %ignore front() const; + %ignore back() const; + %ignore basic_string(size_type n); + %std_sequence_methods_val(basic_string); + + + %ignore pop(); + + +#ifdef %swig_basic_string + // Add swig/language extra methods + %swig_basic_string(std::basic_string<_CharT, _Traits, _Alloc >); +#endif + +#ifdef SWIG_EXPORT_ITERATOR_METHODS + + + class iterator; + class reverse_iterator; + class const_iterator; + class const_reverse_iterator; + + + void + insert(iterator __p, size_type __n, _CharT __c); + + basic_string& + replace(iterator __i1, iterator __i2, const basic_string& __str); + + basic_string& + replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n); + + basic_string& + replace(iterator __i1, iterator __i2, size_type __n, _CharT __c); + + + basic_string& + replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2); + + basic_string& + replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2); +#endif + + basic_string& operator +=(const basic_string& v); + + %newobject __add__; + %newobject __radd__; + %extend { + + std::basic_string<_CharT,_Traits,_Alloc >* __add__(const basic_string& v) { + std::basic_string<_CharT,_Traits,_Alloc >* res = new std::basic_string<_CharT,_Traits,_Alloc >(*self); + *res += v; + return res; + } + + std::basic_string<_CharT,_Traits,_Alloc >* __radd__(const basic_string& v) { + std::basic_string<_CharT,_Traits,_Alloc >* res = new std::basic_string<_CharT,_Traits,_Alloc >(v); + *res += *self; + return res; + } + + std::basic_string<_CharT,_Traits,_Alloc > __str__() { + return *self; + } + + std::basic_ostream<_CharT, std::char_traits<_CharT> >& + __rlshift__(std::basic_ostream<_CharT, std::char_traits<_CharT> >& out) { + out << *self; + return out; + } + } + + }; +} + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_carray.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_carray.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,64 @@ +%{ +#include <algorithm> +%} + +// +// std::carray - is really an extension to the 'std' namespace. +// +// A simple fix C array wrapper, more or less as presented in +// +// "The C++ Standarf Library", by Nicolai M. Josuttis +// +// which is also derived from the example in +// +// "The C++ Programming Language", by Bjarne Stroustup. +// + +%inline %{ +namespace std { + template <class _Type, size_t _Size> + class carray + { + public: + typedef _Type value_type; + typedef size_t size_type; + + typedef _Type * iterator; + typedef const _Type * const_iterator; + + carray() { } + + carray(const carray& c) { + std::copy(c.v, c.v + size(), v); + } + + template <class _Iterator> + carray(_Iterator first, _Iterator last) { + assign(first, last); + } + + iterator begin() { return v; } + iterator end() { return v + _Size; } + + const_iterator begin() const { return v; } + const_iterator end() const { return v + _Size; } + + _Type& operator[](size_t i) { return v[i]; } + const _Type& operator[](size_t i) const { return v[i]; } + + static size_t size() { return _Size; } + + template <class _Iterator> + void assign(_Iterator first, _Iterator last) { + if (std::distance(first,last) == size()) { + std::copy(first, last, v); + } else { + throw std::length_error("bad range length"); + } + } + + private: + _Type v[_Size]; + }; +} +%} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_char_traits.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_char_traits.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,140 @@ +%include <std_common.i> +#if defined(SWIG_WCHAR) +%include <wchar.i> +#endif + +namespace std +{ + + /// 21.1.2 Basis for explicit _Traits specialization + /// NB: That for any given actual character type this definition is + /// probably wrong. + template<class _CharT> + struct char_traits + { + }; + + + /// 21.1.4 char_traits specializations + template<> + struct char_traits<char> { + typedef char char_type; + typedef int int_type; + typedef streampos pos_type; + typedef streamoff off_type; + typedef mbstate_t state_type; + + static void + assign(char_type& __c1, const char_type& __c2); + + static bool + eq(const char_type& __c1, const char_type& __c2); + + static bool + lt(const char_type& __c1, const char_type& __c2); + + static int + compare(const char_type* __s1, const char_type* __s2, size_t __n); + + static size_t + length(const char_type* __s); + + static const char_type* + find(const char_type* __s, size_t __n, const char_type& __a); + + static char_type* + move(char_type* __s1, const char_type* __s2, size_t __n); + + static char_type* + copy(char_type* __s1, const char_type* __s2, size_t __n); + + static char_type* + assign(char_type* __s, size_t __n, char_type __a); + + static char_type + to_char_type(const int_type& __c); + + // To keep both the byte 0xff and the eof symbol 0xffffffff + // from ending up as 0xffffffff. + static int_type + to_int_type(const char_type& __c); + + static bool + eq_int_type(const int_type& __c1, const int_type& __c2); + + static int_type + eof() ; + + static int_type + not_eof(const int_type& __c); + }; + + +#if defined(SWIG_WCHAR) + template<> + struct char_traits<wchar_t> + { + typedef wchar_t char_type; + typedef wint_t int_type; + typedef streamoff off_type; + typedef wstreampos pos_type; + typedef mbstate_t state_type; + + static void + assign(char_type& __c1, const char_type& __c2); + + static bool + eq(const char_type& __c1, const char_type& __c2); + + static bool + lt(const char_type& __c1, const char_type& __c2); + + static int + compare(const char_type* __s1, const char_type* __s2, size_t __n); + + static size_t + length(const char_type* __s); + + static const char_type* + find(const char_type* __s, size_t __n, const char_type& __a); + + static char_type* + move(char_type* __s1, const char_type* __s2, int_type __n); + + static char_type* + copy(char_type* __s1, const char_type* __s2, size_t __n); + + static char_type* + assign(char_type* __s, size_t __n, char_type __a); + + static char_type + to_char_type(const int_type& __c) ; + + static int_type + to_int_type(const char_type& __c) ; + + static bool + eq_int_type(const int_type& __c1, const int_type& __c2); + + static int_type + eof() ; + + static int_type + not_eof(const int_type& __c); + }; +#endif +} + +namespace std { +#ifndef SWIG_STL_WRAP_TRAITS +%template() char_traits<char>; +#if defined(SWIG_WCHAR) +%template() char_traits<wchar_t>; +#endif +#else +%template(char_traits_c) char_traits<char>; +#if defined(SWIG_WCHAR) +%template(char_traits_w) char_traits<wchar_t>; +#endif +#endif +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_common.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_common.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,239 @@ +%include <std/std_except.i> + +// +// Use the following macro with modern STL implementations +// +//#define SWIG_STD_MODERN_STL +// +// Use this to deactive the previous definition, when using gcc-2.95 +// or similar old compilers. +// +//#define SWIG_STD_NOMODERN_STL + +// Here, we identify compilers we know have problems with STL. +%{ +#if defined(__GNUC__) +# if __GNUC__ == 2 && __GNUC_MINOR <= 96 +# define SWIG_STD_NOMODERN_STL +# endif +#endif +%} + +// +// Common code for supporting the C++ std namespace +// + +%{ +#include <string> +#include <stdexcept> +#include <stddef.h> +%} + + +%fragment("StdIteratorTraits","header",fragment="<stddef.h>") %{ +#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) +# if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL) +# define SWIG_STD_NOITERATOR_TRAITS_STL +# endif +#endif + +#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL) +#include <iterator> +#else +namespace std { + template <class Iterator> + struct iterator_traits { + typedef ptrdiff_t difference_type; + typedef typename Iterator::value_type value_type; + }; + + template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance> + struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > { + typedef Distance difference_type; + typedef T value_type; + }; + + template <class T> + struct iterator_traits<T*> { + typedef T value_type; + typedef ptrdiff_t difference_type; + }; + + template<typename _InputIterator> + inline typename iterator_traits<_InputIterator>::difference_type + distance(_InputIterator __first, _InputIterator __last) + { + typename iterator_traits<_InputIterator>::difference_type __n = 0; + while (__first != __last) { + ++__first; ++__n; + } + return __n; + } +} +#endif +%} + +%fragment("StdTraitsCommon","header") %{ +namespace swig { + template <class Type> + struct noconst_traits { + typedef Type noconst_type; + }; + + template <class Type> + struct noconst_traits<const Type> { + typedef Type noconst_type; + }; + + /* + type categories + */ + struct pointer_category { }; + struct value_category { }; + + /* + General traits that provides type_name and type_info + */ + template <class Type> struct traits { }; + + template <class Type> + inline const char* type_name() { + return traits<typename noconst_traits<Type >::noconst_type >::type_name(); + } + + template <class Type> + struct traits_info { + static swig_type_info *type_query(std::string name) { + name += " *"; + return SWIG_TypeQuery(name.c_str()); + } + static swig_type_info *type_info() { + static swig_type_info *info = type_query(type_name<Type>()); + return info; + } + }; + + template <class Type> + inline swig_type_info *type_info() { + return traits_info<Type>::type_info(); + } + + /* + Partial specialization for pointers + */ + template <class Type> struct traits <Type *> { + typedef pointer_category category; + static std::string make_ptr_name(const char* name) { + std::string ptrname = name; + ptrname += " *"; + return ptrname; + } + static const char* type_name() { + static std::string name = make_ptr_name(swig::type_name<Type>()); + return name.c_str(); + } + }; + + template <class Type, class Category> + struct traits_as { }; + + template <class Type, class Category> + struct traits_check { }; + +} +%} + +/* + Generate the traits for a swigtype +*/ + +%define %traits_swigtype(Type...) +%fragment(SWIG_Traits_frag(Type),"header",fragment="StdTraits") { + namespace swig { + template <> struct traits<Type > { + typedef pointer_category category; + static const char* type_name() { return #Type; } + }; + } +} +%enddef + + + +/* + Generate the typemaps for a class that has 'value' traits +*/ + +%define %typemap_traits(Code,Type...) + %typemaps_asvalfrom(%arg(Code), + %arg(swig::asval<Type >), + %arg(swig::from), + %arg(SWIG_Traits_frag(Type)), + %arg(SWIG_Traits_frag(Type)), + Type); +%enddef + +/* + Generate the typemaps for a class that behaves more like a 'pointer' or + plain wrapped Swigtype. +*/ + +%define %typemap_traits_ptr(Code,Type...) + %typemaps_asptrfrom(%arg(Code), + %arg(swig::asptr), + %arg(swig::from), + %arg(SWIG_Traits_frag(Type)), + %arg(SWIG_Traits_frag(Type)), + Type); +%enddef + + +/* + Equality methods +*/ +%define %std_equal_methods(Type...) +%extend Type { + bool operator == (const Type& v) { + return *self == v; + } + + bool operator != (const Type& v) { + return *self != v; + } +} + +%enddef + +/* + Order methods +*/ + +%define %std_order_methods(Type...) +%extend Type { + bool operator > (const Type& v) { + return *self > v; + } + + bool operator < (const Type& v) { + return *self < v; + } + + bool operator >= (const Type& v) { + return *self >= v; + } + + bool operator <= (const Type& v) { + return *self <= v; + } +} +%enddef + +/* + Comparison methods +*/ + +%define %std_comp_methods(Type...) +%std_equal_methods(Type ) +%std_order_methods(Type ) +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_container.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_container.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,109 @@ +%include <std_common.i> +%include <exception.i> +%include <std_alloc.i> + +%{ +#include <algorithm> +%} + +// Common container methods + +%define %std_container_methods(container...) + container(); + container(const container&); + + bool empty() const; + size_type size() const; + void clear(); + + void swap(container& v); + + allocator_type get_allocator() const; + + #ifdef SWIG_EXPORT_ITERATOR_METHODS + class iterator; + class reverse_iterator; + class const_iterator; + class const_reverse_iterator; + + iterator begin(); + iterator end(); + reverse_iterator rbegin(); + reverse_iterator rend(); + #endif + +%enddef + +// Common sequence + +%define %std_sequence_methods_common(sequence) + + %std_container_methods(%arg(sequence)); + + sequence(size_type size); + void pop_back(); + + void resize(size_type new_size); + + #ifdef SWIG_EXPORT_ITERATOR_METHODS + iterator erase(iterator pos); + iterator erase(iterator first, iterator last); + #endif + +%enddef + + +%define %std_sequence_methods(sequence) + + %std_sequence_methods_common(%arg(sequence)); + + sequence(size_type size, const value_type& value); + void push_back(const value_type& x); + + const value_type& front() const; + const value_type& back() const; + + void assign(size_type n, const value_type& x); + + void resize(size_type new_size, const value_type& x); + + #ifdef SWIG_EXPORT_ITERATOR_METHODS + iterator insert(iterator pos, const value_type& x); + void insert(iterator pos, size_type n, const value_type& x); + #endif + +%enddef + +%define %std_sequence_methods_val(sequence...) + + %std_sequence_methods_common(%arg(sequence)); + + sequence(size_type size, value_type value); + void push_back(value_type x); + + value_type front() const; + value_type back() const; + + void assign(size_type n, value_type x); + + void resize(size_type new_size, value_type x); + + #ifdef SWIG_EXPORT_ITERATOR_METHODS + iterator insert(iterator pos, value_type x); + void insert(iterator pos, size_type n, value_type x); + #endif + +%enddef + + +// +// Ignore member methods for Type with no default constructor +// +%define %std_nodefconst_type(Type...) +%feature("ignore") std::vector<Type >::vector(size_type size); +%feature("ignore") std::vector<Type >::resize(size_type size); +%feature("ignore") std::deque<Type >::deque(size_type size); +%feature("ignore") std::deque<Type >::resize(size_type size); +%feature("ignore") std::list<Type >::list(size_type size); +%feature("ignore") std::list<Type >::resize(size_type size); +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_deque.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_deque.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,127 @@ +// +// std::deque + +%include <std_container.i> + +// Deque + +%define %std_deque_methods(deque...) + %std_sequence_methods(deque) + + void pop_front(); + void push_front(const value_type& x); +%enddef + +%define %std_deque_methods_val(deque...) + %std_sequence_methods_val(deque) + + void pop_front(); + void push_front(value_type x); +%enddef + +// ------------------------------------------------------------------------ +// std::deque +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::deque<T>), f(const std::deque<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::deque<T> can be passed. +// -- f(std::deque<T>&), f(std::deque<T>*): +// the parameter may be modified; therefore, only a wrapped std::deque +// can be passed. +// -- std::deque<T> f(), const std::deque<T>& f(): +// the deque is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::deque<T>& f(), std::deque<T>* f(): +// the deque is returned by reference; therefore, a wrapped std::deque +// is returned +// -- const std::deque<T>* f(), f(const std::deque<T>*): +// for consistency, they expect and return a plain deque pointer. +// ------------------------------------------------------------------------ + +%{ +#include <deque> +%} + +// exported classes + +namespace std { + + template<class _Tp, class _Alloc = allocator<_Tp> > + class deque { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::deque<_Tp, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdDequeTraits") { + namespace swig { + template <> struct traits<std::deque<_Tp, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::deque<" #_Tp " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp, _Alloc >); + +#ifdef %swig_deque_methods + // Add swig/language extra methods + %swig_deque_methods(std::deque<_Tp, _Alloc >); +#endif + + %std_deque_methods(deque); + }; + + template<class _Tp, class _Alloc > + class deque<_Tp*, _Alloc > { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp* value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type reference; + typedef value_type const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::deque<_Tp*, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdDequeTraits") { + namespace swig { + template <> struct traits<std::deque<_Tp*, _Alloc > > { + typedef value_category category; + static const char* type_name() { + return "std::deque<" #_Tp " * >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_DEQUE, std::deque<_Tp*, _Alloc >); + +#ifdef %swig_deque_methods_val + // Add swig/language extra methods + %swig_deque_methods_val(std::deque<_Tp*, _Alloc >); +#endif + + %std_deque_methods_val(std::deque<_Tp*, _Alloc >); + }; + +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_except.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_except.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,68 @@ +#if defined(SWIGJAVA) || defined(SWIGCSHARP) +#error "do not use this version of std_except.i" +#endif + +%{ +#include <stdexcept> +%} + +#if defined(SWIG_STD_EXCEPTIONS_AS_CLASSES) + +namespace std { + struct exception + { + virtual ~exception() throw(); + virtual const char* what() const throw(); + }; + + struct bad_exception : exception + { + }; + + struct logic_error : exception + { + logic_error(const string& msg); + }; + + struct domain_error : logic_error + { + domain_error(const string& msg); + }; + + struct invalid_argument : logic_error + { + invalid_argument(const string& msg); + }; + + struct length_error : logic_error + { + length_error(const string& msg); + }; + + struct out_of_range : logic_error + { + out_of_range(const string& msg); + }; + + struct runtime_error : exception + { + runtime_error(const string& msg); + }; + + struct range_error : runtime_error + { + range_error(const string& msg); + }; + + struct overflow_error : runtime_error + { + overflow_error(const string& msg); + }; + + struct underflow_error : runtime_error + { + underflow_error(const string& msg); + }; +} + +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_ios.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_ios.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,260 @@ +%include <std_char_traits.i> +%include <std_basic_string.i> +%include <std_except.i> +%{ +#ifndef SWIG_STD_NOMODERN_STL +# include <ios> +#else +# include <streambuf.h> +#endif +%} + +namespace std { + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_streambuf; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_istream; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ostream; + + // 27.4.2 Class ios_base + typedef size_t streamsize; + + class locale; + + + class ios_base + { + public: + +#ifdef SWIG_NESTED_CLASSES + // 27.4.2.1.1 Class ios_base::failure + class failure : public exception + { + public: + explicit failure(const string& __str) throw(); + }; +#endif + + // 27.4.2.1.2 Type ios_base::fmtflags + typedef int fmtflags; + // 27.4.2.1.2 Type fmtflags + static const fmtflags boolalpha ; + static const fmtflags dec ; + static const fmtflags fixed ; + static const fmtflags hex ; + static const fmtflags internal ; + static const fmtflags left ; + static const fmtflags oct ; + static const fmtflags right ; + static const fmtflags scientific ; + static const fmtflags showbase ; + static const fmtflags showpoint ; + static const fmtflags showpos ; + static const fmtflags skipws ; + static const fmtflags unitbuf ; + static const fmtflags uppercase ; + static const fmtflags adjustfield ; + static const fmtflags basefield ; + static const fmtflags floatfield ; + + // 27.4.2.1.3 Type ios_base::iostate + typedef int iostate; + static const iostate badbit ; + static const iostate eofbit ; + static const iostate failbit ; + static const iostate goodbit ; + + // 27.4.2.1.4 Type openmode + typedef int openmode; + static const openmode app ; + static const openmode ate ; + static const openmode binary ; + static const openmode in ; + static const openmode out ; + static const openmode trunc ; + + // 27.4.2.1.5 Type seekdir + typedef int seekdir; + static const seekdir beg ; + static const seekdir cur ; + static const seekdir end ; + + + // Callbacks; + enum event + { + erase_event, + imbue_event, + copyfmt_event + }; + + typedef void (*event_callback) (event, ios_base&, int); + + void + register_callback(event_callback __fn, int __index); + + // Fmtflags state: + inline fmtflags + flags() const ; + + inline fmtflags + flags(fmtflags __fmtfl); + + inline fmtflags + setf(fmtflags __fmtfl); + + inline fmtflags + setf(fmtflags __fmtfl, fmtflags __mask); + + inline void + unsetf(fmtflags __mask) ; + + inline streamsize + precision() const ; + + inline streamsize + precision(streamsize __prec); + + inline streamsize + width() const ; + + inline streamsize + width(streamsize __wide); + + static bool + sync_with_stdio(bool __sync = true); + + // Locales: + locale + imbue(const locale& __loc); + + inline locale + getloc() const { return _M_ios_locale; } + + // Storage: + static int + xalloc() throw(); + + inline long& + iword(int __ix); + + inline void*& + pword(int __ix); + + // Destructor + ~ios_base(); + + protected: + ios_base(); + + //50. Copy constructor and assignment operator of ios_base + private: + ios_base(const ios_base&); + + ios_base& + operator=(const ios_base&); + }; + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ios : public ios_base + { + public: + // Types: + typedef _CharT char_type; + typedef typename _Traits::int_type int_type; + typedef typename _Traits::pos_type pos_type; + typedef typename _Traits::off_type off_type; + typedef _Traits traits_type; + + public: + + iostate + rdstate() const; + + void + clear(iostate __state = goodbit); + + void + setstate(iostate __state); + + bool + good() const; + + bool + eof() const; + + bool + fail() const; + + bool + bad() const; + + iostate + exceptions() const; + + void + exceptions(iostate __except); + + // Constructor/destructor: + explicit + basic_ios(basic_streambuf<_CharT, _Traits>* __sb) : ios_base(); + + virtual + ~basic_ios() ; + + // Members: + basic_ostream<_CharT, _Traits>* + tie() const; + + basic_ostream<_CharT, _Traits>* + tie(basic_ostream<_CharT, _Traits>* __tiestr); + + basic_streambuf<_CharT, _Traits>* + rdbuf() const; + + basic_streambuf<_CharT, _Traits>* + rdbuf(basic_streambuf<_CharT, _Traits>* __sb); + + basic_ios& + copyfmt(const basic_ios& __rhs); + + char_type + fill() const; + + char_type + fill(char_type __ch); + + // Locales: + locale + imbue(const locale& __loc); + + char + narrow(char_type __c, char __dfault) const; + + char_type + widen(char __c) const; + + protected: + // 27.4.5.1 basic_ios constructors + basic_ios(); + private: + ios_base(const ios_base&); + + ios_base& + operator=(const ios_base&); + }; + +} + +namespace std { + %template(ios) basic_ios<char>; +#if defined(SWIG_WCHAR) + %template(wios) basic_ios<wchar_t>; +#endif +} + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_iostream.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_iostream.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,339 @@ +/* + For wchar support, you need to include the wchar.i file + before this file, ie: + + %include <wchar.i> + %include <std_iostream.i> + + or equivalently, just include + + %include <std_wiostream.i> +*/ + +%include <std_ios.i> +%include <std_basic_string.i> +%include <std_string.i> +#if defined(SWIG_WCHAR) +%include <std_wstring.i> +#endif + +%{ +#include <iostream> +%} + + +namespace std +{ + // 27.6.2.1 Template class basic_ostream + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_ostream : virtual public basic_ios<_CharT, _Traits> + { + public: + // Types (inherited from basic_ios (27.4.4)): + typedef _CharT char_type; + typedef typename _Traits::int_type int_type; + typedef typename _Traits::pos_type pos_type; + typedef typename _Traits::off_type off_type; + typedef _Traits traits_type; + + // 27.6.2.2 Constructor/destructor: + explicit + basic_ostream(basic_streambuf<_CharT, _Traits>* __sb); + + virtual + ~basic_ostream(); + + // 27.6.2.5 Formatted output: + // 27.6.2.5.3 basic_ostream::operator<< + basic_ostream<_CharT, _Traits>& + operator<<(basic_ostream<_CharT, _Traits>& (*__pf)(basic_ostream<_CharT, _Traits>&)); + + + basic_ostream<_CharT, _Traits>& + operator<<(basic_ios<_CharT, _Traits>& (*__pf)(basic_ios<_CharT, _Traits>&)); + + + basic_ostream<_CharT, _Traits>& + operator<<(ios_base& (*__pf) (ios_base&)); + + // 27.6.2.5.2 Arithmetic Inserters + + basic_ostream<_CharT, _Traits>& + operator<<(long __n); + + basic_ostream<_CharT, _Traits>& + operator<<(unsigned long __n); + + basic_ostream<_CharT, _Traits>& + operator<<(bool __n); + + basic_ostream<_CharT, _Traits>& + operator<<(short __n); + + basic_ostream<_CharT, _Traits>& + operator<<(unsigned short __n); + + basic_ostream<_CharT, _Traits>& + operator<<(int __n); + + basic_ostream<_CharT, _Traits>& + operator<<(unsigned int __n); + + basic_ostream<_CharT, _Traits>& + operator<<(long long __n); + + basic_ostream<_CharT, _Traits>& + operator<<(unsigned long long __n); + + basic_ostream<_CharT, _Traits>& + operator<<(double __f); + + basic_ostream<_CharT, _Traits>& + operator<<(float __f); + + basic_ostream<_CharT, _Traits>& + operator<<(long double __f); + + basic_ostream<_CharT, _Traits>& + operator<<(const void* __p); + + basic_ostream<_CharT, _Traits>& + operator<<(basic_streambuf<_CharT, _Traits>* __sb); + + %extend { + std::basic_ostream<_CharT, _Traits >& + operator<<(const std::basic_string<_CharT,_Traits, std::allocator<_CharT> >& s) + { + *self << s; + return *self; + } + } + + // Unformatted output: + basic_ostream<_CharT, _Traits>& + put(char_type __c); + + basic_ostream<_CharT, _Traits>& + write(const char_type* __s, streamsize __n); + + basic_ostream<_CharT, _Traits>& + flush(); + + // Seeks: + pos_type + tellp(); + + basic_ostream<_CharT, _Traits>& + seekp(pos_type); + + basic_ostream<_CharT, _Traits>& + seekp(off_type, ios_base::seekdir); + + }; + + // 27.6.1.1 Template class basic_istream + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_istream : virtual public basic_ios<_CharT, _Traits> + { + public: + // Types (inherited from basic_ios (27.4.4)): + typedef _CharT char_type; + typedef typename _Traits::int_type int_type; + typedef typename _Traits::pos_type pos_type; + typedef typename _Traits::off_type off_type; + typedef _Traits traits_type; + + + public: + // 27.6.1.1.1 Constructor/destructor: + explicit + basic_istream(basic_streambuf<_CharT, _Traits>* __sb); + + virtual + ~basic_istream(); + + // 27.6.1.2.3 basic_istream::operator>> + basic_istream<_CharT, _Traits>& + operator>>(basic_istream<_CharT, _Traits>& (*__pf)(basic_istream<_CharT, _Traits>&)); + + basic_istream<_CharT, _Traits>& + operator>>(basic_ios<_CharT, _Traits>& (*__pf)(basic_ios<_CharT, _Traits>&)); + + basic_istream<_CharT, _Traits>& + operator>>(ios_base& (*__pf)(ios_base&)); + + // 27.6.1.2.2 Arithmetic Extractors + basic_istream<_CharT, _Traits>& + operator>>(bool& __n); + + basic_istream<_CharT, _Traits>& + operator>>(short& __n); + + basic_istream<_CharT, _Traits>& + operator>>(unsigned short& __n); + + basic_istream<_CharT, _Traits>& + operator>>(int& __n); + + basic_istream<_CharT, _Traits>& + operator>>(unsigned int& __n); + + basic_istream<_CharT, _Traits>& + operator>>(long& __n); + + basic_istream<_CharT, _Traits>& + operator>>(unsigned long& __n); + + basic_istream<_CharT, _Traits>& + operator>>(long long& __n); + + basic_istream<_CharT, _Traits>& + operator>>(unsigned long long& __n); + + basic_istream<_CharT, _Traits>& + operator>>(float& __f); + + basic_istream<_CharT, _Traits>& + operator>>(double& __f); + + basic_istream<_CharT, _Traits>& + operator>>(long double& __f); + + basic_istream<_CharT, _Traits>& + operator>>(void*& __p); + + basic_istream<_CharT, _Traits>& + operator>>(basic_streambuf<_CharT, _Traits>* __sb); + + // 27.6.1.3 Unformatted input: + inline streamsize + gcount(void) const; + + int_type + get(void); + + basic_istream<_CharT, _Traits>& + get(char_type& __c); + + basic_istream<_CharT, _Traits>& + get(char_type* __s, streamsize __n, char_type __delim); + + inline basic_istream<_CharT, _Traits>& + get(char_type* __s, streamsize __n); + + basic_istream<_CharT, _Traits>& + get(basic_streambuf<_CharT, _Traits>& __sb, char_type __delim); + + inline basic_istream<_CharT, _Traits>& + get(basic_streambuf<_CharT, _Traits>& __sb); + + basic_istream<_CharT, _Traits>& + getline(char_type* __s, streamsize __n, char_type __delim); + + inline basic_istream<_CharT, _Traits>& + getline(char_type* __s, streamsize __n); + + basic_istream<_CharT, _Traits>& + ignore(streamsize __n = 1, int_type __delim = _Traits::eof()); + + int_type + peek(void); + + basic_istream<_CharT, _Traits>& + read(char_type* __s, streamsize __n); + + streamsize + readsome(char_type* __s, streamsize __n); + + basic_istream<_CharT, _Traits>& + putback(char_type __c); + + basic_istream<_CharT, _Traits>& + unget(void); + + int + sync(void); + + pos_type + tellg(void); + + basic_istream<_CharT, _Traits>& + seekg(pos_type); + + basic_istream<_CharT, _Traits>& + seekg(off_type, ios_base::seekdir); + }; + + // 27.6.1.5 Template class basic_iostream + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_iostream + : public basic_istream<_CharT, _Traits>, + public basic_ostream<_CharT, _Traits> + { + public: + typedef _CharT char_type; + typedef typename _Traits::int_type int_type; + typedef typename _Traits::pos_type pos_type; + typedef typename _Traits::off_type off_type; + typedef _Traits traits_type; + + explicit + basic_iostream(basic_streambuf<_CharT, _Traits>* __sb); + + virtual + ~basic_iostream(); + }; + + typedef basic_ostream<char> ostream ; + typedef basic_istream<char> istream; + typedef basic_iostream<char> iostream; + + extern istream cin; + extern ostream cout; + extern ostream cerr; + extern ostream clog; + +#if defined(SWIG_WCHAR) + typedef basic_ostream<wchar_t> wostream; + typedef basic_istream<wchar_t> wistream; + typedef basic_iostream<wchar_t> wiostream; + + extern wistream wcin; + extern wostream wcout; + extern wostream wcerr; + extern wostream wclog; +#endif + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + std::basic_ostream<_CharT, _Traits>& + endl(std::basic_ostream<_CharT, _Traits>&); + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + std::basic_ostream<_CharT, _Traits>& + ends(std::basic_ostream<_CharT, _Traits>&); + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + std::basic_ostream<_CharT, _Traits>& + flush(std::basic_ostream<_CharT, _Traits>&); +} + +namespace std { + %template(ostream) basic_ostream<char>; + %template(istream) basic_istream<char>; + %template(iostream) basic_iostream<char>; + + %template(endl) endl<char, std::char_traits<char> >; + %template(ends) ends<char, std::char_traits<char> >; + %template(flush) flush<char, std::char_traits<char> >; + +#if defined(SWIG_WCHAR) + %template(wostream) basic_ostream<wchar_t>; + %template(wistream) basic_istream<wchar_t>; + %template(wiostream) basic_iostream<wchar_t>; + + %template(wendl) endl<wchar_t, std::char_traits<wchar_t> >; + %template(wends) ends<wchar_t, std::char_traits<wchar_t> >; + %template(wflush) flush<wchar_t, std::char_traits<wchar_t> >; +#endif +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_list.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_list.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,148 @@ +// +// std::list +// + +%include <std_container.i> + +// List + +%define %std_list_methods(list) + %std_sequence_methods(list) + + void pop_front(); + void push_front(const value_type& x); + + void reverse(); + +%enddef + + +%define %std_list_methods_val(list) + %std_sequence_methods_val(list) + + void pop_front(); + void push_front(value_type x); + + void remove(value_type x); + void unique(); + void reverse(); + void sort(); + + void merge(list& x); +%enddef + +// ------------------------------------------------------------------------ +// std::list +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::list<T>), f(const std::list<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::list<T> can be passed. +// -- f(std::list<T>&), f(std::list<T>*): +// the parameter may be modified; therefore, only a wrapped std::list +// can be passed. +// -- std::list<T> f(), const std::list<T>& f(): +// the list is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::list<T>& f(), std::list<T>* f(): +// the list is returned by reference; therefore, a wrapped std::list +// is returned +// -- const std::list<T>* f(), f(const std::list<T>*): +// for consistency, they expect and return a plain list pointer. +// ------------------------------------------------------------------------ + +%{ +#include <list> +%} + +// exported classes + +namespace std { + + template<class _Tp, class _Alloc = allocator<_Tp> > + class list { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::list<_Tp, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdListTraits") { + namespace swig { + template <> struct traits<std::list<_Tp, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::list<" #_Tp ", " #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp, _Alloc >); + +#ifdef %swig_list_methods + // Add swig/language extra methods + %swig_list_methods(std::list<_Tp, _Alloc >); +#endif + + %std_list_methods(list); + }; + + template<class _Tp, class _Alloc > + class list<_Tp*, _Alloc> { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp* value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type reference; + typedef value_type const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::list<_Tp*, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdListTraits") { + namespace swig { + template <> struct traits<std::list<_Tp*, _Alloc > > { + typedef value_category category; + static const char* type_name() { + return "std::list<" #_Tp " *," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_LIST, std::list<_Tp*, _Alloc >); + +#ifdef %swig_list_methods_val + // Add swig/language extra methods + %swig_list_methods_val(std::list<_Tp*, _Alloc >); +#endif + + %std_list_methods_val(list); + }; + +} + +%define %std_extequal_list(...) +%extend std::list<__VA_ARGS__ > { + void remove(const value_type& x) { self->remove(x); } + void merge(std::list<__VA_ARGS__ >& x){ self->merge(x); } + void unique() { self->unique(); } + void sort() { self->sort(); } +} +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_map.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_map.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,124 @@ +// +// std::map +// + +%include <std_pair.i> +%include <std_container.i> + +%define %std_map_methods_common(map...) + %std_container_methods(map); + + size_type erase(const key_type& x); + size_type count(const key_type& x) const; + +#ifdef SWIG_EXPORT_ITERATOR_METHODS +// iterator insert(iterator position, const value_type& x); + void erase(iterator position); + void erase(iterator first, iterator last); + + iterator find(const key_type& x); + iterator lower_bound(const key_type& x); + iterator upper_bound(const key_type& x); +#endif +%enddef + +%define %std_map_methods(map...) + %std_map_methods_common(map); + + #ifdef SWIG_EXPORT_ITERATOR_METHODS +// iterator insert(const value_type& x); + #endif +%enddef + + +// ------------------------------------------------------------------------ +// std::map +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::map<T>), f(const std::map<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::map<T> can be passed. +// -- f(std::map<T>&), f(std::map<T>*): +// the parameter may be modified; therefore, only a wrapped std::map +// can be passed. +// -- std::map<T> f(), const std::map<T>& f(): +// the map is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::map<T>& f(), std::map<T>* f(): +// the map is returned by reference; therefore, a wrapped std::map +// is returned +// -- const std::map<T>* f(), f(const std::map<T>*): +// for consistency, they expect and return a plain map pointer. +// ------------------------------------------------------------------------ + +%{ +#include <map> +#include <algorithm> +#include <stdexcept> +%} + +// exported class + +namespace std { + + template<class _Key, class _Tp, class _Compare = std::less<_Key >, + class _Alloc = allocator<std::pair<const _Key, _Tp > > > + class map { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Key key_type; + typedef _Tp mapped_type; + typedef std::pair<const _Key, _Tp> value_type; + + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Key); + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::pair< _Key, _Tp >), "header", + fragment=SWIG_Traits_frag(_Key), + fragment=SWIG_Traits_frag(_Tp), + fragment="StdPairTraits") { + namespace swig { + template <> struct traits<std::pair< _Key, _Tp > > { + typedef pointer_category category; + static const char* type_name() { + return "std::pair<" #_Key "," #_Tp " >"; + } + }; + } + } + + %fragment(SWIG_Traits_frag(std::map<_Key, _Tp, _Compare, _Alloc >), "header", + fragment=SWIG_Traits_frag(std::pair<_Key, _Tp >), + fragment="StdMapTraits") { + namespace swig { + template <> struct traits<std::map<_Key, _Tp, _Compare, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::map<" #_Key "," #_Tp "," #_Compare "," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_MAP, std::map<_Key, _Tp, _Compare, _Alloc >); + + map( const _Compare& ); + +#ifdef %swig_map_methods + // Add swig/language extra methods + %swig_map_methods(std::map<_Key, _Tp, _Compare, _Alloc >); +#endif + + %std_map_methods(map); + }; + +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_multimap.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_multimap.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,101 @@ +// +// std::map +// + +%include <std_map.i> + + +%define %std_multimap_methods(mmap...) + %std_map_methods_common(mmap); + +#ifdef SWIG_EXPORT_ITERATOR_METHODS + std::pair<iterator,iterator> equal_range(const key_type& x); + std::pair<const_iterator,const_iterator> equal_range(const key_type& x) const; +#endif +%enddef + +// ------------------------------------------------------------------------ +// std::multimap +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::multimap<T>), f(const std::multimap<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::multimap<T> can be passed. +// -- f(std::multimap<T>&), f(std::multimap<T>*): +// the parameter may be modified; therefore, only a wrapped std::multimap +// can be passed. +// -- std::multimap<T> f(), const std::multimap<T>& f(): +// the map is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::multimap<T>& f(), std::multimap<T>* f(): +// the map is returned by reference; therefore, a wrapped std::multimap +// is returned +// -- const std::multimap<T>* f(), f(const std::multimap<T>*): +// for consistency, they expect and return a plain map pointer. +// ------------------------------------------------------------------------ + + +// exported class + + +namespace std { + template<class _Key, class _Tp, class _Compare = std::less<_Key >, + class _Alloc = allocator<std::pair<const _Key, _Tp > > > + class multimap { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Key key_type; + typedef _Tp mapped_type; + typedef std::pair<const _Key, _Tp> value_type; + + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Key); + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::pair< _Key, _Tp >), "header", + fragment=SWIG_Traits_frag(_Key), + fragment=SWIG_Traits_frag(_Tp), + fragment="StdPairTraits") { + namespace swig { + template <> struct traits<std::pair< _Key, _Tp > > { + typedef pointer_category category; + static const char* type_name() { + return "std::pair<" #_Key "," #_Tp " >"; + } + }; + } + } + + %fragment(SWIG_Traits_frag(std::multimap<_Key, _Tp, _Compare, _Alloc >), "header", + fragment=SWIG_Traits_frag(std::pair<_Key, _Tp >), + fragment="StdMultimapTraits") { + namespace swig { + template <> struct traits<std::multimap<_Key, _Tp, _Compare, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::multimap<" #_Key "," #_Tp "," #_Compare "," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_MULTIMAP, std::multimap<_Key, _Tp, _Compare, _Alloc >); + + multimap( const _Compare& ); + +#ifdef %swig_multimap_methods + // Add swig/language extra methods + %swig_multimap_methods(std::multimap<_Key, _Tp, _Compare, _Alloc >); +#endif + + %std_multimap_methods(multimap); + }; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_multiset.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_multiset.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,83 @@ +// +// std::set +// + +%include <std_set.i> + +// Multiset + +%define %std_multiset_methods(multiset...) + %std_set_methods_common(multiset); +%enddef + + +// ------------------------------------------------------------------------ +// std::multiset +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::multiset<T>), f(const std::multiset<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::multiset<T> can be passed. +// -- f(std::multiset<T>&), f(std::multiset<T>*): +// the parameter may be modified; therefore, only a wrapped std::multiset +// can be passed. +// -- std::multiset<T> f(), const std::multiset<T>& f(): +// the set is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::multiset<T>& f(), std::multiset<T>* f(): +// the set is returned by reference; therefore, a wrapped std::multiset +// is returned +// -- const std::multiset<T>* f(), f(const std::multiset<T>*): +// for consistency, they expect and return a plain set pointer. +// ------------------------------------------------------------------------ + + +// exported classes + +namespace std { + + //multiset + + template <class _Key, class _Compare = std::less<_Key>, + class _Alloc = allocator<_Key> > + class multiset { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Key value_type; + typedef _Key key_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Key); + + %fragment(SWIG_Traits_frag(std::multiset<_Key, _Compare, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Key), + fragment="StdMultisetTraits") { + namespace swig { + template <> struct traits<std::multiset<_Key, _Compare, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::multiset<" #_Key "," #_Compare "," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_MULTISET, std::multiset<_Key, _Compare, _Alloc >); + + multiset( const _Compare& ); + +#ifdef %swig_multiset_methods + // Add swig/language extra methods + %swig_multiset_methods(std::multiset<_Key, _Compare, _Alloc >); +#endif + + %std_multiset_methods(multiset); + }; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_pair.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_pair.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,163 @@ +%include <std_common.i> + +%{ +#include <utility> +%} + + +namespace std { + template <class T, class U > struct pair { + typedef T first_type; + typedef U second_type; + + %traits_swigtype(T); + %traits_swigtype(U); + + %fragment(SWIG_Traits_frag(std::pair<T,U >), "header", + fragment=SWIG_Traits_frag(T), + fragment=SWIG_Traits_frag(U), + fragment="StdPairTraits") { + namespace swig { + template <> struct traits<std::pair<T,U > > { + typedef pointer_category category; + static const char* type_name() { + return "std::pair<" #T "," #U " >"; + } + }; + } + } + +#ifndef SWIG_STD_PAIR_ASVAL + %typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair<T,U >); +#else + %typemap_traits(SWIG_TYPECHECK_PAIR, std::pair<T,U >); +#endif + + pair(); + pair(T first, U second); + pair(const pair& p); + + template <class U1, class U2> pair(const pair<U1, U2> &p); + + T first; + U second; + +#ifdef %swig_pair_methods + // Add swig/language extra methods + %swig_pair_methods(std::pair<T,U >) +#endif + }; + + // *** + // The following specializations should disappear or get + // simplified when a 'const SWIGTYPE*&' can be defined + // *** + template <class T, class U > struct pair<T, U*> { + typedef T first_type; + typedef U* second_type; + + %traits_swigtype(T); + %traits_swigtype(U); + + %fragment(SWIG_Traits_frag(std::pair<T,U* >), "header", + fragment=SWIG_Traits_frag(T), + fragment=SWIG_Traits_frag(U), + fragment="StdPairTraits") { + namespace swig { + template <> struct traits<std::pair<T,U* > > { + typedef pointer_category category; + static const char* type_name() { + return "std::pair<" #T "," #U " * >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair<T,U* >); + + pair(); + pair(T __a, U* __b); + pair(const pair& __p); + + T first; + U* second; + +#ifdef %swig_pair_methods + // Add swig/language extra methods + %swig_pair_methods(std::pair<T,U*>) +#endif + }; + + template <class T, class U > struct pair<T*, U> { + typedef T* first_type; + typedef U second_type; + + %traits_swigtype(T); + %traits_swigtype(U); + + %fragment(SWIG_Traits_frag(std::pair<T*,U >), "header", + fragment=SWIG_Traits_frag(T), + fragment=SWIG_Traits_frag(U), + fragment="StdPairTraits") { + namespace swig { + template <> struct traits<std::pair<T*,U > > { + typedef pointer_category category; + static const char* type_name() { + return "std::pair<" #T " *," #U " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_PAIR, std::pair<T*,U >); + + pair(); + pair(T* __a, U __b); + pair(const pair& __p); + + T* first; + U second; + +#ifdef %swig_pair_methods + // Add swig/language extra methods + %swig_pair_methods(std::pair<T*,U >) +#endif + }; + + template <class T, class U > struct pair<T*, U*> { + typedef T* first_type; + typedef U* second_type; + + %traits_swigtype(T); + %traits_swigtype(U); + + %fragment(SWIG_Traits_frag(std::pair<T*,U* >), "header", + fragment=SWIG_Traits_frag(T), + fragment=SWIG_Traits_frag(U), + fragment="StdPairTraits") { + namespace swig { + template <> struct traits<std::pair<T*,U* > > { + typedef pointer_category category; + static const char* type_name() { + return "std::pair<" #T " *," #U " * >"; + } + }; + } + } + + %typemap_traits(SWIG_TYPECHECK_PAIR, std::pair<T*,U* >); + + pair(); + pair(T* __a, U* __b); + pair(const pair& __p); + + T* first; + U* second; + +#ifdef %swig_pair_methods + // Add swig/language extra methods + %swig_pair_methods(std::pair<T*,U*>) +#endif + }; + +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_queue.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_queue.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,129 @@ +/** + * @file std_queue.i + * @date Sun May 6 01:48:07 2007 + * + * @brief A wrapping of std::queue for Ruby. + * + * + */ + +%include <std_container.i> + +// Queue + +%define %std_queue_methods(queue...) + queue(); + queue( const _Sequence& ); + + bool empty() const; + size_type size() const; + const value_type& front() const; + const value_type& back() const; + void pop(); + void push( const value_type& ); +%enddef + +%define %std_queue_methods_val(queue...) + %std_queue_methods(queue) +%enddef + +// ------------------------------------------------------------------------ +// std::queue +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::queue<T>), f(const std::queue<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::queue<T> can be passed. +// -- f(std::queue<T>&), f(std::queue<T>*): +// the parameter may be modified; therefore, only a wrapped std::queue +// can be passed. +// -- std::queue<T> f(), const std::queue<T>& f(): +// the queue is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::queue<T>& f(), std::queue<T>* f(): +// the queue is returned by reference; therefore, a wrapped std::queue +// is returned +// -- const std::queue<T>* f(), f(const std::queue<T>*): +// for consistency, they expect and return a plain queue pointer. +// ------------------------------------------------------------------------ + +%{ +#include <queue> +%} + +// exported classes + +namespace std { + + template<class _Tp, class _Sequence = std::deque<_Tp> > + class queue { + public: + typedef size_t size_type; + typedef _Tp value_type; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Sequence container_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::queue<_Tp, _Sequence >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdQueueTraits") { + namespace swig { + template <> struct traits<std::queue<_Tp, _Sequence > > { + typedef pointer_category category; + static const char* type_name() { + return "std::queue<" #_Tp "," #_Sequence " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp, _Sequence >); + +#ifdef %swig_queue_methods + // Add swig/language extra methods + %swig_queue_methods(std::queue<_Tp, _Sequence >); +#endif + + %std_queue_methods(queue); + }; + + template<class _Tp, class _Sequence > + class queue<_Tp*, _Sequence > { + public: + typedef size_t size_type; + typedef _Tp value_type; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Sequence container_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::queue<_Tp*, _Sequence >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdQueueTraits") { + namespace swig { + template <> struct traits<std::queue<_Tp*, _Sequence > > { + typedef value_category category; + static const char* type_name() { + return "std::queue<" #_Tp "," #_Sequence " * >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_QUEUE, std::queue<_Tp*, _Sequence >); + +#ifdef %swig_queue_methods_val + // Add swig/language extra methods + %swig_queue_methods_val(std::queue<_Tp*, _Sequence >); +#endif + + %std_queue_methods_val(std::queue<_Tp*, _Sequence >); + }; + +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_set.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_set.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,119 @@ +// +// std::set +// + +%include <std_container.i> +%include <std_pair.i> + +// Set +%define %std_set_methods_common(set...) + set(); + set( const set& ); + + bool empty() const; + size_type size() const; + void clear(); + + void swap(set& v); + + + size_type erase(const key_type& x); + size_type count(const key_type& x) const; + +#ifdef SWIG_EXPORT_ITERATOR_METHODS + class iterator; + class reverse_iterator; + + iterator begin(); + iterator end(); + reverse_iterator rbegin(); + reverse_iterator rend(); + + void erase(iterator pos); + void erase(iterator first, iterator last); + + iterator find(const key_type& x); + iterator lower_bound(const key_type& x); + iterator upper_bound(const key_type& x); + std::pair<iterator,iterator> equal_range(const key_type& x); +#endif +%enddef + +%define %std_set_methods(set...) + %std_set_methods_common(set); +#ifdef SWIG_EXPORT_ITERATOR_METHODS + std::pair<iterator,bool> insert(const value_type& __x); +#endif +%enddef + +// ------------------------------------------------------------------------ +// std::set +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::set<T>), f(const std::set<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::set<T> can be passed. +// -- f(std::set<T>&), f(std::set<T>*): +// the parameter may be modified; therefore, only a wrapped std::set +// can be passed. +// -- std::set<T> f(), const std::set<T>& f(): +// the set is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::set<T>& f(), std::set<T>* f(): +// the set is returned by reference; therefore, a wrapped std::set +// is returned +// -- const std::set<T>* f(), f(const std::set<T>*): +// for consistency, they expect and return a plain set pointer. +// ------------------------------------------------------------------------ + +%{ +#include <set> +%} + +// exported classes + +namespace std { + + template <class _Key, class _Compare = std::less<_Key>, + class _Alloc = allocator<_Key> > + class set { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Key value_type; + typedef _Key key_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Key); + + %fragment(SWIG_Traits_frag(std::set<_Key, _Compare, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Key), + fragment="StdSetTraits") { + namespace swig { + template <> struct traits<std::set<_Key, _Compare, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::set<" #_Key "," #_Compare "," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_SET, std::set<_Key, _Compare, _Alloc >); + + set( const _Compare& ); + +#ifdef %swig_set_methods + // Add swig/language extra methods + %swig_set_methods(std::set<_Key, _Compare, _Alloc >); +#endif + + %std_set_methods(set); + }; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_sstream.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_sstream.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,195 @@ +/* + For wchar support, you need to include the wchar.i file + before this file, ie: + + %include <wchar.i> + %include <std_sstream.i> + + or equivalently, just include + + %include <std_wsstream.i> +*/ + +%include <std_alloc.i> +%include <std_basic_string.i> +%include <std_string.i> +%include <std_ios.i> +#if defined(SWIG_WCHAR) +%include <std_wstring.i> +#endif +%include <std_streambuf.i> +%include <std_iostream.i> + +%{ +#include <sstream> +%} + + +namespace std +{ + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_stringbuf : public basic_streambuf<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + public: + // Constructors: + explicit + basic_stringbuf(ios_base::openmode __mode = ios_base::in | ios_base::out); + + explicit + basic_stringbuf(const basic_string<_CharT, _Traits, _Alloc>& __str, + ios_base::openmode __mode = ios_base::in | ios_base::out); + + // Get and set: + basic_string<_CharT, _Traits, _Alloc> + str() const; + + void + str(const basic_string<_CharT, _Traits, _Alloc>& __s); + + }; + + + // 27.7.2 Template class basic_istringstream + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_istringstream : public basic_istream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + + public: + // Constructors: + explicit + basic_istringstream(ios_base::openmode __mode = ios_base::in); + + explicit + basic_istringstream(const basic_string<_CharT, _Traits, _Alloc>& __str, + ios_base::openmode __mode = ios_base::in); + + ~basic_istringstream(); + + // Members: + basic_stringbuf<_CharT, _Traits, _Alloc>* + rdbuf() const; + + basic_string<_CharT, _Traits, _Alloc> + str() const; + + void + str(const basic_string<_CharT, _Traits, _Alloc>& __s); + }; + + + // 27.7.3 Template class basic_ostringstream + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_ostringstream : public basic_ostream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + + public: + // Constructors/destructor: + explicit + basic_ostringstream(ios_base::openmode __mode = ios_base::out); + + explicit + basic_ostringstream(const basic_string<_CharT, _Traits, _Alloc>& __str, + ios_base::openmode __mode = ios_base::out); + + ~basic_ostringstream(); + + // Members: + basic_stringbuf<_CharT, _Traits, _Alloc>* + rdbuf() const; + + basic_string<_CharT, _Traits, _Alloc> + str() const; + +#if 0 + void + str(const basic_string<_CharT, _Traits, _Alloc>& __s); +#endif + }; + + + // 27.7.4 Template class basic_stringstream + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Alloc = allocator<_CharT> > + class basic_stringstream : public basic_iostream<_CharT, _Traits> + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; +// 251. basic_stringbuf missing allocator_type + typedef _Alloc allocator_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + public: + // Constructors/destructors + explicit + basic_stringstream(ios_base::openmode __m = ios_base::out | ios_base::in); + + explicit + basic_stringstream(const basic_string<_CharT, _Traits, _Alloc>& __str, + ios_base::openmode __m = ios_base::out | ios_base::in); + + ~basic_stringstream(); + + // Members: + basic_stringbuf<_CharT, _Traits, _Alloc>* + rdbuf() const; + + basic_string<_CharT, _Traits, _Alloc> + str() const; + + void + str(const basic_string<_CharT, _Traits, _Alloc>& __s); + }; + + +} // namespace std + + +namespace std { + %template(istringstream) basic_istringstream<char>; + %template(ostringstream) basic_ostringstream<char>; + %template(stringstream) basic_stringstream<char>; + + +#if defined(SWIG_WCHAR) + %template(wistringstream) basic_istringstream<wchar_t>; + %template(wostringstream) basic_ostringstream<wchar_t>; + %template(wstringstream) basic_stringstream<wchar_t>; +#endif +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_stack.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_stack.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,128 @@ +/** + * @file std_stack.i + * @date Sun May 6 01:48:07 2007 + * + * @brief A wrapping of std::stack for Ruby. + * + * + */ + +%include <std_container.i> + +// Stack + +%define %std_stack_methods(stack...) + stack(); + stack( const _Sequence& ); + + bool empty() const; + size_type size() const; + const value_type& top() const; + void pop(); + void push( const value_type& ); +%enddef + +%define %std_stack_methods_val(stack...) + %std_stack_methods(stack) +%enddef + +// ------------------------------------------------------------------------ +// std::stack +// +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::stack<T>), f(const std::stack<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::stack<T> can be passed. +// -- f(std::stack<T>&), f(std::stack<T>*): +// the parameter may be modified; therefore, only a wrapped std::stack +// can be passed. +// -- std::stack<T> f(), const std::stack<T>& f(): +// the stack is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::stack<T>& f(), std::stack<T>* f(): +// the stack is returned by reference; therefore, a wrapped std::stack +// is returned +// -- const std::stack<T>* f(), f(const std::stack<T>*): +// for consistency, they expect and return a plain stack pointer. +// ------------------------------------------------------------------------ + +%{ +#include <stack> +%} + +// exported classes + +namespace std { + + template<class _Tp, class _Sequence = std::deque<_Tp> > + class stack { + public: + typedef size_t size_type; + typedef _Tp value_type; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef _Sequence container_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::stack<_Tp, _Sequence >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdStackTraits") { + namespace swig { + template <> struct traits<std::stack<_Tp, _Sequence > > { + typedef pointer_category category; + static const char* type_name() { + return "std::stack<" #_Tp "," #_Sequence " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_STACK, std::stack<_Tp, _Sequence >); + +#ifdef %swig_stack_methods + // Add swig/language extra methods + %swig_stack_methods(std::stack<_Tp, _Sequence >); +#endif + + %std_stack_methods(stack); + }; + + template<class _Tp, class _Sequence > + class stack<_Tp*, _Sequence > { + public: + typedef size_t size_type; + typedef _Sequence::value_type value_type; + typedef value_type reference; + typedef value_type const_reference; + typedef _Sequence container_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::stack<_Tp*, _Sequence >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdStackTraits") { + namespace swig { + template <> struct traits<std::stack<_Tp*, _Sequence > > { + typedef value_category category; + static const char* type_name() { + return "std::stack<" #_Tp "," #_Sequence " * >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_STACK, std::stack<_Tp*, _Sequence >); + +#ifdef %swig_stack_methods_val + // Add swig/language extra methods + %swig_stack_methods_val(std::stack<_Tp*, _Sequence >); +#endif + + %std_stack_methods_val(std::stack<_Tp*, _Sequence >); + }; + +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_streambuf.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_streambuf.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,94 @@ +%include <std_ios.i> +%{ +#ifndef SWIG_STD_NOMODERN_STL +#include <streambuf> +#else +#include <streambuf.h> +#endif +%} + +namespace std { + + template<typename _CharT, typename _Traits = char_traits<_CharT> > + class basic_streambuf + { + public: + // Types: + typedef _CharT char_type; + typedef _Traits traits_type; + typedef typename traits_type::int_type int_type; + typedef typename traits_type::pos_type pos_type; + typedef typename traits_type::off_type off_type; + + public: + virtual + ~basic_streambuf(); + + // Locales: + locale + pubimbue(const locale &__loc); + + locale + getloc() const; + + // Buffer and positioning: + basic_streambuf<_CharT, _Traits>* + pubsetbuf(char_type* __s, streamsize __n); + + pos_type + pubseekoff(off_type __off, ios_base::seekdir __way, + ios_base::openmode __mode = std::ios_base::in | std::ios_base::out); + + pos_type + pubseekpos(pos_type __sp, + ios_base::openmode __mode = std::ios_base::in | std::ios_base::out); + + int + pubsync() ; + + // Get and put areas: + // Get area: + streamsize + in_avail(); + + int_type + snextc(); + + int_type + sbumpc(); + + int_type + sgetc(); + + streamsize + sgetn(char_type* __s, streamsize __n); + + // Putback: + int_type + sputbackc(char_type __c); + + int_type + sungetc(); + + // Put area: + int_type + sputc(char_type __c); + + streamsize + sputn(const char_type* __s, streamsize __n); + + protected: + basic_streambuf(); + + private: + basic_streambuf(const basic_streambuf&); + + }; +} + +namespace std { + %template(streambuf) basic_streambuf<char>; +#if defined(SWIG_WCHAR) + %template(wstreambuf) basic_streambuf<wchar_t>; +#endif +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_string.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_string.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,13 @@ +%include <std/std_basic_string.i> + +/* plain strings */ + +namespace std +{ + %std_comp_methods(basic_string<char>); + %naturalvar string; + typedef basic_string<char> string; +} + + +%template(string) std::basic_string<char>; diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_vector.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_vector.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,225 @@ +// +// std::vector +// + +%include <std_container.i> + +// Vector + +%define %std_vector_methods(vector...) + %std_sequence_methods(vector) + + void reserve(size_type n); + size_type capacity() const; +%enddef + + +%define %std_vector_methods_val(vector...) + %std_sequence_methods_val(vector) + + void reserve(size_type n); + size_type capacity() const; +%enddef + + +// ------------------------------------------------------------------------ +// std::vector +// +// The aim of all that follows would be to integrate std::vector with +// as much as possible, namely, to allow the user to pass and +// be returned tuples or lists. +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::vector<T>), f(const std::vector<T>&): +// the parameter being read-only, either a sequence or a +// previously wrapped std::vector<T> can be passed. +// -- f(std::vector<T>&), f(std::vector<T>*): +// the parameter may be modified; therefore, only a wrapped std::vector +// can be passed. +// -- std::vector<T> f(), const std::vector<T>& f(): +// the vector is returned by copy; therefore, a sequence of T:s +// is returned which is most easily used in other functions +// -- std::vector<T>& f(), std::vector<T>* f(): +// the vector is returned by reference; therefore, a wrapped std::vector +// is returned +// -- const std::vector<T>* f(), f(const std::vector<T>*): +// for consistency, they expect and return a plain vector pointer. +// ------------------------------------------------------------------------ + +%{ +#include <vector> +%} + +// exported classes + + +namespace std { + + template<class _Tp, class _Alloc = allocator< _Tp > > + class vector { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef _Tp& reference; + typedef const _Tp& const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + %traits_enum(_Tp); + + %fragment(SWIG_Traits_frag(std::vector<_Tp, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdVectorTraits") { + namespace swig { + template <> struct traits<std::vector<_Tp, _Alloc > > { + typedef pointer_category category; + static const char* type_name() { + return "std::vector<" #_Tp "," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp, _Alloc >); + +#ifdef %swig_vector_methods + // Add swig/language extra methods + %swig_vector_methods(std::vector<_Tp, _Alloc >); +#endif + + %std_vector_methods(vector); + }; + + // *** + // This specialization should disappear or get simplified when + // a 'const SWIGTYPE*&' can be defined + // *** + template<class _Tp, class _Alloc > + class vector<_Tp*, _Alloc > { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp* value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type reference; + typedef value_type const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::vector<_Tp*, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdVectorTraits") { + namespace swig { + template <> struct traits<std::vector<_Tp*, _Alloc > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<" #_Tp " *," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp*, _Alloc >); + +#ifdef %swig_vector_methods_val + // Add swig/language extra methods + %swig_vector_methods_val(std::vector<_Tp*, _Alloc >); +#endif + + %std_vector_methods_val(vector); + }; + + // *** + // const pointer specialization + // *** + template<class _Tp, class _Alloc > + class vector<_Tp const *, _Alloc > { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef _Tp const * value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type reference; + typedef value_type const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(_Tp); + + %fragment(SWIG_Traits_frag(std::vector<_Tp const*, _Alloc >), "header", + fragment=SWIG_Traits_frag(_Tp), + fragment="StdVectorTraits") { + namespace swig { + template <> struct traits<std::vector<_Tp const*, _Alloc > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<" #_Tp " const*," #_Alloc " >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<_Tp const*, _Alloc >); + +#ifdef %swig_vector_methods_val + // Add swig/language extra methods + %swig_vector_methods_val(std::vector<_Tp const*, _Alloc >); +#endif + + %std_vector_methods_val(vector); + }; + + // *** + // bool specialization + // *** + + template<class _Alloc > + class vector<bool,_Alloc > { + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef bool value_type; + typedef value_type* pointer; + typedef const value_type* const_pointer; + typedef value_type reference; + typedef value_type const_reference; + typedef _Alloc allocator_type; + + %traits_swigtype(bool); + + %fragment(SWIG_Traits_frag(std::vector<bool, _Alloc >), "header", + fragment=SWIG_Traits_frag(bool), + fragment="StdVectorTraits") { + namespace swig { + template <> struct traits<std::vector<bool, _Alloc > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<bool, _Alloc >"; + } + }; + } + } + + %typemap_traits_ptr(SWIG_TYPECHECK_VECTOR, std::vector<bool, _Alloc >); + + +#ifdef %swig_vector_methods_val + // Add swig/language extra methods + %swig_vector_methods_val(std::vector<bool, _Alloc >); +#endif + + %std_vector_methods_val(vector); + +#if defined(SWIG_STD_MODERN_STL) && !defined(SWIG_STD_NOMODERN_STL) + void flip(); +#endif + + }; + +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_vectora.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_vectora.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +// +// We keep this file only for backward compatibility, since std_vector.i +// now uses the std::allocator parameter. +// + +%include <std_vector.i> + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_wios.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_wios.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +/* + Provide 'std_ios.i' with wchar support. +*/ + +%include <wchar.i> +%include <std_ios.i> + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_wiostream.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_wiostream.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +/* + Provide 'std_iostream.i' with wchar support. +*/ + +%include <wchar.i> +%include <std_iostream.i> + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_wsstream.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_wsstream.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +/* + Provide 'std_sstream.i' with wchar support. +*/ + +%include <wchar.i> +%include <std_sstream.i> + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_wstreambuf.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_wstreambuf.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +/* + Provide 'std_streambuf.i' with wchar support. +*/ + +%include <wchar.i> +%include <std_streambuf.i> + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std/std_wstring.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std/std_wstring.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,14 @@ +%include <wchar.i> +%include <std/std_basic_string.i> + +/* wide strings */ + +namespace std +{ + %std_comp_methods(basic_string<wchar_t>); + %naturalvar wstring; + typedef basic_string<wchar_t> wstring; +} + +%template(wstring) std::basic_string<wchar_t>; + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/std_except.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/std_except.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,55 @@ +/* ----------------------------------------------------------------------------- + * std_except.i + * + * SWIG library file with typemaps to handle and throw STD exceptions in a + * language and STL independent way, i.e., the target language doesn't + * require to support STL but only the 'exception.i' mechanism. + * + * These typemaps are used when methods are declared with an STD + * exception specification, such as + * + * size_t at() const throw (std::out_of_range); + * + * The typemaps here are based on the language independent + * 'exception.i' library. If that is working in your target language, + * this file will work. + * + * If the target language doesn't implement a robust 'exception.i' + * mechanism, or you prefer other ways to map the STD exceptions, write + * a new std_except.i file in the target library directory. + * ----------------------------------------------------------------------------- */ + +#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGUILE) || defined(SWIGUTL) || defined(SWIGD) +#error "This version of std_except.i should not be used" +#endif + +%{ +#include <stdexcept> +%} + +%include <exception.i> + + +%define %std_exception_map(Exception, Code) + %typemap(throws,noblock=1) Exception { + SWIG_exception(Code, $1.what()); + } + %ignore Exception; + struct Exception { + }; +%enddef + +namespace std { + %std_exception_map(bad_exception, SWIG_SystemError); + %std_exception_map(domain_error, SWIG_ValueError); + %std_exception_map(exception, SWIG_SystemError); + %std_exception_map(invalid_argument, SWIG_ValueError); + %std_exception_map(length_error, SWIG_IndexError); + %std_exception_map(logic_error, SWIG_RuntimeError); + %std_exception_map(out_of_range, SWIG_IndexError); + %std_exception_map(overflow_error, SWIG_OverflowError); + %std_exception_map(range_error, SWIG_OverflowError); + %std_exception_map(runtime_error, SWIG_RuntimeError); + %std_exception_map(underflow_error, SWIG_OverflowError); +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/stdint.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/stdint.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,106 @@ +/* ----------------------------------------------------------------------------- + * stdint.i + * + * SWIG library file for ISO C99 types: 7.18 Integer types <stdint.h> + * ----------------------------------------------------------------------------- */ + +%{ +#include <stdint.h> // Use the C99 official header +%} + +%include <swigarch.i> + +/* Exact integral types. */ + +/* Signed. */ + +typedef signed char int8_t; +typedef short int int16_t; +typedef int int32_t; +#if defined(SWIGWORDSIZE64) +typedef long int int64_t; +#else +typedef long long int int64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint8_t; +typedef unsigned short int uint16_t; +typedef unsigned int uint32_t; +#if defined(SWIGWORDSIZE64) +typedef unsigned long int uint64_t; +#else +typedef unsigned long long int uint64_t; +#endif + + +/* Small types. */ + +/* Signed. */ +typedef signed char int_least8_t; +typedef short int int_least16_t; +typedef int int_least32_t; +#if defined(SWIGWORDSIZE64) +typedef long int int_least64_t; +#else +typedef long long int int_least64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint_least8_t; +typedef unsigned short int uint_least16_t; +typedef unsigned int uint_least32_t; +#if defined(SWIGWORDSIZE64) +typedef unsigned long int uint_least64_t; +#else +typedef unsigned long long int uint_least64_t; +#endif + + +/* Fast types. */ + +/* Signed. */ +typedef signed char int_fast8_t; +#if defined(SWIGWORDSIZE64) +typedef long int int_fast16_t; +typedef long int int_fast32_t; +typedef long int int_fast64_t; +#else +typedef int int_fast16_t; +typedef int int_fast32_t; +typedef long long int int_fast64_t; +#endif + +/* Unsigned. */ +typedef unsigned char uint_fast8_t; +#if defined(SWIGWORDSIZE64) +typedef unsigned long int uint_fast16_t; +typedef unsigned long int uint_fast32_t; +typedef unsigned long int uint_fast64_t; +#else +typedef unsigned int uint_fast16_t; +typedef unsigned int uint_fast32_t; +typedef unsigned long long int uint_fast64_t; +#endif + + +/* Types for `void *' pointers. */ +#if defined(SWIGWORDSIZE64) +typedef long int intptr_t; +typedef unsigned long int uintptr_t; +#else +typedef int intptr_t; +typedef unsigned int uintptr_t; +#endif + + +/* Largest integral types. */ +#if defined(SWIGWORDSIZE64) +typedef long int intmax_t; +typedef unsigned long int uintmax_t; +#else +typedef long long int intmax_t; +typedef unsigned long long int uintmax_t; +#endif + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/stl.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/stl.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +/* ----------------------------------------------------------------------------- + * stl.i + * ----------------------------------------------------------------------------- */ + +#warning "stl.i not implemented for this target" +#define SWIG_STL_UNIMPL + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swig.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swig.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,689 @@ +/* ----------------------------------------------------------------------------- + * swig.swg + * + * Common macro definitions for various SWIG directives. This file is always + * included at the top of each input file. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * User Directives + * ----------------------------------------------------------------------------- */ + +/* Deprecated SWIG directives */ + +#define %disabledoc %warn "104:%disabledoc is deprecated" +#define %enabledoc %warn "105:%enabledoc is deprecated" +#define %doconly %warn "106:%doconly is deprecated" +#define %style %warn "107:%style is deprecated" /##/ +#define %localstyle %warn "108:%localstyle is deprecated" /##/ +#define %title %warn "109:%title is deprecated" /##/ +#define %section %warn "110:%section is deprecated" /##/ +#define %subsection %warn "111:%subsection is deprecated" /##/ +#define %subsubsection %warn "112:%subsubsection is deprecated" /##/ +#define %new %warn "117:%new is deprecated. Use %newobject" +#define %text %insert("null") + +/* Code insertion directives such as %wrapper %{ ... %} */ + +#define %begin %insert("begin") +#define %runtime %insert("runtime") +#define %header %insert("header") +#define %wrapper %insert("wrapper") +#define %init %insert("init") + +/* Class extension */ + +#define %addmethods %warn "113:%addmethods is now %extend" %extend + +/* %ignore directive */ + +#define %ignore %rename($ignore) +#define %ignorewarn(x) %rename("$ignore:" x) + +/* Access control directives */ + +#define %readonly %warn "114:%readonly is deprecated. Use %immutable; " %feature("immutable"); +#define %readwrite %warn "115:%readwrite is deprecated. Use %mutable; " %feature("immutable",""); + +#define %immutable %feature("immutable") +#define %noimmutable %feature("immutable","0") +#define %clearimmutable %feature("immutable","") +#define %mutable %clearimmutable + +/* Generation of default constructors/destructors (old form, don't use) */ +#define %nodefault %feature("nodefault","1") +#define %default %feature("nodefault","0") +#define %clearnodefault %feature("nodefault","") +#define %makedefault %clearnodefault + +/* Disable the generation of implicit default constructor */ +#define %nodefaultctor %feature("nodefaultctor","1") +#define %defaultctor %feature("nodefaultctor","0") +#define %clearnodefaultctor %feature("nodefaultctor","") + +/* Disable the generation of implicit default destructor (dangerous) */ +#define %nodefaultdtor %feature("nodefaultdtor","1") +#define %defaultdtor %feature("nodefaultdtor","0") +#define %clearnodefaultdtor %feature("nodefaultdtor","") + +/* Enable the generation of copy constructor */ +#define %copyctor %feature("copyctor","1") +#define %nocopyctor %feature("copyctor","0") +#define %clearcopyctor %feature("copyctor","") + +/* Force the old nodefault behavior, ie disable both constructor and destructor */ +#define %oldnodefault %feature("oldnodefault","1") +#define %nooldnodefault %feature("oldnodefault","0") +#define %clearoldnodefault %feature("oldnodefault","") + +/* the %exception directive */ +#if defined(SWIGCSHARP) || defined(SWIGD) +#define %exception %feature("except", canthrow=1) +#else +#define %exception %feature("except") +#endif +#define %noexception %feature("except","0") +#define %clearexception %feature("except","") + +/* the %allowexception directive allows the %exception feature to + be applied to set/get variable methods */ +#define %allowexception %feature("allowexcept") +#define %noallowexception %feature("allowexcept","0") +#define %clearallowexception %feature("allowexcept","") + +/* the %exceptionvar directive, as %exception but it is only applied + to set/get variable methods. You don't need to use the + %allowexception directive when using %exceptionvar. +*/ +#if defined(SWIGCSHARP) || defined(SWIGD) +#define %exceptionvar %feature("exceptvar", canthrow=1) +#else +#define %exceptionvar %feature("exceptvar") +#endif +#define %noexceptionvar %feature("exceptvar","0") +#define %clearexceptionvar %feature("exceptvar","") + +/* the %catches directive */ +#define %catches(tlist...) %feature("catches","("`tlist`")") +#define %clearcatches %feature("catches","") + +/* the %exceptionclass directive */ +#define %exceptionclass %feature("exceptionclass") +#define %noexceptionclass %feature("exceptionclass","0") +#define %clearexceptionclass %feature("exceptionclass","") + +/* the %newobject directive */ +#define %newobject %feature("new") +#define %nonewobject %feature("new","0") +#define %clearnewobject %feature("new","") + +/* the %delobject directive */ +#define %delobject %feature("del") +#define %nodelobject %feature("del","0") +#define %cleardelobject %feature("del","") + +/* the %refobject/%unrefobject directives */ +#define %refobject %feature("ref") +#define %norefobject %feature("ref","0") +#define %clearrefobject %feature("ref","") + +#define %unrefobject %feature("unref") +#define %nounrefobject %feature("unref","0") +#define %clearunrefobject %feature("unref","") + +/* Directives for callback functions (experimental) */ +#define %callback(x) %feature("callback",`x`) +#define %nocallback %feature("callback","0") +#define %clearcallback %feature("callback","") + +/* the %nestedworkaround directive */ +#define %nestedworkaround %feature("nestedworkaround") +#define %nonestedworkaround %feature("nestedworkaround","0") +#define %clearnestedworkaround %feature("nestedworkaround","") + +/* the %fastdispatch directive */ +#define %fastdispatch %feature("fastdispatch") +#define %nofastdispatch %feature("fastdispatch","0") +#define %clearfastdispatch %feature("fastdispatch","") + +/* directors directives */ +#define %director %feature("director") +#define %nodirector %feature("director","0") +#define %cleardirector %feature("director","") + +/* naturalvar directives */ +#define %naturalvar %feature("naturalvar") +#define %nonaturalvar %feature("naturalvar","0") +#define %clearnaturalvar %feature("naturalvar","") + +/* nspace directives */ +#define %nspace %feature("nspace") +#define %nonspace %feature("nspace","0") +#define %clearnspace %feature("nspace","") + +/* valuewrapper directives */ +#define %valuewrapper %feature("valuewrapper") +#define %clearvaluewrapper %feature("valuewrapper","") +#define %novaluewrapper %feature("novaluewrapper") +#define %clearnovaluewrapper %feature("novaluewrapper","") + +/* Contract support - Experimental and undocumented */ +#define %contract %feature("contract") +#define %nocontract %feature("contract","0") +#define %clearcontract %feature("contract","") + +/* Macro for setting a dynamic cast function */ +%define DYNAMIC_CAST(mangle,func) +%init %{ + mangle->dcast = (swig_dycast_func) func; +%} +%enddef + +/* aggregation support */ +/* + This macro performs constant aggregation. Basically the idea of + constant aggregation is that you can group a collection of constants + together. For example, suppose you have some code like this: + + #define UP 1 + #define DOWN 2 + #define LEFT 3 + #define RIGHT 4 + + Now, suppose you had a function like this: + + int move(int direction) + + In this case, you might want to restrict the direction argument to + one of the supplied constant names. To do this, you could write some + typemap code by hand. Alternatively, you can use the + %aggregate_check macro defined here to create a simple check + function for you. Here is an example: + + %aggregate_check(int, check_direction, UP, DOWN, LEFT, RIGHT); + + Now, using a typemap + + %typemap(check) int direction { + if (!check_direction($1)) SWIG_exception(SWIG_ValueError,"Bad direction."); + } + + or a contract (better) + + %contract move(int x) { + require: + check_direction(x); + } + +*/ + +%define %aggregate_check(TYPE, NAME, FIRST, ...) +%wrapper %{ +static int NAME(TYPE x) { + static TYPE values[] = { FIRST, ##__VA_ARGS__ }; + static int size = sizeof(values); + int i,j; + for (i = 0, j = 0; i < size; i+=sizeof(TYPE),j++) { + if (x == values[j]) return 1; + } + return 0; +} +%} +%enddef + + +/* ----------------------------------------------------------------------------- + * %rename predicates + * ----------------------------------------------------------------------------- */ +/* + Predicates to be used with %rename, for example: + + - to rename all the functions: + + %rename("%(utitle)s", %$isfunction) ""; + + - to rename only the member methods: + + %rename("m_%(utitle)s", %$isfunction, %$ismember) ""; + + - to rename only the global functions: + + %rename("m_%(utitle)s", %$isfunction, %$not %$ismember) ""; + + or + + %rename("g_%(utitle)s", %$isfunction, %$isglobal) ""; + + - to ignore the enumitems in a given class: + + %rename("$ignore", %$isenumitem, %$classname="MyClass") ""; + + we use the prefix '%$' to avoid clashings with other swig + macros/directives. + +*/ + +%define %$not "not" %enddef +%define %$isenum "match"="enum" %enddef +%define %$isenumitem "match"="enumitem" %enddef +%define %$isaccess "match"="access" %enddef +%define %$isclass "match"="class","notmatch$template$templatetype"="class" %enddef +%define %$isextend "match"="extend" %enddef +%define %$isconstructor "match"="constructor" %enddef +%define %$isdestructor "match"="destructor" %enddef +%define %$isnamespace "match"="namespace" %enddef +%define %$istemplate "match"="template" %enddef +%define %$isconstant "match"="constant" %enddef /* %constant definition */ + +%define %$isunion "match$kind"="union" %enddef +%define %$isfunction "match$kind"="function" %enddef +%define %$isvariable "match$kind"="variable" %enddef +%define %$isimmutable "match$feature:immutable"="1" %enddef +%define %$hasconsttype "match$hasconsttype"="1" %enddef +%define %$hasvalue "match$hasvalue"="1" %enddef +%define %$isextension "match$isextension"="1" %enddef + +%define %$isstatic "match$storage"="static" %enddef +%define %$isfriend "match$storage"="friend" %enddef +%define %$istypedef "match$storage"="typedef" %enddef +%define %$isvirtual "match$storage"="virtual" %enddef +%define %$isexplicit "match$storage"="explicit" %enddef +%define %$isextern "match$storage"="extern" %enddef + +%define %$ismember "match$ismember"="1" %enddef +%define %$isglobal %$not %$ismember %enddef +%define %$innamespace "match$parentNode$nodeType"="namespace" %enddef + +%define %$ispublic "match$access"="public" %enddef +%define %$isprotected "match$access"="protected" %enddef +%define %$isprivate "match$access"="private" %enddef + +%define %$ismemberget "match$memberget"="1" %enddef +%define %$ismemberset "match$memberset"="1" %enddef + +%define %$classname %$ismember,"match$parentNode$name" %enddef + +/* ----------------------------------------------------------------------------- + * Include all the warnings labels and macros + * ----------------------------------------------------------------------------- */ + +%include <swigwarnings.swg> + +/* ----------------------------------------------------------------------------- + * Default handling of certain overloaded operators + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +%ignoreoperator(NEW) operator new; +%ignoreoperator(DELETE) operator delete; +%ignoreoperator(NEWARR) operator new[]; +%ignoreoperator(DELARR) operator delete[]; + +/* add C++ operator aliases */ +%rename("operator &&") operator and; // `and' `&&' +%rename("operator ||") operator or; // `or' `||' +%rename("operator !") operator not; // `not' `!' +%rename("operator &=") operator and_eq; // `and_eq' `&=' +%rename("operator &") operator bitand; // `bitand' `&' +%rename("operator |") operator bitor; // `bitor' `|' +%rename("operator ~") operator compl; // `compl' `~' +%rename("operator !=") operator not_eq; // `not_eq' `!=' +%rename("operator |=") operator or_eq; // `or_eq' `|=' +%rename("operator ^") operator xor; // `xor' `^' +%rename("operator ^=") operator xor_eq; // `xor_eq' `^=' + +/* Smart pointer handling */ + +%rename(__deref__) *::operator->; +%rename(__ref__) *::operator*(); +%rename(__ref__) *::operator*() const; + +/* Define std namespace */ +namespace std { +} +#endif + +/* ----------------------------------------------------------------------------- + * Default char * and C array typemaps + * ----------------------------------------------------------------------------- */ + +/* Set up the typemap for handling new return strings */ + +#ifdef __cplusplus +%typemap(newfree) char * "delete [] $1;"; +#else +%typemap(newfree) char * "free($1);"; +#endif + +/* Default typemap for handling char * members */ + +#ifdef __cplusplus +%typemap(memberin) char * { + delete [] $1; + if ($input) { + $1 = ($1_type) (new char[strlen((const char *)$input)+1]); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +%typemap(memberin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * { + if ($input) { + $1 = ($1_type) (new char[strlen((const char *)$input)+1]); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +%typemap(globalin) char * { + delete [] $1; + if ($input) { + $1 = ($1_type) (new char[strlen((const char *)$input)+1]); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +%typemap(globalin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * { + if ($input) { + $1 = ($1_type) (new char[strlen((const char *)$input)+1]); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +#else +%typemap(memberin) char * { + free($1); + if ($input) { + $1 = ($1_type) malloc(strlen((const char *)$input)+1); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +%typemap(memberin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * { + if ($input) { + $1 = ($1_type) malloc(strlen((const char *)$input)+1); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +%typemap(globalin) char * { + free($1); + if ($input) { + $1 = ($1_type) malloc(strlen((const char *)$input)+1); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} +%typemap(globalin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const char * { + if ($input) { + $1 = ($1_type) malloc(strlen((const char *)$input)+1); + strcpy((char *)$1, (const char *)$input); + } else { + $1 = 0; + } +} + +#endif + +/* Character array handling */ + +%typemap(memberin) char [ANY] { + if($input) { + strncpy((char*)$1, (const char *)$input, $1_dim0-1); + $1[$1_dim0-1] = 0; + } else { + $1[0] = 0; + } +} + +%typemap(globalin) char [ANY] { + if($input) { + strncpy((char*)$1, (const char *)$input, $1_dim0-1); + $1[$1_dim0-1] = 0; + } else { + $1[0] = 0; + } +} + +%typemap(memberin) char [] { + if ($input) strcpy((char *)$1, (const char *)$input); + else $1[0] = 0; +} + +%typemap(globalin) char [] { + if ($input) strcpy((char *)$1, (const char *)$input); + else $1[0] = 0; +} + +/* memberin/globalin typemap for arrays. */ + +%typemap(memberin) SWIGTYPE [ANY] { + size_t ii; + $1_basetype *b = ($1_basetype *) $1; + for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii); +} + +%typemap(globalin) SWIGTYPE [ANY] { + size_t ii; + $1_basetype *b = ($1_basetype *) $1; + for (ii = 0; ii < (size_t)$1_size; ii++) b[ii] = *(($1_basetype *) $input + ii); +} + +/* memberin/globalin typemap for double arrays. */ + +%typemap(memberin) SWIGTYPE [ANY][ANY] { + $basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input); + $basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1); + size_t ii = 0; + for (; ii < $1_dim0; ++ii) { + $basetype *ip = inp[ii]; + $basetype *dp = dest[ii]; + size_t jj = 0; + for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj]; + } +} + +%typemap(globalin) SWIGTYPE [ANY][ANY] { + $basetype (*inp)[$1_dim1] = ($basetype (*)[$1_dim1])($input); + $basetype (*dest)[$1_dim1] = ($basetype (*)[$1_dim1])($1); + size_t ii = 0; + for (; ii < $1_dim0; ++ii) { + $basetype *ip = inp[ii]; + $basetype *dp = dest[ii]; + size_t jj = 0; + for (; jj < $1_dim1; ++jj) dp[jj] = ip[jj]; + } +} + +/* ----------------------------------------------------------------------------- + * Overloading support + * ----------------------------------------------------------------------------- */ + +/* + * Function/method overloading support. This is done through typemaps, + * but also involve a precedence level. + */ + +/* Macro for overload resolution */ + +%define %typecheck(_x...) %typemap(typecheck, precedence=_x) %enddef + +/* Macros for precedence levels */ + +%define SWIG_TYPECHECK_POINTER 0 %enddef +%define SWIG_TYPECHECK_ITERATOR 5 %enddef +%define SWIG_TYPECHECK_VOIDPTR 10 %enddef +%define SWIG_TYPECHECK_BOOL 15 %enddef +%define SWIG_TYPECHECK_UINT8 20 %enddef +%define SWIG_TYPECHECK_INT8 25 %enddef +%define SWIG_TYPECHECK_UINT16 30 %enddef +%define SWIG_TYPECHECK_INT16 35 %enddef +%define SWIG_TYPECHECK_UINT32 40 %enddef +%define SWIG_TYPECHECK_INT32 45 %enddef +%define SWIG_TYPECHECK_SIZE 47 %enddef +%define SWIG_TYPECHECK_PTRDIFF 48 %enddef +%define SWIG_TYPECHECK_UINT64 50 %enddef +%define SWIG_TYPECHECK_INT64 55 %enddef +%define SWIG_TYPECHECK_UINT128 60 %enddef +%define SWIG_TYPECHECK_INT128 65 %enddef +%define SWIG_TYPECHECK_INTEGER 70 %enddef +%define SWIG_TYPECHECK_FLOAT 80 %enddef +%define SWIG_TYPECHECK_DOUBLE 90 %enddef +%define SWIG_TYPECHECK_CPLXFLT 95 %enddef +%define SWIG_TYPECHECK_CPLXDBL 100 %enddef +%define SWIG_TYPECHECK_COMPLEX 105 %enddef +%define SWIG_TYPECHECK_UNICHAR 110 %enddef +%define SWIG_TYPECHECK_STDUNISTRING 115 %enddef +%define SWIG_TYPECHECK_UNISTRING 120 %enddef +%define SWIG_TYPECHECK_CHAR 130 %enddef +%define SWIG_TYPECHECK_STDSTRING 135 %enddef +%define SWIG_TYPECHECK_STRING 140 %enddef +%define SWIG_TYPECHECK_PAIR 150 %enddef +%define SWIG_TYPECHECK_VECTOR 160 %enddef +%define SWIG_TYPECHECK_DEQUE 170 %enddef +%define SWIG_TYPECHECK_LIST 180 %enddef +%define SWIG_TYPECHECK_SET 190 %enddef +%define SWIG_TYPECHECK_MULTISET 200 %enddef +%define SWIG_TYPECHECK_MAP 210 %enddef +%define SWIG_TYPECHECK_MULTIMAP 220 %enddef +%define SWIG_TYPECHECK_STACK 230 %enddef +%define SWIG_TYPECHECK_QUEUE 240 %enddef + +%define SWIG_TYPECHECK_BOOL_ARRAY 1015 %enddef +%define SWIG_TYPECHECK_INT8_ARRAY 1025 %enddef +%define SWIG_TYPECHECK_INT16_ARRAY 1035 %enddef +%define SWIG_TYPECHECK_INT32_ARRAY 1045 %enddef +%define SWIG_TYPECHECK_INT64_ARRAY 1055 %enddef +%define SWIG_TYPECHECK_INT128_ARRAY 1065 %enddef +%define SWIG_TYPECHECK_FLOAT_ARRAY 1080 %enddef +%define SWIG_TYPECHECK_DOUBLE_ARRAY 1090 %enddef +%define SWIG_TYPECHECK_CHAR_ARRAY 1130 %enddef +%define SWIG_TYPECHECK_STRING_ARRAY 1140 %enddef +%define SWIG_TYPECHECK_OBJECT_ARRAY 1150 %enddef + +%define SWIG_TYPECHECK_BOOL_PTR 2015 %enddef +%define SWIG_TYPECHECK_UINT8_PTR 2020 %enddef +%define SWIG_TYPECHECK_INT8_PTR 2025 %enddef +%define SWIG_TYPECHECK_UINT16_PTR 2030 %enddef +%define SWIG_TYPECHECK_INT16_PTR 2035 %enddef +%define SWIG_TYPECHECK_UINT32_PTR 2040 %enddef +%define SWIG_TYPECHECK_INT32_PTR 2045 %enddef +%define SWIG_TYPECHECK_UINT64_PTR 2050 %enddef +%define SWIG_TYPECHECK_INT64_PTR 2055 %enddef +%define SWIG_TYPECHECK_FLOAT_PTR 2080 %enddef +%define SWIG_TYPECHECK_DOUBLE_PTR 2090 %enddef +%define SWIG_TYPECHECK_CHAR_PTR 2130 %enddef + + +%define SWIG_TYPECHECK_SWIGOBJECT 5000 %enddef + + +/* ----------------------------------------------------------------------------- + * Runtime code + * ----------------------------------------------------------------------------- */ + +/* The SwigValueWrapper class */ + +/* + * This template wrapper is used to handle C++ objects that are passed or + * returned by value. This is necessary to handle objects that define + * no default-constructor (making it difficult for SWIG to properly declare + * local variables). + * + * The wrapper is used as follows. First consider a function like this: + * + * Vector cross_product(Vector a, Vector b) + * + * Now, if Vector is defined as a C++ class with no default constructor, + * code is generated as follows: + * + * Vector *wrap_cross_product(Vector *inarg1, Vector *inarg2) { + * SwigValueWrapper<Vector> arg1; + * SwigValueWrapper<Vector> arg2; + * SwigValueWrapper<Vector> result; + * + * arg1 = *inarg1; + * arg2 = *inarg2; + * ... + * result = cross_product(arg1,arg2); + * ... + * return new Vector(result); + * } + * + * In the wrappers, the template SwigValueWrapper simply provides a thin + * layer around a Vector *. However, it does this in a way that allows + * the object to be bound after the variable declaration (which is not possible + * with the bare object when it lacks a default constructor). + * + * An observant reader will notice that the code after the variable declarations + * is *identical* to the code used for classes that do define default constructors. + * Thus, this neat trick allows us to fix this special case without having to + * make massive changes to typemaps and other parts of the SWIG code generator. + * + * Note: this code is not included when SWIG runs in C-mode, when classes + * define default constructors, or when pointers and references are used. + * SWIG tries to avoid doing this except in very special circumstances. + * + * Note: This solution suffers from making a large number of copies + * of the underlying object. However, this is needed in the interest of + * safety and in order to cover all of the possible ways in which a value + * might be assigned. For example: + * + * arg1 = *inarg1; // Assignment from a pointer + * arg1 = Vector(1,2,3); // Assignment from a value + * + * The class offers a strong guarantee of exception safety. + * With regards to the implementation, the private SwigMovePointer nested class is + * a simple smart pointer with move semantics, much like std::auto_ptr. + * + * This wrapping technique was suggested by William Fulton and is henceforth + * known as the "Fulton Transform" :-). + */ + +#ifdef __cplusplus +%insert("runtime") %{ +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template<typename T> class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); + SwigValueWrapper(const SwigValueWrapper<T>& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +};%} + +/* + * SwigValueInit() is a generic initialisation solution as the following approach: + * + * T c_result = T(); + * + * doesn't compile for all types for example: + * + * unsigned int c_result = unsigned int(); + */ +%insert("runtime") %{ +template <typename T> T SwigValueInit() { + return T(); +} +#endif +%} +#endif + +/* The swiglabels */ + +%insert("runtime") "swiglabels.swg" + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swigarch.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swigarch.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,62 @@ +/* ----------------------------------------------------------------------------- + * swigarch.i + * + * SWIG library file for 32bit/64bit code specialization and checking. + * + * Use only in extreme cases, when no arch. independent code can be + * generated + * + * To activate architecture specific code, use + * + * swig -DSWIGWORDSIZE32 + * + * or + * + * swig -DSWIGWORDSIZE64 + * + * Note that extra checking code will be added to the wrapped code, + * which will prevent the compilation in a different architecture. + * + * If you don't specify the SWIGWORDSIZE (the default case), swig will + * generate architecture independent and/or 32bits code, with no extra + * checking code added. + * ----------------------------------------------------------------------------- */ + +#if !defined(SWIGWORDSIZE32) && !defined(SWIGWORDSIZE64) +# if (__WORDSIZE == 32) +# define SWIGWORDSIZE32 +# endif +#endif + +#if !defined(SWIGWORDSIZE64) && !defined(SWIGWORDSIZE32) +# if defined(__x86_64) || defined(__x86_64__) || (__WORDSIZE == 64) +# define SWIGWORDSIZE64 +# endif +#endif + + +#ifdef SWIGWORDSIZE32 +%{ +#define SWIGWORDSIZE32 +#ifndef LONG_MAX +#include <limits.h> +#endif +#if (__WORDSIZE == 64) || (LONG_MAX != INT_MAX) +# error "SWIG wrapped code invalid in 64 bit architecture, regenarete code using -DSWIGWORDSIZE64" +#endif +%} +#endif + +#ifdef SWIGWORDSIZE64 +%{ +#define SWIGWORDSIZE64 +#ifndef LONG_MAX +#include <limits.h> +#endif +#if (__WORDSIZE == 32) || (LONG_MAX == INT_MAX) +# error "SWIG wrapped code invalid in 32 bit architecture, regenarete code using -DSWIGWORDSIZE32" +#endif +%} +#endif + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swigerrors.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swigerrors.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,16 @@ +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swiginit.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swiginit.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,234 @@ +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ /* c-mode */ +#endif +} +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swiglabels.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swiglabels.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,108 @@ +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swigrun.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swigrun.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,8 @@ +/* ----------------------------------------------------------------------------- + * swigrun.i + * + * Empty module (for now). Placeholder for runtime libs + * ----------------------------------------------------------------------------- */ + +%module swigrun + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swigrun.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swigrun.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,572 @@ +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if (<obj is ok>) { + if (<need new object>) { + *ptr = <ptr to new allocated object>; + return SWIG_NEWOBJ; + } else { + *ptr = <ptr to old object>; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class<int>" == "Class<int >", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swigwarn.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swigwarn.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,271 @@ +/* SWIG warning codes */ + + +%define SWIGWARN_NONE 0 %enddef + +/* -- Deprecated features -- */ + +%define SWIGWARN_DEPRECATED_EXTERN 101 %enddef +%define SWIGWARN_DEPRECATED_VAL 102 %enddef +%define SWIGWARN_DEPRECATED_OUT 103 %enddef +%define SWIGWARN_DEPRECATED_DISABLEDOC 104 %enddef +%define SWIGWARN_DEPRECATED_ENABLEDOC 105 %enddef +%define SWIGWARN_DEPRECATED_DOCONLY 106 %enddef +%define SWIGWARN_DEPRECATED_STYLE 107 %enddef +%define SWIGWARN_DEPRECATED_LOCALSTYLE 108 %enddef +%define SWIGWARN_DEPRECATED_TITLE 109 %enddef +%define SWIGWARN_DEPRECATED_SECTION 110 %enddef +%define SWIGWARN_DEPRECATED_SUBSECTION 111 %enddef +%define SWIGWARN_DEPRECATED_SUBSUBSECTION 112 %enddef +%define SWIGWARN_DEPRECATED_ADDMETHODS 113 %enddef +%define SWIGWARN_DEPRECATED_READONLY 114 %enddef +%define SWIGWARN_DEPRECATED_READWRITE 115 %enddef +%define SWIGWARN_DEPRECATED_EXCEPT 116 %enddef +%define SWIGWARN_DEPRECATED_NEW 117 %enddef +%define SWIGWARN_DEPRECATED_EXCEPT_TM 118 %enddef +%define SWIGWARN_DEPRECATED_IGNORE_TM 119 %enddef +%define SWIGWARN_DEPRECATED_OPTC 120 %enddef +%define SWIGWARN_DEPRECATED_NAME 121 %enddef +%define SWIGWARN_DEPRECATED_NOEXTERN 122 %enddef +%define SWIGWARN_DEPRECATED_NODEFAULT 123 %enddef +%define SWIGWARN_DEPRECATED_TYPEMAP_LANG 124 %enddef +%define SWIGWARN_DEPRECATED_INPUT_FILE 125 %enddef + +/* -- Preprocessor -- */ + +%define SWIGWARN_PP_MISSING_FILE 201 %enddef +%define SWIGWARN_PP_EVALUATION 202 %enddef +%define SWIGWARN_PP_INCLUDEALL_IMPORTALL 203 %enddef +%define SWIGWARN_PP_CPP_WARNING 204 %enddef +%define SWIGWARN_PP_CPP_ERROR 205 %enddef +%define SWIGWARN_PP_UNEXPECTED_TOKENS 206 %enddef + +/* -- C/C++ Parser -- */ + +%define SWIGWARN_PARSE_CLASS_KEYWORD 301 %enddef +%define SWIGWARN_PARSE_REDEFINED 302 %enddef +%define SWIGWARN_PARSE_EXTEND_UNDEF 303 %enddef +%define SWIGWARN_PARSE_UNSUPPORTED_VALUE 304 %enddef +%define SWIGWARN_PARSE_BAD_VALUE 305 %enddef +%define SWIGWARN_PARSE_PRIVATE 306 %enddef +%define SWIGWARN_PARSE_BAD_DEFAULT 307 %enddef +%define SWIGWARN_PARSE_NAMESPACE_ALIAS 308 %enddef +%define SWIGWARN_PARSE_PRIVATE_INHERIT 309 %enddef +%define SWIGWARN_PARSE_TEMPLATE_REPEAT 310 %enddef +%define SWIGWARN_PARSE_TEMPLATE_PARTIAL 311 %enddef +%define SWIGWARN_PARSE_UNNAMED_NESTED_CLASS 312 %enddef +%define SWIGWARN_PARSE_UNDEFINED_EXTERN 313 %enddef +%define SWIGWARN_PARSE_KEYWORD 314 %enddef +%define SWIGWARN_PARSE_USING_UNDEF 315 %enddef +%define SWIGWARN_PARSE_MODULE_REPEAT 316 %enddef +%define SWIGWARN_PARSE_TEMPLATE_SP_UNDEF 317 %enddef +%define SWIGWARN_PARSE_TEMPLATE_AMBIG 318 %enddef +%define SWIGWARN_PARSE_NO_ACCESS 319 %enddef +%define SWIGWARN_PARSE_EXPLICIT_TEMPLATE 320 %enddef +%define SWIGWARN_PARSE_BUILTIN_NAME 321 %enddef +%define SWIGWARN_PARSE_REDUNDANT 322 %enddef +%define SWIGWARN_PARSE_REC_INHERITANCE 323 %enddef +%define SWIGWARN_PARSE_NESTED_TEMPLATE 324 %enddef +%define SWIGWARN_PARSE_NAMED_NESTED_CLASS 325 %enddef +%define SWIGWARN_PARSE_EXTEND_NAME 326 %enddef + +%define SWIGWARN_IGNORE_OPERATOR_NEW 350 %enddef /* new */ +%define SWIGWARN_IGNORE_OPERATOR_DELETE 351 %enddef /* delete */ +%define SWIGWARN_IGNORE_OPERATOR_PLUS 352 %enddef /* + */ +%define SWIGWARN_IGNORE_OPERATOR_MINUS 353 %enddef /* - */ +%define SWIGWARN_IGNORE_OPERATOR_MUL 354 %enddef /* * */ +%define SWIGWARN_IGNORE_OPERATOR_DIV 355 %enddef /* / */ +%define SWIGWARN_IGNORE_OPERATOR_MOD 356 %enddef /* % */ +%define SWIGWARN_IGNORE_OPERATOR_XOR 357 %enddef /* ^ */ +%define SWIGWARN_IGNORE_OPERATOR_AND 358 %enddef /* & */ +%define SWIGWARN_IGNORE_OPERATOR_OR 359 %enddef /* | */ +%define SWIGWARN_IGNORE_OPERATOR_NOT 360 %enddef /* ~ */ +%define SWIGWARN_IGNORE_OPERATOR_LNOT 361 %enddef /* ! */ +%define SWIGWARN_IGNORE_OPERATOR_EQ 362 %enddef /* = */ +%define SWIGWARN_IGNORE_OPERATOR_LT 363 %enddef /* < */ +%define SWIGWARN_IGNORE_OPERATOR_GT 364 %enddef /* > */ +%define SWIGWARN_IGNORE_OPERATOR_PLUSEQ 365 %enddef /* += */ +%define SWIGWARN_IGNORE_OPERATOR_MINUSEQ 366 %enddef /* -= */ +%define SWIGWARN_IGNORE_OPERATOR_MULEQ 367 %enddef /* *= */ +%define SWIGWARN_IGNORE_OPERATOR_DIVEQ 368 %enddef /* /= */ +%define SWIGWARN_IGNORE_OPERATOR_MODEQ 369 %enddef /* %= */ +%define SWIGWARN_IGNORE_OPERATOR_XOREQ 370 %enddef /* ^= */ +%define SWIGWARN_IGNORE_OPERATOR_ANDEQ 371 %enddef /* &= */ +%define SWIGWARN_IGNORE_OPERATOR_OREQ 372 %enddef /* |= */ +%define SWIGWARN_IGNORE_OPERATOR_LSHIFT 373 %enddef /* << */ +%define SWIGWARN_IGNORE_OPERATOR_RSHIFT 374 %enddef /* >> */ +%define SWIGWARN_IGNORE_OPERATOR_LSHIFTEQ 375 %enddef /* <<= */ +%define SWIGWARN_IGNORE_OPERATOR_RSHIFTEQ 376 %enddef /* >>= */ +%define SWIGWARN_IGNORE_OPERATOR_EQUALTO 377 %enddef /* == */ +%define SWIGWARN_IGNORE_OPERATOR_NOTEQUAL 378 %enddef /* != */ +%define SWIGWARN_IGNORE_OPERATOR_LTEQUAL 379 %enddef /* <= */ +%define SWIGWARN_IGNORE_OPERATOR_GTEQUAL 380 %enddef /* >= */ +%define SWIGWARN_IGNORE_OPERATOR_LAND 381 %enddef /* && */ +%define SWIGWARN_IGNORE_OPERATOR_LOR 382 %enddef /* || */ +%define SWIGWARN_IGNORE_OPERATOR_PLUSPLUS 383 %enddef /* ++ */ +%define SWIGWARN_IGNORE_OPERATOR_MINUSMINUS 384 %enddef /* -- */ +%define SWIGWARN_IGNORE_OPERATOR_COMMA 385 %enddef /* , */ +%define SWIGWARN_IGNORE_OPERATOR_ARROWSTAR 386 %enddef /* ->* */ +%define SWIGWARN_IGNORE_OPERATOR_ARROW 387 %enddef /* -> */ +%define SWIGWARN_IGNORE_OPERATOR_CALL 388 %enddef /* () */ +%define SWIGWARN_IGNORE_OPERATOR_INDEX 389 %enddef /* [] */ +%define SWIGWARN_IGNORE_OPERATOR_UPLUS 390 %enddef /* + */ +%define SWIGWARN_IGNORE_OPERATOR_UMINUS 391 %enddef /* - */ +%define SWIGWARN_IGNORE_OPERATOR_UMUL 392 %enddef /* * */ +%define SWIGWARN_IGNORE_OPERATOR_UAND 393 %enddef /* & */ +%define SWIGWARN_IGNORE_OPERATOR_NEWARR 394 %enddef /* new [] */ +%define SWIGWARN_IGNORE_OPERATOR_DELARR 395 %enddef /* delete [] */ +%define SWIGWARN_IGNORE_OPERATOR_REF 396 %enddef /* operator *() */ + +/* 394-399 are reserved */ + +/* -- Type system and typemaps -- */ + +%define SWIGWARN_TYPE_UNDEFINED_CLASS 401 %enddef +%define SWIGWARN_TYPE_INCOMPLETE 402 %enddef +%define SWIGWARN_TYPE_ABSTRACT 403 %enddef +%define SWIGWARN_TYPE_REDEFINED 404 %enddef + +%define SWIGWARN_TYPEMAP_SOURCETARGET 450 %enddef +%define SWIGWARN_TYPEMAP_CHARLEAK 451 %enddef +%define SWIGWARN_TYPEMAP_SWIGTYPE 452 %enddef +%define SWIGWARN_TYPEMAP_APPLY_UNDEF 453 %enddef +%define SWIGWARN_TYPEMAP_SWIGTYPELEAK 454 %enddef + +%define SWIGWARN_TYPEMAP_IN_UNDEF 460 %enddef +%define SWIGWARN_TYPEMAP_OUT_UNDEF 461 %enddef +%define SWIGWARN_TYPEMAP_VARIN_UNDEF 462 %enddef +%define SWIGWARN_TYPEMAP_VAROUT_UNDEF 463 %enddef +%define SWIGWARN_TYPEMAP_CONST_UNDEF 464 %enddef +%define SWIGWARN_TYPEMAP_UNDEF 465 %enddef +%define SWIGWARN_TYPEMAP_VAR_UNDEF 466 %enddef +%define SWIGWARN_TYPEMAP_TYPECHECK 467 %enddef +%define SWIGWARN_TYPEMAP_THROW 468 %enddef +%define SWIGWARN_TYPEMAP_DIRECTORIN_UNDEF 469 %enddef +%define SWIGWARN_TYPEMAP_THREAD_UNSAFE 470 %enddef /* mostly used in directorout typemaps */ +%define SWIGWARN_TYPEMAP_DIRECTOROUT_UNDEF 471 %enddef +%define SWIGWARN_TYPEMAP_TYPECHECK_UNDEF 472 %enddef +%define SWIGWARN_TYPEMAP_DIRECTOROUT_PTR 473 %enddef +%define SWIGWARN_TYPEMAP_OUT_OPTIMAL_IGNORED 474 %enddef +%define SWIGWARN_TYPEMAP_OUT_OPTIMAL_MULTIPLE 475 %enddef + +/* -- Fragments -- */ +%define SWIGWARN_FRAGMENT_NOT_FOUND 490 %enddef + +/* -- General code generation -- */ + +%define SWIGWARN_LANG_OVERLOAD_DECL 501 %enddef +%define SWIGWARN_LANG_OVERLOAD_CONSTRUCT 502 %enddef +%define SWIGWARN_LANG_IDENTIFIER 503 %enddef +%define SWIGWARN_LANG_RETURN_TYPE 504 %enddef +%define SWIGWARN_LANG_VARARGS 505 %enddef +%define SWIGWARN_LANG_VARARGS_KEYWORD 506 %enddef +%define SWIGWARN_LANG_NATIVE_UNIMPL 507 %enddef +%define SWIGWARN_LANG_DEREF_SHADOW 508 %enddef +%define SWIGWARN_LANG_OVERLOAD_SHADOW 509 %enddef +%define SWIGWARN_LANG_FRIEND_IGNORE 510 %enddef +%define SWIGWARN_LANG_OVERLOAD_KEYWORD 511 %enddef +%define SWIGWARN_LANG_OVERLOAD_CONST 512 %enddef +%define SWIGWARN_LANG_CLASS_UNNAMED 513 %enddef +%define SWIGWARN_LANG_DIRECTOR_VDESTRUCT 514 %enddef +%define SWIGWARN_LANG_DISCARD_CONST 515 %enddef +%define SWIGWARN_LANG_OVERLOAD_IGNORED 516 %enddef +%define SWIGWARN_LANG_DIRECTOR_ABSTRACT 517 %enddef +%define SWIGWARN_LANG_PORTABILITY_FILENAME 518 %enddef +%define SWIGWARN_LANG_TEMPLATE_METHOD_IGNORE 519 %enddef +%define SWIGWARN_LANG_SMARTPTR_MISSING 520 %enddef +%define SWIGWARN_LANG_ILLEGAL_DESTRUCTOR 521 %enddef +%define SWIGWARN_LANG_EXTEND_CONSTRUCTOR 522 %enddef +%define SWIGWARN_LANG_EXTEND_DESTRUCTOR 523 %enddef + +/* -- Reserved (600-799) -- */ + +/* -- Language module specific warnings (700 - 899) -- */ + + +%define SWIGWARN_D_TYPEMAP_CTYPE_UNDEF 700 %enddef +%define SWIGWARN_D_TYPEMAP_IMTYPE_UNDEF 701 %enddef +%define SWIGWARN_D_TYPEMAP_DTYPE_UNDEF 702 %enddef +%define SWIGWARN_D_MULTIPLE_INHERITANCE 703 %enddef +%define SWIGWARN_D_TYPEMAP_CLASSMOD_UNDEF 704 %enddef +%define SWIGWARN_D_TYPEMAP_DBODY_UNDEF 705 %enddef +%define SWIGWARN_D_TYPEMAP_DOUT_UNDEF 706 %enddef +%define SWIGWARN_D_TYPEMAP_DIN_UNDEF 707 %enddef +%define SWIGWARN_D_TYPEMAP_DDIRECTORIN_UNDEF 708 %enddef +%define SWIGWARN_D_TYPEMAP_DCONSTRUCTOR_UNDEF 709 %enddef +%define SWIGWARN_D_EXCODE_MISSING 710 %enddef +%define SWIGWARN_D_CANTHROW_MISSING 711 %enddef +%define SWIGWARN_D_NO_DIRECTORCONNECT_ATTR 712 %enddef +%define SWIGWARN_D_NAME_COLLISION 713 %enddef + +/* please leave 700-719 free for D */ + +%define SWIGWARN_RUBY_WRONG_NAME 801 %enddef +%define SWIGWARN_RUBY_MULTIPLE_INHERITANCE 802 %enddef + +/* please leave 800-809 free for Ruby */ + +%define SWIGWARN_JAVA_TYPEMAP_JNI_UNDEF 810 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JTYPE_UNDEF 811 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JSTYPE_UNDEF 812 %enddef +%define SWIGWARN_JAVA_MULTIPLE_INHERITANCE 813 %enddef +%define SWIGWARN_JAVA_TYPEMAP_GETCPTR_UNDEF 814 %enddef +%define SWIGWARN_JAVA_TYPEMAP_CLASSMOD_UNDEF 815 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVABODY_UNDEF 816 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVAOUT_UNDEF 817 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVAIN_UNDEF 818 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVADIRECTORIN_UNDEF 819 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVADIRECTOROUT_UNDEF 820 %enddef +%define SWIGWARN_JAVA_COVARIANT_RET 822 %enddef +%define SWIGWARN_JAVA_TYPEMAP_JAVACONSTRUCT_UNDEF 823 %enddef +%define SWIGWARN_JAVA_TYPEMAP_DIRECTORIN_NODESC 824 %enddef +%define SWIGWARN_JAVA_NO_DIRECTORCONNECT_ATTR 825 %enddef +%define SWIGWARN_JAVA_NSPACE_WITHOUT_PACKAGE 826 %enddef + +/* please leave 810-829 free for Java */ + +%define SWIGWARN_CSHARP_TYPEMAP_CTYPE_UNDEF 830 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSTYPE_UNDEF 831 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSWTYPE_UNDEF 832 %enddef +%define SWIGWARN_CSHARP_MULTIPLE_INHERITANCE 833 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_GETCPTR_UNDEF 834 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CLASSMOD_UNDEF 835 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSBODY_UNDEF 836 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSOUT_UNDEF 837 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSIN_UNDEF 838 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSDIRECTORIN_UNDEF 839 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSDIRECTOROUT_UNDEF 840 %enddef +%define SWIGWARN_CSHARP_COVARIANT_RET 842 %enddef +%define SWIGWARN_CSHARP_TYPEMAP_CSCONSTRUCT_UNDEF 843 %enddef +%define SWIGWARN_CSHARP_EXCODE 844 %enddef +%define SWIGWARN_CSHARP_CANTHROW 845 %enddef +%define SWIGWARN_CSHARP_NO_DIRECTORCONNECT_ATTR 846 %enddef + +/* please leave 830-849 free for C# */ + +%define SWIGWARN_MODULA3_TYPEMAP_TYPE_UNDEF 850 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_GETCPTR_UNDEF 851 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_CLASSMOD_UNDEF 852 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_PTRCONSTMOD_UNDEF 853 %enddef +%define SWIGWARN_MODULA3_TYPEMAP_MULTIPLE_RETURN 854 %enddef +%define SWIGWARN_MODULA3_MULTIPLE_INHERITANCE 855 %enddef +%define SWIGWARN_MODULA3_TYPECONSTRUCTOR_UNKNOWN 856 %enddef +%define SWIGWARN_MODULA3_UNKNOWN_PRAGMA 857 %enddef +%define SWIGWARN_MODULA3_BAD_ENUMERATION 858 %enddef +%define SWIGWARN_MODULA3_DOUBLE_ID 859 %enddef +%define SWIGWARN_MODULA3_BAD_IMPORT 860 %enddef + +/* please leave 850-869 free for Modula 3 */ + +%define SWIGWARN_PHP_MULTIPLE_INHERITANCE 870 %enddef +%define SWIGWARN_PHP_UNKNOWN_PRAGMA 871 %enddef +%define SWIGWARN_PHP_PUBLIC_BASE 872 %enddef + +/* please leave 870-889 free for PHP */ + +%define SWIGWARN_GO_NAME_CONFLICT 890 %enddef + +/* please leave 890-899 free for Go */ + +/* -- User defined warnings (900 - 999) -- */ + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/swigwarnings.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/swigwarnings.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,128 @@ +/* + Include the internal swig macro codes. These macros correspond to + the one found in Source/Include/swigwarn.h plus the 'SWIG' prefix. + + For example, in the include file 'swigwarn.h' you will find + + #define WARN_TYPEMAP_CHARLEAK ... + + and in the 'swigwarn.swg' interface, you will see + + %define SWIGWARN_TYPEMAP_CHARLEAK ... + + This code can be used in warning filters as follows: + + %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK); + + Warnings messages used in typemaps. Message names will be the same + as those in Lib/swigwarn.swg but with the suffix _MSG. + + For example, for the code SWIGWARN_TYPEMAP_CHARLEAK, once you use + + %typemapmsg(CHARLEAK,<msg>); + + you use the message in your typemap as + + %typemap(varin,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) char * + + while you suppress the warning using + + %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK); + + as described above. +*/ + +/* ----------------------------------------------------------------------------- + * SWIG warning codes + * ----------------------------------------------------------------------------- */ + +%include <swigwarn.swg> + +/* ----------------------------------------------------------------------------- + * Auxiliary macros + * ----------------------------------------------------------------------------- */ + +/* Macro to define warning messages */ +#define %_warningmsg(Val, Msg...) `Val`":"Msg +#define %warningmsg(Val, Msg...) %_warningmsg(Val, Msg) + +/* ----------------------------------------------------------------------------- + * Typemap related warning messages + * ----------------------------------------------------------------------------- */ + +%define SWIGWARN_TYPEMAP_CHARLEAK_MSG "451:Setting a const char * variable may leak memory." %enddef +%define SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG "454:Setting a pointer/reference variable may leak memory." %enddef +%define SWIGWARN_TYPEMAP_THREAD_UNSAFE_MSG "470:Thread/reentrant unsafe wrapping, consider returning by value instead." %enddef +%define SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG "473:Returning a pointer or reference in a director method is not recommended." %enddef + +/* ----------------------------------------------------------------------------- + * Operator related warning messages + * ----------------------------------------------------------------------------- */ + +%define SWIGWARN_IGNORE_OPERATOR_NEW_MSG "350:operator new ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_DELETE_MSG "351:operator delete ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_PLUS_MSG "352:operator+ ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MINUS_MSG "353:operator- ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MUL_MSG "354:operator* ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_DIV_MSG "355:operator/ ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MOD_MSG "356:operator% ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_XOR_MSG "357:operator^ ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_AND_MSG "358:operator& ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_OR_MSG "359:operator| ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_NOT_MSG "360:operator~ ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LNOT_MSG "361:operator! ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_EQ_MSG "362:operator= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LT_MSG "363:operator< ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_GT_MSG "364:operator> ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_PLUSEQ_MSG "365:operator+= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MINUSEQ_MSG "366:operator-= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MULEQ_MSG "367:operator*= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_DIVEQ_MSG "368:operator/= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MODEQ_MSG "369:operator%= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_XOREQ_MSG "370:operator^= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_ANDEQ_MSG "371:operator&= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_OREQ_MSG "372:operator|= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LSHIFT_MSG "373:operator<< ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_RSHIFT_MSG "374:operator>> ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LSHIFTEQ_MSG "375:operator<<= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_RSHIFTEQ_MSG "376:operator>>= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_EQUALTO_MSG "377:operator== ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_NOTEQUAL_MSG "378:operator!= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LTEQUAL_MSG "379:operator<= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_GTEQUAL_MSG "380:operator>= ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LAND_MSG "381:operator&& ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_LOR_MSG "382:operator|| ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_PLUSPLUS_MSG "383:operator++ ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_MINUSMINUS_MSG "384:operator-- ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_COMMA_MSG "385:operator-- ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_ARROWSTAR_MSG "386:operator->* ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_ARROW_MSG "387:operator-> ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_CALL_MSG "388:operator() ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_INDEX_MSG "389:operator[] ignored (consider using %%extend)" %enddef +%define SWIGWARN_IGNORE_OPERATOR_UPLUS_MSG "390:operator+ ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_UMINUS_MSG "391:operator- ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_UMUL_MSG "392:operator* ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_UAND_MSG "393:operator& ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_NEWARR_MSG "394:operator new[] ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_DELARR_MSG "395:operator delete[] ignored" %enddef +%define SWIGWARN_IGNORE_OPERATOR_REF_MSG "396:operator*() ignored" %enddef + +#define %ignoreoperator(Oper) %ignorewarn(SWIGWARN_IGNORE_OPERATOR_##Oper##_MSG) + +/* ----------------------------------------------------------------------------- + * Macros for keyword and built-in names + * ----------------------------------------------------------------------------- */ + +#define %keywordwarn(msg...) %namewarn(%warningmsg(SWIGWARN_PARSE_KEYWORD, msg)) +#define %builtinwarn(msg...) %namewarn(%warningmsg(SWIGWARN_PARSE_BUILTIN_NAME, msg), %$isfunction) + + +/* ----------------------------------------------------------------------------- + * Warning filter feature + * ----------------------------------------------------------------------------- */ + +#define %_warnfilter(filter...) %feature("warnfilter",`filter`) +#define %warnfilter(filter...) %_warnfilter(filter) + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/README Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,54 @@ +Still in development, but if you are interested into looking around, +start with + + + swigtypemaps.swg + +which is the head file. Also read the docs for %fragments in + + fragments.swg + +and follow the definitions in one of the supported languages: + + python, perl, ruby, tcl + + + + +/* ----------------------------------------------------------------------------- + * Internal typemap specializations + * ----------------------------------------------------------------------------- */ + + +carrays.swg Implement the carrays.i library +cdata.swg Implement the cdata.i library +cmalloc.swg Implement the cmalloc.i library +cpointer.swg Implement the cpointer.i library +cstring.swg Implement the cstring.i library typemaps for char * +cwstring.swg Implement the cstring.i library typemaps for wchar_t * +exception.swg Implement the exception.i library +implicit.swg Allow the use of implicit C++ constructors + +string.swg Typemaps for char * string +wstring.swg Typemaps for wchar_t * string +std_string.swg Typemaps for std::string +std_wstring.swg Typemaps for std::wstring +swigtype.swg Typemaps for the SWIGTYPE type +void.swg Typemaps for the 'void' type +enumint.swg Typemaps for enums treated as 'int' +swigobject.swg Typemaps for the SWIG_Object as in PyObject, Tcl_Obj, etc. +misctypes.swg Typemaps for miscellaneos types (size_t, ptrdiff_t, etc) +ptrtypes.swg Typemaps for types with a 'ptr' behavior +valtypes.swg Typemaps for 'by value' types +inoutlist.swg IN/OUTPUT/INOUT typemaps, where the OUTPUT values are returned in a list +primtypes.swg Common macros to manage primitive types (short,int,double,etc) + +cstrings.swg Common macros to implemented the cstring/cwstring libraries +std_strings.swg Common macros to implemented the std::string/std::wstring typemaps +strings.swg Common macros and typemaps for string and wstring (char *, wchar_t *) + +swigmacros.swg Basic macros +fragments.swg Macros for fragment manipulations + + +typemaps.swg The old typemaps.i library, not needed anymore diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/attribute.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/attribute.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,283 @@ +/* ----------------------------------------------------------------------------- + * attribute.swg + * + * Attribute implementation + * ----------------------------------------------------------------------------- */ + +/* + The following macros convert a pair of set/get methods + into a "native" attribute. + + Use %attribute when you have a pair of get/set methods to a primitive type + like in: + + %attribute(A, int, a, get_a, set_a); + + struct A + { + int get_a() const; + void set_a(int aa); + }; + + If you don't provide a 'set' method, a 'read-only' attribute + is generated, ie, like in: + + %attribute(A, int, c, get_c); + + Use %attributeref when you have const/non-const reference access methods + for primitive types or class/structs, like in: + + %attributeref(A, int, b); + + struct A + { + const int& b() const; + int& b(); + }; + + %attributeref(B, int, c); + + struct B + { + int& c(); + }; + + You can also use + + %attributeref(Class, AttributeType, AttributeName, AccessorMethod) + + if the internal C++ reference methods have a different name from the + attribute you want, so + + %attributeref(B, int, d, c); + + is the same as the last example, but instead of the attribute 'c' being + called 'c', it is called 'd'. + + Now you can use the attributes like so: + + x = A() + x.a = 3 # calls A::set_a + print x.a # calls A::get_a + + x.b = 3 # calls A::b() + print x.b # calls A::b() const + + Use %attribute2 instead of %attribute to indicate that reference-pointer + translation is required. You use %attribute2 instead of %attribute in + cases like this: + + %attribute2(MyClass, MyFoo, Foo, GetFoo, SetFoo); + %inline %{ + struct MyFoo { + int x; + }; + class MyClass { + MyFoo foo; + public: + MyFoo& GetFoo() { return foo; } + void SetFoo(const MyFoo& other) { foo = other; } + }; + %} + + Here, the data type of the property is a wrapped type (MyFoo) and on the + C++ side it is passed by reference. The problem is that the SWIG wrapper will + pass around a pointer (MyFoo *) which is not compatible with the reference + type of the accessors (MyFoo &). Therefore, if you use %attribute, you'll get + an error from your C/C++ compiler. %attribute2 translates between a pointer + and a reference to eliminate the error. In case you're confused, let's make it + simple: just use %attribute at first, but if the C/C++ compiler gives an error + while compiling the wrapper, try %attribute2 instead. + + NOTE: remember that if the type contains commas, such as 'std::pair<int,int>', + you need to use the macro like: + + %attributeref(A, %arg(std::pair<int,int>), pval); + + where %arg() 'normalizes' the type to be understood as a single + argument, otherwise the macro will get confused by the comma. + + The %attributeval is the same as %attribute, but should be used when the type + is a class/struct (ie a non-primitive type) and when the get and set methods + return/pass by value. The following is very similar to the above example, but + note that the access is by value rather than reference. + + %attributeval(MyClassVal, MyFoo, ReadWriteFoo, GetFoo, SetFoo); + %attributeval(MyClassVal, MyFoo, ReadOnlyFoo, GetFoo); + %inline %{ + class MyClassVal { + MyFoo foo; + public: + MyFoo GetFoo() { return foo; } + void SetFoo(MyFoo other) { foo = other; } + }; + %} + + The %attributestring is the same as %attributeval, but should be used for string + class types, which are unusual as they are a class on the C++ side, but normally an + immutable/primitive type in the target language. Example usage for std::string: + + %include <std_string.i> + %attributestring(MyStringyClass, std::string, ReadWriteString, GetString, SetString); + %attributestring(MyStringyClass, std::string, ReadOnlyString, GetString); + %inline %{ + class MyStringyClass { + std::string str; + public: + MyStringyClass(const std::string &val) : str(val) {} + std::string GetString() { return str; } + void SetString(std::string other) { str = other; } + }; + %} + +*/ + +// +// Define SWIG_ATTRIBUTE_TEMPLATE if you want to use templates instead of macros for the C++ get and set wrapper methods +// Does not always generate compileable code, use at your peril! +// +//#define SWIG_ATTRIBUTE_TEMPLATE + +%define %attribute_custom(Class, AttributeType, AttributeName, GetMethod, SetMethod, GetMethodCall, SetMethodCall) + %ignore Class::GetMethod(); + %ignore Class::GetMethod() const; + #if #SetMethod != #AttributeName + %ignore Class::SetMethod; + #endif + %extend Class { + AttributeType AttributeName; + } +#if defined(__cplusplus) && defined(SWIG_ATTRIBUTE_TEMPLATE) + %{ + template < class C > inline AttributeType %mangle(Class) ##_## AttributeName ## _get(const C* self_) { + return GetMethodCall; + } + template < class C > inline AttributeType %mangle(Class) ##_## AttributeName ## _get(C* self_) { + return GetMethodCall; + } + template < class C > inline void %mangle(Class) ##_## AttributeName ## _set(C* self_, AttributeType val_) { + SetMethodCall; + } + %} +#else + %{ + #define %mangle(Class) ##_## AttributeName ## _get(self_) GetMethodCall + #define %mangle(Class) ##_## AttributeName ## _set(self_, val_) SetMethodCall + %} +#endif +%enddef + +%define %attribute_readonly(Class, AttributeType, AttributeName, GetMethod, GetMethodCall) + %ignore Class::GetMethod(); + %ignore Class::GetMethod() const; + %immutable Class::AttributeName; + %extend Class { + AttributeType AttributeName; + } +#if defined(__cplusplus) && defined(SWIG_ATTRIBUTE_TEMPLATE) + %{ + template < class C > inline AttributeType %mangle(Class) ##_## AttributeName ## _get(const C* self_) { + return GetMethodCall; + } + template < class C > inline AttributeType %mangle(Class) ##_## AttributeName ## _get(C* self_) { + return GetMethodCall; + } + %} +#else + %{ + #define %mangle(Class) ##_## AttributeName ## _get(self_) GetMethodCall + %} +#endif +%enddef + + +// User macros + +%define %attribute(Class, AttributeType, AttributeName, GetMethod, SetMethod...) + #if #SetMethod != "" + %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, SetMethod, self_->GetMethod(), self_->SetMethod(val_)) + #else + %attribute_readonly(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, self_->GetMethod()) + #endif +%enddef + +%define %attribute2(Class, AttributeType, AttributeName, GetMethod, SetMethod...) + #if #SetMethod != "" + %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, SetMethod, &self_->GetMethod(), self_->SetMethod(*val_)) + #else + %attribute_readonly(%arg(Class), %arg(AttributeType), AttributeName, GetMethod, &self_->GetMethod()) + #endif +%enddef + +%define %attributeref(Class, AttributeType, AttributeName, AccessorMethod...) + #if #AccessorMethod != "" + %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_) + #else + %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AttributeName, AttributeName, self_->AttributeName(), self_->AttributeName() = val_) + #endif +%enddef + +%define %attribute2ref(Class, AttributeType, AttributeName, AccessorMethod...) + #if #AccessorMethod != "" + %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, &self_->AccessorMethod(), self_->AccessorMethod() = *val_) + #else + %attribute_custom(%arg(Class), %arg(AttributeType), AccessorName, AccessorName, AccessorName, &self_->AccessorName(), self_->AccessorName() = *val_) + #endif +%enddef + +// deprecated (same as %attributeref, but there is an argument order inconsistency) +%define %attribute_ref(Class, AttributeType, AccessorMethod, AttributeName...) + #if #AttributeName != "" + %attribute_custom(%arg(Class), %arg(AttributeType), AttributeName, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_) + #else + %attribute_custom(%arg(Class), %arg(AttributeType), AccessorMethod, AccessorMethod, AccessorMethod, self_->AccessorMethod(), self_->AccessorMethod() = val_) + #endif +%enddef + + +%define %attributeval(Class, AttributeType, AttributeName, GetMethod, SetMethod...) + %{ + #define %mangle(Class) ##_## AttributeName ## _get(self_) new AttributeType(self_->GetMethod()) + %} + #if #SetMethod != "" + %{ + #define %mangle(Class) ##_## AttributeName ## _set(self_, val_) self_->SetMethod(*val_) + %} + #if #SetMethod != #AttributeName + %ignore Class::SetMethod; + #endif + #else + %immutable Class::AttributeName; + #endif + %ignore Class::GetMethod(); + %ignore Class::GetMethod() const; + %newobject Class::AttributeName; + %extend Class { + AttributeType AttributeName; + } +%enddef + + +%define %attributestring(Class, AttributeType, AttributeName, GetMethod, SetMethod...) + %{ + #define %mangle(Class) ##_## AttributeName ## _get(self_) *new AttributeType(self_->GetMethod()) + %} + #if #SetMethod != "" + %{ + #define %mangle(Class) ##_## AttributeName ## _set(self_, val_) self_->SetMethod(val_) + %} + #if #SetMethod != #AttributeName + %ignore Class::SetMethod; + #endif + #else + %immutable Class::AttributeName; + #endif + %ignore Class::GetMethod(); + %ignore Class::GetMethod() const; + %newobject Class::AttributeName; + %typemap(newfree) const AttributeType &AttributeName "delete $1;// my newfree override" + %extend Class { + AttributeType AttributeName; + } +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/carrays.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/carrays.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,114 @@ +/* ----------------------------------------------------------------------------- + * carrays.swg + * + * This library file contains macros that can be used to manipulate simple + * pointers as arrays. + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * %array_functions(TYPE,NAME) + * + * Generates functions for creating and accessing elements of a C array + * (as pointers). Creates the following functions: + * + * TYPE *new_NAME(int nelements) + * void delete_NAME(TYPE *); + * TYPE NAME_getitem(TYPE *, int index); + * void NAME_setitem(TYPE *, int index, TYPE value); + * + * ----------------------------------------------------------------------------- */ + +%define %array_functions(TYPE,NAME) +%{ + static TYPE *new_##NAME(size_t nelements) { + return %new_array(nelements, TYPE); + } + + static void delete_##NAME(TYPE *ary) { + %delete_array(ary); + } + + static TYPE NAME##_getitem(TYPE *ary, size_t index) { + return ary[index]; + } + static void NAME##_setitem(TYPE *ary, size_t index, TYPE value) { + ary[index] = value; + } +%} + +TYPE *new_##NAME(size_t nelements); +void delete_##NAME(TYPE *ary); +TYPE NAME##_getitem(TYPE *ary, size_t index); +void NAME##_setitem(TYPE *ary, size_t index, TYPE value); + +%enddef + + +/* ----------------------------------------------------------------------------- + * %array_class(TYPE,NAME) + * + * Generates a class wrapper around a C array. The class has the following + * interface: + * + * struct NAME { + * NAME(int nelements); + * ~NAME(); + * TYPE getitem(int index); + * void setitem(int index, TYPE value); + * TYPE * cast(); + * static NAME *frompointer(TYPE *t); + * } + * + * Use + * + * %array_class_wrap(TYPE,NAME,GET,SET) + * + * if you want different names for the get/set methods. + * ----------------------------------------------------------------------------- */ + +%define %array_class_wrap(TYPE,NAME,getitem,setitem) +%{ +typedef TYPE NAME; +%} + + +typedef struct { +} NAME; + +%extend NAME { + + NAME(size_t nelements) { + return %new_array(nelements, TYPE); + } + + ~NAME() { + %delete_array(self); + } + + TYPE getitem(size_t index) { + return self[index]; + } + + void setitem(size_t index, TYPE value) { + self[index] = value; + } + + TYPE * cast() { + return self; + } + + static NAME *frompointer(TYPE *t) { + return %static_cast(t, NAME *); + } +}; + +%types(NAME = TYPE); + +%enddef + + +#ifndef %array_class +%define %array_class(TYPE,NAME) + %array_class_wrap(TYPE,NAME,getitem,setitem) +%enddef +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/cdata.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/cdata.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,76 @@ +/* ----------------------------------------------------------------------------- + * cdata.swg + * + * This library file contains macros for manipulating raw C data as strings. + * ----------------------------------------------------------------------------- */ + +%{ +typedef struct SWIGCDATA { + char *data; + size_t len; +} SWIGCDATA; +%} + +/* ----------------------------------------------------------------------------- + * Typemaps for returning binary data + * ----------------------------------------------------------------------------- */ + +%typemap(out,noblock=1,fragment="SWIG_FromCharPtrAndSize") SWIGCDATA { + %set_output(SWIG_FromCharPtrAndSize($1.data,$1.len)); +} +%typemap(in) (const void *indata, size_t inlen) = (char *STRING, size_t SIZE); + + +/* ----------------------------------------------------------------------------- + * %cdata(TYPE [, NAME]) + * + * Convert raw C data to a binary string. + * ----------------------------------------------------------------------------- */ + +%define %cdata(TYPE,NAME...) + +%insert("header") { +#ifdef __cplusplus +extern "C" { +#endif +#if #NAME == "" +static SWIGCDATA cdata_##TYPE(TYPE *ptr, size_t nelements) +#else +static SWIGCDATA cdata_##NAME(TYPE *ptr, size_t nelements) +#endif +{ + SWIGCDATA d; + d.data = (char *) ptr; +#if #TYPE != "void" + d.len = nelements*sizeof(TYPE); +#else + d.len = nelements; +#endif + return d; +} +#ifdef __cplusplus +} +#endif +} + +#ifdef __cplusplus +extern "C" +#endif +#if #NAME == "" +SWIGCDATA cdata_##TYPE(TYPE *ptr, size_t nelements = 1); +#else +SWIGCDATA cdata_##NAME(TYPE *ptr, size_t nelements = 1); +#endif +%enddef + +%rename(cdata) ::cdata_void(void *ptr, size_t nelements = 1); + +%cdata(void); + +/* Memory move function. Due to multi-argument typemaps this appears to be wrapped as +void memmove(void *data, const char *s); */ +void memmove(void *data, const void *indata, size_t inlen); + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/cmalloc.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/cmalloc.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,110 @@ +/* ----------------------------------------------------------------------------- + * cmalloc.swg + * + * This library file contains macros that can be used to create objects using + * the C malloc function. + * ----------------------------------------------------------------------------- */ + +%{ +#include <stdlib.h> +%} + +/* %malloc(TYPE [, NAME = TYPE]) + %calloc(TYPE [, NAME = TYPE]) + %realloc(TYPE [, NAME = TYPE]) + %free(TYPE [, NAME = TYPE]) + %allocators(TYPE [,NAME = TYPE]) + + Creates functions for allocating/reallocating memory. + + TYPE *malloc_NAME(size_t nbytes = sizeof(TYPE); + TYPE *calloc_NAME(size_t nobj=1, size_t size=sizeof(TYPE)); + TYPE *realloc_NAME(TYPE *ptr, size_t nbytes); + void free_NAME(TYPE *ptr); + +*/ + +%define %malloc(TYPE,NAME...) +#if #NAME != "" +%rename(malloc_##NAME) ::malloc(size_t nbytes); +#else +%rename(malloc_##TYPE) ::malloc(size_t nbytes); +#endif + +#if #TYPE != "void" +%typemap(default) size_t nbytes "$1 = (size_t) sizeof(TYPE);" +#endif +TYPE *malloc(size_t nbytes); +%typemap(default) size_t nbytes; +%enddef + +%define %calloc(TYPE,NAME...) +#if #NAME != "" +%rename(calloc_##NAME) ::calloc(size_t nobj, size_t sz); +#else +%rename(calloc_##TYPE) ::calloc(size_t nobj, size_t sz); +#endif +#if #TYPE != "void" +%typemap(default) size_t sz "$1 = (size_t) sizeof(TYPE);" +#else +%typemap(default) size_t sz "$1 = 1;" +#endif +%typemap(default) size_t nobj "$1 = 1;" +TYPE *calloc(size_t nobj, size_t sz); +%typemap(default) size_t sz; +%typemap(default) size_t nobj; +%enddef + +%define %realloc(TYPE,NAME...) +%insert("header") { +#if #NAME != "" +TYPE *realloc_##NAME(TYPE *ptr, size_t nitems) +#else +TYPE *realloc_##TYPE(TYPE *ptr, size_t nitems) +#endif +{ +#if #TYPE != "void" +return (TYPE *) realloc(ptr, nitems*sizeof(TYPE)); +#else +return (TYPE *) realloc(ptr, nitems); +#endif +} +} +#if #NAME != "" +TYPE *realloc_##NAME(TYPE *ptr, size_t nitems); +#else +TYPE *realloc_##TYPE(TYPE *ptr, size_t nitems); +#endif +%enddef + +%define %free(TYPE,NAME...) +#if #NAME != "" +%rename(free_##NAME) ::free(TYPE *ptr); +#else +%rename(free_##TYPE) ::free(TYPE *ptr); +#endif +void free(TYPE *ptr); +%enddef + +%define %sizeof(TYPE,NAME...) +#if #NAME != "" +%constant size_t sizeof_##NAME = sizeof(TYPE); +#else +%constant size_t sizeof_##TYPE = sizeof(TYPE); +#endif +%enddef + +%define %allocators(TYPE,NAME...) +%malloc(TYPE,NAME) +%calloc(TYPE,NAME) +%realloc(TYPE,NAME) +%free(TYPE,NAME) +#if #TYPE != "void" +%sizeof(TYPE,NAME) +#endif +%enddef + + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/cpointer.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/cpointer.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,157 @@ +/* ----------------------------------------------------------------------------- + * cpointer.swg + * + * This library file contains macros that can be used to manipulate simple + * pointer objects. + * + * ----------------------------------------------------------------------------- */ + +/* ----------------------------------------------------------------------------- + * %pointer_class(type,name) + * + * Places a simple proxy around a simple type like 'int', 'float', or whatever. + * The proxy provides this interface: + * + * class type { + * public: + * type(); + * ~type(); + * type value(); + * void assign(type value); + * }; + * + * Example: + * + * %pointer_class(int, intp); + * + * int add(int *x, int *y) { return *x + *y; } + * + * In python (with proxies) + * + * >>> a = intp() + * >>> a.assign(10) + * >>> a.value() + * 10 + * >>> b = intp() + * >>> b.assign(20) + * >>> print add(a,b) + * 30 + * + * As a general rule, this macro should not be used on class/structures that + * are already defined in the interface. + * ----------------------------------------------------------------------------- */ + + +%define %pointer_class(TYPE, NAME) +%{ +typedef TYPE NAME; +%} + +typedef struct { +} NAME; + +%extend NAME { + NAME() { + return %new_instance(TYPE); + } + ~NAME() { + if ($self) %delete($self); + } +} + +%extend NAME { + + void assign(TYPE value) { + *$self = value; + } + TYPE value() { + return *$self; + } + TYPE * cast() { + return $self; + } + static NAME * frompointer(TYPE *t) { + return (NAME *) t; + } +} + +%types(NAME = TYPE); + +%enddef + +/* ----------------------------------------------------------------------------- + * %pointer_functions(type,name) + * + * Create functions for allocating/deallocating pointers. This can be used + * if you don't want to create a proxy class or if the pointer is complex. + * + * %pointer_functions(int, intp) + * + * int add(int *x, int *y) { return *x + *y; } + * + * In python (with proxies) + * + * >>> a = copy_intp(10) + * >>> intp_value(a) + * 10 + * >>> b = new_intp() + * >>> intp_assign(b,20) + * >>> print add(a,b) + * 30 + * >>> delete_intp(a) + * >>> delete_intp(b) + * + * ----------------------------------------------------------------------------- */ + +%define %pointer_functions(TYPE,NAME) +%{ + static TYPE *new_##NAME() { + return %new_instance(TYPE); + } + + static TYPE *copy_##NAME(TYPE value) { + return %new_copy(value, TYPE); + } + + static void delete_##NAME(TYPE *obj) { + if (obj) %delete(obj); + } + + static void NAME ##_assign(TYPE *obj, TYPE value) { + *obj = value; + } + + static TYPE NAME ##_value(TYPE *obj) { + return *obj; + } +%} + +TYPE *new_##NAME(); +TYPE *copy_##NAME(TYPE value); +void delete_##NAME(TYPE *obj); +void NAME##_assign(TYPE *obj, TYPE value); +TYPE NAME##_value(TYPE *obj); + +%enddef + +/* ----------------------------------------------------------------------------- + * %pointer_cast(type1,type2,name) + * + * Generates a pointer casting function. + * ----------------------------------------------------------------------------- */ + +%define %pointer_cast(TYPE1,TYPE2,NAME) +%inline %{ +TYPE2 NAME(TYPE1 x) { + return %static_cast(x, TYPE2); +} +%} +%enddef + + + + + + + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/cstring.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/cstring.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,9 @@ +%include <typemaps/cstrings.swg> + +%typemaps_cstring(%cstring, + char, + SWIG_AsCharPtr, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtr, + SWIG_FromCharPtrAndSize); + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/cstrings.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/cstrings.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,288 @@ +/* ----------------------------------------------------------------------------- + * cstrings.swg + * + * This file provides typemaps and macros for dealing with various forms + * of C character string handling. The primary use of this module + * is in returning character data that has been allocated or changed in + * some way. + * ----------------------------------------------------------------------------- */ + +%define %typemaps_cstring(Name, Char, + SWIG_AsCharPtr, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtr, + SWIG_FromCharPtrAndSize) + + +/* %cstring_input_binary(TYPEMAP, SIZE) + * + * Macro makes a function accept binary string data along with + * a size. For example: + * + * %cstring_input_binary(Char *buff, int size); + * void foo(Char *buff, int size) { + * } + * + */ + +%define Name ## _input_binary(TYPEMAP, SIZE) +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) (TYPEMAP, SIZE) + (int res, Char *buf = 0, size_t size = 0, int alloc = 0) { + res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum); + } + $1 = ($1_ltype) buf; + $2 = ($2_ltype) size - 1; +} +%typemap(freearg,noblock=1,match="in") (TYPEMAP, SIZE) { + if (alloc$argnum == SWIG_NEWOBJ) %delete_array(buf$argnum); +} +%enddef + + + +/* + * %cstring_bounded_output(TYPEMAP, MAX) + * + * This macro is used to return a NULL-terminated output string of + * some maximum length. For example: + * + * %cstring_bounded_output(Char *outx, 512); + * void foo(Char *outx) { + * sprintf(outx,"blah blah\n"); + * } + * + */ + +%define Name ## _bounded_output(TYPEMAP,MAX) +%typemap(in,noblock=1,numinputs=0) TYPEMAP (Char temp[MAX+1]) { + $1 = ($1_ltype) temp; +} +%typemap(freearg,match="in") TYPEMAP ""; +%typemap(argout,noblock=1,fragment= #SWIG_FromCharPtr ) TYPEMAP { + $1[MAX] = 0; + %append_output(SWIG_FromCharPtr($1)); +} +%enddef + + + +/* + * %cstring_chunk_output(TYPEMAP, SIZE) + * + * This macro is used to return a chunk of binary string data. + * Embedded NULLs are okay. For example: + * + * %cstring_chunk_output(Char *outx, 512); + * void foo(Char *outx) { + * memmove(outx, somedata, 512); + * } + * + */ + +%define Name ## _chunk_output(TYPEMAP,SIZE) +%typemap(in,noblock=1,numinputs=0) TYPEMAP(Char temp[SIZE]) { + $1 = ($1_ltype) temp; +} +%typemap(freearg,match="in") TYPEMAP ""; +%typemap(argout,noblock=1,fragment= #SWIG_FromCharPtrAndSize) TYPEMAP { + %append_output(SWIG_FromCharPtrAndSize($1,SIZE)); +} +%enddef + + + +/* + * %cstring_bounded_mutable(TYPEMAP, SIZE) + * + * This macro is used to wrap a string that's going to mutate. + * + * %cstring_bounded_mutable(Char *in, 512); + * void foo(in *x) { + * while (*x) { + * *x = toupper(*x); + * x++; + * } + * } + * + */ + + +%define Name ## _bounded_mutable(TYPEMAP,MAX) +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) TYPEMAP + (int res,Char temp[MAX+1], Char *t = 0, size_t n = 0, int alloc = 0) { + res = SWIG_AsCharPtrAndSize($input, &t, &n, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "TYPEMAP", $symname, $argnum); + } + if ( n > (size_t) MAX ) n = (size_t) MAX; + memcpy(temp, t, sizeof(Char)*n); + if (alloc == SWIG_NEWOBJ) %delete_array(t); + temp[n - 1] = 0; + $1 = ($1_ltype) temp; +} +%typemap(freearg,match="in") TYPEMAP ""; +%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP { + $1[MAX] = 0; + %append_output(SWIG_FromCharPtr($1)); +} +%enddef + + +/* + * %cstring_mutable(TYPEMAP [, expansion]) + * + * This macro is used to wrap a string that will mutate in place. + * It may change size up to a user-defined expansion. + * + * %cstring_mutable(Char *in); + * void foo(in *x) { + * while (*x) { + * *x = toupper(*x); + * x++; + * } + * } + * + */ + +%define Name ## _mutable(TYPEMAP,EXP...) +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) TYPEMAP (int res, Char *t = 0, size_t n = 0, int alloc = 0, size_t expansion = 0) { +#if #EXP != "" + expansion += EXP; +#endif + res = SWIG_AsCharPtrAndSize($input, &t, &n, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "TYPEMAP", $symname, $argnum); + } + $1 = %new_array(n+expansion, $*1_ltype); + memcpy($1,t,sizeof(Char)*n); + if (alloc == SWIG_NEWOBJ) %delete_array(t); + $1[n-1] = 0; +} +%typemap(freearg,match="in") TYPEMAP ""; +%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP { + %append_output(SWIG_FromCharPtr($1)); + %delete_array($1); +} +%enddef + + +/* + * %cstring_output_maxsize(TYPEMAP, SIZE) + * + * This macro returns data in a string of some user-defined size. + * + * %cstring_output_maxsize(Char *outx, int max) { + * void foo(Char *outx, int max) { + * sprintf(outx,"blah blah\n"); + * } + */ + +%define Name ## _output_maxsize(TYPEMAP, SIZE) +%typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (TYPEMAP, SIZE) (int res, size_t size, Char *buff = 0) { + res = SWIG_AsVal(size_t)($input, &size); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum); + } + buff= %new_array(size+1, Char); + $2 = %numeric_cast(size, $2_ltype); + $1 = %static_cast(buff, $1_ltype); +} +%typemap(freearg,noblock=1,match="in") (TYPEMAP,SIZE) { + if (buff$argnum) %delete_array(buff$argnum); +} +%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) (TYPEMAP,SIZE) { + %append_output(SWIG_FromCharPtr($1)); +} +%enddef + +/* + * %cstring_output_withsize(TYPEMAP, SIZE) + * + * This macro is used to return Character data along with a size + * parameter. + * + * %cstring_output_maxsize(Char *outx, int *max) { + * void foo(Char *outx, int *max) { + * sprintf(outx,"blah blah\n"); + * *max = strlen(outx); + * } + */ + +%define Name ## _output_withsize(TYPEMAP, SIZE) +%typemap(in,noblock=1,fragment=SWIG_AsVal_frag(size_t)) (TYPEMAP, SIZE) (int res, size_t n, Char *buff = 0, $*2_ltype size) { + res = SWIG_AsVal(size_t)($input, &n); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "(TYPEMAP, SIZE)", $symname, $argnum); + } + buff= %new_array(n+1, Char); + $1 = %static_cast(buff, $1_ltype); + size = %numeric_cast(n,$*2_ltype); + $2 = &size; +} +%typemap(freearg,noblock=1,match="in")(TYPEMAP,SIZE) { + if (buff$argnum) %delete_array(buff$argnum); +} +%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtrAndSize) (TYPEMAP,SIZE) { + %append_output(SWIG_FromCharPtrAndSize($1,*$2)); +} +%enddef + + +/* + * %cstring_output_allocate(TYPEMAP, RELEASE) + * + * This macro is used to return Character data that was + * allocated with new or malloc. + * + * %cstring_output_allocated(Char **outx, free($1)); + * void foo(Char **outx) { + * *outx = (Char *) malloc(512); + * sprintf(outx,"blah blah\n"); + * } + */ + +%define Name ## _output_allocate(TYPEMAP, RELEASE) +%typemap(in,noblock=1,numinputs=0) TYPEMAP($*1_ltype temp = 0) { + $1 = &temp; +} +%typemap(freearg,match="in") TYPEMAP ""; +%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtr) TYPEMAP { + if (*$1) { + %append_output(SWIG_FromCharPtr(*$1)); + RELEASE; + } +} +%enddef + + +/* + * %cstring_output_allocate_size(TYPEMAP, SIZE, RELEASE) + * + * This macro is used to return Character data that was + * allocated with new or malloc. + * + * %cstring_output_allocated(Char **outx, int *sz, free($1)); + * void foo(Char **outx, int *sz) { + * *outx = (Char *) malloc(512); + * sprintf(outx,"blah blah\n"); + * *sz = strlen(outx); + * } + */ + +%define Name ## _output_allocate_size(TYPEMAP, SIZE, RELEASE) +%typemap(in,noblock=1,numinputs=0) (TYPEMAP, SIZE) ($*1_ltype temp = 0, $*2_ltype tempn) { + $1 = &temp; $2 = &tempn; +} +%typemap(freearg,match="in") (TYPEMAP,SIZE) ""; +%typemap(argout,noblock=1,fragment=#SWIG_FromCharPtrAndSize)(TYPEMAP,SIZE) { + if (*$1) { + %append_output(SWIG_FromCharPtrAndSize(*$1,*$2)); + RELEASE; + } +} +%enddef + +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/cwstring.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/cwstring.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,10 @@ +%include <typemaps/cstrings.swg> +%include <typemaps/wstring.swg> + +%typemaps_cstring(%cwstring, + wchar_t, + SWIG_AsWCharPtr, + SWIG_AsWCharPtrAndSize, + SWIG_FromWCharPtr, + SWIG_FromWCharPtrAndSize); + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/enumint.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/enumint.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,28 @@ +/* ------------------------------------------------------------ + * Enums mapped as integer values + * ------------------------------------------------------------ */ + +%apply int { enum SWIGTYPE }; +%apply const int& { const enum SWIGTYPE& }; + +%typemap(in,fragment=SWIG_AsVal_frag(int),noblock=1) const enum SWIGTYPE& (int val, int ecode, $basetype temp) { + ecode = SWIG_AsVal(int)($input, &val); + if (!SWIG_IsOK(ecode)) { + %argument_fail(ecode, "$type", $symname, $argnum); + } else { + temp = %static_cast(val,$basetype); + $1 = &temp; + } +} + +%typemap(varin,fragment=SWIG_AsVal_frag(int),noblock=1) enum SWIGTYPE { + if (sizeof(int) != sizeof($1)) { + %variable_fail(SWIG_AttributeError,"$type", "arch, read-only $name"); + } else { + int ecode = SWIG_AsVal(int)($input, %reinterpret_cast(&$1,int*)); + if (!SWIG_IsOK(ecode)) { + %variable_fail(ecode, "$type", "$name"); + } + } +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/exception.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/exception.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,86 @@ +/* ----------------------------------------------------------------------------- + * exceptions.swg + * + * This SWIG library file provides language independent exception handling + * ----------------------------------------------------------------------------- */ + +%include <typemaps/swigmacros.swg> + + +/* macros for error manipulation */ +#define %nullref_fmt() "invalid null reference " +#define %varfail_fmt(_type,_name) "in variable '"`_name`"' of type '"`_type`"'" +#ifndef %argfail_fmt +#define %argfail_fmt(_type,_name,_argn) "in method '" `_name` "', argument " `_argn`" of type '" `_type`"'" +#endif +#define %outfail_fmt(_type) "in output value of type '"_type"'" +#ifndef %argnullref_fmt +#define %argnullref_fmt(_type,_name,_argn) %nullref_fmt() %argfail_fmt(_type, _name, _argn) +#endif +#define %varnullref_fmt(_type,_name) %nullref_fmt() %varfail_fmt(_type, _name) +#define %outnullref_fmt(_type) %nullref_fmt() %outfail_fmt(_type) + +/* setting an error */ +#define %error(code,msg...) SWIG_Error(code, msg) +#define %type_error(msg...) SWIG_Error(SWIG_TypeError, msg) + + + +%insert("runtime") { + +%define_as(SWIG_exception_fail(code, msg), %block(%error(code, msg); SWIG_fail)) + +%define_as(SWIG_contract_assert(expr, msg), if (!(expr)) { %error(SWIG_RuntimeError, msg); SWIG_fail; } else) + +} + +#ifdef __cplusplus +/* + You can use the SWIG_CATCH_STDEXCEPT macro with the %exception + directive as follows: + + %exception { + try { + $action + } + catch (my_except& e) { + ... + } + SWIG_CATCH_STDEXCEPT // catch std::exception + catch (...) { + SWIG_exception_fail(SWIG_UnknownError, "Unknown exception"); + } + } +*/ +%{ +#include <stdexcept> +%} +%define SWIG_CATCH_STDEXCEPT + /* catching std::exception */ + catch (std::invalid_argument& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::domain_error& e) { + SWIG_exception_fail(SWIG_ValueError, e.what() ); + } catch (std::overflow_error& e) { + SWIG_exception_fail(SWIG_OverflowError, e.what() ); + } catch (std::out_of_range& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::length_error& e) { + SWIG_exception_fail(SWIG_IndexError, e.what() ); + } catch (std::runtime_error& e) { + SWIG_exception_fail(SWIG_RuntimeError, e.what() ); + } catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } +%enddef +%define SWIG_CATCH_UNKNOWN + catch (std::exception& e) { + SWIG_exception_fail(SWIG_SystemError, e.what() ); + } + catch (...) { + SWIG_exception_fail(SWIG_UnknownError, "unknown exception"); + } +%enddef + + +#endif /* __cplusplus */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/factory.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/factory.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,88 @@ +/* + Implement a more natural wrap for factory methods, for example, if + you have: + + ---- geometry.h -------- + struct Geometry { + enum GeomType{ + POINT, + CIRCLE + }; + + virtual ~Geometry() {} + virtual int draw() = 0; + + // + // Factory method for all the Geometry objects + // + static Geometry *create(GeomType i); + }; + + struct Point : Geometry { + int draw() { return 1; } + double width() { return 1.0; } + }; + + struct Circle : Geometry { + int draw() { return 2; } + double radius() { return 1.5; } + }; + + // + // Factory method for all the Geometry objects + // + Geometry *Geometry::create(GeomType type) { + switch (type) { + case POINT: return new Point(); + case CIRCLE: return new Circle(); + default: return 0; + } + } + ---- geometry.h -------- + + + You can use the %factory with the Geometry::create method as follows: + + %newobject Geometry::create; + %factory(Geometry *Geometry::create, Point, Circle); + %include "geometry.h" + + and Geometry::create will return a 'Point' or 'Circle' instance + instead of the plain 'Geometry' type. For example, in python: + + circle = Geometry.create(Geometry.CIRCLE) + r = circle.radius() + + where circle is a Circle proxy instance. + + NOTES: remember to fully qualify all the type names and don't + use %factory inside a namespace declaration, ie, instead of + + namespace Foo { + %factory(Geometry *Geometry::create, Point, Circle); + } + + use + + %factory(Foo::Geometry *Foo::Geometry::create, Foo::Point, Foo::Circle); + + +*/ + +%define %_factory_dispatch(Type) +if (!dcast) { + Type *dobj = dynamic_cast<Type *>($1); + if (dobj) { + dcast = 1; + %set_output(SWIG_NewPointerObj(%as_voidptr(dobj),$descriptor(Type *), $owner | %newpointer_flags)); + } +}%enddef + +%define %factory(Method,Types...) +%typemap(out) Method { + int dcast = 0; + %formacro(%_factory_dispatch, Types) + if (!dcast) { + %set_output(SWIG_NewPointerObj(%as_voidptr($1),$descriptor, $owner | %newpointer_flags)); + } +}%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/fragments.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/fragments.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,269 @@ +/* + Fragments + ========= + See the "Typemap fragments" section in the documentation for understanding + fragments. Below is some info on how fragments and automatic type + specialization is used. + + Macros that make the automatic generation of typemaps easier are provided. + + Consider the following code: + + %fragment(SWIG_From_frag(bool), "header") { + static PyObject* + SWIG_From_dec(bool)(bool value) + { + PyObject *obj = value ? Py_True : Py_False; + Py_INCREF(obj); + return obj; + } + } + + %typemap(out, fragment=SWIG_From_frag(bool)) bool { + $result = SWIG_From(bool)($1)); + } + + Here the macros + + SWIG_From_frag => fragment + SWIG_From_dec => declaration + SWIG_From => call + + allow you to define/include a fragment, and declare and call the + 'from-bool' method as needed. In the simpler case, these macros + just return something like + + SWIG_From_frag(bool) => "SWIG_From_bool" + SWIG_From_dec(bool) => SWIG_From_bool + SWIG_From(bool) => SWIG_From_bool + + But they are specialized for the different languages requirements, + such as perl or tcl that requires passing the interpreter pointer, + and also they can manage C++ ugly types, for example: + + SWIG_From_frag(std::complex<double>) => "SWIG_From_std_complex_Sl_double_Sg_" + SWIG_From_dec(std::complex<double>) => SWIG_From_std_complex_Sl_double_Sg_ + SWIG_From(std::complex<double>) => SWIG_From_std_complex_Sl_double_Sg_ + + + Hence, to declare methods to use with typemaps, always use the + SWIG_From* macros. In the same way, the SWIG_AsVal* and SWIG_AsPtr* + set of macros are provided. + +*/ + + +/* ----------------------------------------------------------------------------- + * Define the basic macros to 'normalize' the type fragments + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_AS_DECL_ARGS +#define SWIG_AS_DECL_ARGS +#endif + +#ifndef SWIG_FROM_DECL_ARGS +#define SWIG_FROM_DECL_ARGS +#endif + +#ifndef SWIG_AS_CALL_ARGS +#define SWIG_AS_CALL_ARGS +#endif + +#ifndef SWIG_FROM_CALL_ARGS +#define SWIG_FROM_CALL_ARGS +#endif + +#define %fragment_name(Name, Type...) %string_name(Name) "_" {Type} + +#define SWIG_Traits_frag(Type...) %fragment_name(Traits, Type) +#define SWIG_AsPtr_frag(Type...) %fragment_name(AsPtr, Type) +#define SWIG_AsVal_frag(Type...) %fragment_name(AsVal, Type) +#define SWIG_From_frag(Type...) %fragment_name(From, Type) + +#define SWIG_AsVal_name(Type...) %symbol_name(AsVal, Type) +#define SWIG_AsPtr_name(Type...) %symbol_name(AsPtr, Type) +#define SWIG_From_name(Type...) %symbol_name(From, Type) + +#define SWIG_AsVal_dec(Type...) SWIG_AsVal_name(Type) SWIG_AS_DECL_ARGS +#define SWIG_AsPtr_dec(Type...) SWIG_AsPtr_name(Type) SWIG_AS_DECL_ARGS +#define SWIG_From_dec(Type...) SWIG_From_name(Type) SWIG_FROM_DECL_ARGS + +#define SWIG_AsVal(Type...) SWIG_AsVal_name(Type) SWIG_AS_CALL_ARGS +#define SWIG_AsPtr(Type...) SWIG_AsPtr_name(Type) SWIG_AS_CALL_ARGS +#define SWIG_From(Type...) SWIG_From_name(Type) SWIG_FROM_CALL_ARGS + +/* ------------------------------------------------------------ + * common fragments + * ------------------------------------------------------------ */ + +/* Default compiler options for gcc allow long_long but not LLONG_MAX. + * Define SWIG_NO_LLONG_MAX if this added limits support is not wanted. */ +%fragment("<limits.h>","header") %{ +#include <limits.h> +#if !defined(SWIG_NO_LLONG_MAX) +# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) +# define LLONG_MAX __LONG_LONG_MAX__ +# define LLONG_MIN (-LLONG_MAX - 1LL) +# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) +# endif +#endif +%} + +%fragment("<math.h>","header") %{ +#include <math.h> +%} + +%fragment("<wchar.h>","header") %{ +#include <wchar.h> +#include <limits.h> +#ifndef WCHAR_MIN +# define WCHAR_MIN 0 +#endif +#ifndef WCHAR_MAX +# define WCHAR_MAX 65535 +#endif +%} + +%fragment("<float.h>","header") %{ +#include <float.h> +%} + +%fragment("<stdio.h>","header") %{ +#include <stdio.h> +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# ifndef snprintf +# define snprintf _snprintf +# endif +#endif +%} + +%fragment("<stdlib.h>","header") %{ +#include <stdlib.h> +#ifdef _MSC_VER +# ifndef strtoull +# define strtoull _strtoui64 +# endif +# ifndef strtoll +# define strtoll _strtoi64 +# endif +#endif +%} + +%fragment("<stddef.h>", "header") %{ + #include <stddef.h> +%} + +%fragment("SWIG_isfinite","header",fragment="<math.h>,<float.h>") %{ +/* Getting isfinite working pre C99 across multiple platforms is non-trivial. Users can provide SWIG_isfinite on older platforms. */ +#ifndef SWIG_isfinite +# if defined(isfinite) +# define SWIG_isfinite(X) (isfinite(X)) +# elif defined(_MSC_VER) +# define SWIG_isfinite(X) (_finite(X)) +# elif defined(__sun) && defined(__SVR4) +# include <ieeefp.h> +# define SWIG_isfinite(X) (finite(X)) +# endif +#endif +%} + +%fragment("SWIG_Float_Overflow_Check","header",fragment="<float.h>,SWIG_isfinite") %{ +/* Accept infinite as a valid float value unless we are unable to check if a value is finite */ +#ifdef SWIG_isfinite +# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX) && SWIG_isfinite(X)) +#else +# define SWIG_Float_Overflow_Check(X) ((X < -FLT_MAX || X > FLT_MAX)) +#endif +%} + +/* ----------------------------------------------------------------------------- + * special macros for fragments + * ----------------------------------------------------------------------------- */ + +/* Macros to derive numeric types */ + +%define %numeric_type_from(Type, Base) +%fragment(SWIG_From_frag(Type),"header", + fragment=SWIG_From_frag(Base)) { +SWIGINTERNINLINE SWIG_Object +SWIG_From_dec(Type)(Type value) +{ + return SWIG_From(Base)(value); +} +} +%enddef + +%define %numeric_type_asval(Type, Base, Frag, OverflowCond) +%fragment(SWIG_AsVal_frag(Type),"header", + fragment=Frag, + fragment=SWIG_AsVal_frag(Base)) { +SWIGINTERN int +SWIG_AsVal_dec(Type)(SWIG_Object obj, Type *val) +{ + Base v; + int res = SWIG_AsVal(Base)(obj, &v); + if (SWIG_IsOK(res)) { + if (OverflowCond) { + return SWIG_OverflowError; + } else { + if (val) *val = %numeric_cast(v, Type); + } + } + return res; +} +} +%enddef + +#define %numeric_signed_type_asval(Type, Base, Frag, Min, Max) \ +%numeric_type_asval(Type, Base, Frag, (v < Min || v > Max)) + +#define %numeric_unsigned_type_asval(Type, Base, Frag, Max) \ +%numeric_type_asval(Type, Base, Frag, (v > Max)) + + +/* Macro for 'signed long' derived types */ + +%define %numeric_slong(Type, Frag, Min, Max) +%numeric_type_from(Type, long) +%numeric_signed_type_asval(Type, long, Frag , Min, Max) +%enddef + +/* Macro for 'unsigned long' derived types */ + +%define %numeric_ulong(Type, Frag, Max) +%numeric_type_from(Type, unsigned long) +%numeric_unsigned_type_asval(Type, unsigned long, Frag, Max) +%enddef + + +/* Macro for floating point derived types (original macro) */ + +%define %numeric_double(Type, Frag, Min, Max) +%numeric_type_from(Type, double) +%numeric_signed_type_asval(Type, double, Frag , Min, Max) +%enddef + +/* Macro for floating point derived types */ + +%define %numeric_float(Type, Frag, OverflowCond) +%numeric_type_from(Type, double) +%numeric_type_asval(Type, double, Frag, OverflowCond) +%enddef + + +/* Macros for missing fragments */ + +%define %ensure_fragment(Fragment) +%fragment(`Fragment`,"header") { +%#error "SWIG language implementation must provide the Fragment fragment" +} +%enddef + +%define %ensure_type_fragments(Type) +%fragment(SWIG_From_frag(Type),"header") { +%#error "SWIG language implementation must provide a SWIG_From_frag(Type) fragment" +} +%fragment(SWIG_AsVal_frag(Type),"header") { +%#error "SWIG language implementation must provide a SWIG_AsVal_frag(Type) fragment" +} +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/implicit.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/implicit.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,208 @@ +/* + The %implicit macro allows a SwigType (Class) to be accepted + as an input parameter and use its implicit constructors when needed. + + For example: + + + %implicit(A, int, double, B); + + %inline + { + struct B { }; + struct A + { + int ii; + A(int i) { ii = 1; } + A(double d) { ii = 2; } + A(const B& b) { ii = 3; } + }; + + int get(A a) { return a.ii; } + } + + Here, you can call 'get' as + + get(1) ==> get(A(1)) + get(2.0) ==> get(A(2.0)) + get(B()) ==> get(A(B())) + + and swig will construct an 'A' temporal variable using the + corresponding implicit constructor. + + + The plain implicit macro takes care of simple type list. If it doesn't + work because you are passing template types with commas, then use + the %implicit_{1,2,3} versions and/or the %arg macro. + +*/ + +%define %implicit_type(Type...) +%traits_swigtype(Type); +%enddef + +%define %implicit_frag(Type...) ,fragment=SWIG_Traits_frag(Type) %enddef + +%define %implicit_code(Type...) +{ + Type _v; + int res = swig::asval<Type >(obj, &_v); + if (SWIG_IsOK(res)) { + if (val) *val = new value_type(static_cast<const Type& >(_v)); + return SWIG_AddNewMask(res); + } +} +%enddef + +/* implicit */ + +%define %implicit(Type, ...) + +%formacro_1(%implicit_type,__VA_ARGS__); + +%fragment(SWIG_Traits_frag(Type),"header", + fragment="StdTraits" + %formacro_1(%implicit_frag,__VA_ARGS__)) %{ +namespace swig { + template <> struct traits<Type > { + typedef pointer_category category; + static const char* type_name() { return "Type"; } + }; + + template <> struct traits_asptr< Type > { + typedef Type value_type; + static int asptr(SWIG_Object obj, value_type **val) { + Type *vptr; + static swig_type_info* desc = SWIG_TypeQuery("Type *"); + int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0); + if (SWIG_IsOK(res)) { + if (val) *val = vptr; + return res; + } else { + %formacro_1(%implicit_code,__VA_ARGS__) + } + return SWIG_TypeError; + } + }; +} +%} + +%typemap_traits_ptr(%checkcode(POINTER),Type); +%enddef + +/* implicit_1 */ + + +%define %implicit_1(Type, Imp1) +%traits_swigtype(Imp1); + +%fragment(SWIG_Traits_frag(Type),"header", + fragment="StdTraits", + fragment=SWIG_Traits_frag(Imp1)) %{ +namespace swig { + template <> struct traits< Type > { + typedef pointer_category category; + static const char* type_name() { return "Type"; } + }; + + template <> struct traits_asptr< Type > { + typedef Type value_type; + static int asptr(SWIG_Object obj, value_type **val) { + Type *vptr; + static swig_type_info* desc = SWIG_TypeQuery("Type *"); + int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0); + if (SWIG_IsOK(res)) { + if (val) *val = vptr; + return res; + } else { + %implicit_code(Imp1); + } + return SWIG_TypeError; + } + }; +} +%} + +%typemap_traits_ptr(%checkcode(POINTER),Type); + +%enddef + +/* implicit_2 */ + +%define %implicit_2(Type, Imp1, Imp2) +%traits_swigtype(Imp1); +%traits_swigtype(Imp2); + +%fragment(SWIG_Traits_frag(Type),"header", + fragment="StdTraits", + fragment=SWIG_Traits_frag(Imp1), + fragment=SWIG_Traits_frag(Imp2)) %{ +namespace swig { + template <> struct traits< Type > { + typedef pointer_category category; + static const char* type_name() { return "Type"; } + }; + + template <> struct traits_asptr< Type > { + typedef Type value_type; + static int asptr(SWIG_Object obj, value_type **val) { + Type *vptr; + static swig_type_info* desc = SWIG_TypeQuery("Type *"); + int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0); + if (SWIG_IsOK(res)) { + if (val) *val = vptr; + return SWIG_OLDOBJ; + } else { + %implicit_code(Imp1); + %implicit_code(Imp2); + } + return SWIG_TypeError; + } + }; +} +%} + +%typemap_traits_ptr(%checkcode(POINTER),Type); +%enddef + + +/* implicit_3 */ + +%define %implicit_3(Type, Imp1, Imp2, Imp3) +%traits_swigtype(Imp1); +%traits_swigtype(Imp2); +%traits_swigtype(Imp3); + +%fragment(SWIG_Traits_frag(Type),"header", + fragment="StdTraits", + fragment=SWIG_Traits_frag(Imp1), + fragment=SWIG_Traits_frag(Imp2), + fragment=SWIG_Traits_frag(Imp3)) %{ +namespace swig { + template <> struct traits< Type > { + typedef pointer_category category; + static const char* type_name() { return "Type"; } + }; + + template <> struct traits_asptr< Type > { + typedef Type value_type; + static int asptr(SWIG_Object obj, value_type **val) { + Type *vptr; + static swig_type_info* desc = SWIG_TypeQuery("Type *"); + int res = SWIG_ConvertPtr(obj, (void **)&vptr, desc, 0); + if (SWIG_IsOK(res)) { + if (val) *val = vptr; + return res; + } else { + %implicit_code(Imp1); + %implicit_code(Imp2); + %implicit_code(Imp3); + } + return SWIG_TypeError; + } + }; +} +%} + +%typemap_traits_ptr(%checkcode(POINTER),Type); +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/inoutlist.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/inoutlist.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,296 @@ +/* ------------------------------------------------------------ + * + * Define the IN/OUTPUT typemaps assuming the output parameters are + * returned in a list, i.e., they are not directly modified. + * + * The user should provide the %append_output(result, obj) method, + * via a macro, which append a particular object to the result. + * + * + * In Tcl, for example, the file is used as: + * + * #define %append_output(obj) Tcl_ListObjAppendElement(interp,Tcl_GetObjResult(interp),obj); + * %include <typemaps/inoutlist.swg> + * + * while in Python it is used as: + * + * #define %append_output(obj) $result = SWIG_Python_AppendResult($result, obj) + * %include <typemaps/inoutlist.swg> + * + * where the method SWIG_Python_AppendResult is defined inside the + * %append_output fragment. + * + * If you forget to define %append_output, this file will generate + * an error. + * + * ------------------------------------------------------------ */ + + +// +// Uncomment the following definition if you don't want the in/out +// typemaps by default, ie, you prefer to use typemaps.i. +// +//#define SWIG_INOUT_NODEF + +// +// Use the following definition to enable the INPUT parameters to +// accept both 'by value' and 'pointer' objects. +// +#define SWIG_INPUT_ACCEPT_PTRS + +// ------------------------------------------------------------------------ +// Pointer handling +// +// These mappings provide support for input/output arguments and common +// uses for C/C++ pointers. +// ------------------------------------------------------------------------ + +// INPUT typemaps. +// These remap a C pointer to be an "INPUT" value which is passed by value +// instead of reference. + +/* +The following methods can be applied to turn a pointer into a simple +"input" value. That is, instead of passing a pointer to an object, +you would use a real value instead. + +To use these, suppose you had a C function like this : + + double fadd(double *a, double *b) { + return *a+*b; + } + +You could wrap it with SWIG as follows : + + double fadd(double *INPUT, double *INPUT); + +or you can use the %apply directive : + + %apply double *INPUT { double *a, double *b }; + double fadd(double *a, double *b); + +*/ +#if defined(SWIG_INPUT_ACCEPT_PTRS) +#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK((res = SWIG_ConvertPtr(input,%as_voidptrptr(arg),desc,disown)))) +#else +#define %check_input_ptr(input,arg,desc,disown) (SWIG_IsOK((res = SWIG_ERROR))) +#endif + +%define %_value_input_typemap(code, asval_meth, asval_frag, Type) + %typemap(in,noblock=1,fragment=asval_frag) Type *INPUT ($*ltype temp, int res = 0) { + if (!%check_input_ptr($input,&$1,$descriptor,$disown)) { + Type val; + int ecode = asval_meth($input, &val); + if (!SWIG_IsOK(ecode)) { + %argument_fail(ecode, "$*ltype",$symname, $argnum); + } + temp = %static_cast(val, $*ltype); + $1 = &temp; + res = SWIG_AddTmpMask(ecode); + } + } + %typemap(in,noblock=1,fragment=asval_frag) Type &INPUT($*ltype temp, int res = 0) { + if (!%check_input_ptr($input,&$1,$descriptor,$disown)) { + Type val; + int ecode = asval_meth($input, &val); + if (!SWIG_IsOK(ecode)) { + %argument_fail(ecode, "$*ltype",$symname, $argnum); + } + temp = %static_cast(val, $*ltype); + $1 = &temp; + res = SWIG_AddTmpMask(ecode); + } + } + %typemap(freearg,noblock=1,match="in") Type *INPUT, Type &INPUT { + if (SWIG_IsNewObj(res$argnum)) %delete($1); + } + %typemap(typecheck,noblock=1,precedence=code,fragment=asval_frag) Type *INPUT, Type &INPUT { + void *ptr = 0; + int res = asval_meth($input, 0); + $1 = SWIG_CheckState(res); + if (!$1) { + $1 = %check_input_ptr($input,&ptr,$1_descriptor,0); + } + } +%enddef + +%define %_ptr_input_typemap(code,asptr_meth,asptr_frag,Type) + %typemap(in,noblock=1,fragment=asptr_frag) Type *INPUT(int res = 0) { + res = asptr_meth($input, &$1); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + res = SWIG_AddTmpMask(res); + } + %typemap(in,noblock=1,fragment=asptr_frag) Type &INPUT(int res = 0) { + res = asptr_meth($input, &$1); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + if (!$1) { + %argument_nullref("$type",$symname, $argnum); + } + res = SWIG_AddTmpMask(res); + } + %typemap(freearg,noblock=1,match="in") Type *INPUT, Type &INPUT { + if (SWIG_IsNewObj(res$argnum)) %delete($1); + } + %typemap(typecheck,noblock=1,precedence=code,fragment=asptr_frag) Type *INPUT, Type &INPUT { + int res = asptr_meth($input, (Type**)0); + $1 = SWIG_CheckState(res); + } +%enddef + +// OUTPUT typemaps. These typemaps are used for parameters that +// are output only. The output value is appended to the result as +// a list element. + +/* +The following methods can be applied to turn a pointer into an "output" +value. When calling a function, no input value would be given for +a parameter, but an output value would be returned. In the case of +multiple output values, they are returned in the form of a list. + + +For example, suppose you were trying to wrap the modf() function in the +C math library which splits x into integral and fractional parts (and +returns the integer part in one of its parameters): + + double modf(double x, double *ip); + +You could wrap it with SWIG as follows : + + double modf(double x, double *OUTPUT); + +or you can use the %apply directive : + + %apply double *OUTPUT { double *ip }; + double modf(double x, double *ip); + +The output of the function would be a list containing both output +values. + +*/ + +%define %_value_output_typemap(from_meth, from_frag, Type) + %typemap(in,numinputs=0,noblock=1) + Type *OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ), + Type &OUTPUT ($*1_ltype temp, int res = SWIG_TMPOBJ) { + $1 = &temp; + } + %typemap(argout,noblock=1,fragment=from_frag) Type *OUTPUT, Type &OUTPUT { + if (SWIG_IsTmpObj(res$argnum)) { + %append_output(from_meth((*$1))); + } else { + int new_flags = SWIG_IsNewObj(res$argnum) ? (SWIG_POINTER_OWN | %newpointer_flags) : %newpointer_flags; + %append_output(SWIG_NewPointerObj((void*)($1), $1_descriptor, new_flags)); + } + } +%enddef + + +// INOUT +// Mappings for an argument that is both an input and output +// parameter + +/* +The following methods can be applied to make a function parameter both +an input and output value. This combines the behavior of both the +"INPUT" and "OUTPUT" methods described earlier. Output values are +returned in the form of a list. + +For example, suppose you were trying to wrap the following function : + + void neg(double *x) { + *x = -(*x); + } + +You could wrap it with SWIG as follows : + + void neg(double *INOUT); + +or you can use the %apply directive : + + %apply double *INOUT { double *x }; + void neg(double *x); + +Unlike C, this mapping does not directly modify the input value. +Rather, the modified input value shows up as the return value of the +function. Thus, to apply this function to a variable you might do +this : + + x = neg(x) + +Note : previous versions of SWIG used the symbol 'BOTH' to mark +input/output arguments. This is still supported, but will be slowly +phased out in future releases. + +*/ + +%define %_value_inout_typemap(Type) + %typemap(in) Type *INOUT = Type *INPUT; + %typemap(in) Type &INOUT = Type &INPUT; + %typemap(typecheck) Type *INOUT = Type *INPUT; + %typemap(typecheck) Type &INOUT = Type &INPUT; + %typemap(argout) Type *INOUT = Type *OUTPUT; + %typemap(argout) Type &INOUT = Type &OUTPUT; +%enddef + + +%define %_ptr_inout_typemap(Type) + %_value_inout_typemap(%arg(Type)) + %typemap(typecheck) Type *INOUT = Type *INPUT; + %typemap(typecheck) Type &INOUT = Type &INPUT; + %typemap(freearg) Type *INOUT = Type *INPUT; + %typemap(freearg) Type &INOUT = Type &INPUT; +%enddef + +#ifndef SWIG_INOUT_NODEF + +%define %value_input_typemap(code,asval_meth, asval_frag, Type...) + %_value_input_typemap(%arg(code),%arg(asval_meth),%arg(asval_frag),%arg(Type)) +%enddef + +%define %ptr_input_typemap(code,asval_meth,asval_frag,Type...) + %_ptr_input_typemap(%arg(code),%arg(asval_meth),%arg(asval_frag),%arg(Type)) +%enddef + +%define %value_output_typemap(from_meth,from_frag,Type...) + %_value_output_typemap(%arg(from_meth),%arg(from_frag),%arg(Type)) +%enddef + +#define %value_inout_typemap(Type...) %_value_inout_typemap(%arg(Type)) +#define %ptr_inout_typemap(Type...) %_ptr_inout_typemap(%arg(Type)) + +#else /* You need to include typemaps.i */ + + +#define %value_output_typemap(Type...) +#define %value_input_typemap(Type...) +#define %value_inout_typemap(Type...) +#define %ptr_input_typemap(Type...) +#define %ptr_inout_typemap(Type...) + +#endif /* SWIG_INOUT_DEFAULT */ + +/*---------------------------------------------------------------------- + Front ends. + + use the following macros to define your own IN/OUTPUT/INOUT typemaps + + ------------------------------------------------------------------------*/ +%define %typemaps_inout(Code, AsValMeth, FromMeth, AsValFrag, FromFrag, Type...) + %_value_input_typemap(%arg(Code), %arg(AsValMeth), + %arg(AsValFrag), %arg(Type)); + %_value_output_typemap(%arg(FromMeth), %arg(FromFrag), %arg(Type)); + %_value_inout_typemap(%arg(Type)); +%enddef + +%define %typemaps_inoutn(Code,Type...) + %typemaps_inout(%arg(Code), + %arg(SWIG_AsVal(Type)), + %arg(SWIG_From(Type)), + %arg(SWIG_AsVal_frag(Type)), + %arg(SWIG_From_frag(Type)), + %arg(Type)); +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/misctypes.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/misctypes.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,21 @@ + +/* ------------------------------------------------------------ + * --- ANSI/Posix C/C++ types --- + * ------------------------------------------------------------ */ + + +#ifdef __cplusplus + +%apply size_t { std::size_t }; +%apply const size_t& { const std::size_t& }; + +%apply ptrdiff_t { std::ptrdiff_t }; +%apply const ptrdiff_t& { const std::ptrdiff_t& }; + +#ifndef SWIG_INOUT_NODEF +%apply size_t& { std::size_t& }; +%apply ptrdiff_t& { std::ptrdiff_t& }; +#endif + +#endif + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/primtypes.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/primtypes.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,321 @@ +/* ------------------------------------------------------------ + * Primitive type fragments and macros + * ------------------------------------------------------------ */ + +/* + This file provide fragments and macros for the C/C++ primitive types. + + The file defines default fragments for the following types: + + bool + signed char + unsigned char + signed wchar_t // in C++ + unsigned wchar_t // in C++ + short + unsigned short + int + unsigned int + float + size_t + ptrdiff_t + + which can always be redefined in the swig target language if needed. + + The fragments for the following types, however, always need to be + defined in the target language: + + long + unsigned long + long long + unsigned long long + double + + If they are not provided, an #error directive will appear in the + wrapped code. + + -------------------------------------------------------------------- + + This file provides the macro + + %typemaps_primitive(CheckCode, Type) + + which generates the typemaps for a primitive type with a given + checkcode. It is assumed that the primitive type is 'normalized' and + the corresponding SWIG_AsVal(Type) and SWIG_From(Type) methods are + provided via fragments. + + + The following auxiliary macros (explained with bash pseudo code) are + also defined: + + %apply_ctypes(Macro) + for i in C Type + do + Macro($i) + done + + %apply_cpptypes(Macro) + for i in C++ Type + do + Macro($i) + done + + %apply_ctypes_2(Macro2) + for i in C Type + do + for j in C Type + do + Macro_2($i, $j) + done + done + + %apply_cpptypes_2(Macro2) + for i in C++ Type + do + for j in C++ Type + do + Macro_2($i, $j) + done + done + + %apply_checkctypes(Macro2) + for i in Check Type + do + Macro2(%checkcode($i), $i) + done + +*/ + + +/* ------------------------------------------------------------ + * Primitive type fragments + * ------------------------------------------------------------ */ +/* boolean */ + +%fragment(SWIG_From_frag(bool),"header",fragment=SWIG_From_frag(long)) { +SWIGINTERN SWIG_Object +SWIG_From_dec(bool)(bool value) +{ + return SWIG_From(long)(value ? 1 : 0); +} +} + +%fragment(SWIG_AsVal_frag(bool),"header",fragment=SWIG_AsVal_frag(long)) { +SWIGINTERN int +SWIG_AsVal_dec(bool)(SWIG_Object obj, bool *val) +{ + long v; + int res = SWIG_AsVal(long)(obj, val ? &v : 0); + if (SWIG_IsOK(res)) { + if (val) *val = v ? true : false; + return res; + } + return SWIG_TypeError; +} +} + +/* signed/unsigned char */ + +%numeric_slong(signed char, "<limits.h>", SCHAR_MIN, SCHAR_MAX) +%numeric_ulong(unsigned char, "<limits.h>", UCHAR_MAX) + +/* short/unsigned short */ + +%numeric_slong(short, "<limits.h>", SHRT_MIN, SHRT_MAX) +%numeric_ulong(unsigned short, "<limits.h>", USHRT_MAX) + +/* int/unsigned int */ + +%numeric_slong(int, "<limits.h>", INT_MIN, INT_MAX) +%numeric_ulong(unsigned int, "<limits.h>", UINT_MAX) + +/* signed/unsigned wchar_t */ + +#ifdef __cplusplus +%numeric_slong(signed wchar_t, "<wchar.h>", WCHAR_MIN, WCHAR_MAX) +%numeric_ulong(unsigned wchar_t, "<wchar.h>", UWCHAR_MAX) +#endif + +/* float */ + +%numeric_float(float, "SWIG_Float_Overflow_Check", SWIG_Float_Overflow_Check(v)) + +/* long/unsigned long */ + +%ensure_type_fragments(long) +%ensure_type_fragments(unsigned long) + +/* long long/unsigned long long */ + +%ensure_type_fragments(long long) +%ensure_type_fragments(unsigned long long) + +/* double */ + +%ensure_type_fragments(double) + +/* size_t */ + +%fragment(SWIG_From_frag(size_t),"header",fragment=SWIG_From_frag(unsigned long)) { +SWIGINTERNINLINE SWIG_Object +SWIG_From_dec(size_t)(size_t value) +{ + return SWIG_From(unsigned long)(%numeric_cast(value, unsigned long)); +} +} + +%fragment(SWIG_AsVal_frag(size_t),"header",fragment=SWIG_AsVal_frag(unsigned long)) { +SWIGINTERNINLINE int +SWIG_AsVal_dec(size_t)(SWIG_Object obj, size_t *val) +{ + unsigned long v; + int res = SWIG_AsVal(unsigned long)(obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = %numeric_cast(v, size_t); + return res; +} +} + +/* ptrdiff_t */ + +%fragment(SWIG_From_frag(ptrdiff_t),"header",fragment=SWIG_From_frag(long)) { +SWIGINTERNINLINE SWIG_Object +SWIG_From_dec(ptrdiff_t)(ptrdiff_t value) +{ + return SWIG_From(long)(%numeric_cast(value,long)); +} +} + +%fragment(SWIG_AsVal_frag(ptrdiff_t),"header",fragment=SWIG_AsVal_frag(long)) { +SWIGINTERNINLINE int +SWIG_AsVal_dec(ptrdiff_t)(SWIG_Object obj, ptrdiff_t *val) +{ + long v; + int res = SWIG_AsVal(long)(obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = %numeric_cast(v, ptrdiff_t); + return res; +} +} + + +%fragment("SWIG_CanCastAsInteger","header", + fragment=SWIG_AsVal_frag(double), + fragment="<float.h>", + fragment="<math.h>") { +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} +} + +/* ------------------------------------------------------------ + * Generate the typemaps for primitive type + * ------------------------------------------------------------ */ + +#define %typemaps_primitive(Code, Type) %typemaps_asvalfromn(%arg(Code), Type) + +/* ------------------------------------------------------------ + * Primitive Type Macros + * ------------------------------------------------------------ */ + +/* useful macros to derive typemap declarations from primitive types */ + +%define _apply_macro(macro, arg2, arg1...) +#if #arg1 != "" +macro(%arg(arg1),arg2); +#else +macro(arg2); +#endif +%enddef + +/* Apply macro to the C-types */ +%define %apply_ctypes(Macro, Arg2...) +_apply_macro(Macro, bool , Arg2); +_apply_macro(Macro, signed char , Arg2); +_apply_macro(Macro, unsigned char , Arg2); +_apply_macro(Macro, short , Arg2); +_apply_macro(Macro, unsigned short , Arg2); +_apply_macro(Macro, int , Arg2); +_apply_macro(Macro, unsigned int , Arg2); +_apply_macro(Macro, long , Arg2); +_apply_macro(Macro, unsigned long , Arg2); +_apply_macro(Macro, long long , Arg2); +_apply_macro(Macro, unsigned long long , Arg2); +_apply_macro(Macro, float , Arg2); +_apply_macro(Macro, double , Arg2); +_apply_macro(Macro, char , Arg2); +_apply_macro(Macro, wchar_t , Arg2); +_apply_macro(Macro, size_t , Arg2); +_apply_macro(Macro, ptrdiff_t , Arg2); +%enddef + +/* apply the Macro2(Type1, Type2) to all C types */ +#define %apply_ctypes_2(Macro2) %apply_ctypes(%apply_ctypes, Macro2) + + +/* apply the Macro(Type) to all C++ types */ +%define %apply_cpptypes(Macro, Arg2...) +%apply_ctypes(Macro, Arg2) +_apply_macro(Macro, std::size_t, Arg2); +_apply_macro(Macro, std::ptrdiff_t, Arg2); +_apply_macro(Macro, std::string, Arg2); +_apply_macro(Macro, std::wstring, Arg2); +_apply_macro(Macro, std::complex<float>, Arg2); +_apply_macro(Macro, std::complex<double>, Arg2); +%enddef + +/* apply the Macro2(Type1, Type2) to all C++ types */ +#define %apply_cpptypes_2(Macro2) %apply_cpptypes(%apply_cpptypes, Macro2) + +/* apply the Macro2(CheckCode,Type) to all Checked Types */ +%define %apply_checkctypes(Macro2) +Macro2(%checkcode(BOOL), bool); +Macro2(%checkcode(INT8), signed char); +Macro2(%checkcode(UINT8), unsigned char); +Macro2(%checkcode(INT16), short); +Macro2(%checkcode(UINT16), unsigned short); +Macro2(%checkcode(INT32), int); +Macro2(%checkcode(UINT32), unsigned int); +Macro2(%checkcode(INT64), long); +Macro2(%checkcode(UINT64), unsigned long); +Macro2(%checkcode(INT128), long long); +Macro2(%checkcode(UINT128), unsigned long long); +Macro2(%checkcode(FLOAT), float); +Macro2(%checkcode(DOUBLE), double); +Macro2(%checkcode(CHAR), char); +Macro2(%checkcode(UNICHAR), wchar_t); +Macro2(%checkcode(SIZE), size_t); +Macro2(%checkcode(PTRDIFF), ptrdiff_t); +%enddef + + +/* ------------------------------------------------------------ + * Generate the typemaps for all the primitive types with checkcode + * ------------------------------------------------------------ */ + +%apply_checkctypes(%typemaps_primitive); + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/ptrtypes.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/ptrtypes.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,208 @@ +/* ----------------------------------------------------------------------------- + * ptrtypes.swg + * + * Value typemaps (Type, const Type&) for "Ptr" types, such as swig + * wrapped classes, that define the AsPtr/From methods + * + * To apply them, just use one of the following macros: + * + * %typemaps_asptr(CheckCode, AsPtrMeth, AsPtrFrag, Type) + * %typemaps_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type) + * + * or the simpler and normalize form: + * + * %typemaps_asptrfromn(CheckCode, Type) + * + * Also, you can use the individual typemap definitions: + * + * %ptr_in_typemap(asptr_meth,frag,Type) + * %ptr_varin_typemap(asptr_meth,frag,Type) + * %ptr_typecheck_typemap(check,asptr_meth,frag,Type) + * %ptr_directorout_typemap(asptr_meth,frag,Type) + * ----------------------------------------------------------------------------- */ + +%include <typemaps/valtypes.swg> + +/* in */ + +%define %ptr_in_typemap(asptr_meth,frag,Type...) + %typemap(in,fragment=frag) Type { + Type *ptr = (Type *)0; + int res = asptr_meth($input, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + %argument_fail((ptr ? res : SWIG_TypeError), "$type", $symname, $argnum); + } + $1 = *ptr; + if (SWIG_IsNewObj(res)) %delete(ptr); + } + %typemap(freearg) Type ""; + %typemap(in,fragment=frag) const Type & (int res = SWIG_OLDOBJ) { + Type *ptr = (Type *)0; + res = asptr_meth($input, &ptr); + if (!SWIG_IsOK(res)) { %argument_fail(res,"$type",$symname, $argnum); } + if (!ptr) { %argument_nullref("$type",$symname, $argnum); } + $1 = ptr; + } + %typemap(freearg,noblock=1) const Type & { + if (SWIG_IsNewObj(res$argnum)) %delete($1); + } +%enddef + +/* varin */ + +%define %ptr_varin_typemap(asptr_meth,frag,Type...) + %typemap(varin,fragment=frag) Type { + Type *ptr = (Type *)0; + int res = asptr_meth($input, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + %variable_fail((ptr ? res : SWIG_TypeError), "$type", "$name"); + } + $1 = *ptr; + if (SWIG_IsNewObj(res)) %delete(ptr); + } +%enddef + +#if defined(SWIG_DIRECTOR_TYPEMAPS) +/* directorout */ + +%define %ptr_directorout_typemap(asptr_meth,frag,Type...) + %typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT ($*ltype temp, int swig_ores) { + Type *swig_optr = 0; + swig_ores = $result ? asptr_meth($result, &swig_optr) : 0; + if (!SWIG_IsOK(swig_ores) || !swig_optr) { + %dirout_fail((swig_optr ? swig_ores : SWIG_TypeError),"$type"); + } + temp = *swig_optr; + $1 = &temp; + if (SWIG_IsNewObj(swig_ores)) %delete(swig_optr); + } + + %typemap(directorout,noblock=1,fragment=frag) Type { + Type *swig_optr = 0; + int swig_ores = asptr_meth($input, &swig_optr); + if (!SWIG_IsOK(swig_ores) || !swig_optr) { + %dirout_fail((swig_optr ? swig_ores : SWIG_TypeError),"$type"); + } + $result = *swig_optr; + if (SWIG_IsNewObj(swig_ores)) %delete(swig_optr); + } + + %typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Type* { + Type *swig_optr = 0; + int swig_ores = asptr_meth($input, &swig_optr); + if (!SWIG_IsOK(swig_ores)) { + %dirout_fail(swig_ores,"$type"); + } + $result = swig_optr; + if (SWIG_IsNewObj(swig_ores)) { + swig_acquire_ownership(swig_optr); + } + } + %typemap(directorfree,noblock=1) Type* + { + if (director) { + director->swig_release_ownership(%as_voidptr($input)); + } + } + + %typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Type& { + Type *swig_optr = 0; + int swig_ores = asptr_meth($input, &swig_optr); + if (!SWIG_IsOK(swig_ores)) { + %dirout_fail(swig_ores,"$type"); + } else { + if (!swig_optr) { + %dirout_nullref("$type"); + } + } + $result = swig_optr; + if (SWIG_IsNewObj(swig_ores)) { + swig_acquire_ownership(swig_optr); + } + } + %typemap(directorfree,noblock=1) Type& + { + if (director) { + director->swig_release_ownership(%as_voidptr($input)); + } + } + + + %typemap(directorout,fragment=frag) Type &DIRECTOROUT = Type + +%enddef + +#else + +#define %ptr_directorout_typemap(asptr_meth,frag,Type...) + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + +/* typecheck */ + +%define %ptr_typecheck_typemap(check,asptr_meth,frag,Type...) +%typemap(typecheck,noblock=1,precedence=check,fragment=frag) Type * { + int res = asptr_meth($input, (Type**)(0)); + $1 = SWIG_CheckState(res); +} + +%typemap(typecheck,noblock=1,precedence=check,fragment=frag) Type, const Type& { + int res = asptr_meth($input, (Type**)(0)); + $1 = SWIG_CheckState(res); +} +%enddef + + +/*--------------------------------------------------------------------- + * typemap definition for types with asptr method + *---------------------------------------------------------------------*/ + +%define %typemaps_asptr(CheckCode, AsPtrMeth, AsPtrFrag, Type...) + %fragment(SWIG_AsVal_frag(Type),"header",fragment=SWIG_AsPtr_frag(Type)) { + SWIGINTERNINLINE int + SWIG_AsVal(Type)(SWIG_Object obj, Type *val) + { + Type *v = (Type *)0; + int res = SWIG_AsPtr(Type)(obj, &v); + if (!SWIG_IsOK(res)) return res; + if (v) { + if (val) *val = *v; + if (SWIG_IsNewObj(res)) { + %delete(v); + res = SWIG_DelNewMask(res); + } + return res; + } + return SWIG_ERROR; + } + } + %ptr_in_typemap(%arg(AsPtrMeth), %arg(AsPtrFrag), Type); + %ptr_varin_typemap(%arg(AsPtrMeth), %arg(AsPtrFrag), Type); + %ptr_directorout_typemap(%arg(AsPtrMeth), %arg(AsPtrFrag), Type); + %ptr_typecheck_typemap(%arg(CheckCode), %arg(AsPtrMeth),%arg(AsPtrFrag), Type); + %ptr_input_typemap(%arg(CheckCode),%arg(AsPtrMeth),%arg(AsPtrFrag),Type); +%enddef + +/*--------------------------------------------------------------------- + * typemap definition for types with asptr/from methods + *---------------------------------------------------------------------*/ + +%define %typemaps_asptrfrom(CheckCode, AsPtrMeth, FromMeth, AsPtrFrag, FromFrag, Type...) + %typemaps_asptr(%arg(CheckCode), %arg(AsPtrMeth), %arg(AsPtrFrag), Type) + %typemaps_from(%arg(FromMeth), %arg(FromFrag), Type); + %value_output_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %ptr_inout_typemap(Type); +%enddef + +/*--------------------------------------------------------------------- + * typemap definition for types with for 'normalized' asptr/from methods + *---------------------------------------------------------------------*/ + +%define %typemaps_asptrfromn(CheckCode, Type...) +%typemaps_asptrfrom(%arg(CheckCode), + %arg(SWIG_AsPtr(Type)), + %arg(SWIG_From(Type)), + %arg(SWIG_AsPtr_frag(Type)), + %arg(SWIG_From_frag(Type)), + Type); +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/std_except.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/std_except.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,36 @@ +%include <typemaps/exception.swg> + +/* + Mark all of std exception classes as "exception classes" via + the "exceptionclass" feature. + + If needed, you can disable it by using %noexceptionclass. +*/ + +%define %std_exception_map(Exception, Code) + %exceptionclass Exception; +#if !defined(SWIG_STD_EXCEPTIONS_AS_CLASSES) + %typemap(throws,noblock=1) Exception { + SWIG_exception_fail(Code, $1.what()); + } + %ignore Exception; + struct Exception { + }; +#endif +%enddef + +namespace std { + %std_exception_map(bad_exception, SWIG_SystemError); + %std_exception_map(domain_error, SWIG_ValueError); + %std_exception_map(exception, SWIG_SystemError); + %std_exception_map(invalid_argument, SWIG_ValueError); + %std_exception_map(length_error, SWIG_IndexError); + %std_exception_map(logic_error, SWIG_RuntimeError); + %std_exception_map(out_of_range, SWIG_IndexError); + %std_exception_map(overflow_error, SWIG_OverflowError); + %std_exception_map(range_error, SWIG_OverflowError); + %std_exception_map(runtime_error, SWIG_RuntimeError); + %std_exception_map(underflow_error, SWIG_OverflowError); +} + +%include <std/std_except.i> diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/std_string.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/std_string.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,27 @@ +// +// String +// + + +#ifndef SWIG_STD_BASIC_STRING +#define SWIG_STD_STRING + +%include <typemaps/std_strings.swg> + +%{ +#include <string> +%} + +namespace std +{ + %naturalvar string; + class string; +} + +%typemaps_std_string(std::string, char, SWIG_AsCharPtrAndSize, SWIG_FromCharPtrAndSize, %checkcode(STDSTRING)); + +#else + +%include <std/std_string.i> + +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/std_strings.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/std_strings.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,78 @@ + +/* defining the String asptr/from methods */ + +%define %std_string_asptr(String, Char, SWIG_AsCharPtrAndSize, Frag) +%fragment(SWIG_AsPtr_frag(String),"header",fragment=Frag) { +SWIGINTERN int +SWIG_AsPtr_dec(String)(SWIG_Object obj, String **val) +{ + Char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ; + if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) { + if (buf) { + if (val) *val = new String(buf, size - 1); + if (alloc == SWIG_NEWOBJ) %delete_array(buf); + return SWIG_NEWOBJ; + } else { + if (val) *val = 0; + return SWIG_OLDOBJ; + } + } else { + static int init = 0; + static swig_type_info* descriptor = 0; + if (!init) { + descriptor = SWIG_TypeQuery(#String " *"); + init = 1; + } + if (descriptor) { + String *vptr; + int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0); + if (SWIG_IsOK(res) && val) *val = vptr; + return res; + } + } + return SWIG_ERROR; +} +} +%enddef + +%define %std_string_from(String, SWIG_FromCharPtrAndSize, Frag) +%fragment(SWIG_From_frag(String),"header",fragment=Frag) { +SWIGINTERNINLINE SWIG_Object +SWIG_From_dec(String)(const String& s) +{ + return SWIG_FromCharPtrAndSize(s.data(), s.size()); +} +} +%enddef + +%define %std_string_asval(String) +%fragment(SWIG_AsVal_frag(String),"header", fragment=SWIG_AsPtr_frag(String)) { +SWIGINTERN int +SWIG_AsVal_dec(String)(SWIG_Object obj, String *val) +{ + String* v = (String *) 0; + int res = SWIG_AsPtr(String)(obj, &v); + if (!SWIG_IsOK(res)) return res; + if (v) { + if (val) *val = *v; + if (SWIG_IsNewObj(res)) { + %delete(v); + res = SWIG_DelNewMask(res); + } + return res; + } + return SWIG_ERROR; +} +} +%enddef + + +%define %typemaps_std_string(String, Char, AsPtrMethod, FromMethod, CheckCode) + +%std_string_asptr(String, Char, AsPtrMethod, #AsPtrMethod) +%std_string_asval(String) +%std_string_from(String, FromMethod, #FromMethod) + +%typemaps_asptrfromn(%arg(CheckCode), String); + +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/std_wstring.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/std_wstring.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,26 @@ +%include <typemaps/wstring.swg> + +#ifndef SWIG_STD_BASIC_STRING +#define SWIG_STD_WSTRING + +%include <typemaps/std_strings.swg> + +%{ +#include <cwchar> +#include <string> +%} + +namespace std +{ + %naturalvar wstring; + class wstring; +} + +%typemaps_std_string(std::wstring, wchar_t, SWIG_AsWCharPtrAndSize, SWIG_FromWCharPtrAndSize, %checkcode(STDUNISTRING)); + + +#else + +%include <std/std_wstring.i> + +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/string.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/string.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,24 @@ +%ensure_fragment(SWIG_AsCharPtrAndSize) +%ensure_fragment(SWIG_FromCharPtrAndSize) + +%types(char *); + +%fragment("SWIG_pchar_descriptor","header") { +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} +} + + +%include <typemaps/strings.swg> +%typemaps_string(%checkcode(STRING), %checkcode(CHAR), + char, Char, SWIG_AsCharPtrAndSize, SWIG_FromCharPtrAndSize, strlen, + "<limits.h>", CHAR_MIN, CHAR_MAX) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/strings.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/strings.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,638 @@ +// +// Use the macro SWIG_PRESERVE_CARRAY_SIZE if you prefer to preserve +// the size of char arrays, ie +// ------------------------------------------ +// C Side => Language Side +// ------------------------------------------ +// char name[5] = "hola" => 'hola\0' +// +// the default behaviour is +// +// char name[5] = "hola" => 'hola' +// +// +//#define SWIG_PRESERVE_CARRAY_SIZE + +/* ------------------------------------------------------------ + * String typemaps for type Char (char or wchar_t) + * ------------------------------------------------------------ */ + +%define %_typemap_string(StringCode, + Char, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + SWIG_AsCharPtr, + SWIG_FromCharPtr, + SWIG_AsCharArray, + SWIG_NewCopyCharArray, + SWIG_DeleteCharArray) + +/* in */ + +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtr) + Char * (int res, Char *buf = 0, int alloc = 0), + const Char * (int res, Char *buf = 0, int alloc = 0) { + res = SWIG_AsCharPtr($input, &buf, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $1 = %reinterpret_cast(buf, $1_ltype); +} +%typemap(freearg,noblock=1,match="in") Char *, const Char * { + if (alloc$argnum == SWIG_NEWOBJ) SWIG_DeleteCharArray(buf$argnum); +} + +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtr) Char const*& (int res, Char *buf = 0, int alloc = 0) { + res = SWIG_AsCharPtr($input, &buf, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $1 = &buf; +} +%typemap(freearg, noblock=1,match="in") Char const*& { + if (alloc$argnum == SWIG_NEWOBJ) SWIG_DeleteCharArray(buf$argnum); +} + +/* out */ + +%typemap(out,noblock=1,fragment=#SWIG_FromCharPtr) Char *, const Char * { + %set_output(SWIG_FromCharPtr((const Char *)$1)); +} + + +%typemap(out,noblock=1,fragment=#SWIG_FromCharPtr) Char const*& { + %set_output(SWIG_FromCharPtr(*$1)); +} + +%typemap(newfree,noblock=1) Char * { + SWIG_DeleteCharArray($1); +} + +/* varin */ + +%typemap(varin,fragment=#SWIG_AsCharPtrAndSize) Char * { + Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ; + int res = SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc); + if (!SWIG_IsOK(res)) { + %variable_fail(res,"$type","$name"); + } + if ($1) SWIG_DeleteCharArray($1); + if (alloc == SWIG_NEWOBJ) { + $1 = cptr; + } else { + $1 = csize ? ($1_type)SWIG_NewCopyCharArray(cptr, csize, Char) : 0; + } +} + +%typemap(varin,fragment=#SWIG_AsCharPtrAndSize,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const Char * { + Char *cptr = 0; size_t csize = 0; int alloc = SWIG_NEWOBJ; + int res = SWIG_AsCharPtrAndSize($input, &cptr, &csize, &alloc); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + if (alloc == SWIG_NEWOBJ) { + $1 = cptr; + } else { + $1 = csize ? ($1_type)SWIG_NewCopyCharArray(cptr, csize, Char) : 0; + } +} + +/* varout */ + +%typemap(varout,noblock=1,fragment=#SWIG_FromCharPtr) Char *, const Char * { + %set_varoutput(SWIG_FromCharPtr($1)); +} + +/* memberin */ + +%typemap(memberin,noblock=1) Char * { + if ($1) SWIG_DeleteCharArray($1); + if ($input) { + size_t size = SWIG_CharPtrLen(%reinterpret_cast($input, const Char *)) + 1; + $1 = ($1_type)SWIG_NewCopyCharArray(%reinterpret_cast($input, const Char *), size, Char); + } else { + $1 = 0; + } +} + +%typemap(memberin,noblock=1,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const Char * { + if ($input) { + size_t size = SWIG_CharPtrLen(%reinterpret_cast(%reinterpret_cast($input, const Char *), const Char *)) + 1; + $1 = ($1_type)SWIG_NewCopyCharArray($input, size, Char); + } else { + $1 = 0; + } +} + +/* globalin */ + +%typemap(globalin,noblock=1) Char * { + if ($1) SWIG_DeleteCharArray($1); + if ($input) { + size_t size = SWIG_CharPtrLen(%reinterpret_cast(%reinterpret_cast($input, const Char *), const Char *)) + 1; + $1 = ($1_type)SWIG_NewCopyCharArray($input, size, Char); + } else { + $1 = 0; + } +} + +%typemap(globalin,noblock=1,warning=SWIGWARN_TYPEMAP_CHARLEAK_MSG) const Char * { + if ($input) { + size_t size = SWIG_CharPtrLen($input) + 1; + $1 = ($1_type)SWIG_NewCopyCharArray($input, size, Char); + } else { + $1 = 0; + } +} + +/* constant */ + +%typemap(constcode,noblock=1,fragment=#SWIG_FromCharPtr) + Char *, Char const*, Char * const, Char const* const { + %set_constant("$symname", SWIG_FromCharPtr($value)); +} + + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ + +%typemap(directorin,noblock=1,fragment=#SWIG_FromCharPtr) + Char *, Char const*, Char *const, Char const *const, + Char const *&, Char *const &, Char const *const & { + $input = SWIG_FromCharPtr((const Char *)$1); +} + + +/* directorout */ + +%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Char * (int res, Char *buf = 0, int alloc = SWIG_NEWOBJ) { + res = SWIG_AsCharPtr($input, &buf, &alloc); + if (!SWIG_IsOK(res)) { + %dirout_fail(res, "$type"); + } + if (alloc == SWIG_NEWOBJ) { + swig_acquire_ownership_array(buf); + } + $result = %reinterpret_cast(buf, $1_ltype); +} +%typemap(directorfree,noblock=1) Char * +{ + if (director) { + director->swig_release_ownership(%as_voidptr($input)); + } +} + + +%typemap(directorout,noblock=1,fragment=#SWIG_AsCharPtr,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) Char *const& (int res, Char *buf = 0, int alloc = SWIG_NEWOBJ), Char const*const& (int res, Char *buf = 0, int alloc = SWIG_NEWOBJ) { + res = SWIG_AsCharPtr($input, &buf, &alloc); + if (!SWIG_IsOK(res)) { + %dirout_fail(res, "$type"); + } + static $*1_ltype tmp = buf; + $result = &tmp; + if (alloc == SWIG_NEWOBJ) { + swig_acquire_ownership_array(buf); + } +} +%typemap(directorfree,noblock=1) + Char * const&, Char const* const& { + if (director) { + director->swig_release_ownership(%as_voidptr(*$input)); + } +} + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + +/* typecheck */ + +%typemap(typecheck,noblock=1,precedence=StringCode, + fragment=#SWIG_AsCharPtr) Char *, const Char *, Char const*& { + int res = SWIG_AsCharPtr($input, 0, 0); + $1 = SWIG_CheckState(res); +} + + +/* throws */ + +%typemap(throws,noblock=1,fragment=#SWIG_FromCharPtr) Char * { + %raise(SWIG_FromCharPtr($1), "$type", 0); +} + + +/* ------------------------------------------------------------ + * Unknown size const Character array Char[ANY] handling + * ------------------------------------------------------------ */ + +%apply Char * { Char [] }; +%apply const Char * { const Char [] }; + +%typemap(varin,noblock=1,warning="462:Unable to set variable of type Char []") Char [] +{ + %variable_fail(SWIG_AttributeError, "$type", "read-only $name"); +} + + +/* ------------------------------------------------------------ + * Fixed size Character array Char[ANY] handling + * ------------------------------------------------------------ */ + +/* memberin and globalin typemaps */ + +%typemap(memberin,noblock=1) Char [ANY] +{ + if ($input) memcpy($1,$input,$1_dim0*sizeof(Char)); + else memset($1,0,$1_dim0*sizeof(Char)); +} + +%typemap(globalin,noblock=1) Char [ANY] +{ + if ($input) memcpy($1,$input,$1_dim0*sizeof(Char)); + else memset($1,0,$1_dim0*sizeof(Char)); +} + +/* in */ + +%typemap(in,noblock=1,fragment=#SWIG_AsCharArray) + Char [ANY] (Char temp[$1_dim0], int res), + const Char [ANY](Char temp[$1_dim0], int res) +{ + res = SWIG_AsCharArray($input, temp, $1_dim0); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $1 = %reinterpret_cast(temp, $1_ltype); +} +%typemap(freearg) Char [ANY], const Char [ANY] ""; + +%typemap(in,noblock=1,fragment=#SWIG_AsCharArray) const Char (&)[ANY] (Char temp[$1_dim0], int res) +{ + res = SWIG_AsCharArray($input, temp, $1_dim0); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $1 = &temp; +} +%typemap(freearg) const Char (&)[ANY] ""; + +%typemap(out,fragment=#SWIG_FromCharPtrAndSize) + Char [ANY], const Char[ANY] +{ + size_t size = $1_dim0; +%#ifndef SWIG_PRESERVE_CARRAY_SIZE + while (size && ($1[size - 1] == '\0')) --size; +%#endif + %set_output(SWIG_FromCharPtrAndSize($1, size)); +} + +/* varin */ + +%typemap(varin,fragment=#SWIG_AsCharArray) Char [ANY] +{ + int res = SWIG_AsCharArray($input, $1, $1_dim0); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } +} + +/* varout */ + +%typemap(varout,noblock=1,fragment=#SWIG_FromCharPtrAndSize) + Char [ANY], const Char [ANY] { + size_t size = $1_dim0; +%#ifndef SWIG_PRESERVE_CARRAY_SIZE + while (size && ($1[size - 1] == '\0')) --size; +%#endif + %set_varoutput(SWIG_FromCharPtrAndSize($1, size)); +} + +/* constant */ + +%typemap(constcode,fragment=#SWIG_FromCharPtrAndSize) + Char [ANY], const Char [ANY] +{ + size_t size = $value_dim0; +%#ifndef SWIG_PRESERVE_CARRAY_SIZE + while (size && ($value[size - 1] == '\0')) --size; +%#endif + %set_constant("$symname", SWIG_FromCharPtrAndSize($value,size)); +} + + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ +%typemap(directorin,fragment=#SWIG_FromCharPtrAndSize) + Char [ANY], const Char [ANY] +{ + size_t size = $1_dim0; +%#ifndef SWIG_PRESERVE_CARRAY_SIZE + while (size && ($1[size - 1] == '\0')) --size; +%#endif + $input = SWIG_FromCharPtrAndSize($1, size); +} + +/* directorout */ + +%typemap(directorout,noblock=1,fragment=#SWIG_AsCharArray) + Char [ANY] (Char temp[$result_dim0]), + const Char [ANY] (Char temp[$result_dim0], int res) +{ + res = SWIG_AsCharArray($input, temp, $result_dim0); + if (!SWIG_IsOK(res)) { + %dirout_fail(res, "$type"); + } + $result = temp; +} + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + +/* typecheck */ + +%typemap(typecheck,noblock=1,precedence=StringCode, + fragment=#SWIG_AsCharArray) + Char [ANY], const Char[ANY] { + int res = SWIG_AsCharArray($input, (Char *)0, $1_dim0); + $1 = SWIG_CheckState(res); +} + + +/* throws */ + +%typemap(throws,fragment=#SWIG_FromCharPtrAndSize) + Char [ANY], const Char[ANY] +{ + size_t size = $1_dim0; +%#ifndef SWIG_PRESERVE_CARRAY_SIZE + while (size && ($1[size - 1] == '\0')) --size; +%#endif + %raise(SWIG_FromCharPtrAndSize($1, size), "$type", 0); +} + +/* ------------------------------------------------------------------- + * --- Really fix size Char arrays, including '\0'chars at the end --- + * ------------------------------------------------------------------- */ + +%typemap(varout,noblock=1,fragment=#SWIG_FromCharPtrAndSize) + Char FIXSIZE[ANY], const Char FIXSIZE[ANY] +{ + %set_varoutput(SWIG_FromCharPtrAndSize($1, $1_dim0)); +} + +%typemap(out,noblock=1,fragment=#SWIG_FromCharPtrAndSize) + Char FIXSIZE[ANY], const Char FIXSIZE[ANY] +{ + %set_output(SWIG_FromCharPtrAndSize($1, $1_dim0)); +} + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +%typemap(directorin,noblock=1,fragment=#SWIG_FromCharPtrAndSize) + Char FIXSIZE[ANY], const Char FIXSIZE[ANY] +{ + $input = SWIG_FromCharPtrAndSize($1, $1_dim0); +} + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + +%typemap(throws,noblock=1,fragment=#SWIG_FromCharPtrAndSize) + Char FIXSIZE[ANY], const Char FIXSIZE[ANY] { + %raise(SWIG_FromCharPtrAndSize($1, $1_dim0), "$type", 0); +} + +/* ------------------------------------------------------------ + * --- String & length --- + * ------------------------------------------------------------ */ + +/* Here len doesn't include the '0' terminator */ +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) + (Char *STRING, size_t LENGTH) (int res, Char *buf = 0, size_t size = 0, int alloc = 0), + (const Char *STRING, size_t LENGTH) (int res, Char *buf = 0, size_t size = 0, int alloc = 0) +{ + res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $1 = %reinterpret_cast(buf, $1_ltype); + $2 = %numeric_cast(size - 1, $2_ltype); +} +%typemap(freearg,noblock=1,match="in") (Char *STRING, size_t LENGTH) { + if (alloc$argnum == SWIG_NEWOBJ) SWIG_DeleteCharArray(buf$argnum); +} +/* old 'int' form */ +%typemap(in) (Char *STRING, int LENGTH) = (Char *STRING, size_t LENGTH); +%typemap(freearg) (Char *STRING, int LENGTH) = (Char *STRING, size_t LENGTH); + + +/* Here size includes the '0' terminator */ +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) + (Char *STRING, size_t SIZE) (int res, Char *buf = 0, size_t size = 0, int alloc = 0), + (const Char *STRING, size_t SIZE) (int res, Char *buf = 0, size_t size = 0, int alloc = 0) +{ + res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $1 = %reinterpret_cast(buf, $1_ltype); + $2 = %numeric_cast(size, $2_ltype); +} +%typemap(freearg,noblock=1,match="in") (Char *STRING, size_t SIZE) { + if (alloc$argnum == SWIG_NEWOBJ) SWIG_DeleteCharArray(buf$argnum); +} +/* old 'int' form */ +%typemap(in) (Char *STRING, int SIZE) = (Char *STRING, size_t SIZE); +%typemap(freearg) (Char *STRING, int SIZE) = (Char *STRING, size_t SIZE); + + +/* reverse order versions */ + +/* Here len doesn't include the '0' terminator */ +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) + (size_t LENGTH, Char *STRING) (int res, Char *buf = 0, size_t size = 0, int alloc = 0), + (size_t LENGTH, const Char *STRING) (int res, Char *buf = 0, size_t size = 0, int alloc = 0) +{ + res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } + $2 = %reinterpret_cast(buf, $2_ltype) ; + $1 = %numeric_cast(size - 1, $1_ltype) ; +} +%typemap(freearg, noblock=1, match="in") (size_t LENGTH, Char *STRING) { + if (alloc$argnum == SWIG_NEWOBJ) SWIG_DeleteCharArray(buf$argnum); +} +/* old 'int' form */ +%typemap(in) (int LENGTH, Char *STRING) = (size_t LENGTH, Char *STRING); +%typemap(freearg) (int LENGTH, Char *STRING) = (size_t LENGTH, Char *STRING); + +/* Here size includes the '0' terminator */ +%typemap(in,noblock=1,fragment=#SWIG_AsCharPtrAndSize) + (size_t SIZE, Char *STRING) (int res, Char *buf = 0, size_t size = 0, int alloc = 0), + (size_t SIZE, const Char *STRING) (int res, Char *buf = 0, size_t size = 0, int alloc = 0) +{ + res = SWIG_AsCharPtrAndSize($input, &buf, &size, &alloc); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type",$symname, $argnum); + } + $2 = %reinterpret_cast(buf, $2_ltype) ; + $1 = %numeric_cast(size, $1_ltype) ; +} +%typemap(freearg, noblock=1, match="in") (size_t SIZE, Char *STRING) { + if (alloc$argnum == SWIG_NEWOBJ) SWIG_DeleteCharArray(buf$argnum); +} +/* old 'int' form */ +%typemap(in) (int SIZE, Char *STRING) = (size_t SIZE, Char *STRING); +%typemap(freearg) (int SIZE, Char *STRING) = (size_t SIZE, Char *STRING); + + +%enddef + + +/* ------------------------------------------------------------ + * --- String fragment methods --- + * ------------------------------------------------------------ */ + + +%define %_typemap2_string(StringCode, CharCode, + Char, CharName, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + SWIG_NewCopyCharArray, + SWIG_DeleteCharArray, + FragLimits, CHAR_MIN, CHAR_MAX) + +%fragment("SWIG_From"#CharName"Ptr","header",fragment=#SWIG_FromCharPtrAndSize) { +SWIGINTERNINLINE SWIG_Object +SWIG_From##CharName##Ptr(const Char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? SWIG_CharPtrLen(cptr) : 0)); +} +} + +%fragment("SWIG_From"#CharName"Array","header",fragment=#SWIG_FromCharPtrAndSize) { +SWIGINTERNINLINE SWIG_Object +SWIG_From##CharName##Array(const Char *cptr, size_t size) +{ + return SWIG_FromCharPtrAndSize(cptr, size); +} +} + +%fragment("SWIG_As" #CharName "Ptr","header",fragment=#SWIG_AsCharPtrAndSize) { +%define_as(SWIG_As##CharName##Ptr(obj, val, alloc), SWIG_AsCharPtrAndSize(obj, val, NULL, alloc)) +} + +%fragment("SWIG_As" #CharName "Array","header",fragment=#SWIG_AsCharPtrAndSize) { +SWIGINTERN int +SWIG_As##CharName##Array(SWIG_Object obj, Char *val, size_t size) +{ + Char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ; + int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc); + if (SWIG_IsOK(res)) { + if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize; + if (csize <= size) { + if (val) { + if (csize) memcpy(val, cptr, csize*sizeof(Char)); + if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(Char)); + } + if (alloc == SWIG_NEWOBJ) { + SWIG_DeleteCharArray(cptr); + res = SWIG_DelNewMask(res); + } + return res; + } + if (alloc == SWIG_NEWOBJ) SWIG_DeleteCharArray(cptr); + } + return SWIG_TypeError; +} +} + +/* Char */ + +%fragment(SWIG_From_frag(Char),"header",fragment=#SWIG_FromCharPtrAndSize) { +SWIGINTERNINLINE SWIG_Object +SWIG_From_dec(Char)(Char c) +{ + return SWIG_FromCharPtrAndSize(&c,1); +} +} + +%fragment(SWIG_AsVal_frag(Char),"header", + fragment="SWIG_As"#CharName"Array", + fragment=FragLimits, + fragment=SWIG_AsVal_frag(long)) { +SWIGINTERN int +SWIG_AsVal_dec(Char)(SWIG_Object obj, Char *val) +{ + int res = SWIG_As##CharName##Array(obj, val, 1); + if (!SWIG_IsOK(res)) { + long v; + res = SWIG_AddCast(SWIG_AsVal(long)(obj, &v)); + if (SWIG_IsOK(res)) { + if ((CHAR_MIN <= v) && (v <= CHAR_MAX)) { + if (val) *val = %numeric_cast(v, Char); + } else { + res = SWIG_OverflowError; + } + } + } + return res; +} +} + +%_typemap_string(StringCode, + Char, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + SWIG_As##CharName##Ptr, + SWIG_From##CharName##Ptr, + SWIG_As##CharName##Array, + SWIG_NewCopyCharArray, + SWIG_DeleteCharArray) + +%enddef + + +/* ------------------------------------------------------------ + * String typemaps and fragments, with default allocators + * ------------------------------------------------------------ */ + +%define %typemaps_string(StringCode, CharCode, + Char, CharName, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + FragLimits, CHAR_MIN, CHAR_MAX) +%_typemap2_string(StringCode, CharCode, + Char, CharName, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + %new_copy_array, + %delete_array, + FragLimits, CHAR_MIN, CHAR_MAX) +%enddef + +/* ------------------------------------------------------------ + * String typemaps and fragments, with custom allocators + * ------------------------------------------------------------ */ + +%define %typemaps_string_alloc(StringCode, CharCode, + Char, CharName, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + SWIG_NewCopyCharArray, + SWIG_DeleteCharArray, + FragLimits, CHAR_MIN, CHAR_MAX) +%_typemap2_string(StringCode, CharCode, + Char, CharName, + SWIG_AsCharPtrAndSize, + SWIG_FromCharPtrAndSize, + SWIG_CharPtrLen, + SWIG_NewCopyCharArray, + SWIG_DeleteCharArray, + FragLimits, CHAR_MIN, CHAR_MAX) +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/swigmacros.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/swigmacros.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,245 @@ +/* ----------------------------------------------------------------------------- + * SWIG API. Portion only visible from SWIG + * ----------------------------------------------------------------------------- */ +/* + This file implements the internal macros of the 'SWIG API', which + are useful to implement all the SWIG target languges. + + Basic preprocessor macros: + -------------------------- + + %arg(Arg) Safe argument wrap + %str(Arg) Stringtify the argument + %begin_block Begin a execution block + %end_block End a execution block + %block(Block) Execute Block as a excecution block + %define_as(Def, Val) Define 'Def' as 'Val', expanding Def and Val first + %ifcplusplus(V1, V2) if C++ Mode; then V1; else V2; fi + + + Casting Operations: + ------------------- + + SWIG provides the following casting macros, which implement the + corresponding C++ casting operations: + + %const_cast(a, Type) const_cast<Type >(a) + %static_cast(a, Type) static_cast<Type >(a) + %reinterpret_cast(a, Type) reinterpret_cast<Type >(a) + %numeric_cast(a, Type) static_cast<Type >(a) + %as_voidptr(a) const_cast<void *>(static_cast<const void *>(a)) + %as_voidptrptr(a) reinterpret_cast<void **>(a) + + or their C unsafe versions. In C++ we use the safe version unless + SWIG_NO_CPLUSPLUS_CAST is defined (usually via the -nocppcast swig flag). + + + Memory allocation: + ------------------ + + These allocation/freeing macros are safe to use in C or C++ and + dispatch the proper new/delete/delete[] or free/malloc calls as + needed. + + %new_instance(Type) Allocate a new instance of given Type + %new_copy(value,Type) Allocate and initialize a new instance with 'value' + %new_array(size,Type) Allocate a new array with given size and Type + %new_copy_array(cptr,size,Type) Allocate and initialize a new array from 'cptr' + %delete(cptr) Delete an instance + %delete_array(cptr) Delete an array + + + Auxiliary loop macros: + ---------------------- + + %formacro(Macro, Args...) or %formacro_1(Macro, Args...) + for i in Args + do + Macro($i) + done + + %formacro_2(Macro2, Args...) + for i,j in Args + do + Macro2($i, $j) + done + + + Flags and conditional macros: + ----------------------------- + + %mark_flag(flag) + flag := True + + %evalif(flag,expr) + if flag; then + expr + fi + + %evalif_2(flag1 flag2,expr) + if flag1 and flag2; then + expr + fi + + +*/ +/* ----------------------------------------------------------------------------- + * Basic preprocessor macros + * ----------------------------------------------------------------------------- */ + +#define %arg(Arg...) Arg +#define %str(Arg) `Arg` +#ifndef %begin_block +# define %begin_block do { +#endif +#ifndef %end_block +# define %end_block } while(0) +#endif +#define %block(Block...) %begin_block Block; %end_block + +/* define a new macro */ +%define %define_as(Def, Val...)%#define Def Val %enddef + +/* include C++ or else value */ +%define %ifcplusplus(cppval, nocppval) +#ifdef __cplusplus +cppval +#else +nocppval +#endif +%enddef + +/* insert the SWIGVERSION in the interface and the wrapper code */ +#if SWIG_VERSION +%insert("header") { +%define_as(SWIGVERSION, SWIG_VERSION) +%#define SWIG_VERSION SWIGVERSION +} +#endif + + + +/* ----------------------------------------------------------------------------- + * Casting operators + * ----------------------------------------------------------------------------- */ + +#if defined(SWIG_NO_CPLUSPLUS_CAST) +/* Disable 'modern' cplusplus casting operators */ +# if defined(SWIG_CPLUSPLUS_CAST) +# undef SWIG_CPLUSPLUS_CAST +# endif +#endif + +#if defined(__cplusplus) && defined(SWIG_CPLUSPLUS_CAST) +# define %const_cast(a,Type...) const_cast< Type >(a) +# define %static_cast(a,Type...) static_cast< Type >(a) +# define %reinterpret_cast(a,Type...) reinterpret_cast< Type >(a) +# define %numeric_cast(a,Type...) static_cast< Type >(a) +#else /* C case */ +# define %const_cast(a,Type...) (Type)(a) +# define %static_cast(a,Type...) (Type)(a) +# define %reinterpret_cast(a,Type...) (Type)(a) +# define %numeric_cast(a,Type...) (Type)(a) +#endif /* __cplusplus */ + + +#define %as_voidptr(a) SWIG_as_voidptr(a) +#define %as_voidptrptr(a) SWIG_as_voidptrptr(a) + +%insert("header") { +%define_as(SWIG_as_voidptr(a), %const_cast(%static_cast(a,const void *), void *)) +%define_as(SWIG_as_voidptrptr(a), ((void)%as_voidptr(*a),%reinterpret_cast(a, void**))) +} + + +/* ----------------------------------------------------------------------------- + * Allocating/freeing elements + * ----------------------------------------------------------------------------- */ + +#if defined(__cplusplus) +# define %new_instance(Type...) (new Type) +# define %new_copy(val,Type...) (new Type(%static_cast(val, const Type&))) +# define %new_array(size,Type...) (new Type[size]) +# define %new_copy_array(ptr,size,Type...) %reinterpret_cast(memcpy(%new_array(size,Type), ptr, sizeof(Type)*(size)), Type*) +# define %delete(cptr) delete cptr +# define %delete_array(cptr) delete[] cptr +#else /* C case */ +# define %new_instance(Type...) (Type *)malloc(sizeof(Type)) +# define %new_copy(val,Type...) (Type *)memcpy(%new_instance(Type),&val,sizeof(Type)) +# define %new_array(size,Type...) (Type *)malloc((size)*sizeof(Type)) +# define %new_copy_array(ptr,size,Type...) (Type *)memcpy(%new_array(size,Type), ptr, sizeof(Type)*(size)) +# define %delete(cptr) free((char*)cptr) +# define %delete_array(cptr) free((char*)cptr) +#endif /* __cplusplus */ + +/* ----------------------------------------------------------------------------- + * SWIG names and mangling + * ----------------------------------------------------------------------------- */ + +#define %mangle(Type...) #@Type +#define %descriptor(Type...) SWIGTYPE_ ## #@Type +#define %string_name(Name) "SWIG_" %str(Name) +#define %symbol_name(Name, Type...) SWIG_ ## Name ## _ #@Type +#define %checkcode(Code) SWIG_TYPECHECK_ ## Code + + +/* ----------------------------------------------------------------------------- + * Auxiliary loop macros + * ----------------------------------------------------------------------------- */ + + +/* for loop for macro with one argument */ +%define %_formacro_1(macro, arg1,...)macro(arg1) +#if #__VA_ARGS__ != "__fordone__" +%_formacro_1(macro, __VA_ARGS__) +#endif +%enddef + +/* for loop for macro with one argument */ +%define %formacro_1(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef +%define %formacro(macro,...)%_formacro_1(macro,__VA_ARGS__,__fordone__)%enddef + +/* for loop for macro with two arguments */ +%define %_formacro_2(macro, arg1, arg2, ...)macro(arg1, arg2) +#if #__VA_ARGS__ != "__fordone__" +%_formacro_2(macro, __VA_ARGS__) +#endif +%enddef + +/* for loop for macro with two arguments */ +%define %formacro_2(macro,...)%_formacro_2(macro, __VA_ARGS__, __fordone__)%enddef + +/* ----------------------------------------------------------------------------- + * SWIG flags + * ----------------------------------------------------------------------------- */ + +/* + mark a flag, ie, define a macro name but ignore it in + the interface. + + the flag can be later used with %evalif +*/ + +%define %mark_flag(x) %define x 1 %enddef %enddef + + +/* + %evalif and %evalif_2 are use to evaluate or process + an expression if the given predicate is 'true' (1). +*/ +%define %_evalif(_x,_expr) +#if _x == 1 +_expr +#endif +%enddef + +%define %_evalif_2(_x,_y,_expr) +#if _x == 1 && _y == 1 +_expr +#endif +%enddef + +%define %evalif(_x,_expr...) %_evalif(%arg(_x),%arg(_expr)) %enddef + +%define %evalif_2(_x,_y,_expr...) %_evalif_2(%arg(_x),%arg(_y),%arg(_expr)) %enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/swigobject.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/swigobject.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,37 @@ +/* ------------------------------------------------------------ + * Language Object * - Just pass straight through unmodified + * ------------------------------------------------------------ */ + +%typemap(in) SWIG_Object "$1 = $input;"; + +%typemap(in,noblock=1) SWIG_Object const & ($*ltype temp) +{ + temp = %static_cast($input, $*ltype); + $1 = &temp; +} + +%typemap(out,noblock=1) SWIG_Object { + %set_output($1); +} + +%typemap(out,noblock=1) SWIG_Object const & { + %set_output(*$1); +} + +%typecheck(SWIG_TYPECHECK_SWIGOBJECT) SWIG_Object "$1 = ($input != 0);"; + +%typemap(throws,noblock=1) SWIG_Object { + %raise($1, "$type", 0); +} + +%typemap(constcode,noblock=1) SWIG_Object { + %set_constant("$symname", $value); +} + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +%typemap(directorin) SWIG_Object "$input = $1;"; +%typemap(directorout) SWIG_Object "$result = $input;"; + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/swigtype.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/swigtype.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,607 @@ +/* ----------------------------------------------------------------------------- + * --- Input arguments --- + * ----------------------------------------------------------------------------- */ +/* Pointers and arrays */ +%typemap(in, noblock=1) SWIGTYPE *(void *argp = 0, int res = 0) { + res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + $1 = %reinterpret_cast(argp, $ltype); +} +%typemap(freearg) SWIGTYPE * ""; + +%typemap(in, noblock=1) SWIGTYPE [] (void *argp = 0, int res = 0) { + res = SWIG_ConvertPtr($input, &argp,$descriptor, $disown | %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + $1 = %reinterpret_cast(argp, $ltype); +} +%typemap(freearg) SWIGTYPE [] ""; + + +%typemap(in, noblock=1) SWIGTYPE *const& (void *argp = 0, int res = 0, $*1_ltype temp) { + res = SWIG_ConvertPtr($input, &argp, $*descriptor, $disown | %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$*ltype", $symname, $argnum); + } + temp = %reinterpret_cast(argp, $*ltype); + $1 = %reinterpret_cast(&temp, $1_ltype); +} +%typemap(freearg) SWIGTYPE *const& ""; + + +/* Reference */ +%typemap(in, noblock=1) SWIGTYPE & (void *argp = 0, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + if (!argp) { %argument_nullref("$type", $symname, $argnum); } + $1 = %reinterpret_cast(argp, $ltype); +} +%typemap(freearg) SWIGTYPE & ""; + +#if defined(__cplusplus) && defined(%implicitconv_flag) +%typemap(in,noblock=1,implicitconv=1) const SWIGTYPE & (void *argp = 0, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags | %implicitconv_flag); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + if (!argp) { %argument_nullref("$type", $symname, $argnum); } + $1 = %reinterpret_cast(argp, $ltype); +} +%typemap(freearg,noblock=1,match="in",implicitconv=1) const SWIGTYPE & +{ + if (SWIG_IsNewObj(res$argnum)) %delete($1); +} +#else +%typemap(in,noblock=1) const SWIGTYPE & (void *argp, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + if (!argp) { %argument_nullref("$type", $symname, $argnum); } + $1 = %reinterpret_cast(argp, $ltype); +} +#endif + +/* By value */ +#if defined(__cplusplus) && defined(%implicitconv_flag) +%typemap(in,implicitconv=1) SWIGTYPE (void *argp, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags | %implicitconv_flag); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + if (!argp) { + %argument_nullref("$type", $symname, $argnum); + } else { + $<ype temp = %reinterpret_cast(argp, $<ype); + $1 = *temp; + if (SWIG_IsNewObj(res)) %delete(temp); + } +} +#else +%typemap(in) SWIGTYPE (void *argp, int res = 0) { + res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } + if (!argp) { + %argument_nullref("$type", $symname, $argnum); + } else { + $1 = *(%reinterpret_cast(argp, $<ype)); + } +} +#endif + + +/* ----------------------------------------------------------------------------- + * --- Output arguments --- + * ----------------------------------------------------------------------------- */ + +/* Pointers, references */ +%typemap(out,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE[] { + %set_output(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, $owner | %newpointer_flags)); +} + +%typemap(out, noblock=1) SWIGTYPE *const& { + %set_output(SWIG_NewPointerObj(%as_voidptr(*$1), $*descriptor, $owner | %newpointer_flags)); +} + +/* Return by value */ +%typemap(out, noblock=1) SWIGTYPE { + %set_output(SWIG_NewPointerObj(%new_copy($1, $ltype), $&descriptor, SWIG_POINTER_OWN | %newpointer_flags)); +} + +/* ----------------------------------------------------------------------------- + * --- Variable input --- + * ----------------------------------------------------------------------------- */ + +/* memberin/globalin/varin, for fix arrays. */ + +%typemap(memberin) SWIGTYPE [ANY] { + if ($input) { + size_t ii = 0; + for (; ii < (size_t)$1_dim0; ++ii) $1[ii] = $input[ii]; + } else { + %variable_nullref("$type","$name"); + } +} + +%typemap(globalin) SWIGTYPE [ANY] { + if ($input) { + size_t ii = 0; + for (; ii < (size_t)$1_dim0; ++ii) $1[ii] = $input[ii]; + } else { + %variable_nullref("$type","$name"); + } +} + +%typemap(varin) SWIGTYPE [ANY] { + $basetype *inp = 0; + int res = SWIG_ConvertPtr($input, %as_voidptrptr(&inp), $descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } else if (inp) { + size_t ii = 0; + for (; ii < (size_t)$1_dim0; ++ii) $1[ii] = inp[ii]; + } else { + %variable_nullref("$type", "$name"); + } +} + + +/* memberin/globalin/varin, for fix double arrays. */ + +%typemap(memberin) SWIGTYPE [ANY][ANY] { + if ($input) { + size_t ii = 0; + for (; ii < (size_t)$1_dim0; ++ii) { + if ($input[ii]) { + size_t jj = 0; + for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj]; + } else { + %variable_nullref("$type","$name"); + } + } + } else { + %variable_nullref("$type","$name"); + } +} + +%typemap(globalin) SWIGTYPE [ANY][ANY] { + if ($input) { + size_t ii = 0; + for (; ii < (size_t)$1_dim0; ++ii) { + if ($input[ii]) { + size_t jj = 0; + for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = $input[ii][jj]; + } else { + %variable_nullref("$type","$name"); + } + } + } else { + %variable_nullref("$type","$name"); + } +} + +%typemap(varin) SWIGTYPE [ANY][ANY] { + $basetype (*inp)[$1_dim1] = 0; + int res = SWIG_ConvertPtr($input, %as_voidptrptr(&inp), $descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } else if (inp) { + size_t ii = 0; + for (; ii < (size_t)$1_dim0; ++ii) { + if (inp[ii]) { + size_t jj = 0; + for (; jj < (size_t)$1_dim1; ++jj) $1[ii][jj] = inp[ii][jj]; + } else { + %variable_nullref("$type", "$name"); + } + } + } else { + %variable_nullref("$type", "$name"); + } +} + +/* Pointers, references, and variable size arrays */ + +%typemap(varin,warning=SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) SWIGTYPE * { + void *argp = 0; + int res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + $1 = %reinterpret_cast(argp, $ltype); +} + +%typemap(varin,noblock=1,warning="462:Unable to set dimensionless array variable") SWIGTYPE [] +{ + %variable_fail(SWIG_AttributeError, "$type", "read-only $name"); +} + +%typemap(varin,warning=SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG) SWIGTYPE & { + void *argp = 0; + int res = SWIG_ConvertPtr($input, &argp, $descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + if (!argp) { + %variable_nullref("$type", "$name"); + } + $1 = *(%reinterpret_cast(argp, $ltype)); +} + +#if defined(__cplusplus) && defined(%implicitconv_flag) +%typemap(varin,implicitconv=1) SWIGTYPE { + void *argp = 0; + int res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags | %implicitconv_flag); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + if (!argp) { + %variable_nullref("$type", "$name"); + } else { + $&type temp; + temp = %reinterpret_cast(argp, $&type); + $1 = *temp; + if (SWIG_IsNewObj(res)) %delete(temp); + } +} +#else +%typemap(varin) SWIGTYPE { + void *argp = 0; + int res = SWIG_ConvertPtr($input, &argp, $&descriptor, %convertptr_flags); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + if (!argp) { + %variable_nullref("$type", "$name"); + } else { + $1 = *(%reinterpret_cast(argp, $&type)); + } +} +#endif + +/* ----------------------------------------------------------------------------- + * --- Variable output --- + * ----------------------------------------------------------------------------- */ + +/* Pointers and arrays */ +%typemap(varout, noblock=1) SWIGTYPE * { + %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, %newpointer_flags)); +} + +%typemap(varout, noblock=1) SWIGTYPE [] { + %set_varoutput(SWIG_NewPointerObj(%as_voidptr($1), $descriptor, %newpointer_flags)); +} + +/* References */ +%typemap(varout, noblock=1) SWIGTYPE & { + %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, %newpointer_flags)); +} + +/* Value */ +%typemap(varout, noblock=1) SWIGTYPE { + %set_varoutput(SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, %newpointer_flags)); +} + +/* ------------------------------------------------------------ + * --- Typechecking rules --- + * ------------------------------------------------------------ */ + +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE * { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + $1 = SWIG_CheckState(res); +} + +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE *const& { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $*descriptor, 0); + $1 = SWIG_CheckState(res); +} + +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE & { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + $1 = SWIG_CheckState(res); +} + +#if defined(__cplusplus) && defined(%implicitconv_flag) +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) const SWIGTYPE & { + int res = SWIG_ConvertPtr($input, 0, $descriptor, %implicitconv_flag); + $1 = SWIG_CheckState(res); +} + +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1,implicitconv=1) SWIGTYPE { + int res = SWIG_ConvertPtr($input, 0, $&descriptor, %implicitconv_flag); + $1 = SWIG_CheckState(res); +} +#else +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) const SWIGTYPE & { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $descriptor, 0); + $1 = SWIG_CheckState(res); +} + +%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE { + void *vptr = 0; + int res = SWIG_ConvertPtr($input, &vptr, $&descriptor, 0); + $1 = SWIG_CheckState(res); +} +#endif + +/* ----------------------------------------------------------------------------- + * --- Director typemaps --- * + * ----------------------------------------------------------------------------- */ + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ + +%typemap(directorin,noblock=1) SWIGTYPE *, SWIGTYPE *const& { + $input = SWIG_NewPointerObj(%as_voidptr($1), $descriptor, %newpointer_flags); +} + +%typemap(directorin,noblock=1) SWIGTYPE { + $input = SWIG_NewPointerObj(%as_voidptr(&$1), $&descriptor, %newpointer_flags); +} + +%typemap(directorin,noblock=1) SWIGTYPE & { + $input = SWIG_NewPointerObj(%as_voidptr(&$1), $descriptor, %newpointer_flags); +} + +/* directorout */ +#if defined(__cplusplus) && defined(%implicitconv_flag) +%typemap(directorout,noblock=1,implicitconv=1) SWIGTYPE (void * swig_argp, int swig_res = 0) { + swig_res = SWIG_ConvertPtr($input,&swig_argp,$&descriptor, %convertptr_flags | %implicitconv_flag); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res,"$type"); + } + $result = *(%reinterpret_cast(swig_argp, $<ype)); + if (SWIG_IsNewObj(swig_res)) %delete(%reinterpret_cast(swig_argp, $<ype)); +} +#else +%typemap(directorout,noblock=1) SWIGTYPE (void * swig_argp, int swig_res = 0) { + swig_res = SWIG_ConvertPtr($input,&swig_argp,$&descriptor, %convertptr_flags); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res,"$type"); + } + $result = *(%reinterpret_cast(swig_argp, $<ype)); +} +#endif + +%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) + SWIGTYPE *(void *swig_argp, int swig_res, swig_owntype own) { + swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res,"$type"); + } + $result = %reinterpret_cast(swig_argp, $ltype); + swig_acquire_ownership_obj(%as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */); +} +%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE * { + if (director) { + SWIG_AcquirePtr($result, director->swig_release_ownership(%as_voidptr($input))); + } +} + +%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) + SWIGTYPE &(void *swig_argp, int swig_res, swig_owntype own) { + swig_res = SWIG_ConvertPtrAndOwn($input, &swig_argp, $descriptor, %convertptr_flags | SWIG_POINTER_DISOWN, &own); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res,"$type"); + } + if (!swig_argp) { %dirout_nullref("$type"); } + $result = %reinterpret_cast(swig_argp, $ltype); + swig_acquire_ownership_obj(%as_voidptr($result), own /* & TODO: SWIG_POINTER_OWN */); +} +%typemap(directorfree,noblock=1,match="directorout") SWIGTYPE & { + if (director) { + SWIG_AcquirePtr($result, director->swig_release_ownership(%as_voidptr($input))); + } +} + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + + +/* ------------------------------------------------------------ + * --- Constants --- + * ------------------------------------------------------------ */ + +%typemap(constcode,noblock=1) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] { + %set_constant("$symname", SWIG_NewPointerObj(%as_voidptr($value),$descriptor,%newpointer_flags)); +} + +%typemap(constcode,noblock=1) SWIGTYPE { + %set_constant("$symname", SWIG_NewPointerObj(%as_voidptr(&$value),$&descriptor,%newpointer_flags)); +} + +/* ------------------------------------------------------------ + * --- Exception handling --- + * ------------------------------------------------------------ */ + +%typemap(throws,noblock=1) SWIGTYPE { + %raise(SWIG_NewPointerObj(%new_copy($1, $ltype),$&descriptor,SWIG_POINTER_OWN), "$type", $&descriptor); +} + +%typemap(throws,noblock=1) SWIGTYPE * { + %raise(SWIG_NewPointerObj(%as_voidptr($1),$descriptor,0), "$type", $descriptor); +} + +%typemap(throws,noblock=1) SWIGTYPE [ANY] { + %raise(SWIG_NewPointerObj(%as_voidptr($1),$descriptor,0), "$type", $descriptor); +} + +%typemap(throws,noblock=1) SWIGTYPE & { + %raise(SWIG_NewPointerObj(%as_voidptr(&$1),$descriptor,0), "$type", $descriptor); +} + +%typemap(throws,noblock=1) (...) { + SWIG_exception_fail(SWIG_RuntimeError,"unknown exception"); +} + +/* ------------------------------------------------------------ + * --- CLASS::* typemaps --- + * ------------------------------------------------------------ */ + +%typemap(in) SWIGTYPE (CLASS::*) { + int res = SWIG_ConvertMember($input, %as_voidptr(&$1), sizeof($type),$descriptor); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } +} + +%typemap(out,noblock=1) SWIGTYPE (CLASS::*) { + %set_output(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($type), $descriptor)); +} + +%typemap(varin) SWIGTYPE (CLASS::*) { + int res = SWIG_ConvertMember($input,%as_voidptr(&$1), sizeof($type), $descriptor); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } +} + +%typemap(varout,noblock=1) SWIGTYPE (CLASS::*) { + %set_varoutput(SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($type), $descriptor)); +} + +%typemap(constcode,noblock=1) SWIGTYPE (CLASS::*) { + %set_constant("$symname", SWIG_NewMemberObj(%as_voidptr(&$value), sizeof($type), $descriptor)); +} + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ + +%typemap(directorin,noblock=1) SWIGTYPE (CLASS::*) { + $input = SWIG_NewMemberObj(%as_voidptr(&$1), sizeof($type), $descriptor); +} + +/* directorout */ + +%typemap(directorout) SWIGTYPE (CLASS::*) { + int swig_res = SWIG_ConvertMember($input,%as_voidptr(&$result), sizeof($type), $descriptor); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res,"$type"); + } +} +#endif + +/* ------------------------------------------------------------ + * --- function ptr typemaps --- + * ------------------------------------------------------------ */ + +/* + ISO C++ doesn't allow direct casting of a function ptr to a object + ptr. So, maybe the ptr sizes are not the same, and we need to take + some providences. + */ +%typemap(in) SWIGTYPE ((*)(ANY)) { + int res = SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type",$symname, $argnum); + } +} + +%typecheck(SWIG_TYPECHECK_POINTER,noblock=1) SWIGTYPE ((*)(ANY)) { + void *ptr = 0; + int res = SWIG_ConvertFunctionPtr($input, &ptr, $descriptor); + $1 = SWIG_CheckState(res); +} + + +%typemap(out, noblock=1) SWIGTYPE ((*)(ANY)) { + %set_output(SWIG_NewFunctionPtrObj((void *)($1), $descriptor)); +} + +%typemap(varin) SWIGTYPE ((*)(ANY)) { + int res = SWIG_ConvertFunctionPtr($input, (void**)(&$1), $descriptor); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } +} + +%typemap(varout,noblock=1) SWIGTYPE ((*)(ANY)) { + %set_varoutput(SWIG_NewFunctionPtrObj((void *)($1), $descriptor)); +} + +%typemap(constcode, noblock=1) SWIGTYPE ((*)(ANY)){ + %set_constant("$symname", SWIG_NewFunctionPtrObj((void *)$value, $descriptor)); +} + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ + +%typemap(directorin,noblock=1) SWIGTYPE ((*)(ANY)) { + $input = SWIG_NewFunctionPtrObj((void*)($1), $descriptor); +} + +/* directorout */ + +%typemap(directorout) SWIGTYPE ((*)(ANY)) { + int swig_res = SWIG_ConvertFunctionPtr($input,(void**)(&$result),$descriptor); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res,"$type"); + } +} +#endif + +%apply SWIGTYPE * { SWIGTYPE *const } + +/* ------------------------------------------------------------ + * --- Special typemaps --- + * ------------------------------------------------------------ */ + +/* DISOWN typemap */ + +%typemap(in, noblock=1) SWIGTYPE *DISOWN (int res = 0) { + res = SWIG_ConvertPtr($input, %as_voidptrptr(&$1), $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags); + if (!SWIG_IsOK(res)) { + %argument_fail(res,"$type", $symname, $argnum); + } +} + +%typemap(varin) SWIGTYPE *DISOWN { + void *temp = 0; + int res = SWIG_ConvertPtr($input, &temp, $descriptor, SWIG_POINTER_DISOWN | %convertptr_flags); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + $1 = ($ltype) temp; +} + +/* DYNAMIC typemap */ + +%typemap(out,noblock=1) SWIGTYPE *DYNAMIC, SWIGTYPE &DYNAMIC { + %set_output(SWIG_NewPointerObj(%as_voidptr($1), SWIG_TypeDynamicCast($descriptor, %as_voidptrptr(&$1)), $owner | %newpointer_flags)); +} + +/* INSTANCE typemap */ + +%typemap(out,noblock=1) SWIGTYPE INSTANCE { + %set_output(SWIG_NewInstanceObj(%new_copy($1, $1_ltype), $&1_descriptor, SWIG_POINTER_OWN | %newinstance_flags)); +} + +%typemap(out,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE &INSTANCE, SWIGTYPE INSTANCE[] { + %set_output(SWIG_NewInstanceObj(%as_voidptr($1), $1_descriptor, $owner | %newinstance_flags)); +} + +%typemap(varout,noblock=1) SWIGTYPE *INSTANCE, SWIGTYPE INSTANCE[] { + %set_varoutput(SWIG_NewInstanceObj(%as_voidptr($1), $1_descriptor, %newinstance_flags)); +} + +%typemap(varout,noblock=1) SWIGTYPE &INSTANCE { + %set_varoutput(SWIG_NewInstanceObj(%as_voidptr($1), $1_descriptor, %newinstance_flags)); +} + +%typemap(varout,noblock=1) SWIGTYPE INSTANCE { + %set_varoutput(SWIG_NewInstanceObj(%as_voidptr(&$1), $&1_descriptor, %newinstance_flags)); +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/swigtypemaps.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/swigtypemaps.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,167 @@ +/* ----------------------------------------------------------------------------- + * swigtypemaps.swg + * + * Unified Typemap Library frontend + * ----------------------------------------------------------------------------- */ + +/* + This file provides the frontend to the Unified Typemap Library. + + When using this library in a SWIG target language, you need to + define a minimum set of fragments, specialize a couple of macros, + and then include this file. + + Typically you will create a 'mytypemaps.swg' file in each target + languge, where you will have the following sections: + + === mytypemaps.swg === + + // Fragment section + %include <typemaps/fragments.swg> + <include target language fragments> + + // Unified typemap section + <specialized the typemap library macros> + %include <typemaps/swigtypemaps.swg> + + // Local typemap section + <add/replace extra target language typemaps> + + === mytypemaps.swg === + + While we add more docs, please take a look at the following cases + to see how you specialized the unified typemap library for a new + target language: + + Lib/python/pytypemaps.swg + Lib/tcl/tcltypemaps.swg + Lib/ruby/rubytypemaps.swg + Lib/perl5/perltypemaps.swg + +*/ + +#define SWIGUTL SWIGUTL + +/* ----------------------------------------------------------------------------- + * Language specialization section. + * + * Tune these macros for each language as needed. + * ----------------------------------------------------------------------------- */ + +/* + The SWIG target language object must be provided. + For example in python you define: + + #define SWIG_Object PyObject * +*/ + +#if !defined(SWIG_Object) +#error "SWIG_Object must be defined as the SWIG target language object" +#endif + +/*==== flags for new/convert methods ====*/ + + +#ifndef %convertptr_flags +%define %convertptr_flags 0 %enddef +#endif + +#ifndef %newpointer_flags +%define %newpointer_flags 0 %enddef +#endif + +#ifndef %newinstance_flags +%define %newinstance_flags 0 %enddef +#endif + +/*==== set output ====*/ + +#ifndef %set_output +/* simple set output operation */ +#define %set_output(obj) $result = obj +#endif + +/*==== set variable output ====*/ + +#ifndef %set_varoutput +/* simple set varoutput operation */ +#define %set_varoutput(obj) $result = obj +#endif + +/*==== append output ====*/ + +#ifndef %append_output +#if defined(SWIG_AppendOutput) +/* simple append operation */ +#define %append_output(obj) $result = SWIG_AppendOutput($result,obj) +#else +#error "Language must define SWIG_AppendOutput or %append_output" +#endif +#endif + +/*==== set constant ====*/ + +#ifndef %set_constant +#if defined(SWIG_SetConstant) +/* simple set constant operation */ +#define %set_constant(name,value) SWIG_SetConstant(name,value) +#else +#error "Language must define SWIG_SetConstant or %set_constant" +#endif +#endif + +/*==== raise an exception ====*/ + +#ifndef %raise +#if defined(SWIG_Raise) +/* simple raise operation */ +#define %raise(obj, type, desc) SWIG_Raise(obj, type, desc); SWIG_fail +#else +#error "Language must define SWIG_Raise or %raise" +#endif +#endif + +/*==== director output exception ====*/ + +#if defined(SWIG_DIRECTOR_TYPEMAPS) +#ifndef SWIG_DirOutFail +#define SWIG_DirOutFail(code, msg) Swig::DirectorTypeMismatchException::raise(SWIG_ErrorType(code), msg) +#endif +#endif + + +/* ----------------------------------------------------------------------------- + * Language independent definitions + * ----------------------------------------------------------------------------- */ + +#define %error_block(Block...) %block(Block) +#define %default_code(code) SWIG_ArgError(code) +#define %argument_fail(code, type, name, argn) SWIG_exception_fail(%default_code(code), %argfail_fmt(type, name, argn)) +#define %argument_nullref(type, name, argn) SWIG_exception_fail(SWIG_ValueError, %argnullref_fmt(type, name, argn)) +#define %variable_fail(code, type, name) SWIG_exception_fail(%default_code(code), %varfail_fmt(type, name)) +#define %variable_nullref(type, name) SWIG_exception_fail(SWIG_ValueError, %varnullref_fmt(type, name)) + +#if defined(SWIG_DIRECTOR_TYPEMAPS) +#define %dirout_fail(code, type) SWIG_DirOutFail(%default_code(code), %outfail_fmt(type)) +#define %dirout_nullref(type) SWIG_DirOutFail(SWIG_ValueError, %outnullref_fmt(type)) +#endif + +/* ----------------------------------------------------------------------------- + * All the typemaps + * ----------------------------------------------------------------------------- */ + + +%include <typemaps/fragments.swg> +%include <typemaps/exception.swg> +%include <typemaps/swigtype.swg> +%include <typemaps/void.swg> +%include <typemaps/swigobject.swg> +%include <typemaps/valtypes.swg> +%include <typemaps/ptrtypes.swg> +%include <typemaps/inoutlist.swg> +%include <typemaps/primtypes.swg> +%include <typemaps/string.swg> +%include <typemaps/misctypes.swg> +%include <typemaps/enumint.swg> + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/traits.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/traits.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,307 @@ +// +// Use the following macro with modern STL implementations +// +//#define SWIG_STD_MODERN_STL +// +// Use this to deactive the previous definition, when using gcc-2.95 +// or similar old compilers. +// +//#define SWIG_STD_NOMODERN_STL + +// Here, we identify compilers we now have problems with STL. +%{ +#if defined(__GNUC__) +# if __GNUC__ == 2 && __GNUC_MINOR <= 96 +# define SWIG_STD_NOMODERN_STL +# endif +#endif +%} + +// +// Common code for supporting the STD C++ namespace +// + +%{ +#include <string> +#include <stdexcept> +%} + +%fragment("Traits","header") +{ +namespace swig { + /* + type categories + */ + struct pointer_category { }; + struct value_category { }; + + /* + General traits that provides type_name and type_info + */ + template <class Type> struct traits { }; + + template <class Type> + inline const char* type_name() { + return traits<Type>::type_name(); + } + + template <class Type> + struct traits_info { + static swig_type_info *type_query(std::string name) { + name += " *"; + return SWIG_TypeQuery(name.c_str()); + } + static swig_type_info *type_info() { + static swig_type_info *info = type_query(type_name<Type>()); + return info; + } + }; + + template <class Type> + inline swig_type_info *type_info() { + return traits_info<Type>::type_info(); + } + + /* + Partial specialization for pointers + */ + template <class Type> struct traits <Type *> { + typedef pointer_category category; + static std::string make_ptr_name(const char* name) { + std::string ptrname = name; + ptrname += " *"; + return ptrname; + } + static const char* type_name() { + static std::string name = make_ptr_name(swig::type_name<Type>()); + return name.c_str(); + } + }; + + + template <class Type, class Category = typename traits<Type>::category > + struct traits_check { }; + + /* + Traits that provides the from method for an unknown type + */ + template <int flags, class Type> struct traits_from_ptr { + static SWIG_Object from SWIG_FROM_DECL_ARGS(Type *val) { + return SWIG_NewPointerObj(val, type_info<Type>(), flags); + } + }; + + template <class Type> struct traits_from { + static SWIG_Object from SWIG_FROM_DECL_ARGS(const Type& val) { + return traits_from_ptr<SWIG_POINTER_OWN, Type>::from(new Type(val)); + } + }; + + template <class Type> struct traits_from<Type *> { + static SWIG_Object from SWIG_FROM_DECL_ARGS(Type* val) { + return traits_from_ptr<0, Type>::from(val); + } + }; + + template <class Type> + inline SWIG_Object from SWIG_FROM_DECL_ARGS(const Type& val) { + return traits_from<Type>::from(val); + } + + /* + Traits that provides the asptr/asval method for an unknown type + */ + template <class Type> + struct traits_asptr { + static int asptr SWIG_AS_DECL_ARGS (SWIG_Object obj, Type **val) { + Type *p; + int res = SWIG_ConvertPtr(obj, %as_voidptrptr(&p), type_info<Type>(), 0); + if (SWIG_IsOK(res) && val) *val = p; + return res; + } + }; + + template <class Type> + inline int asptr SWIG_AS_DECL_ARGS(SWIG_Object obj, Type **vptr) { + return traits_asptr<Type>::asptr SWIG_AS_CALL_ARGS(obj, vptr); + } + + template <class Type> + struct traits_asval { + static int asval SWIG_AS_DECL_ARGS(SWIG_Object obj, Type *val) { + if (val) { + Type *p = 0; + int res = traits_asptr<Type>::asptr SWIG_AS_CALL_ARGS(obj, &p); + if (SWIG_IsOK(res) && p) { + *val = *p; + if (SWIG_IsNewObj(res)) { + %delete(p); + res = SWIG_DelNewMask(res); + } + } + return res; + } else { + return traits_asptr<Type>::asptr SWIG_AS_CALL_ARGS(obj, (Type **)(0)); + } + } + }; + + template <class Type> + inline int asval SWIG_AS_DECL_ARGS (SWIG_Object obj, Type *val) { + return traits_asval<Type>::asval SWIG_AS_CALL_ARGS(obj, val); + } + + /* + Traits that provides the check method for an unknown type + */ +#define SWIG_CHECK_DECL_ARGS(obj) SWIG_AS_DECL_ARGS(obj, void * = 0) +#define SWIG_CHECK_CALL_ARGS(obj) SWIG_AS_CALL_ARGS(obj, 0) + + template <class Type> + struct traits_checkval { + static int check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) { + if (obj) { + int res = asval SWIG_AS_CALL_ARGS(obj, (Type *)(0)); + return SWIG_CheckState(res); + } else { + return 0; + } + } + }; + + template <class Type> + struct traits_checkptr { + static int check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) { + if (obj) { + int res = asptr SWIG_AS_CALL_ARGS(obj, (Type **)(0)); + return SWIG_CheckState(res); + } else { + return 0; + } + } + }; + + template <class Type> + struct traits_check<Type, value_category> : traits_checkval<Type> { + }; + + template <class Type> + struct traits_check<Type, pointer_category> : traits_checkptr<Type> { + }; + + template <class Type> + inline int check SWIG_CHECK_DECL_ARGS(SWIG_Object obj) { + return traits_check<Type>::check SWIG_CHECK_CALL_ARGS(obj); + } + +} +} + +/* + Generate the traits for an unknown SWIGTYPE +*/ + +%define %traits_swigtype(Type...) +%fragment(SWIG_Traits_frag(Type),"header",fragment="Traits") { + namespace swig { + template <> struct traits<Type > { + typedef pointer_category category; + static const char* type_name() { return #Type; } + }; + } +} +%enddef + + +/* + Generate the traits for a 'value' type, such as 'double', + for which the SWIG_AsVal and SWIG_From methods are already defined. +*/ + +%define %traits_value(Type...) +%fragment(SWIG_Traits_frag(Type),"header", + fragment=SWIG_AsVal_frag(Type), + fragment=SWIG_From_frag(Type), + fragment="Traits") { +namespace swig { + template <> struct traits<Type > { + typedef value_category category; + static const char* type_name() { return #Type; } + }; + + template <> struct traits_asval<Type > { + typedef Type value_type; + static int asval SWIG_AS_DECL_ARGS (SWIG_Object obj, value_type *val) { + return SWIG_AsVal(Type)(obj, val); + } + }; + + template <> struct traits_from<Type > { + typedef Type value_type; + static SWIG_Object from SWIG_FROM_DECL_ARGS (const value_type& val) { + return SWIG_From(Type)(val); + } + }; +} +} +%enddef + +/* + Generate the traits for a 'pointer' type, such as 'std::string', + for which the SWIG_AsPtr and SWIG_From methods are already defined. +*/ + +%define %traits_pointer(Type...) +%fragment(SWIG_Traits_frag(Type),"header", + fragment=SWIG_AsVal_frag(Type), + fragment=SWIG_From_frag(Type), + fragment="Traits") { +namespace swig { + template <> struct traits<Type > { + typedef pointer_category category; + static const char* type_name() { return #Type; } + }; + + template <> struct traits_asptr<Type > { + typedef Type value_type; + static int asptr SWIG_AS_DECL_ARGS (SWIG_Object obj, value_type **val) { + return SWIG_AsPtr(Type)(obj, val); + } + }; + + template <> struct traits_from<Type > { + typedef Type value_type; + static SWIG_Object from SWIG_FROM_DECL_ARGS (const value_type& val) { + return SWIG_From(Type)(val); + } + }; +} +} +%enddef + +/* + Generate the typemaps for a class that has 'value' traits +*/ + +%define %typemap_traits_value(Code,Type...) + %typemaps_asvalfrom(%arg(Code), + %arg(swig::asval), + %arg(swig::from), + %arg(SWIG_Traits_frag(Type)), + %arg(SWIG_Traits_frag(Type)), + Type); +%enddef + +/* + Generate the typemaps for a class that has 'pointer' traits +*/ + +%define %typemap_traits_pointer(Code,Type...) + %typemaps_asptrfrom(%arg(Code), + %arg(swig::asptr), + %arg(swig::from), + %arg(SWIG_Traits_frag(Type)), + %arg(SWIG_Traits_frag(Type)), + Type); +%enddef + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/typemaps.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/typemaps.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,157 @@ +/* ----------------------------------------------------------------------------- + * typemaps.swg + * + * Tcl Pointer handling + * + * These mappings provide support for input/output arguments and common + * uses for C/C++ pointers. + * ----------------------------------------------------------------------------- */ + +// INPUT typemaps. +// These remap a C pointer to be an "INPUT" value which is passed by value +// instead of reference. + +/* +The following methods can be applied to turn a pointer into a simple +"input" value. That is, instead of passing a pointer to an object, +you would use a real value instead. + + int *INPUT + short *INPUT + long *INPUT + long long *INPUT + unsigned int *INPUT + unsigned short *INPUT + unsigned long *INPUT + unsigned long long *INPUT + unsigned char *INPUT + bool *INPUT + float *INPUT + double *INPUT + +To use these, suppose you had a C function like this : + + double fadd(double *a, double *b) { + return *a+*b; + } + +You could wrap it with SWIG as follows : + + %include <typemaps.i> + double fadd(double *INPUT, double *INPUT); + +or you can use the %apply directive : + + %include <typemaps.i> + %apply double *INPUT { double *a, double *b }; + double fadd(double *a, double *b); + +*/ + +// OUTPUT typemaps. These typemaps are used for parameters that +// are output only. The output value is appended to the result as +// a list element. + +/* +The following methods can be applied to turn a pointer into an "output" +value. When calling a function, no input value would be given for +a parameter, but an output value would be returned. In the case of +multiple output values, they are returned in the form of a Tcl tuple. + + int *OUTPUT + short *OUTPUT + long *OUTPUT + long long *OUTPUT + unsigned int *OUTPUT + unsigned short *OUTPUT + unsigned long *OUTPUT + unsigned long long *OUTPUT + unsigned char *OUTPUT + bool *OUTPUT + float *OUTPUT + double *OUTPUT + +For example, suppose you were trying to wrap the modf() function in the +C math library which splits x into integral and fractional parts (and +returns the integer part in one of its parameters).K: + + double modf(double x, double *ip); + +You could wrap it with SWIG as follows : + + %include <typemaps.i> + double modf(double x, double *OUTPUT); + +or you can use the %apply directive : + + %include <typemaps.i> + %apply double *OUTPUT { double *ip }; + double modf(double x, double *ip); + +The Tcl output of the function would be a tuple containing both +output values. + +*/ + +// INOUT +// Mappings for an argument that is both an input and output +// parameter + +/* +The following methods can be applied to make a function parameter both +an input and output value. This combines the behavior of both the +"INPUT" and "OUTPUT" methods described earlier. Output values are +returned in the form of a Tcl tuple. + + int *INOUT + short *INOUT + long *INOUT + long long *INOUT + unsigned int *INOUT + unsigned short *INOUT + unsigned long *INOUT + unsigned long long *INOUT + unsigned char *INOUT + bool *INOUT + float *INOUT + double *INOUT + +For example, suppose you were trying to wrap the following function : + + void neg(double *x) { + *x = -(*x); + } + +You could wrap it with SWIG as follows : + + %include <typemaps.i> + void neg(double *INOUT); + +or you can use the %apply directive : + + %include <typemaps.i> + %apply double *INOUT { double *x }; + void neg(double *x); + +Unlike C, this mapping does not directly modify the input value (since +this makes no sense in Tcl). Rather, the modified input value shows +up as the return value of the function. Thus, to apply this function +to a Tcl variable you might do this : + + x = neg(x) + +Note : previous versions of SWIG used the symbol 'BOTH' to mark +input/output arguments. This is still supported, but will be slowly +phased out in future releases. + +*/ + + +#if defined(SWIG_INOUT_NODEF) + +%apply_checkctypes(%typemaps_inoutn) + +%apply size_t& { std::size_t& }; +%apply ptrdiff_t& { std::ptrdiff_t& }; + +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/valtypes.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/valtypes.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,215 @@ +/*--------------------------------------------------------------------- + * Value typemaps (Type, const Type&) for value types, such as + * fundamental types (int, double), that define the AsVal/From + * methods. + * + * To apply them, just use one of the following macros: + * + * %typemaps_from(FromMeth, FromFrag, Type) + * %typemaps_asval(CheckCode, AsValMeth, AsValFrag, Type) + * %typemaps_asvalfrom(CheckCode, AsValMeth, FromMeth, AsValFrag, FromFrag, Type) + * + * or the simpler and normalize form: + * + * %typemaps_asvalfromn(CheckCode, Type) + * + * Also, you can use the individual typemap definitions: + * + * %value_in_typemap(asval_meth,frag,Type) + * %value_varin_typemap(asval_meth,frag,Type) + * %value_typecheck_typemap(checkcode,asval_meth,frag,Type) + * %value_directorout_typemap(asval_meth,frag,Type) + * + * %value_out_typemap(from_meth,frag,Type) + * %value_varout_typemap(from_meth,frag,Type) + * %value_constcode_typemap(from_meth,frag,Type) + * %value_directorin_typemap(from_meth,frag,Type) + * %value_throws_typemap(from_meth,frag,Type) + * + *---------------------------------------------------------------------*/ + +/* in */ + +%define %value_in_typemap(asval_meth,frag,Type...) + %typemap(in,noblock=1,fragment=frag) Type (Type val, int ecode = 0) { + ecode = asval_meth($input, &val); + if (!SWIG_IsOK(ecode)) { + %argument_fail(ecode, "$ltype", $symname, $argnum); + } + $1 = %static_cast(val,$ltype); + } + %typemap(freearg) Type ""; + %typemap(in,noblock=1,fragment=frag) const Type & ($*ltype temp, Type val, int ecode = 0) { + ecode = asval_meth($input, &val); + if (!SWIG_IsOK(ecode)) { + %argument_fail(ecode, "$*ltype", $symname, $argnum); + } + temp = %static_cast(val, $*ltype); + $1 = &temp; + } + %typemap(freearg) const Type& ""; +%enddef + +/* out */ + +%define %value_out_typemap(from_meth,frag,Type...) + %typemap(out,noblock=1,fragment=frag) Type, const Type { + %set_output(from_meth(%static_cast($1,Type))); + } + %typemap(out,noblock=1,fragment=frag) const Type& { + %set_output(from_meth(%static_cast(*$1,Type))); + } +%enddef + +/* varin */ + +%define %value_varin_typemap(asval_meth,frag,Type...) + %typemap(varin,fragment=frag) Type { + Type val; + int res = asval_meth($input, &val); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + $1 = %static_cast(val,$ltype); + } +%enddef + +/* varout */ + +%define %value_varout_typemap(from_meth,frag,Type...) + %typemap(varout,noblock=1,fragment=frag) Type, const Type& { + %set_varoutput(from_meth(%static_cast($1,Type))); + } +%enddef + +/* constant installation code */ + +%define %value_constcode_typemap(from_meth,frag,Type...) + %typemap(constcode,noblock=1,fragment=frag) Type { + %set_constant("$symname", from_meth(%static_cast($value,Type))); + } +%enddef + + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ + +%define %value_directorin_typemap(from_meth,frag,Type...) + %typemap(directorin,noblock=1,fragment=frag) Type *DIRECTORIN { + $input = from_meth(%static_cast(*$1,Type)); + } + %typemap(directorin,noblock=1,fragment=frag) Type, const Type& { + $input = from_meth(%static_cast($1,Type)); + } +%enddef + +/* directorout */ + +%define %value_directorout_typemap(asval_meth,frag,Type...) + %typemap(directorargout,noblock=1,fragment=frag) Type *DIRECTOROUT(Type swig_val, int swig_res) { + swig_res = asval_meth($result, &swig_val); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res, "$type"); + } + *$1 = swig_val; + } + %typemap(directorout,noblock=1,fragment=frag) Type { + Type swig_val; + int swig_res = asval_meth($input, &swig_val); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res, "$type"); + } + $result = %static_cast(swig_val,$type); + } + %typemap(directorout,noblock=1,fragment=frag,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) const Type& { + Type swig_val; + int swig_res = asval_meth($input, &swig_val); + if (!SWIG_IsOK(swig_res)) { + %dirout_fail(swig_res, "$type"); + } + $basetype *temp = new $basetype(($basetype)swig_val); + swig_acquire_ownership(temp); + $result = temp; + } + %typemap(directorfree,noblock=1) const Type & { + if (director) { + director->swig_release_ownership(%as_voidptr($input)); + } + } + %typemap(directorout,fragment=frag) Type &DIRECTOROUT = Type +%enddef + +#else + +#define %value_directorin_typemap(from_meth,frag,Type...) +#define %value_directorout_typemap(asval_meth,frag,Type...) + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + + +/* throws */ + +%define %value_throws_typemap(from_meth,frag,Type...) + %typemap(throws,noblock=1,fragment=frag) Type { + %raise(from_meth(%static_cast($1,Type)), "$type", 0); + } +%enddef + +/* typecheck */ + +%define %value_typecheck_typemap(check,asval_meth,frag,Type...) + %typemap(typecheck,precedence=check,fragment=frag) Type, const Type& { + int res = asval_meth($input, NULL); + $1 = SWIG_CheckState(res); + } +%enddef + +/*--------------------------------------------------------------------- + * typemap definition for types with AsVal methods + *---------------------------------------------------------------------*/ +%define %typemaps_asval(CheckCode, AsValMeth, AsValFrag, Type...) + %value_in_typemap(%arg(AsValMeth), %arg(AsValFrag), Type); + %value_varin_typemap(%arg(AsValMeth), %arg(AsValFrag), Type); + %value_directorout_typemap(%arg(AsValMeth), %arg(AsValFrag), Type); + %value_typecheck_typemap(%arg(CheckCode), %arg(AsValMeth), %arg(AsValFrag), Type); + %value_input_typemap(%arg(CheckCode), %arg(AsValMeth), %arg(AsValFrag), Type); +%enddef + + +/*--------------------------------------------------------------------- + * typemap definition for types with from method + *---------------------------------------------------------------------*/ +%define %typemaps_from(FromMeth, FromFrag, Type...) + %value_out_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_varout_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_constcode_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_directorin_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_throws_typemap(%arg(FromMeth), %arg(FromFrag), Type); + %value_output_typemap(%arg(FromMeth), %arg(FromFrag), Type); +%enddef + + +/*--------------------------------------------------------------------- + * typemap definition for types with alval/from method + *---------------------------------------------------------------------*/ + +%define %typemaps_asvalfrom(CheckCode, AsValMeth, FromMeth, + AsValFrag, FromFrag, Type...) + %typemaps_asval(%arg(CheckCode), %arg(AsValMeth), %arg(AsValFrag), Type); + %typemaps_from(%arg(FromMeth), %arg(FromFrag), Type); + %value_inout_typemap(Type); +%enddef + + +/*--------------------------------------------------------------------- + * typemap definition for types with for 'normalized' asval/from methods + *---------------------------------------------------------------------*/ +%define %typemaps_asvalfromn(CheckCode, Type...) + %typemaps_asvalfrom(%arg(CheckCode), + SWIG_AsVal(Type), + SWIG_From(Type), + %arg(SWIG_AsVal_frag(Type)), + %arg(SWIG_From_frag(Type)), + Type); +%enddef diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/void.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/void.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,84 @@ +/* ------------------------------------------------------------ + * Void * - Accepts any kind of pointer + * ------------------------------------------------------------ */ + +/* in */ + +%typemap(in,noblock=1) void * (int res) { + res = SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "$type", $symname, $argnum); + } +} +%typemap(freearg) void * ""; + +%typemap(in,noblock=1) void * const& ($*ltype temp = 0, int res) { + res = SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown); + if (!SWIG_IsOK(res)) { + %argument_fail(res, "Stype", $symname, $argnum); + } + $1 = &temp; +} +%typemap(freearg) void * const& ""; + + +/* out */ + +#if defined(VOID_Object) +%typemap(out,noblock=1) void { $result = VOID_Object; } +#else +%typemap(out,noblock=1) void {} +#endif + +/* varin */ + +%typemap(varin) void * { + void *temp = 0; + int res = SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN); + if (!SWIG_IsOK(res)) { + %variable_fail(res, "$type", "$name"); + } + $1 = ($1_ltype) temp; +} + +/* typecheck */ + +%typecheck(SWIG_TYPECHECK_VOIDPTR, noblock=1) void * +{ + void *ptr = 0; + int res = SWIG_ConvertPtr($input, &ptr, 0, 0); + $1 = SWIG_CheckState(res); +} + +#if defined(SWIG_DIRECTOR_TYPEMAPS) + +/* directorin */ + +%typemap(directorin,noblock=1) void *, void const*, void *const, void const *const, + void const *&, void *const &, void const *const & { + $input = SWIG_NewPointerObj(%as_voidptr($1), $descriptor, %newpointer_flags); +} + +/* directorout */ + +%typemap(directorout,noblock=1) void * (void *argp, int res) { + res = SWIG_ConvertPtr($input, &argp, 0, 0); + if (!SWIG_IsOK(res)) { + %dirout_fail(res,"$type"); + } + $result = %reinterpret_cast(argp, $ltype); +} + +%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) void * const& (void *argp, int res) { + res = SWIG_ConvertPtr($input, &argp, 0, $disown); + if (!SWIG_IsOK(res)) { + %dirout_fail(res,"$type"); + } + static $*ltype temp = %reinterpret_cast(argp, $*ltype); + $result = &temp; +} + + + +#endif /* SWIG_DIRECTOR_TYPEMAPS */ + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/typemaps/wstring.swg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/typemaps/wstring.swg Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,25 @@ +%ensure_fragment(SWIG_AsWCharPtrAndSize) +%ensure_fragment(SWIG_FromWCharPtrAndSize) + + +%types(wchar_t *); + +%fragment("SWIG_pwchar_descriptor","header") { +SWIGINTERN swig_type_info* +SWIG_pwchar_descriptor() +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_wchar_t"); + init = 1; + } + return info; +} +} + +%include <typemaps/strings.swg> +%typemaps_string(%checkcode(UNISTRING), %checkcode(UNICHAR), + wchar_t, WChar, SWIG_AsWCharPtrAndSize, SWIG_FromWCharPtrAndSize, wcslen, + "<wchar.h>", WCHAR_MIN, WCHAR_MAX) + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/wchar.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/wchar.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,11 @@ +/* ----------------------------------------------------------------------------- + * wchar.i + * ----------------------------------------------------------------------------- */ + +/* + wchar_t not supported, unless otherwise specified in the target language. +*/ + +#if defined(SWIG_WCHAR) +#undef SWIG_WCHAR +#endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Lib/windows.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Lib/windows.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,149 @@ +/* ----------------------------------------------------------------------------- + * windows.i + * + * SWIG library file to support types found in windows.h as well as Microsoft + * integral type extensions. The types are set for 32 bit Windows. + * ----------------------------------------------------------------------------- */ + +// Support for non ISO (Windows) integral types +%apply unsigned char { unsigned __int8 }; +%apply const unsigned char& { const unsigned __int8& }; + +%apply signed char { __int8 }; +%apply const signed char& { const __int8& }; + +%apply unsigned short { unsigned __int16 }; +%apply const unsigned short& { const unsigned __int16& }; + +%apply short { __int16 }; +%apply const short& { const __int16& }; + +%apply unsigned int { unsigned __int32 }; +%apply const unsigned int& { const unsigned __int32& }; + +%apply int { __int32 }; +%apply const int& { const __int32& }; + +%apply unsigned long long { unsigned __int64 }; +%apply const unsigned long long& { const unsigned __int64& }; + +%apply long long { __int64 }; +%apply const long long& { const __int64& }; + + +// Workaround Microsoft calling conventions +#define __cdecl +#define __fastcall +#define __far +#define __forceinline +#define __fortran +#define __inline +#define __pascal +#define __stdcall +#define __syscall +#define _cdecl +#define _fastcall +#define _inline +#define _pascal +#define _stdcall +#define WINAPI +#define __declspec(WINDOWS_EXTENDED_ATTRIBUTE) + +#define __w64 + +// Types from windef.h +typedef unsigned long ULONG; +typedef ULONG *PULONG; +typedef unsigned short USHORT; +typedef USHORT *PUSHORT; +typedef unsigned char UCHAR; +typedef UCHAR *PUCHAR; +typedef char *PSZ; +typedef unsigned long DWORD; +typedef int BOOL; +typedef unsigned char BYTE; +typedef unsigned short WORD; +typedef float FLOAT; +typedef FLOAT *PFLOAT; +typedef BOOL *PBOOL; +typedef BOOL *LPBOOL; +typedef BYTE *PBYTE; +typedef BYTE *LPBYTE; +typedef int *PINT; +typedef int *LPINT; +typedef WORD *PWORD; +typedef WORD *LPWORD; +typedef long *LPLONG; +typedef DWORD *PDWORD; +typedef DWORD *LPDWORD; +typedef void *LPVOID; +typedef const void *LPCVOID; +typedef int INT; +typedef unsigned int UINT; +typedef unsigned int *PUINT; + +// Types from basetsd.h +typedef signed char INT8, *PINT8; +typedef signed short INT16, *PINT16; +typedef signed int INT32, *PINT32; +typedef signed __int64 INT64, *PINT64; +typedef unsigned char UINT8, *PUINT8; +typedef unsigned short UINT16, *PUINT16; +typedef unsigned int UINT32, *PUINT32; +typedef unsigned __int64 UINT64, *PUINT64; +typedef signed int LONG32, *PLONG32; +typedef unsigned int ULONG32, *PULONG32; +typedef unsigned int DWORD32, *PDWORD32; +typedef __w64 int INT_PTR, *PINT_PTR; +typedef __w64 unsigned int UINT_PTR, *PUINT_PTR; +typedef __w64 long LONG_PTR, *PLONG_PTR; +typedef __w64 unsigned long ULONG_PTR, *PULONG_PTR; +typedef unsigned short UHALF_PTR, *PUHALF_PTR; +typedef short HALF_PTR, *PHALF_PTR; +typedef __w64 long SHANDLE_PTR; +typedef __w64 unsigned long HANDLE_PTR; +typedef ULONG_PTR SIZE_T, *PSIZE_T; +typedef LONG_PTR SSIZE_T, *PSSIZE_T; +typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR; +typedef __int64 LONG64, *PLONG64; +typedef unsigned __int64 ULONG64, *PULONG64; +typedef unsigned __int64 DWORD64, *PDWORD64; + +// Types from winnt.h +typedef void *PVOID; +typedef void *PVOID64; +typedef char CHAR; +typedef short SHORT; +typedef long LONG; +typedef CHAR *PCHAR; +typedef CHAR *LPCH, *PCH; +typedef const CHAR *LPCCH, *PCCH; +typedef CHAR *NPSTR; +typedef CHAR *LPSTR, *PSTR; +typedef const CHAR *LPCSTR, *PCSTR; +typedef char TCHAR, *PTCHAR; +typedef unsigned char TBYTE , *PTBYTE ; +typedef LPSTR LPTCH, PTCH; +typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR; +typedef LPCSTR PCTSTR, LPCTSTR, PCUTSTR, LPCUTSTR; +typedef SHORT *PSHORT; +typedef LONG *PLONG; +typedef void *HANDLE; +typedef HANDLE *PHANDLE; +typedef BYTE FCHAR; +typedef WORD FSHORT; +typedef DWORD FLONG; +typedef LONG HRESULT; +typedef char CCHAR; +typedef DWORD LCID; +typedef PDWORD PLCID; +typedef WORD LANGID; +typedef __int64 LONGLONG; +typedef unsigned __int64 ULONGLONG; +typedef LONGLONG *PLONGLONG; +typedef ULONGLONG *PULONGLONG; +typedef ULONGLONG DWORDLONG; +typedef DWORDLONG *PDWORDLONG; +typedef BYTE BOOLEAN; +typedef BOOLEAN *PBOOLEAN; + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Makefile.in Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,574 @@ +####################################################################### +# SWIG top level Makefile +####################################################################### + +.PHONY: ccache source swig + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +srcdir = @srcdir@ +datarootdir = @datarootdir@ + +############################################################################## +# Compiler and system configuration +############################################################################## + +SHELL = /bin/sh +SWIG_LIB = @swig_lib@ +BIN_DIR = @bindir@ +ENABLE_CCACHE = @ENABLE_CCACHE@ +TARGET_NOEXE= swig +TARGET = $(TARGET_NOEXE)@EXEEXT@ +SOURCE = Source +CCACHE = CCache +DOCS = Doc/Manual +RUNPIPE = \>/dev/null + +swig: libfiles source ccache + +source: + @cd $(SOURCE) && $(MAKE) + +ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE)) + +libfiles: $(srcdir)/Lib/swigwarn.swg + +# Files required just for the tarball +maintainer: libfiles + @cd $(SOURCE) && $(MAKE) CParse/parser.h + +##################################################################### +# Documentation +##################################################################### + +docs: docs-main docs-ccache + +docs-main: + @echo making docs + @test -d $(DOCS) || exit 0; cd $(DOCS) && $(MAKE) all clean-baks + +docs-ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) docs) + +##################################################################### +# All the languages SWIG speaks (when it wants to) +##################################################################### + +skip-tcl = test -n "@SKIP_TCL@" +skip-perl5 = test -n "@SKIP_PERL5@" +skip-python = test -n "@SKIP_PYTHON@" +skip-java = test -n "@SKIP_JAVA@" +skip-guile = test -n "@SKIP_GUILE@" +skip-mzscheme = test -n "@SKIP_MZSCHEME@" +skip-ruby = test -n "@SKIP_RUBY@" +skip-php = test -n "@SKIP_PHP@" +skip-ocaml = test -n "@SKIP_OCAML@" +skip-octave = test -n "@SKIP_OCTAVE@" +skip-pike = test -n "@SKIP_PIKE@" +skip-chicken = test -n "@SKIP_CHICKEN@" +skip-csharp = test -n "@SKIP_CSHARP@" +skip-modula3 = test -n "@SKIP_MODULA3@" +skip-lua = test -n "@SKIP_LUA@" +skip-allegrocl = test -n "@SKIP_ALLEGROCL@" +skip-clisp = test -n "@SKIP_CLISP@" +skip-cffi = test -n "@SKIP_CFFI@" +skip-uffi = test -n "@SKIP_UFFI@" +skip-r = test -n "@SKIP_R@" +skip-go = test -n "@SKIP_GO@" +skip-d = test -n "@SKIP_D@" + +# Additional dependencies for some tests +skip-gcj = test -n "@SKIP_GCJ@" +skip-android = test -n "@SKIP_ANDROID@" + +##################################################################### +# CHECK +##################################################################### + +ACTION = check +NOSKIP = + +chk-set-swiglib = SWIG_LIB=@ROOT_DIR@/Lib +chk-set-swig = SWIG=@ROOT_DIR@/$(TARGET) +chk-set-env = $(chk-set-swiglib) $(chk-set-swig) + +check-aliveness: + test -x ./$(TARGET) + ./$(TARGET) -version + ./$(TARGET) -help + @$(skip-tcl) || ./$(TARGET) -tcl -help + @$(skip-perl5) || ./$(TARGET) -perl -help + @$(skip-python) || ./$(TARGET) -python -help + @$(skip-java) || ./$(TARGET) -java -help + @$(skip-guile) || ./$(TARGET) -guile -help + @$(skip-mzscheme) || ./$(TARGET) -mzscheme -help + @$(skip-ruby) || ./$(TARGET) -ruby -help + @$(skip-ocaml) || ./$(TARGET) -ocaml -help + @$(skip-octave) || ./$(TARGET) -octave -help + @$(skip-php) || ./$(TARGET) -php -help + @$(skip-pike) || ./$(TARGET) -pike -help + @$(skip-chicken) || ./$(TARGET) -chicken -help + @$(skip-csharp) || ./$(TARGET) -csharp -help + @$(skip-modula3) || ./$(TARGET) -modula3 -help + @$(skip-allegrocl)|| ./$(TARGET) -allegrocl -help + @$(skip-clisp) || ./$(TARGET) -clisp -help + @$(skip-uffi) || ./$(TARGET) -uffi -help + @$(skip-cffi) || ./$(TARGET) -cffi -help + @$(skip-lua) || ./$(TARGET) -lua -help + @$(skip-r) || ./$(TARGET) -r -help + @$(skip-go) || ./$(TARGET) -go -help + @$(skip-d) || ./$(TARGET) -d -help + +check-ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) check) + +# Checks / displays versions of each target language +check-versions: \ + check-tcl-version \ + check-perl5-version \ + check-python-version \ + check-java-version \ + check-android-version \ + check-guile-version \ + check-mzscheme-version \ + check-ruby-version \ + check-ocaml-version \ + check-octave-version \ + check-php-version \ + check-pike-version \ + check-chicken-version \ + check-csharp-version \ + check-modula3-version \ + check-lua-version \ + check-allegrocl-version \ + check-clisp-version \ + check-uffi-version \ + check-cffi-version \ + check-r-version \ + check-go-version \ + check-d-version + +# all examples +check-%-version : + @if test -z "$(skip-$*)"; then \ + echo $* unknown; \ + exit 1; \ + fi + @if $(skip-$*); then \ + echo skipping $* version; \ + else \ + echo showing $* version; \ + (cd Examples && $(MAKE) -s $*_version) \ + fi + +# Checks examples for compilation (does not run them) +check-examples: \ + check-tcl-examples \ + check-perl5-examples \ + check-python-examples \ + check-java-examples \ + check-android-examples \ + check-guile-examples \ + check-mzscheme-examples \ + check-ruby-examples \ + check-ocaml-examples \ + check-octave-examples \ + check-php-examples \ + check-pike-examples \ + check-chicken-examples \ + check-csharp-examples \ + check-modula3-examples \ + check-lua-examples \ + check-allegrocl-examples \ + check-clisp-examples \ + check-uffi-examples \ + check-cffi-examples \ + check-r-examples \ + check-go-examples \ + check-d-examples + +tcl_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/tcl/check.list) +perl5_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/perl5/check.list) +python_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/python/check.list) +java_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/java/check.list) +android_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/android/check.list) +guile_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/guile/check.list) +mzscheme_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/mzscheme/check.list) +ruby_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/ruby/check.list) +ocaml_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/ocaml/check.list) +octave_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/octave/check.list) +php_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/php/check.list) +pike_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/pike/check.list) +chicken_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/chicken/check.list) +csharp_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/csharp/check.list) +modula3_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/modula3/check.list) +lua_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/lua/check.list) +allegrocl_examples := +clisp_examples := +uffi_examples := +cffi_examples := +r_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/r/check.list) +go_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/go/check.list) +d_examples :=$(shell sed '/^\#/d' $(srcdir)/Examples/d/check.list) + +# all examples +check-%-examples : + @if test -z "$(skip-$*)"; then \ + echo $* unknown; \ + exit 1; \ + fi + @if $(skip-$*); then \ + echo skipping $* $(ACTION); \ + elif test -z "$($(strip $*_examples))"; then \ + echo empty $* $(ACTION); \ + else \ + $(MAKE) -k -s $($*_examples:=.actionexample) LANGUAGE=$* ACTION=$(ACTION); \ + fi + +# individual example +%.actionexample: + @echo $(ACTION)ing Examples/$(LANGUAGE)/$* + @(cd Examples/$(LANGUAGE)/$* && $(MAKE) -s $(chk-set-env) $(ACTION) RUNPIPE=$(RUNPIPE)) + +# gcj individual example +java.actionexample: + @if $(skip-gcj); then \ + echo "skipping Examples/$(LANGUAGE)/java $(ACTION) (gcj test)"; \ + else \ + echo $(ACTION)ing Examples/$(LANGUAGE)/java; \ + (cd Examples/$(LANGUAGE)/java && $(MAKE) -s $(chk-set-env) $(ACTION)) \ + fi + +# Checks testcases in the test-suite excluding those which are known to be broken +check-test-suite: \ + check-tcl-test-suite \ + check-perl5-test-suite \ + check-python-test-suite \ + check-java-test-suite \ + check-guile-test-suite \ + check-mzscheme-test-suite \ + check-ruby-test-suite \ + check-ocaml-test-suite \ + check-octave-test-suite \ + check-php-test-suite \ + check-pike-test-suite \ + check-csharp-test-suite \ + check-modula3-test-suite \ + check-lua-test-suite \ + check-allegrocl-test-suite \ + check-clisp-test-suite \ + check-uffi-test-suite \ + check-cffi-test-suite \ + check-chicken-test-suite \ + check-r-test-suite \ + check-go-test-suite \ + check-d-test-suite + +check-%-test-suite: + @if test -z "$(skip-$*)"; then \ + echo $* unknown; \ + exit 1; \ + fi + @passed=true; \ + dir="Examples/test-suite/$*"; \ + if $(skip-$*) -a "$(NOSKIP)" != "1"; then \ + echo skipping $* test-suite $(ACTION); \ + elif [ ! -d $$dir ]; then \ + echo warning: cannot $(ACTION) $* test-suite "(no dir $$dir)";\ + else \ + echo $(ACTION)ing $* test-suite; \ + (cd $$dir && $(MAKE) -k -s $(ACTION)) \ + || passed=false; \ + fi; \ + test $$passed = true + +# Partial test-suite check - it only invokes SWIG, ie no compilation and no runtime testing +partialcheck-test-suite: + @$(MAKE) -k -s check-test-suite ACTION=partialcheck NOSKIP=1 + +partialcheck-%-test-suite: + @$(MAKE) -k -s check-$*-test-suite ACTION=partialcheck NOSKIP=1 + +check: check-aliveness check-ccache check-versions check-examples check-test-suite + +# Run known-to-be-broken as well as not broken testcases in the test-suite +all-test-suite: \ + all-tcl-test-suite \ + all-perl5-test-suite \ + all-python-test-suite \ + all-java-test-suite \ + all-guile-test-suite \ + all-mzscheme-test-suite \ + all-ruby-test-suite \ + all-ocaml-test-suite \ + all-octave-test-suite \ + all-php-test-suite \ + all-pike-test-suite \ + all-csharp-test-suite \ + all-modula3-test-suite \ + all-lua-test-suite \ + all-allegrocl-test-suite \ + all-clisp-test-suite \ + all-uffi-test-suite \ + all-cffi-test-suite \ + all-chicken-test-suite \ + all-r-test-suite \ + all-go-test-suite \ + all-d-test-suite + +all-%-test-suite: + @$(MAKE) -k -s check-$*-test-suite ACTION=all + +# Run known-to-be-broken testcases in the test-suite +broken-test-suite: \ + broken-tcl-test-suite \ + broken-perl5-test-suite \ + broken-python-test-suite \ + broken-java-test-suite \ + broken-guile-test-suite \ + broken-mzscheme-test-suite \ + broken-ruby-test-suite \ + broken-ocaml-test-suite \ + broken-octave-test-suite \ + broken-php-test-suite \ + broken-pike-test-suite \ + broken-csharp-test-suite \ + broken-modula3-test-suite \ + broken-lua-test-suite \ + broken-allegrocl-test-suite \ + broken-clisp-test-suite \ + broken-uffi-test-suite \ + broken-cffi-test-suite \ + broken-chicken-test-suite \ + broken-r-test-suite \ + broken-go-test-suite \ + broken-d-test-suite + +broken-%-test-suite: + @$(MAKE) -k -s check-$*-test-suite ACTION=broken + +##################################################################### +# CLEAN +##################################################################### + +clean: clean-objects clean-examples clean-test-suite + +clean-objects: clean-source clean-ccache + +clean-source: + @echo cleaning Source + @cd $(SOURCE) && $(MAKE) -s clean + @rm -f $(TARGET) + +clean-examples: + @$(MAKE) -k -s check-examples ACTION=clean + +clean-test-suite: + @$(MAKE) -k -s check-test-suite ACTION=clean NOSKIP=1 + +clean-%-examples: + @$(MAKE) -k -s check-$*-examples ACTION=clean + +clean-%-test-suite: + @$(MAKE) -k -s check-$*-test-suite ACTION=clean NOSKIP=1 + +clean-ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s clean) + +##################################################################### +# DISTCLEAN - clean what configure built +##################################################################### + +DISTCLEAN-DEAD = config.status config.log config.cache swig.spec Makefile mkmf.log libtool preinst-swig Lib/ocaml/swigp4.ml + +distclean-helper: distclean-test-suite distclean-examples distclean-dead + +distclean: distclean-source distclean-ccache distclean-helper + +distclean-source: + @echo distcleaning Source + @cd $(SOURCE) && $(MAKE) -s distclean + @rm -f $(TARGET) + +distclean-test-suite: + @echo distcleaning Examples/test-suite + @$(MAKE) -k -s check-test-suite ACTION=distclean NOSKIP=1 + +distclean-examples: + @echo distcleaning Examples + @$(MAKE) -k -s clean-examples + @cd Examples && $(MAKE) -k -s distclean + +distclean-ccache: + @test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s distclean) + +distclean-dead: + rm -f $(DISTCLEAN-DEAD) + rm -rf autom4te.cache + +##################################################################### +# MAINTAINER CLEAN - clean what the maintainer builds and ships in +# the distributed tarball - should not delete anything needed to run +# ./configure && make +##################################################################### + +maintainer-clean: + @echo maintainer-cleaning source + @cd $(SOURCE) && $(MAKE) -k -s maintainer-clean + @echo maintainer-cleaning CCache + @test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s maintainer-clean) + @echo maintainer-cleaning docs + @cd $(DOCS) && $(MAKE) -k -s maintainer-clean + @echo maintainer-cleaning Lib files + @rm -f $(srcdir)/Lib/swigwarn.swg + @echo distcleaning + @$(MAKE) -k -s distclean-helper + +##################################################################### +# Update the Lib/swigwarn.swg file +# Note: Generated into the source tree rather than build tree +##################################################################### + +$(srcdir)/Lib/swigwarn.swg: $(srcdir)/Source/Include/swigwarn.h + mkdir -p Lib + echo "/* SWIG warning codes */" > $@ + cat $? | grep "^#define WARN\|/\*.*\*/\|^[ \t]*$$" | sed 's/^#define \(WARN.*[0-9][0-9]*\)\(.*\)$$/%define SWIG\1 %enddef\2/' >> $@ + +##################################################################### +# TARGETS: install & friends +##################################################################### + +INSTALL = @abs_srcdir@/Tools/config/install-sh -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} -m 755 +MKINSTDIRS = @abs_srcdir@/Tools/config/install-sh -m 0755 -d +# Use standard autoconf approach to transform executable name using --program-prefix and --program-suffix +transform = @program_transform_name@ + +install: install-main install-lib install-ccache + @echo "Installation complete" + +install-main: + @echo "Installing SWIG executable" + @$(MKINSTDIRS) $(DESTDIR)$(BIN_DIR) + @echo "Installing $(DESTDIR)$(BIN_DIR)/`echo $(TARGET_NOEXE) | sed '$(transform)'`@EXEEXT@" + @$(INSTALL_PROGRAM) $(TARGET) $(DESTDIR)$(BIN_DIR)/`echo $(TARGET_NOEXE) | sed '$(transform)'`@EXEEXT@ + +lib-languages = gcj typemaps tcl perl5 python guile java mzscheme ruby php ocaml octave \ + pike chicken csharp modula3 allegrocl clisp lua cffi uffi r go d + +lib-modules = std + + +install-lib: + @echo "Installing the SWIG library" + @$(MKINSTDIRS) $(DESTDIR)$(SWIG_LIB) + @for file in $(srcdir)/Lib/*.i $(srcdir)/Lib/*.swg ; do \ + i=`basename $$file` ; \ + echo "Installing $(DESTDIR)$(SWIG_LIB)/$$i"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(SWIG_LIB)/$$i; \ + done; + @for lang in $(lib-languages) $(lib-modules); \ + do \ + echo "Installing language specific files for $$lang"; \ + dst=$(DESTDIR)$(SWIG_LIB)/$$lang; \ + $(MKINSTDIRS) $$dst; \ + (doti="`cd $(srcdir)/Lib/$$lang && ls *.i 2>/dev/null || echo ''`"; \ + dotswg="`cd $(srcdir)/Lib/$$lang && ls *.swg 2>/dev/null || echo ''`"; \ + if [ -f $(srcdir)/Lib/$$lang/extra-install.list ]; then \ + extra="`sed '/^#/d' $(srcdir)/Lib/$$lang/extra-install.list`"; \ + fi; \ + files="`echo $$doti $$dotswg $$extra`"; \ + if [ x"$$files" = x ]; then \ + echo "Installing nothing from Lib/$$lang"; \ + else for file in $$doti $$dotswg $$extra; \ + do \ + echo "Installing $$dst/$$file"; \ + $(INSTALL_DATA) $(srcdir)/Lib/$$lang/$$file $$dst/$$file; \ + done; \ + fi) ; \ + done + +install-ccache: + @test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) -s install) + + +##################################################################### +# TARGETS: uninstall & friends +##################################################################### + +uninstall: uninstall-main uninstall-lib uninstall-ccache + @echo "Uninstall complete" + +uninstall-main: + @echo "Uninstalling SWIG executable $(DESTDIR)$(BIN_DIR)/`echo $(TARGET_NOEXE) | sed '$(transform)'`@EXEEXT@" + rm -f $(DESTDIR)$(BIN_DIR)/`echo $(TARGET_NOEXE) | sed '$(transform)'`@EXEEXT@ + +uninstall-lib: + @echo "Uninstalling the SWIG library" + rm -rf $(DESTDIR)$(SWIG_LIB)/ + +uninstall-ccache: + test -z "$(ENABLE_CCACHE)" || (cd $(CCACHE) && $(MAKE) uninstall) + +############################################################################ +# DIST and other maintenance +############################################################################ + +# distribution directory +dd = @PACKAGE_NAME@-@PACKAGE_VERSION@ +srpm = @PACKAGE_NAME@-@PACKAGE_VERSION@ + +dist: + @echo "not implemented - use Tools/makedist.py instead." + false + +srcrpm: + rm -fr $(srpm) $(srpm).src.rpm + echo "TODO: update to use git instead of cvs" + cvs export -d $(srpm) -r HEAD SWIG + cp swig.spec $(srpm) + tar -cf - $(srpm) | gzip --best > $(srpm).tar.gz + rm -fr $(srpm) + rpmbuild -ts $(srpm).tar.gz + +# Update the autoconf files for detecting host/targets. Automake will do this in +# version 1.10 for our case of not having a top level Makefile.am. Until then we +# can fetch them manually and will have to commit them to Git. +configfiles: + wget ftp://ftp.gnu.org/pub/gnu/config/config.guess -O Tools/config/config.guess + chmod a+x Tools/config/config.guess + wget ftp://ftp.gnu.org/pub/gnu/config/config.sub -O Tools/config/config.sub + chmod a+x Tools/config/config.sub + +# Regenerate Makefile if Makefile.in or config.status have changed. +Makefile: $(srcdir)/Makefile.in config.status + $(SHELL) ./config.status + +# This target is usually called from Source/Makefile when configure.ac has +# changed. +am--refresh: $(srcdir)/configure + +$(srcdir)/configure: $(srcdir)/configure.ac + @echo "Build system is out of date. If the following commands fail, please reconfigure by hand (rerun: ./autogen.sh && ./configure)" + cd $(srcdir) && ./autogen.sh + $(SHELL) ./config.status --recheck + +############################################################################ +# Tools +############################################################################ + +# Coverity static code analyser build and submit - EMAIL and PASSWORD need specifying +# See http://scan.coverity.com/start/ +EMAIL=wsf@fultondesigns.co.uk +PASSWORD= +coverity: + test -n "$(PASSWORD)" || (echo "PASSWORD not set" && false) + $(MAKE) clean-source + rm -rf cov-int + cov-build --dir cov-int $(MAKE) source + tar czvf swig-coverity.tgz cov-int + curl --form file=@swig-coverity.tgz --form project=swig --form password=$(PASSWORD) --form email=$(EMAIL) http://scan5.coverity.com/cgi-bin/upload.py + +# Makefile ends here diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/capitalize --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/capitalize Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,5 @@ +#!/bin/sh +# usage: capitalize word +# write word to stdout w/ first character upcased +first_char=`echo $1 | sed 's/^\(.\).*/\1/' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` +echo ${first_char}`echo $1 | sed 's/^.//'` diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/check-include-path.pike --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/check-include-path.pike Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,20 @@ +/** + * This is a helper script to identify the proper include path + * for Pike header files. It should be run with the full path + * to the Pike executable as its single argument, e.g. + * + * pike check-include-path.pike /usr/local/bin/pike + * + * and its output should be the correct path to the header + * files, e.g. + * + * /usr/local/pike/7.2.239/include/pike + * + */ + +int main(int argc, array(string) argv) +{ + string prefix = replace(argv[1], "/bin/pike", ""); + write(prefix + "/pike/" + __MAJOR__ + "." + __MINOR__ + "." + __BUILD__ + "/include/pike"); + return 0; +} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ac_compare_version.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ac_compare_version.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,40 @@ +dnl @synopsis AC_COMPARE_VERSION\ +dnl (version-a, version-b, action-if-greater, action-if-equal, action-if-less) +dnl +dnl This macro compares two version numbers and executes the indicated action +dnl based on whether they're equal or one is greater than the other. +dnl It's needed to determine whether ocaml is new enough that the incompatible +dnl change 'loc' -> '_loc' is present in this version of camlp4. +dnl +dnl It's implemented from scratch just for SWIG by arty. +dnl +dnl @category Misc +dnl @author arty +dnl @version 2006-11-02 +dnl @license GPLWithACException + +AC_DEFUN([AC_COMPARE_VERSION], [ + # Split the version into units. + ver_a="[$1]" + ver_b="[$2]" + nodots_a=`echo $ver_a | sed -e 's/\./ /g'` + condition="equal" + isolate_b_regex='\([[0-9]]\+\).*' + for ver_part in $nodots_a ; do + b_ver_part=`echo "$ver_b" | sed -e 's/'"$isolate_b_regex"'/\1/'` + if test \( "$ver_part" -lt "$b_ver_part" \) -a \( "x$condition" = "xequal" \) ; then + condition=less + elif test \( "$ver_part" -gt "$b_ver_part" \) -a \( "x$condition" = "xequal" \) ; then + condition=greater + fi + isolate_b_regex='[[0-9]]\+\.'"$isolate_b_regex" + done + + if test "x$condition" = "xequal" ; then + [$4] + elif test "x$condition" = "xless" ; then + [$3] + elif test "x$condition" = "xgreater" ; then + [$5] + fi +]) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ac_compile_warnings.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ac_compile_warnings.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,56 @@ +dnl @synopsis AC_COMPILE_WARNINGS +dnl +dnl Set the maximum warning verbosity according to C and C++ compiler used. +dnl Currently supports g++ and gcc. +dnl +dnl The compiler options are always added CFLAGS and CXXFLAGS even if +dnl these are overidden at configure time. Removing the maximum warning +dnl flags can be removed with --without-maximum-compile-warnings. For example: +dnl +dnl ./configure --without-maximum-compile-warnings CFLAGS= CXXFLAGS= +dnl +dnl @category Misc +dnl @author Loic Dachary <loic@senga.org> +dnl @author William Fulton <wsf@fultondesigns.co.uk> +dnl @version 2005-04-29 +dnl @license GPLWithACException + +AC_DEFUN([AC_COMPILE_WARNINGS], [ +AC_MSG_CHECKING([maximum warning verbosity option]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_PROG_CXX]) + + AC_ARG_WITH([maximum-compile-warnings], + AS_HELP_STRING([--without-maximum-compile-warnings], + [Disable maximum warning verbosity]), + [ac_compile_warnings_on="$withval"], + [ac_compile_warnings_on=""]) + + if test x"$ac_compile_warnings_on" = xno + then + ac_compile_warnings_msg=no + else + if test -n "$CXX" + then + if test "$GXX" = "yes" + then + ac_compile_warnings_opt='-Wall -W -ansi -pedantic' + fi + CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" + ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" + fi + + if test -n "$CC" + then + if test "$GCC" = "yes" + then + ac_compile_warnings_opt='-Wall -W -ansi -pedantic' + fi + CFLAGS="$CFLAGS $ac_compile_warnings_opt" + ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" + fi + fi + AC_MSG_RESULT([$ac_compile_warnings_msg]) + unset ac_compile_warnings_msg + unset ac_compile_warnings_opt +]) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ac_define_dir.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ac_define_dir.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,35 @@ +dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) +dnl +dnl This macro sets VARNAME to the expansion of the DIR variable, +dnl taking care of fixing up ${prefix} and such. +dnl +dnl VARNAME is then offered as both an output variable and a C +dnl preprocessor symbol. +dnl +dnl Example: +dnl +dnl AC_DEFINE_DIR([DATADIR], [datadir], [Where data are placed to.]) +dnl +dnl @category Misc +dnl @author Stepan Kasal <kasal@ucw.cz> +dnl @author Andreas Schwab <schwab@suse.de> +dnl @author Guido Draheim <guidod@gmx.de> +dnl @author Alexandre Oliva +dnl @version 2005-07-29 +dnl @license AllPermissive + +AC_DEFUN([AC_DEFINE_DIR], [ + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix +dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn +dnl refers to ${prefix}. Thus we have to use `eval' twice. + eval ac_define_dir="\"[$]$2\"" + eval ac_define_dir="\"$ac_define_dir\"" + AC_SUBST($1, "$ac_define_dir") + AC_DEFINE_UNQUOTED($1, "$ac_define_dir", [$3]) + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE +]) + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ax_boost_base.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ax_boost_base.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,258 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# DESCRIPTION +# +# Test for the Boost C++ libraries of a particular version (or newer) +# +# If no path to the installed boost library is given the macro searchs +# under /usr, /usr/local, /opt and /opt/local and evaluates the +# $BOOST_ROOT environment variable. Further documentation is available at +# <http://randspringer.de/boost/index.html>. +# +# This macro calls: +# +# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS) +# +# And sets: +# +# HAVE_BOOST +# +# LICENSE +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2009 Peter Adolphs +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 20 + +AC_DEFUN([AX_BOOST_BASE], +[ +AC_ARG_WITH([boost], + [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], + [use Boost library from a standard location (ARG=yes), + from the specified location (ARG=<path>), + or disable it (ARG=no) + @<:@ARG=yes@:>@ ])], + [ + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ac_boost_path="" + else + want_boost="yes" + ac_boost_path="$withval" + fi + ], + [want_boost="yes"]) + + +AC_ARG_WITH([boost-libdir], + AS_HELP_STRING([--with-boost-libdir=LIB_DIR], + [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]), + [ + if test -d "$withval" + then + ac_boost_lib_path="$withval" + else + AC_MSG_ERROR(--with-boost-libdir expected directory name) + fi + ], + [ac_boost_lib_path=""] +) + +if test "x$want_boost" = "xyes"; then + boost_lib_version_req=ifelse([$1], ,1.20.0,$1) + boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` + boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` + boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` + boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` + if test "x$boost_lib_version_req_sub_minor" = "x" ; then + boost_lib_version_req_sub_minor="0" + fi + WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` + AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) + succeeded=no + + dnl On 64-bit systems check for system libraries in both lib64 and lib. + dnl The former is specified by FHS, but e.g. Debian does not adhere to + dnl this (as it rises problems for generic multi-arch support). + dnl The last entry in the list is chosen by default when no libraries + dnl are found, e.g. when only header-only libraries are installed! + libsubdirs="lib" + ax_arch=`uname -m` + if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then + libsubdirs="lib64 lib lib64" + fi + + dnl first we check the system location for boost libraries + dnl this location ist chosen if boost libraries are installed with the --layout=system option + dnl or if you install boost with RPM + if test "$ac_boost_path" != ""; then + BOOST_CPPFLAGS="-I$ac_boost_path/include" + for ac_boost_path_tmp in $libsubdirs; do + if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then + BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" + break + fi + done + elif test "$cross_compiling" != yes; then + for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do + if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then + for libsubdir in $libsubdirs ; do + if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" + BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" + break; + fi + done + fi + + dnl overwrite ld flags if we have required special directory with + dnl --with-boost-libdir parameter + if test "$ac_boost_lib_path" != ""; then + BOOST_LDFLAGS="-L$ac_boost_lib_path" + fi + + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_REQUIRE([AC_PROG_CXX]) + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include <boost/version.hpp> + ]], [[ + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + succeeded=yes + found_system=yes + ],[ + ]) + AC_LANG_POP([C++]) + + + + dnl if we found no boost with system layout we search for boost libraries + dnl built and installed without the --layout=system option or for a staged(not installed) version + if test "x$succeeded" != "xyes"; then + _version=0 + if test "$ac_boost_path" != ""; then + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + fi + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" + done + fi + else + if test "$cross_compiling" != yes; then + for ac_boost_path in /usr /usr/local /opt /opt/local ; do + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + best_path=$ac_boost_path + fi + done + fi + done + + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" + if test "$ac_boost_lib_path" = ""; then + for libsubdir in $libsubdirs ; do + if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + BOOST_LDFLAGS="-L$best_path/$libsubdir" + fi + fi + + if test "x$BOOST_ROOT" != "x"; then + for libsubdir in $libsubdirs ; do + if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then + version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` + stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` + stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` + V_CHECK=`expr $stage_version_shorten \>\= $_version` + if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then + AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) + BOOST_CPPFLAGS="-I$BOOST_ROOT" + BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" + fi + fi + fi + fi + + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + AC_LANG_PUSH(C++) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include <boost/version.hpp> + ]], [[ + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + ]])],[ + AC_MSG_RESULT(yes) + succeeded=yes + found_system=yes + ],[ + ]) + AC_LANG_POP([C++]) + fi + + if test "$succeeded" != "yes" ; then + if test "$_version" = "0" ; then + AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]]) + else + AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) + fi + # execute ACTION-IF-NOT-FOUND (if present): + ifelse([$3], , :, [$3]) + else + AC_SUBST(BOOST_CPPFLAGS) + AC_SUBST(BOOST_LDFLAGS) + AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) + # execute ACTION-IF-FOUND (if present): + ifelse([$2], , :, [$2]) + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" +fi + +]) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ax_compare_version.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ax_compare_version.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,177 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) +# +# DESCRIPTION +# +# This macro compares two version strings. Due to the various number of +# minor-version numbers that can exist, and the fact that string +# comparisons are not compatible with numeric comparisons, this is not +# necessarily trivial to do in a autoconf script. This macro makes doing +# these comparisons easy. +# +# The six basic comparisons are available, as well as checking equality +# limited to a certain number of minor-version levels. +# +# The operator OP determines what type of comparison to do, and can be one +# of: +# +# eq - equal (test A == B) +# ne - not equal (test A != B) +# le - less than or equal (test A <= B) +# ge - greater than or equal (test A >= B) +# lt - less than (test A < B) +# gt - greater than (test A > B) +# +# Additionally, the eq and ne operator can have a number after it to limit +# the test to that number of minor versions. +# +# eq0 - equal up to the length of the shorter version +# ne0 - not equal up to the length of the shorter version +# eqN - equal up to N sub-version levels +# neN - not equal up to N sub-version levels +# +# When the condition is true, shell commands ACTION-IF-TRUE are run, +# otherwise shell commands ACTION-IF-FALSE are run. The environment +# variable 'ax_compare_version' is always set to either 'true' or 'false' +# as well. +# +# Examples: +# +# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) +# +# would both be true. +# +# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) +# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) +# +# would both be false. +# +# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) +# +# would be true because it is only comparing two minor versions. +# +# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) +# +# would be true because it is only comparing the lesser number of minor +# versions of the two values. +# +# Note: The characters that separate the version numbers do not matter. An +# empty string is the same as version 0. OP is evaluated by autoconf, not +# configure, so must be a string, not a variable. +# +# The author would like to acknowledge Guido Draheim whose advice about +# the m4_case and m4_ifvaln functions make this macro only include the +# portions necessary to perform the specific comparison specified by the +# OP argument in the final configure script. +# +# LICENSE +# +# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +dnl ######################################################################### +AC_DEFUN([AX_COMPARE_VERSION], [ + AC_REQUIRE([AC_PROG_AWK]) + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + AS_VAR_PUSHDEF([A],[ax_compare_version_A]) + A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + AS_VAR_PUSHDEF([B],[ax_compare_version_B]) + B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ + -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ + -e 's/[[^0-9]]//g'` + + dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary + dnl # then the first line is used to determine if the condition is true. + dnl # The sed right after the echo is to remove any indented white space. + m4_case(m4_tolower($2), + [lt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [gt],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` + ], + [le],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ], + [ge],[ + ax_compare_version=`echo "x$A +x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` + ],[ + dnl Split the operator from the subversion count if present. + m4_bmatch(m4_substr($2,2), + [0],[ + # A count of zero means use the length of the shorter version. + # Determine the number of characters in A and B. + ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` + ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` + + # Set A to no more than B's length and B to no more than A's length. + A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` + B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` + ], + [[0-9]+],[ + # A count greater than zero means use only that many subversions + A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` + ], + [.+],[ + AC_WARNING( + [illegal OP numeric parameter: $2]) + ],[]) + + # Pad zeros at end of numbers to make same length. + ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" + B="$B`echo $A | sed 's/./0/g'`" + A="$ax_compare_version_tmp_A" + + # Check for equality or inequality as necessary. + m4_case(m4_tolower(m4_substr($2,0,2)), + [eq],[ + test "x$A" = "x$B" && ax_compare_version=true + ], + [ne],[ + test "x$A" != "x$B" && ax_compare_version=true + ],[ + AC_WARNING([illegal OP parameter: $2]) + ]) + ]) + + AS_VAR_POPDEF([A])dnl + AS_VAR_POPDEF([B])dnl + + dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. + if test "$ax_compare_version" = "true" ; then + m4_ifvaln([$4],[$4],[:])dnl + m4_ifvaln([$5],[else $5])dnl + fi +]) dnl AX_COMPARE_VERSION diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ax_path_generic.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ax_path_generic.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,164 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_path_generic.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PATH_GENERIC(LIBRARY,[MINIMUM-VERSION,[SED-EXPR-EXTRACTOR]],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[CONFIG-SCRIPTS],[CFLAGS-ARG],[LIBS-ARG]) +# +# DESCRIPTION +# +# Runs the LIBRARY-config script and defines LIBRARY_CFLAGS and +# LIBRARY_LIBS unless the user had predefined them in the environment. +# +# The script must support `--cflags' and `--libs' args. If MINIMUM-VERSION +# is specified, the script must also support the `--version' arg. If the +# `--with-library-[exec-]prefix' arguments to ./configure are given, it +# must also support `--prefix' and `--exec-prefix'. Prefereable use +# CONFIG-SCRIPTS as config script, CFLAGS-ARG instead of `--cflags` and +# LIBS-ARG instead of `--libs`, if given. +# +# The SED-EXPR-EXTRACTOR parameter representes the expression used in sed +# to extract the version number. Use it if your 'foo-config --version' +# dumps something like 'Foo library v1.0.0 (alfa)' instead of '1.0.0'. +# +# The macro respects LIBRARY_CONFIG, LIBRARY_CFLAGS and LIBRARY_LIBS +# variables. If the first one is defined, it specifies the name of the +# config script to use. If the latter two are defined, the script is not +# ran at all and their values are used instead (if only one of them is +# defined, the empty value of the remaining one is still used). +# +# Example: +# +# AX_PATH_GENERIC(Foo, 1.0.0) +# +# would run `foo-config --version' and check that it is at least 1.0.0, if +# successful the following variables would be defined and substituted: +# +# FOO_CFLAGS to `foo-config --cflags` +# FOO_LIBS to `foo-config --libs` +# +# Example: +# +# AX_PATH_GENERIC([Bar],,,[ +# AC_MSG_ERROR([Cannot find Bar library]) +# ]) +# +# would check for bar-config program, defining and substituting the +# following variables: +# +# BAR_CFLAGS to `bar-config --cflags` +# BAR_LIBS to `bar-config --libs` +# +# Example: +# +# ./configure BAZ_LIBS=/usr/lib/libbaz.a +# +# would link with a static version of baz library even if `baz-config +# --libs` returns just "-lbaz" that would normally result in using the +# shared library. +# +# This macro is a rearranged version of AC_PATH_GENERIC from Angus Lees. +# +# LICENSE +# +# Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 11 + +AU_ALIAS([AC_PATH_GENERIC], [AX_PATH_GENERIC]) +AC_DEFUN([AX_PATH_GENERIC],[ + AC_REQUIRE([AC_PROG_SED]) + + dnl we're going to need uppercase and lowercase versions of the + dnl string `LIBRARY' + pushdef([UP], translit([$1], [a-z], [A-Z]))dnl + pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl + + AC_ARG_WITH(DOWN-prefix,[AS_HELP_STRING([--with-]DOWN[-prefix=PREFIX], [Prefix where $1 is installed (optional)])], + DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") + AC_ARG_WITH(DOWN-exec-prefix,[AS_HELP_STRING([--with-]DOWN[-exec-prefix=EPREFIX], [Exec prefix where $1 is installed (optional)])], + DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") + + AC_ARG_VAR(UP[]_CONFIG, [config script used for $1]) + AC_ARG_VAR(UP[]_CFLAGS, [CFLAGS used for $1]) + AC_ARG_VAR(UP[]_LIBS, [LIBS used for $1]) + + AS_IF([test x$UP[]_CFLAGS != x -o x$UP[]_LIBS != x],[ + dnl Don't run config script at all, use user-provided values instead. + AC_SUBST(UP[]_CFLAGS) + AC_SUBST(UP[]_LIBS) + : + $4 + ],[ + AS_IF([test x$DOWN[]_config_exec_prefix != x],[ + DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" + AS_IF([test x${UP[]_CONFIG+set} != xset],[ + UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config + ]) + ]) + AS_IF([test x$DOWN[]_config_prefix != x],[ + DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" + AS_IF([test x${UP[]_CONFIG+set} != xset],[ + UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config + ]) + ]) + + AC_PATH_PROGS(UP[]_CONFIG,[$6 DOWN-config],[no]) + AS_IF([test "$UP[]_CONFIG" = "no"],[ + : + $5 + ],[ + dnl Get the CFLAGS from LIBRARY-config script + AS_IF([test x"$7" = x],[ + UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" + ],[ + UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args $7`" + ]) + + dnl Get the LIBS from LIBRARY-config script + AS_IF([test x"$8" = x],[ + UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" + ],[ + UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args $8`" + ]) + + AS_IF([test x"$2" != x],[ + dnl Check for provided library version + AS_IF([test x"$3" != x],[ + dnl Use provided sed expression + DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e $3`" + ],[ + DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e 's/^\ *\(.*\)\ *$/\1/'`" + ]) + + AC_MSG_CHECKING([for $1 ($DOWN[]_version) >= $2]) + AX_COMPARE_VERSION($DOWN[]_version,[ge],[$2],[ + AC_MSG_RESULT([yes]) + + AC_SUBST(UP[]_CFLAGS) + AC_SUBST(UP[]_LIBS) + : + $4 + ],[ + AC_MSG_RESULT([no]) + : + $5 + ]) + ],[ + AC_SUBST(UP[]_CFLAGS) + AC_SUBST(UP[]_LIBS) + : + $4 + ]) + ]) + ]) + + popdef([UP]) + popdef([DOWN]) +]) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/compile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/compile Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,310 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-01-04.17; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free +# Software Foundation, Inc. +# Written by Tom Tromey <tromey@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l*) + lib=${1#-l} + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + set x "$@" "$dir/$lib.dll.lib" + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + set x "$@" "$dir/$lib.lib" + break + fi + done + IFS=$save_IFS + + test "$found" != yes && set x "$@" "$lib.lib" + shift + ;; + -L*) + func_file_conv "${1#-L}" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/config.guess --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/config.guess Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1530 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to <config-patches@gnu.org> and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` + case ${UNAME_PROCESSOR} in + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:MSYS*:*) + echo ${UNAME_MACHINE}-pc-msys + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo ${UNAME_MACHINE}-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + hexagon:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; + x86_64:VMkernel:*:*) + echo ${UNAME_MACHINE}-unknown-esx + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include <sys/param.h> +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 <<EOF +$0: unable to guess system type + +This script, last modified $timestamp, has failed to recognize +the operating system you are using. It is advised that you +download the most up to date version of the config scripts from + + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +and + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +If the version you run ($0) is already up to date, please +send the following data and any information you think might be +pertinent to <config-patches@gnu.org> in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/config.sub --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/config.sub Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1773 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011, 2012 Free Software Foundation, Inc. + +timestamp='2012-02-10' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to <config-patches@gnu.org>. Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to <config-patches@gnu.org>." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + android-linux) + os=-linux-android + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | be32 | be64 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | epiphany \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nios | nios2 \ + | ns16k | ns32k \ + | open8 \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pyramid \ + | rl78 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ + | we32k \ + | x86 | xc16x | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + xgate) + basic_machine=$basic_machine-unknown + os=-none + ;; + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | aarch64-* | aarch64_be-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | be32-* | be64-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | hexagon-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | le32-* | le64-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pyramid-* \ + | rl78-* | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile*-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ + | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16 | cr16-*) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + msys) + basic_machine=i386-pc + os=-msys + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + nacl) + basic_machine=le32-unknown + os=-nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc | ppcbe) basic_machine=powerpc-unknown + ;; + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tile*) + basic_machine=$basic_machine-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -nacl*) + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/depcomp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/depcomp Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,688 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2011-12-04.11; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, +# 2011 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>. + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputting dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp +fi + +if test "$depmode" = msvc7msys; then + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. hp depmode also adds that space, but also prefixes the VPATH +## to the object. Take care to not repeat it in the output. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> "$depfile" + echo >> "$depfile" + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${ + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +msvc7) + if test "$libtool" = yes; then + showIncludes=-Wc,-showIncludes + else + showIncludes=-showIncludes + fi + "$@" $showIncludes > "$tmpdepfile" + stat=$? + grep -v '^Note: including file: ' "$tmpdepfile" + if test "$stat" = 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + # The first sed program below extracts the file names and escapes + # backslashes for cygpath. The second sed program outputs the file + # name when reading, but also accumulates all include files in the + # hold buffer in order to output them again at the end. This only + # works with sed implementations that can handle large buffers. + sed < "$tmpdepfile" -n ' +/^Note: including file: *\(.*\)/ { + s//\1/ + s/\\/\\\\/g + p +}' | $cygpath_u | sort -u | sed -n ' +s/ /\\ /g +s/\(.*\)/ \1 \\/p +s/.\(.*\) \\/\1:/ +H +$ { + s/.*/ / + G + p +}' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvc7msys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + # makedepend may prepend the VPATH from the source file name to the object. + # No need to regex-escape $object, excess matching of '.' is harmless. + sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/install-sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/install-sh Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,527 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2011-01-19.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names problematic for `test' and other utilities. + case $src in + -* | [=\(\)!]) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + dst=$dst_arg + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/missing --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/missing Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,331 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2012-01-06.13; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and +\`g' are ignored when checking the name. + +Send bug reports to <bug-automake@gnu.org>." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# normalize program name to check for. +program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). This is about non-GNU programs, so use $1 not +# $program. +case $1 in + lex*|yacc*) + # Not GNU programs, they don't have --version. + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $program in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te*) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison*|yacc*) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex*|flex*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG=\${$#} + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit $? + fi + ;; + + makeinfo*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/config/ylwrap --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/config/ylwrap Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,226 @@ +#! /bin/sh +# ylwrap - wrapper for lex/yacc invocations. + +scriptversion=2011-08-25.18; # UTC + +# Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, +# 2007, 2009, 2010, 2011 Free Software Foundation, Inc. +# +# Written by Tom Tromey <tromey@cygnus.com>. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +case "$1" in + '') + echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 + exit 1 + ;; + --basedir) + basedir=$2 + shift 2 + ;; + -h|--h*) + cat <<\EOF +Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... + +Wrapper for lex/yacc invocations, renaming files as desired. + + INPUT is the input file + OUTPUT is one file PROG generates + DESIRED is the file we actually want instead of OUTPUT + PROGRAM is program to run + ARGS are passed to PROG + +Any number of OUTPUT,DESIRED pairs may be used. + +Report bugs to <bug-automake@gnu.org>. +EOF + exit $? + ;; + -v|--v*) + echo "ylwrap $scriptversion" + exit $? + ;; +esac + + +# The input. +input="$1" +shift +case "$input" in + [\\/]* | ?:[\\/]*) + # Absolute path; do nothing. + ;; + *) + # Relative path. Make it absolute. + input="`pwd`/$input" + ;; +esac + +pairlist= +while test "$#" -ne 0; do + if test "$1" = "--"; then + shift + break + fi + pairlist="$pairlist $1" + shift +done + +# The program to run. +prog="$1" +shift +# Make any relative path in $prog absolute. +case "$prog" in + [\\/]* | ?:[\\/]*) ;; + *[\\/]*) prog="`pwd`/$prog" ;; +esac + +# FIXME: add hostname here for parallel makes that run commands on +# other machines. But that might take us over the 14-char limit. +dirname=ylwrap$$ +do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' +trap "ret=129; $do_exit" 1 +trap "ret=130; $do_exit" 2 +trap "ret=141; $do_exit" 13 +trap "ret=143; $do_exit" 15 +mkdir $dirname || exit 1 + +cd $dirname + +case $# in + 0) "$prog" "$input" ;; + *) "$prog" "$@" "$input" ;; +esac +ret=$? + +if test $ret -eq 0; then + set X $pairlist + shift + first=yes + # Since DOS filename conventions don't allow two dots, + # the DOS version of Bison writes out y_tab.c instead of y.tab.c + # and y_tab.h instead of y.tab.h. Test to see if this is the case. + y_tab_nodot="no" + if test -f y_tab.c || test -f y_tab.h; then + y_tab_nodot="yes" + fi + + # The directory holding the input. + input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` + # Quote $INPUT_DIR so we can use it in a regexp. + # FIXME: really we should care about more than `.' and `\'. + input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` + + while test "$#" -ne 0; do + from="$1" + # Handle y_tab.c and y_tab.h output by DOS + if test $y_tab_nodot = "yes"; then + if test $from = "y.tab.c"; then + from="y_tab.c" + else + if test $from = "y.tab.h"; then + from="y_tab.h" + fi + fi + fi + if test -f "$from"; then + # If $2 is an absolute path name, then just use that, + # otherwise prepend `../'. + case "$2" in + [\\/]* | ?:[\\/]*) target="$2";; + *) target="../$2";; + esac + + # We do not want to overwrite a header file if it hasn't + # changed. This avoid useless recompilations. However the + # parser itself (the first file) should always be updated, + # because it is the destination of the .y.c rule in the + # Makefile. Divert the output of all other files to a temporary + # file so we can compare them to existing versions. + if test $first = no; then + realtarget="$target" + target="tmp-`echo $target | sed s/.*[\\/]//g`" + fi + # Edit out `#line' or `#' directives. + # + # We don't want the resulting debug information to point at + # an absolute srcdir; it is better for it to just mention the + # .y file with no path. + # + # We want to use the real output file name, not yy.lex.c for + # instance. + # + # We want the include guards to be adjusted too. + FROM=`echo "$from" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + TARGET=`echo "$2" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` + + sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ + -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? + + # Check whether header files must be updated. + if test $first = no; then + if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then + echo "$2" is unchanged + rm -f "$target" + else + echo updating "$2" + mv -f "$target" "$realtarget" + fi + fi + else + # A missing file is only an error for the first file. This + # is a blatant hack to let us support using "yacc -d". If -d + # is not specified, we don't want an error when the header + # file is "missing". + if test $first = yes; then + ret=1 + fi + fi + shift + shift + first=no + done +else + ret=$? +fi + +# Remove the directory. +cd .. +rm -rf $dirname + +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/mkdist.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/mkdist.py Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,100 @@ +#!/usr/bin/env python + +# This script builds a swig-x.y.z distribution. +# Usage : mkdist.py version, where version should be x.y.z + +import sys +import string +import os +import subprocess + +def failed(): + print "mkdist.py failed to complete" + sys.exit(2) + + +try: + version = sys.argv[1] + dirname = "swig-" + version +except: + print "Usage: mkdist.py version, where version should be x.y.z" + sys.exit(1) + +# Check name matches normal unix conventions +if string.lower(dirname) != dirname: + print "directory name ("+dirname+") should be in lowercase" + sys.exit(3) + +# If directory and tarball exist, remove it +print "Removing ", dirname +os.system("rm -rf "+dirname) + +print "Removing "+dirname+".tar if exists" +os.system("rm -f "+dirname+".tar.gz") + +print "Removing "+dirname+".tar.gz if exists" +os.system("rm -f "+dirname+".tar") + +# Grab the code from git + +print "Checking git repository is in sync with remote repository" +os.system("git remote update") == 0 or failed() +command = ["git", "status", "--porcelain", "-uno"] +out = subprocess.check_output(command) +if out.strip() != "": + print "Local git repository has modifications" + print " ".join(command) + print out + sys.exit(3) + +command = ["git", "log", "--oneline", "master..origin/master"] +out = subprocess.check_output(command) +if out.strip() != "": + print "Remote repository has additional modifications to local repository" + print " ".join(command) + print out + sys.exit(3) + +command = ["git", "log", "--oneline", "origin/master..master"] +out = subprocess.check_output(command) +if out.strip() != "": + print "Local repository has modifications not pushed to the remote repository" + print "These should be pushed and checked that they pass Continuous Integration testing before continuing" + print " ".join(command) + print out + sys.exit(3) + +print "Tagging release" +tag = "'rel-" + version + "'" +os.system("git tag -a -m " + tag + " " + tag) == 0 or failed() + +outdir = os.path.basename(os.getcwd()) + "/" + dirname + "/" +print "Grabbing tagged release git repository using 'git archive' into " + outdir +os.system("(cd .. && git archive --prefix=" + outdir + " " + tag + " . | tar -xf -)") == 0 or failed() + +# Remove the debian directory -- it's not official + +os.system("rm -Rf "+dirname+"/debian") == 0 or failed() + +# Go build the system + +print "Building system" +os.system("cd "+dirname+" && ./autogen.sh") == 0 or failed() +os.system("cd "+dirname+"/Source/CParse && bison -y -d parser.y && mv y.tab.c parser.c && mv y.tab.h parser.h") == 0 or failed() +os.system("cd "+dirname+" && make -f Makefile.in libfiles srcdir=./") == 0 or failed() + +# Remove autoconf files +os.system("find "+dirname+" -name autom4te.cache -exec rm -rf {} \\;") + +# Build documentation +print "Building html documentation" +os.system("cd "+dirname+"/Doc/Manual && make all clean-baks") == 0 or failed() +print "Building man pages" +os.system("cd "+dirname+"/CCache && yodl2man -o ccache-swig.1 ccache.yo") == 0 or failed() + +# Build the tar-ball +os.system("tar -cf "+dirname+".tar "+dirname) == 0 or failed() +os.system("gzip "+dirname+".tar") == 0 or failed() + +print "Finished building "+dirname+".tar.gz" + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/mkrelease.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/mkrelease.py Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,48 @@ +#!/usr/bin/env python + +# This script builds the SWIG source tarball, creates the Windows executable and the Windows zip package +# and uploads them both to SF ready for release. Also uploaded are the release notes. +import sys +import string +import os + +def failed(message): + if message == "": + print "mkrelease.py failed to complete" + else: + print message + sys.exit(2) + +try: + version = sys.argv[1] + username = sys.argv[2] +except: + print "Usage: python mkrelease.py version username" + print "where version should be x.y.z and username is your SF username" + sys.exit(1) + +print "Looking for rsync" +os.system("which rsync") and failed("rsync not installed/found. Please install.") + +print "Making source tarball" +os.system("python ./mkdist.py " + version) and failed("") + +print "Build Windows package" +os.system("./mkwindows.sh " + version) and failed("") + +print "Uploading to SourceForge" + +swig_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swig/swig-" + version + "/" +swigwin_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swigwin/swigwin-" + version + "/" + +# If a file with 'readme' in the name exists in the same folder as the zip/tarball, it gets automatically displayed as the release notes by SF +full_readme_file = "readme-" + version + ".txt" +os.system("rm -f " + full_readme_file) +os.system("cat swig-" + version + "/README " + "swig-" + version + "/CHANGES.current " + "swig-" + version + "/RELEASENOTES " + "> " + full_readme_file) + +os.system("rsync --archive --verbose -P --times -e ssh " + "swig-" + version + ".tar.gz " + full_readme_file + " " + swig_dir_sf) and failed("") +os.system("rsync --archive --verbose -P --times -e ssh " + "swigwin-" + version + ".zip " + full_readme_file + " " + swigwin_dir_sf) and failed("") + +print "Finished" + +print "Now log in to SourceForge and set the operating systems applicable to the newly uploaded tarball and zip file. Also remember to do a 'git push'." diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/mkwindows.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/mkwindows.sh Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,122 @@ +#!/bin/sh + +# Build Windows distribution (swigwin-2.0.x.zip) from source tarball (swig-2.0.x.tar.gz) +# Requires running in either: +# - MinGW environment +# - Linux using MinGW cross compiler +# - Cygwin using MinGW compiler + +# path to zip program +zip= + +# options for configure +extraconfigureoptions= +compileflags="-O2" +extracompileflags= + +if test x$1 != x; then + version=$1 + if test x$2 != x; then + zip=$2; + echo zip: $zip; + fi +else + echo "Usage: mkwindows.sh version [zip]" + echo " Build SWIG Windows distribution from source tarball. Works on Cygwin, MinGW or Linux" + echo " version should be 2.0.x" + echo " zip is full path to zip program - default is /c/cygwin/bin/zip on MinGW, zip on Linux and Cygwin" + exit 1 +fi + +uname=`uname -a` +mingw=`echo "$uname" | grep -i mingw` +linux=`echo "$uname" | grep -i linux` +cygwin=`echo "$uname" | grep -i cygwin` +if test "$mingw"; then + echo "Building native Windows executable on MinGW"; + if test x$zip = x; then + zip=/c/cygwin/bin/zip + fi +else + if test "$linux"; then + echo "Building native Windows executable on Linux" + if test x$zip = x; then + zip=zip + fi + extraconfigureoptions="--host=i586-mingw32msvc --build=i686-linux" + else + if test "$cygwin"; then + echo "Building native Windows executable on Cygwin" + if test x$zip = x; then + zip=zip + fi + compileflags="-O2 -mno-cygwin" + else + echo "Unknown platform. Requires either Linux or MinGW." + exit 1; + fi + fi +fi + +swigbasename=swig-$version +swigwinbasename=swigwin-$version +tarball=$swigbasename.tar.gz +pcre_tarball=`ls pcre-*.tar.*` + +if ! test -f "$pcre_tarball"; then + echo "Could not find PCRE tarball. Please download a PCRE source tarball from http://www.pcre.org" + echo "and place in the same directory as the SWIG tarball." + exit 1 +fi + +if test -f "$tarball"; then + builddir=build-$version + if test -e $builddir; then + echo "Deleting directory $builddir..." + rm -rf $builddir + fi + echo "Creating directory $builddir..." + mkdir $builddir + cd $builddir + echo "Unzipping tarball..." + tar -zxf ../$tarball + sleep 2 # fix strange not finding newly created directory + if test -d $swigbasename; then + mv $swigbasename $swigwinbasename + tar -zxf ../$tarball + cd $swigbasename + (cd ../.. && cp $pcre_tarball $builddir/$swigbasename) + echo Running: Tools/pcre-build.sh $extraconfigureoptions CFLAGS="$compileflags" CXXFLAGS="$compileflags" + ./Tools/pcre-build.sh $extraconfigureoptions CFLAGS="$compileflags" CXXFLAGS="$compileflags" || exit 1 + echo Running: ./configure $extraconfigureoptions CFLAGS="$compileflags" CXXFLAGS="$compileflags" + ./configure $extraconfigureoptions CFLAGS="$compileflags" CXXFLAGS="$compileflags" || exit 1 + echo "Compiling (quietly)..." + make > build.log + echo "Simple check to see if swig.exe runs..." + env LD_LIBRARY_PATH= PATH= ./swig.exe -version || exit 1 + echo "Simple check to see if ccache-swig.exe runs..." + env LD_LIBRARY_PATH= PATH= ./CCache/ccache-swig.exe -V || exit 1 + echo "Creating $swigwinbasename.zip..." + cd .. + cp $swigbasename/swig.exe $swigwinbasename + cp $swigbasename/CCache/ccache-swig.exe $swigwinbasename/CCache + cp $swigbasename/Lib/swigwarn.swg $swigwinbasename/Lib + sleep 2 # fix strange not finding swig.exe + echo "Unzip into a directory of your choice. Please read the README file as well as Doc\Manual\Windows.html for installation instructions." > swig_windows_zip_comments.txt + rm -f ../$swigwinbasename.zip + $zip -q -r -9 -z < swig_windows_zip_comments.txt ../$swigwinbasename.zip $swigwinbasename + rm -f swig_windows_zip_comments.txt + echo "Cleaning up..." + cd .. + rm -rf $builddir + echo "Finished building $swigwinbasename.zip" + else + echo "Expecting tarball to create directory: $swigbasename but it does not exist" + exit 1 + fi +else + echo tarball missing: $tarball + exit 1 +fi + +exit 0 diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/pcre-build.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/pcre-build.sh Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,55 @@ +#!/bin/sh + +pcre_subdir=pcre/pcre-swig-install +pcre_install_dir=`pwd`/$pcre_subdir + +usage() { + echo "Helper script to build PCRE as a static library from a tarball just for use during the" + echo "SWIG build. It does not install PCRE for global use on your system." + echo "Usage: pcre-build.sh [--help] [args]" + echo " args - optional additional arguments passed on to the PCRE configure script (leave out" + echo " unless you are an expert at configure)" + echo " --help - Display this help information." + echo "Instructions:" + echo " - Download the latest PCRE source tarball from http://www.pcre.org and place in the" + echo " directory that you will configure and build SWIG." + echo " - Run this script in the same directory that you intend to configure and build SWIG in." + echo " This will configure and build PCRE as a static library." + echo " - Afterwards run the SWIG configure script which will then find and use the PCRE static" + echo " libraries in the $pcre_subdir subdirectory." + exit 0 +} + +bail() { + echo $1 >&2 + exit 1 +} + +if test "$1" = "-h" -o "$1" = "-help" -o "$1" = "--help" ; then + usage +fi + +if test -f "pcre-build.sh" ; then + echo "Error: this script should not be run in the Tools directory" >&2 + echo "" + usage +fi + +echo "Looking for PCRE tarball..." +rm -rf pcre +pcre_tarball=`ls pcre-*.tar*` +test -n "$pcre_tarball" || bail "Could not find tarball matching pattern: pcre-*.tar*" +test -f "$pcre_tarball" || bail "Could not find a single PCRE tarball. Found: $pcre_tarball" + +echo "Extracting tarball: $pcre_tarball" +tar -xf $pcre_tarball || bail "Could not untar $pcre_tarball" +pcre_dir=`echo $pcre_tarball | sed -e "s/\.tar.*//"` +echo "Configuring PCRE in directory: pcre" +mv $pcre_dir pcre || bail "Could not create pcre directory" +cd pcre && ./configure --prefix=$pcre_install_dir --disable-shared $* || bail "PCRE configure failed" +echo "Building PCRE..." +${MAKE:-make} -s || bail "Could not build PCRE" +echo "Installing PCRE locally to $pcre_install_dir..." +${MAKE:-make} -s install || bail "Could not install PCRE" +echo "" +echo "The SWIG configure script can now be run, whereupon PCRE will automatically be detected and used from $pcre_install_dir/bin/pcre-config." diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/pyname_patch.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/pyname_patch.py Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,123 @@ +#!/usr/bin/env python +""" +From SWIG 1.3.37 we deprecated all SWIG symbols that start with Py, +since they are inappropriate and discouraged in Python documentation +(from http://www.python.org/doc/2.5.2/api/includes.html): + +"All user visible names defined by Python.h (except those defined by the included +standard headers) have one of the prefixes "Py" or "_Py". Names beginning with +"_Py" are for internal use by the Python implementation and should not be used +by extension writers. Structure member names do not have a reserved prefix. + +Important: user code should never define names that begin with "Py" or "_Py". +This confuses the reader, and jeopardizes the portability of the user code to +future Python versions, which may define additional names beginning with one +of these prefixes." + +This file is a simple script used for change all of these symbols, for user code +or SWIG itself. +""" +import re +from shutil import copyfile +import sys + +symbols = [ + #(old name, new name) + ("PySequence_Base", "SwigPySequence_Base"), + ("PySequence_Cont", "SwigPySequence_Cont"), + ("PySwigIterator_T", "SwigPyIterator_T"), + ("PyPairBoolOutputIterator", "SwigPyPairBoolOutputIterator"), + ("PySwigIterator", "SwigPyIterator"), + ("PySwigIterator_T", "SwigPyIterator_T"), + ("PyMapIterator_T", "SwigPyMapIterator_T"), + ("PyMapKeyIterator_T", "SwigPyMapKeyIterator_T"), + ("PyMapValueIterator_T", "SwigPyMapValueITerator_T"), + ("PyObject_ptr", "SwigPtr_PyObject"), + ("PyObject_var", "SwigVar_PyObject"), + ("PyOper", "SwigPyOper"), + ("PySeq", "SwigPySeq"), + ("PySequence_ArrowProxy", "SwigPySequence_ArrowProxy"), + ("PySequence_Cont", "SwigPySequence_Cont"), + ("PySequence_InputIterator", "SwigPySequence_InputIterator"), + ("PySequence_Ref", "SwigPySequence_Ref"), + ("PySwigClientData", "SwigPyClientData"), + ("PySwigClientData_Del", "SwigPyClientData_Del"), + ("PySwigClientData_New", "SwigPyClientData_New"), + ("PySwigIterator", "SwigPyIterator"), + ("PySwigIteratorClosed_T", "SwigPyIteratorClosed_T"), + ("PySwigIteratorOpen_T", "SwigPyIteratorOpen_T"), + ("PySwigIterator_T", "SwigPyIterator_T"), + ("PySwigObject", "SwigPyObject"), + ("PySwigObject_Check", "SwigPyObject_Check"), + ("PySwigObject_GetDesc", "SwigPyObject_GetDesc"), + ("PySwigObject_New", "SwigPyObject_New"), + ("PySwigObject_acquire", "SwigPyObject_acquire"), + ("PySwigObject_append", "SwigPyObject_append"), + ("PySwigObject_as_number", "SwigPyObject_as_number"), + ("PySwigObject_compare", "SwigPyObject_compare"), + ("PySwigObject_dealloc", "SwigPyObject_dealloc"), + ("PySwigObject_disown", "SwigPyObject_disown"), + ("PySwigObject_format", "SwigPyObject_format"), + ("PySwigObject_getattr", "SwigPyObject_getattr"), + ("PySwigObject_hex", "SwigPyObject_hex"), + ("PySwigObject_long", "SwigPyObject_long"), + ("PySwigObject_next", "SwigPyObject_next"), + ("PySwigObject_oct", "SwigPyObject_oct"), + ("PySwigObject_own", "SwigPyObject_own"), + ("PySwigObject_print", "SwigPyObject_print"), + ("PySwigObject_repr", "SwigPyObject_repr"), + ("PySwigObject_richcompare", "SwigPyObject_richcompare"), + ("PySwigObject_str", "SwigPyObject_str"), + ("PySwigObject_type", "SwigPyObject_type"), + ("PySwigPacked", "SwigPyPacked"), + ("PySwigPacked_Check", "SwigPyPacked_Check"), + ("PySwigPacked_New", "SwigPyPacked_New"), + ("PySwigPacked_UnpackData", "SwigPyPacked_UnpackData"), + ("PySwigPacked_compare", "SwigPyPacked_compare"), + ("PySwigPacked_dealloc", "SwigPyPacked_dealloc"), + ("PySwigPacked_print", "SwigPyPacked_print"), + ("PySwigPacked_repr", "SwigPyPacked_repr"), + ("PySwigPacked_str", "SwigPyPacked_str"), + ("PySwigPacked_type", "SwigPyPacked_type"), + ("pyseq", "swigpyseq"), + ("pyswigobject_type", "swigpyobject_type"), + ("pyswigpacked_type", "swigpypacked_type"), + ] + +res = [(re.compile("\\b(%s)\\b"%oldname), newname) for oldname, newname in symbols] + +def patch_file(fn): + newf = [] + changed = False + for line in open(fn): + for r, newname in res: + line, n = r.subn(newname, line) + if n>0: + changed = True + newf.append(line) + + if changed: + copyfile(fn, fn+".bak") + f = open(fn, "w") + f.write("".join(newf)) + f.close() + return changed + +def main(fns): + for fn in fns: + try: + if patch_file(fn): + print "Patched file", fn + except IOError: + print "Error occurred during patching", fn + return + +if __name__=="__main__": + if len(sys.argv) > 1: + main(sys.argv[1:]) + else: + print "Patch your interface file for SWIG's Py* symbol name deprecation." + print "Usage:" + print " %s files..."%sys.argv[0] + + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/setup.py.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/setup.py.tmpl Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,139 @@ +#!@PYTHON@ +'''A setup.py script with better SWIG support. To use it, either +rename it to setup.py.in and have it pe processed by your configure +script (you will need to define @PYTHON@), or replace the @*@ strings +by hand. + +Copyright 2001, Anthony Joseph Seward''' + + +from distutils.core import setup, Extension + +############################################################################### +## Start of better Swig support +############################################################################### +from distutils.command.build_ext import build_ext +import os +import string +class build_swig_ext(build_ext): + '''Better swig support for Distutils''' + + ## __ Tell Distutils about the options + user_options = build_ext.user_options + boolean_options = build_ext.boolean_options + + user_options.append( + ('swig-doc=', None, + 'what type of documentation should SWIG produce (default: none)') + ) + user_options.append( + ('swig-inc=', None, + 'a list of directories to add to the SWIG include path' + + "(separated by ':')(default: SWIG)") + ) + user_options.append( + ('swig-shadow', None, + 'have SWIG create shadow classes' + + ' (also adds docstrings to the shadow classes') + ) + + boolean_options.append('swig-shadow') + + def initialize_options(self): + '''Initialize the new options after the inherited ones''' + build_ext.initialize_options(self) + self.swig_doc = 'none' + self.swig_inc = 'SWIG' + self.swig_shadow = None + + def swig_sources(self, sources): + """Override the definition of 'swig_sources' in build_ext. This + is essentially the same function but with better swig support. + I will now quote the original docstring: + + Walk the list of source files in 'sources', looking for SWIG + interface (.i) files. Run SWIG on all that are found, and + return a modified 'sources' list with SWIG source files replaced + by the generated C (or C++) files. + """ + + new_sources = [] + swig_sources = [] + swig_targets = {} + + # XXX this drops generated C/C++ files into the source tree, which + # is fine for developers who want to distribute the generated + # source -- but there should be an option to put SWIG output in + # the temp dir. + + if self.swig_cpp: + target_ext = '.cpp' + else: + target_ext = '.c' + + for source in sources: + (base, ext) = os.path.splitext(source) + if ext == ".i": # SWIG interface file + new_sources.append(base + target_ext) + swig_sources.append(source) + swig_targets[source] = new_sources[-1] + else: + new_sources.append(source) + + if not swig_sources: + return new_sources + + includes = self.swig_inc + if type(includes) is type(''): + includes = string.split(includes, ':') + includes = map(lambda x: '-I'+x, includes) + includes = string.join(includes) + + swig = self.find_swig() +## swig_cmd = [swig, "-python", "-d%s" % self.swig_doc, includes] + swig_cmd = [swig, '-v', '-python', '-d%s' % self.swig_doc, includes] + if self.swig_cpp: + swig_cmd.append('-c++') + + if self.swig_shadow: + swig_cmd.append('-shadow') +## swig1.1 swig_cmd.append('-docstring') + + for source in swig_sources: + target = swig_targets[source] + self.announce('swigging %s to %s' % (source, target)) + self.spawn(swig_cmd + ['-o', target, source]) + + return new_sources + + # swig_sources () +############################################################################### +## End of improved swig support +############################################################################### + +package = '@PACKAGE@' +version = '@VERSION@' +include_dirs = ['@top_srcdir@'] +lib_dirs = ['@top_srcdir@/@PACKAGE@'] +libraries = ['@PACKAGE@', 'stdc++'] + +setup(name = package, + version = version, + description = '', + author = '', + author_email = '', + url = 'http://', + + cmdclass = {'build_ext': build_swig_ext}, + ext_modules = [Extension(package+'cmodule', + [package+'.i'], + include_dirs=include_dirs, + library_dirs=lib_dirs, + libraries=libraries, + )], + options = {'build_ext': + {'swig_doc': 'html', + 'swig_cpp': not None, + 'swig_shadow': not None} + } + ) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/swig.gdb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/swig.gdb Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,41 @@ +# User-defined commands for easier debugging of SWIG in gdb +# +# This file can be "included" into your main .gdbinit file using: +# source swig.gdb +# or otherwise paste the contents into .gdbinit +# +# Note all user defined commands can be seen using: +# (gdb) show user +# The documentation for each command can be easily viewed, for example: +# (gdb) help swigprint + +define swigprint + if ($argc == 2) + set $expand_count = $arg1 + else + set $expand_count = -1 + end + Printf "%s\n", Swig_to_string($arg0, $expand_count) +end +document swigprint +Displays any SWIG DOH object +Usage: swigprint swigobject [hashexpandcount] + swigobject - The object to display. + hashexpandcount - Number of nested Hash types to expand (default is 1). See Swig_set_max_hash_expand() to change default. +end + + +define locswigprint + if ($argc == 2) + set $expand_count = $arg1 + else + set $expand_count = -1 + end + Printf "%s\n", Swig_to_string_with_location($arg0, $expand_count) +end +document locswigprint +Displays any SWIG DOH object prefixed with file and line location +Usage: locswigprint swigobject [hashexpandcount] + swigobject - The object to display. + hashexpandcount - Number of nested Hash types to expand (default is 1). See Swig_set_max_hash_expand() to change default. +end diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/Tools/vcfilter --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/Tools/vcfilter Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,10 @@ +#!/bin/sh + +# This is a simple utility for Cygwin/Mingw which is useful when running the SWIG +# test-suite through Visual Studio. If the output from the test-suite is piped +# through this utility, it will filter the junk that the compiler generates. +# Typical usage: make check | vcfilter + +# dos2unix needed for ^ and $ to work. +2>&1 dos2unix | grep -v "\.cxx$" | grep -v "\.c$" | grep -v "^ Creating library" | grep -v "^Generating Code" + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/aclocal.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/aclocal.m4 Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1012 @@ +# generated automatically by aclocal 1.11.3 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, +# Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, +[m4_warning([this file was generated for autoconf 2.68. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.3], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.3])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, +# 2010, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +AC_SUBST([am__nodep])dnl +_AM_SUBST_NOTMAKE([am__nodep])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, +# Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software +# Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# -------------------- +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ------------------------ +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 1 + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# -------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AC_SUBST([AMTAR], ['$${TAR-tar}']) +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar <conftest.tar]) + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([Tools/config/ac_compare_version.m4]) +m4_include([Tools/config/ac_compile_warnings.m4]) +m4_include([Tools/config/ac_define_dir.m4]) +m4_include([Tools/config/ax_boost_base.m4]) +m4_include([Tools/config/ax_compare_version.m4]) +m4_include([Tools/config/ax_path_generic.m4]) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/autogen.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/autogen.sh Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,15 @@ +#! /bin/sh + +# Bootstrap the development environment - add extra files needed to run configure. +# Note autoreconf should do what this file achieves, but it has a bug when working with automake! +# The latest config.guess and config.sub should be copied into Tools/config. +# This script will ensure the latest is copied from your autotool installation. + +set -e +set -x +test -d Tools/config || mkdir Tools/config +${ACLOCAL-aclocal} -I Tools/config +${AUTOHEADER-autoheader} +${AUTOMAKE-automake} --add-missing --copy --force-missing +${AUTOCONF-autoconf} +cd CCache && ${AUTORECONF-autoreconf} diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/configure --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/configure Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,13330 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.68 for swig 2.0.11. +# +# Report bugs to <http://www.swig.org>. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: http://www.swig.org about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 </dev/null +exec 6>&1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='swig' +PACKAGE_TARNAME='swig' +PACKAGE_VERSION='2.0.11' +PACKAGE_STRING='swig 2.0.11' +PACKAGE_BUGREPORT='http://www.swig.org' +PACKAGE_URL='' + +ac_unique_file="Source/Swig/swig.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +enable_option_checking=no +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +SWIG_LIB +swig_lib +ac_aux_dir +EXTRA_CLEAN +ROOT_DIR +SKIP_ANDROID +SKIP_GCJ +SKIP_D +SKIP_GO +SKIP_UFFI +SKIP_CFFI +SKIP_R +SKIP_CLISP +SKIP_ALLEGROCL +SKIP_LUA +SKIP_MODULA3 +SKIP_CSHARP +SKIP_CHICKEN +SKIP_PIKE +SKIP_OCAML +SKIP_PHP +SKIP_RUBY +SKIP_MZSCHEME +SKIP_GUILE +SKIP_JAVA +SKIP_PYTHON3 +SKIP_PYTHON +SKIP_OCTAVE +SKIP_PERL5 +SKIP_TCL +DLIBPREFIX +DDEFAULTVERSION +D2COMPILER +D1COMPILER +GOVERSIONOPTION +GOOPT +GO1 +GOC +GOGCC +GO +RBIN +CLISPBIN +ALLEGROCLBIN +LUALINK +LUAFLAGS +LUADYNAMICLINKING +LUABIN +CSHARPSO +CSHARPCFLAGS +CSHARPLIBRARYPREFIX +CSHARPDYNAMICLINKING +CSHARPCYGPATH_W +CSHARPPATHSEPARATOR +CSHARPCILINTERPRETER_FLAGS +CSHARPCILINTERPRETER +CSHARPCOMPILER +CHICKENSHAREDLIB +CHICKENLIB +CHICKENOPTS +CHICKEN_CSI +CHICKEN_CSC +CHICKEN +PIKEDYNAMICLINKING +PIKECCDLFLAGS +PIKEINCLUDE +PIKECONFIG +PIKE +OCAMLINC +OCAMLVER +OCAMLLOC +OCAMLMKTOP +OCAMLBIN +OCAMLC +OCAMLFIND +OCAMLDLGEN +PHPINC +PHP +RUBYDYNAMICLINKING +RUBYSO +RUBYCCDLFLAGS +RUBYLINK +RUBYLIB +RUBYINCLUDE +RUBY +MZDYNOBJ +MZC +MZSCHEME +GUILE_LIBS +GUILE_CFLAGS +GUILE +GUILE_CONFIG +NDKBUILD +ANT +ADB +ANDROID +GCJH +GCJ +JAVACFLAGS +JAVACXXSHARED +JAVALDSHARED +JAVASO +JAVALIBRARYPREFIX +JAVADYNAMICLINKING +JAVAINC +JAVAC +JAVA +OCTAVE_LDFLAGS +OCTAVE_CXXFLAGS +OCTAVE_CPPFLAGS +OCTAVE_SO +OCTAVE +PERL5LDFLAGS +PERL5CCCDLFLAGS +PERL5CCDLFLAGS +PERL5CCFLAGS +PERL5LIB +PERL5DYNAMICLINKING +PERL5EXT +PERL +PYTHON3DYNAMICLINKING +PY3LINK +PY3LIB +PY3INCLUDE +PY3CONFIG +PYTHON3 +PYTHONDYNAMICLINKING +PYLINK +PYLIB +PYINCLUDE +PYTHON +TCLCXXSHARED +TCLLDSHARED +TCLDYNAMICLINKING +TCLLIB +TCLINCLUDE +XLIBSW +XINCLUDES +XMKMF +LIBC +LIBCRYPT +LIBM +SWILL +SWIGLIBS +LUA_SO +MZSCHEME_SO +PHP_SO +GUILE_SO +TCL_SO +PYTHON_SO +LINKFORSHARED +PLATFLAGS +RPATH +TRYLINKINGWITHCXX +CXXSHARED +CCSHARED +LDSHARED +SO +BOOST_LDFLAGS +BOOST_CPPFLAGS +YODL2HTML +YODL2MAN +AR +RANLIB +YFLAGS +YACC +ENABLE_CCACHE +subdirs +PCRE_LIBS +PCRE_CFLAGS +PCRE_CONFIG +SED +EGREP +GREP +CPP +am__fastdepCXX_FALSE +am__fastdepCXX_TRUE +CXXDEPMODE +ac_ct_CXX +CXXFLAGS +CXX +am__fastdepCC_FALSE +am__fastdepCC_TRUE +CCDEPMODE +am__nodep +AMDEPBACKSLASH +AMDEP_FALSE +AMDEP_TRUE +am__quote +am__include +DEPDIR +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +am__untar +am__tar +AMTAR +am__leading_dot +SET_MAKE +AWK +mkdir_p +MKDIR_P +INSTALL_STRIP_PROGRAM +STRIP +install_sh +MAKEINFO +AUTOHEADER +AUTOMAKE +AUTOCONF +ACLOCAL +VERSION +PACKAGE +CYGPATH_W +am__isrc +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_dependency_tracking +with_maximum_compile_warnings +with_popen +with_pcre +with_pcre_prefix +with_pcre_exec_prefix +enable_ccache +with_boost +with_boost_libdir +with_libm +with_libc +with_x +with_alllang +with_tclconfig +with_tcl +with_tclincl +with_tcllib +with_python +with_python3 +with_perl5 +with_octave +with_java +with_javac +with_javaincl +with_gcj +with_gcjh +with_android +with_adb +with_ant +with_ndk_build +with_guile_config +with_guile +with_guile_cflags +with_guile_libs +with_mzscheme +with_mzc +with_ruby +with_php +with_ocaml +with_ocamlc +with_ocamldlgen +with_ocamlfind +with_ocamlmktop +with_pike +with_pike_config +with_pikeincl +with_chicken +with_chickencsc +with_chickencsi +with_chickenopts +with_chickensharedlib +with_chickenlib +with_csharp +with_cil_interpreter +with_csharp_compiler +with_lua +with_luaincl +with_lualib +with_allegrocl +with_clisp +with_r +with_go +with_d +with_d1_compiler +with_d2_compiler +with_swiglibdir +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CXX +CXXFLAGS +CCC +CPP +PCRE_CONFIG +PCRE_CFLAGS +PCRE_LIBS +YACC +YFLAGS +XMKMF' +ac_subdirs_all='CCache' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures swig 2.0.11 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking ...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/swig] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of swig 2.0.11:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --disable-ccache disable building and installation of ccache-swig + executable (default enabled) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --without-maximum-compile-warnings + Disable maximum warning verbosity + --without-popen Disable popen + --without-pcre Disable support for regular expressions using PCRE + --with-pcre-prefix=PREFIX + Prefix where pcre is installed (optional) + --with-pcre-exec-prefix=EPREFIX + Exec prefix where pcre is installed (optional) + --with-boost[=ARG] use Boost library from a standard location + (ARG=yes), from the specified location (ARG=<path>), + or disable it (ARG=no) [ARG=yes] + --with-boost-libdir=LIB_DIR + Force given directory for boost libraries. Note that + this will override library path detection, so use + this parameter only if default library detection + fails and you know exactly where your boost + libraries are located. + --with-libm=STRING math library + --with-libc=STRING C library + --with-x use the X Window System + --without-alllang Disable all languages + --without-tcl Disable Tcl + --with-tclconfig=path Set location of tclConfig.sh + --with-tcl=path Set location of Tcl package + --with-tclincl=path Set location of Tcl include directory + --with-tcllib=path Set location of Tcl library directory + --without-python Disable Python + --with-python=path Set location of Python executable + --without-python3 Disable Python 3.x support + --with-python3=path Set location of Python 3.x executable + --without-perl5 Disable Perl5 + --with-perl5=path Set location of Perl5 executable + --without-octave Disable Octave + --with-octave=path Set location of Octave executable + --without-java Disable Java + --with-java=path Set location of java executable + --with-javac=path Set location of javac executable + --with-javaincl=path Set location of Java include directory + --without-gcj Disable GCJ + --with-gcj=path Set location of gcj executable + --with-gcjh=path Set location of gcjh executable + --without-android Disable Android + --with-android=path Set location of android executable + --with-adb=path Set location of adb executable - Android Debug Bridge + --with-ant=path Set location of ant executable for Android + --with-ndk-build=path Set location of Android ndk-build executable + --without-guile Disable Guile + --with-guile-config=path + Set location of guile-config + --with-guile=path Set location of Guile executable + --with-guile-cflags=cflags Set cflags required to compile against Guile + --with-guile-libs=ldflags Set ldflags needed to link with Guile + --without-mzscheme Disable MzScheme + --with-mzscheme=path Set location of MzScheme executable + --with-mzc=path Set location of MzScheme's mzc + --without-ruby Disable Ruby + --with-ruby=path Set location of Ruby executable + --without-php Disable PHP + --with-php=path Set location of PHP executable + --without-ocaml Disable OCaml + --with-ocaml=path Set location of ocaml executable + --with-ocamlc=path Set location of ocamlc executable + --with-ocamldlgen=path Set location of ocamldlgen + --with-ocamlfind=path Set location of ocamlfind + --with-ocamlmktop=path Set location of ocamlmktop executable + --without-pike Disable Pike + --with-pike=path Set location of Pike executable + --with-pike-config=path Set location of pike-config script + --with-pikeincl=path Set location of Pike include directory + --without-chicken Disable CHICKEN + --with-chicken=path Set location of CHICKEN executable + --with-chickencsc=path Set location of csc executable + --with-chickencsi=path Set location of csi executable + --with-chickenopts=args Set compiler options for static CHICKEN generated code + --with-chickensharedlib=args Set linker options for shared CHICKEN generated code + --with-chickenlib=args Set linker options for static CHICKEN generated code + --without-csharp Disable CSharp + --with-cil-interpreter=path Set location of CIL interpreter for CSharp + --with-csharp-compiler=path Set location of CSharp compiler + --without-lua Disable Lua + --with-lua=path Set location of Lua executable + --with-luaincl=path Set location of Lua include directory + --with-lualib=path Set location of Lua library directory + --without-allegrocl Disable Allegro CL + --with-allegrocl=path Set location of Allegro CL executable (alisp) + --without-clisp Disable CLISP + --with-clisp=path Set location of CLISP executable (clisp) + --without-r Disable R + --with-r=path Set location of R executable (r) + --without-go Disable Go + --with-go=path Set location of Go compiler + --without-d Disable D + --with-d1-compiler=path Set location of D1/Tango compiler (DMD compatible) + --with-d2-compiler=path Set location of D2 compiler (DMD compatible) + --with-swiglibdir=DIR Put SWIG system-independent libraries into DIR. + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + PCRE_CONFIG config script used for pcre + PCRE_CFLAGS CFLAGS used for pcre + PCRE_LIBS LIBS used for pcre + YACC The `Yet Another Compiler Compiler' implementation to use. + Defaults to the first program found out of: `bison -y', `byacc', + `yacc'. + YFLAGS The list of arguments that will be passed by default to $YACC. + This script will default YFLAGS to the empty string to avoid a + default value of `-d' given by some make applications. + XMKMF Path to xmkmf, Makefile generator for X Window System + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to <http://www.swig.org>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +swig configure 2.0.11 +generated by GNU Autoconf 2.68 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES +# --------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_cxx_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_type + +# ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_cxx_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_cxx_check_header_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case <limits.h> declares $2. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_func + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------- ## +## Report this to http://www.swig.org ## +## ---------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include <stdio.h> +#include <stdlib.h> +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 <conftest.val; ac_retval=0 +else + ac_retval=1 +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f conftest.val + + fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_compute_int +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by swig $as_me 2.0.11, which was +generated by GNU Autoconf 2.68. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + +ac_aux_dir= +for ac_dir in Tools/config "$srcdir"/Tools/config; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in Tools/config \"$srcdir\"/Tools/config" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +ac_config_headers="$ac_config_headers Source/Include/swigconfig.h" + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if ${ac_cv_build+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if ${ac_cv_host+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +am__api_version='1.11' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if ${ac_cv_path_install+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_STRIP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if ${ac_cv_path_mkdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done + done +IFS=$as_save_IFS + +fi + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AWK+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='swig' + VERSION='2.0.11' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. Yes, it's still used +# in the wild :-( We should find a proper way to deprecate it ... +AMTAR='$${TAR-tar}' + +am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' + am__nodep='_no' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CC_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi +fi + + fi +fi +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if ${ac_cv_cxx_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if ${ac_cv_prog_cxx_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +else + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +depcc="$CXX" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if ${am_cv_CXX_dependencies_compiler_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CXX_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CXX_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then + am__fastdepCXX_TRUE= + am__fastdepCXX_FALSE='#' +else + am__fastdepCXX_TRUE='#' + am__fastdepCXX_FALSE= +fi + + + + +if test "x$CC" != xcc; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5 +$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5 +$as_echo_n "checking whether cc understands -c and -o together... " >&6; } +fi +set dummy $CC; ac_cc=`$as_echo "$2" | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && + test -f conftest2.$ac_objext && { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o +if test "$am_t" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + # Needed for subdir-objects in AUTOMAKE_OPTIONS + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking maximum warning verbosity option" >&5 +$as_echo_n "checking maximum warning verbosity option... " >&6; } + + + + +# Check whether --with-maximum-compile-warnings was given. +if test "${with_maximum_compile_warnings+set}" = set; then : + withval=$with_maximum_compile_warnings; ac_compile_warnings_on="$withval" +else + ac_compile_warnings_on="" +fi + + + if test x"$ac_compile_warnings_on" = xno + then + ac_compile_warnings_msg=no + else + if test -n "$CXX" + then + if test "$GXX" = "yes" + then + ac_compile_warnings_opt='-Wall -W -ansi -pedantic' + fi + CXXFLAGS="$CXXFLAGS $ac_compile_warnings_opt" + ac_compile_warnings_msg="$ac_compile_warnings_opt for C++" + fi + + if test -n "$CC" + then + if test "$GCC" = "yes" + then + ac_compile_warnings_opt='-Wall -W -ansi -pedantic' + fi + CFLAGS="$CFLAGS $ac_compile_warnings_opt" + ac_compile_warnings_msg="$ac_compile_warnings_msg $ac_compile_warnings_opt for C" + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_compile_warnings_msg" >&5 +$as_echo "$ac_compile_warnings_msg" >&6; } + unset ac_compile_warnings_msg + unset ac_compile_warnings_opt + # Increase warning levels + + +cat >>confdefs.h <<_ACEOF +#define SWIG_CXX "$CXX" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define SWIG_PLATFORM "$host" +_ACEOF + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <string.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <ctype.h> +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_cxx_check_type "$LINENO" "bool" "ac_cv_type_bool" "$ac_includes_default" +if test "x$ac_cv_type_bool" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_BOOL 1 +_ACEOF + + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +# Check whether --with-popen was given. +if test "${with_popen+set}" = set; then : + withval=$with_popen; with_popen="$withval" +fi + +if test x"${with_popen}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling popen" >&5 +$as_echo "$as_me: Disabling popen" >&6;} +else +ac_fn_c_check_func "$LINENO" "popen" "ac_cv_func_popen" +if test "x$ac_cv_func_popen" = xyes; then : + +$as_echo "#define HAVE_POPEN 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling popen" >&5 +$as_echo "$as_me: Disabling popen" >&6;} +fi + +fi + + + + + +# Check whether --with-pcre was given. +if test "${with_pcre+set}" = set; then : + withval=$with_pcre; +else + with_pcre=yes +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable PCRE support" >&5 +$as_echo_n "checking whether to enable PCRE support... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_pcre" >&5 +$as_echo "$with_pcre" >&6; } + +if test x"${with_pcre}" = xyes ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use local PCRE" >&5 +$as_echo_n "checking whether to use local PCRE... " >&6; } + local_pcre_config=no + if test -z $PCRE_CONFIG; then + if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then + PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config + local_pcre_config=$PCRE_CONFIG + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $local_pcre_config" >&5 +$as_echo "$local_pcre_config" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if ${ac_cv_path_SED+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ + for ac_i in 1 2 3 4 5 6 7; do + ac_script="$ac_script$as_nl$ac_script" + done + echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +if test "x$with_pcre" != xno; then : + + + + + +# Check whether --with-pcre-prefix was given. +if test "${with_pcre_prefix+set}" = set; then : + withval=$with_pcre_prefix; pcre_config_prefix="$withval" +else + pcre_config_prefix="" +fi + + +# Check whether --with-pcre-exec-prefix was given. +if test "${with_pcre_exec_prefix+set}" = set; then : + withval=$with_pcre_exec_prefix; pcre_config_exec_prefix="$withval" +else + pcre_config_exec_prefix="" +fi + + + + + + + if test x$PCRE_CFLAGS != x -o x$PCRE_LIBS != x; then : + + + + : + +$as_echo "#define HAVE_PCRE 1" >>confdefs.h + + LIBS="$LIBS $PCRE_LIBS" + CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" + + +else + + if test x$pcre_config_exec_prefix != x; then : + + pcre_config_args="$pcre_config_args --exec-prefix=$pcre_config_exec_prefix" + if test x${PCRE_CONFIG+set} != xset; then : + + PCRE_CONFIG=$pcre_config_exec_prefix/bin/pcre-config + +fi + +fi + if test x$pcre_config_prefix != x; then : + + pcre_config_args="$pcre_config_args --prefix=$pcre_config_prefix" + if test x${PCRE_CONFIG+set} != xset; then : + + PCRE_CONFIG=$pcre_config_prefix/bin/pcre-config + +fi + +fi + + for ac_prog in pcre-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PCRE_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PCRE_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PCRE_CONFIG="$PCRE_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_PCRE_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PCRE_CONFIG=$ac_cv_path_PCRE_CONFIG +if test -n "$PCRE_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCRE_CONFIG" >&5 +$as_echo "$PCRE_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PCRE_CONFIG" && break +done +test -n "$PCRE_CONFIG" || PCRE_CONFIG="no" + + if test "$PCRE_CONFIG" = "no"; then : + + : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? " + Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions) + library package. This dependency is needed for configure to complete, + Either: + - Install the PCRE developer package on your system (preferred approach). + - Download the PCRE source tarball, build and install on your system + as you would for any package built from source distribution. + - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically + link against. Run 'Tools/pcre-build.sh --help' for instructions. + (quite easy and does not require privileges to install PCRE on your system) + - Use configure --without-pcre to disable regular expressions support in SWIG + (not recommended). +See \`config.log' for more details" "$LINENO" 5; } + + +else + + if test x"" = x; then : + + PCRE_CFLAGS="`$PCRE_CONFIG $pcre_config_args --cflags`" + +else + + PCRE_CFLAGS="`$PCRE_CONFIG $pcre_config_args `" + +fi + + if test x"" = x; then : + + PCRE_LIBS="`$PCRE_CONFIG $pcre_config_args --libs`" + +else + + PCRE_LIBS="`$PCRE_CONFIG $pcre_config_args `" + +fi + + if test x"" != x; then : + + if test x" " != x; then : + + pcre_version="`$PCRE_CONFIG $pcre_config_args --version | $SED -e `" + +else + + pcre_version="`$PCRE_CONFIG $pcre_config_args --version | $SED -e 's/^\ *\(.*\)\ *$/\1/'`" + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre ($pcre_version) >= " >&5 +$as_echo_n "checking for pcre ($pcre_version) >= ... " >&6; } + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$pcre_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + + + + : + +$as_echo "#define HAVE_PCRE 1" >>confdefs.h + + LIBS="$LIBS $PCRE_LIBS" + CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" + + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? " + Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions) + library package. This dependency is needed for configure to complete, + Either: + - Install the PCRE developer package on your system (preferred approach). + - Download the PCRE source tarball, build and install on your system + as you would for any package built from source distribution. + - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically + link against. Run 'Tools/pcre-build.sh --help' for instructions. + (quite easy and does not require privileges to install PCRE on your system) + - Use configure --without-pcre to disable regular expressions support in SWIG + (not recommended). +See \`config.log' for more details" "$LINENO" 5; } + + + fi + + +else + + + + : + +$as_echo "#define HAVE_PCRE 1" >>confdefs.h + + LIBS="$LIBS $PCRE_LIBS" + CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" + + +fi + +fi + +fi + + + + + +fi + + +# Check whether --enable-ccache was given. +if test "${enable_ccache+set}" = set; then : + enableval=$enable_ccache; enable_ccache=$enableval +else + enable_ccache=yes +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable ccache-swig" >&5 +$as_echo_n "checking whether to enable ccache-swig... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_ccache" >&5 +$as_echo "$enable_ccache" >&6; } + +if test "$enable_ccache" = yes; then + + +subdirs="$subdirs CCache" + + ENABLE_CCACHE=1 +fi + + + +echo "" +echo "Checking packages required for SWIG developers." +echo "Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball" +echo "" + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YACC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YACC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 +$as_echo "$YACC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +for ac_prog in ar aal +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AR" && break +done +test -n "$AR" || AR="ar" + + +for ac_prog in yodl2man +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YODL2MAN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YODL2MAN"; then + ac_cv_prog_YODL2MAN="$YODL2MAN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YODL2MAN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YODL2MAN=$ac_cv_prog_YODL2MAN +if test -n "$YODL2MAN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YODL2MAN" >&5 +$as_echo "$YODL2MAN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YODL2MAN" && break +done + +for ac_prog in yodl2html +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_YODL2HTML+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$YODL2HTML"; then + ac_cv_prog_YODL2HTML="$YODL2HTML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_YODL2HTML="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +YODL2HTML=$ac_cv_prog_YODL2HTML +if test -n "$YODL2HTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YODL2HTML" >&5 +$as_echo "$YODL2HTML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$YODL2HTML" && break +done + + +if test -n "$YODL2MAN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking yodl2man version >= 2.02" >&5 +$as_echo_n "checking yodl2man version >= 2.02... " >&6; } + yodl_version=`$YODL2MAN --version 2>&1 | grep 'yodl version' | sed 's/.*\(0-90-9*\.0-90-9*\.*0-9*\).*/\1/g'` + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$yodl_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "2.02" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - $yodl_version found" >&5 +$as_echo "no - $yodl_version found" >&6; } + fi + +fi + +if test -n "$YODL2HTML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking yodl2html version >= 2.02" >&5 +$as_echo_n "checking yodl2html version >= 2.02... " >&6; } + yodl_version=`$YODL2HTML --version 2>&1 | grep 'yodl version' | sed 's/.*\(0-90-9*\.0-90-9*\.0-90-9*\).*/\1/g'` + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$yodl_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "2.02" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - $yodl_version found" >&5 +$as_echo "no - $yodl_version found" >&6; } + fi + +fi + +echo "" +echo "Checking for installed target languages and other information in order to compile and run" +echo "the examples and test-suite invoked by 'make check'." +echo "Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball" +echo "" + + + +# Check whether --with-boost was given. +if test "${with_boost+set}" = set; then : + withval=$with_boost; + if test "$withval" = "no"; then + want_boost="no" + elif test "$withval" = "yes"; then + want_boost="yes" + ac_boost_path="" + else + want_boost="yes" + ac_boost_path="$withval" + fi + +else + want_boost="yes" +fi + + + + +# Check whether --with-boost-libdir was given. +if test "${with_boost_libdir+set}" = set; then : + withval=$with_boost_libdir; + if test -d "$withval" + then + ac_boost_lib_path="$withval" + else + as_fn_error $? "--with-boost-libdir expected directory name" "$LINENO" 5 + fi + +else + ac_boost_lib_path="" + +fi + + +if test "x$want_boost" = "xyes"; then + boost_lib_version_req=1.20.0 + boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([0-9]*\.[0-9]*\)'` + boost_lib_version_req_major=`expr $boost_lib_version_req : '\([0-9]*\)'` + boost_lib_version_req_minor=`expr $boost_lib_version_req : '[0-9]*\.\([0-9]*\)'` + boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'` + if test "x$boost_lib_version_req_sub_minor" = "x" ; then + boost_lib_version_req_sub_minor="0" + fi + WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for boostlib >= $boost_lib_version_req" >&5 +$as_echo_n "checking for boostlib >= $boost_lib_version_req... " >&6; } + succeeded=no + + libsubdirs="lib" + ax_arch=`uname -m` + if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then + libsubdirs="lib64 lib lib64" + fi + + if test "$ac_boost_path" != ""; then + BOOST_CPPFLAGS="-I$ac_boost_path/include" + for ac_boost_path_tmp in $libsubdirs; do + if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then + BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp" + break + fi + done + elif test "$cross_compiling" != yes; then + for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do + if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then + for libsubdir in $libsubdirs ; do + if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir" + BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" + break; + fi + done + fi + + if test "$ac_boost_lib_path" != ""; then + BOOST_LDFLAGS="-L$ac_boost_lib_path" + fi + + CPPFLAGS_SAVED="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + + LDFLAGS_SAVED="$LDFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <boost/version.hpp> + +int +main () +{ + + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + succeeded=yes + found_system=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + if test "x$succeeded" != "xyes"; then + _version=0 + if test "$ac_boost_path" != ""; then + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + fi + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" + done + fi + else + if test "$cross_compiling" != yes; then + for ac_boost_path in /usr /usr/local /opt /opt/local ; do + if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then + for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do + _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` + V_CHECK=`expr $_version_tmp \> $_version` + if test "$V_CHECK" = "1" ; then + _version=$_version_tmp + best_path=$ac_boost_path + fi + done + fi + done + + VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` + BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" + if test "$ac_boost_lib_path" = ""; then + for libsubdir in $libsubdirs ; do + if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + BOOST_LDFLAGS="-L$best_path/$libsubdir" + fi + fi + + if test "x$BOOST_ROOT" != "x"; then + for libsubdir in $libsubdirs ; do + if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi + done + if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then + version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` + stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` + stage_version_shorten=`expr $stage_version : '\([0-9]*\.[0-9]*\)'` + V_CHECK=`expr $stage_version_shorten \>\= $_version` + if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: We will use a staged boost library from $BOOST_ROOT" >&5 +$as_echo "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;} + BOOST_CPPFLAGS="-I$BOOST_ROOT" + BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir" + fi + fi + fi + fi + + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + export CPPFLAGS + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" + export LDFLAGS + + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <boost/version.hpp> + +int +main () +{ + + #if BOOST_VERSION >= $WANT_BOOST_VERSION + // Everything is okay + #else + # error Boost version is too old + #endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + succeeded=yes + found_system=yes + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi + + if test "$succeeded" != "yes" ; then + if test "$_version" = "0" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&5 +$as_echo "$as_me: We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation." >&6;} + else + { $as_echo "$as_me:${as_lineno-$LINENO}: Your boost libraries seems to old (version $_version)." >&5 +$as_echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;} + fi + # execute ACTION-IF-NOT-FOUND (if present): + : + else + + + +$as_echo "#define HAVE_BOOST /**/" >>confdefs.h + + # execute ACTION-IF-FOUND (if present): + : + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" +fi + + + + +# -I should not be used on system directories (GCC) +if test "$GCC" = yes; then + ISYSTEM="-isystem " +else + ISYSTEM="-I" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: ISYSTEM: $ISYSTEM" >&5 +$as_echo "$as_me: ISYSTEM: $ISYSTEM" >&6;} + + +# SO is the extension of shared libraries (including the dot!) +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SO" >&5 +$as_echo_n "checking SO... " >&6; } +if test -z "$SO" +then + case $host in + *-*-hp*) SO=.sl;; + *-*-darwin*) SO=.bundle;; + *-*-cygwin* | *-*-mingw*) SO=.dll;; + *) SO=.so;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SO" >&5 +$as_echo "$SO" >&6; } + +# LDSHARED is the ld *command* used to create shared library +# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 +# (Shared libraries in this instance are shared modules to be loaded into +# Python, as opposed to building Python itself as a shared library.) +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } +if test -z "$LDSHARED" +then + case $host in + *-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";; + *-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + LDSHARED="$CC -shared" + else + if test "cl" = $CC ; then + # Microsoft Visual C++ (MSVC) + LDSHARED="$CC -nologo -LD" + else + # Unknown compiler try gcc approach + LDSHARED="$CC -shared" + fi + fi ;; + *-*-irix5*) LDSHARED="ld -shared";; + *-*-irix6*) LDSHARED="ld ${SGI_ABI} -shared -all";; + *-*-sunos4*) LDSHARED="ld";; + *-*-solaris*) LDSHARED="ld -G";; + *-*-hp*) LDSHARED="ld -b";; + *-*-osf*) LDSHARED="ld -shared -expect_unresolved \"*\"";; + *-sequent-sysv4) LDSHARED="ld -G";; + *-*-next*) + if test "$ns_dyld" + then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind' + else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r' + fi + if test "$with_next_framework" ; then + LDSHARED="$LDSHARED \$(LDLIBRARY)" + fi ;; + *-*-linux*) LDSHARED="gcc -shared";; + *-*-dgux*) LDSHARED="ld -G";; + *-*-freebsd3*) LDSHARED="gcc -shared";; + *-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";; + *-*-netbsd*) + if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ] + then + LDSHARED="cc -shared" + else + LDSHARED="ld -Bshareable" + fi;; + *-sco-sysv*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";; + *-*-darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";; + *) LDSHARED="ld";; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } +# CXXSHARED is the ld *command* used to create C++ shared library +# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 +# (Shared libraries in this instance are shared modules to be loaded into +# Python, as opposed to building Python itself as a shared library.) +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CXXSHARED" >&5 +$as_echo_n "checking CXXSHARED... " >&6; } +if test -z "$CXXSHARED" +then + CXXSHARED="$LDSHARED" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXSHARED" >&5 +$as_echo "$CXXSHARED" >&6; } + +# +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking TRYLINKINGWITHCXX" >&5 +$as_echo_n "checking TRYLINKINGWITHCXX... " >&6; } +if test -z "$TRYLINKINGWITHCXX" +then + case $host in + *-*-solaris*) if test "$GCC" = yes + then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G" + else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun -lCstd" + fi;; + *-*-hp*) TRYLINKINGWITHCXX="CXXSHARED= $CXX +z ";; + *-*-darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";; + *-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared " + else + if test "cl" = $CXX ; then + # Microsoft Visual C++ (MSVC) + TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD" + else + TRYLINKINGWITHCXX="#unknown Windows compiler" + fi + fi ;; + *) TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TRYLINKINGWITHCXX" >&5 +$as_echo "$TRYLINKINGWITHCXX" >&6; } +# CCSHARED are the C *flags* used to create objects to go into a shared +# library (module) -- this is only needed for a few systems +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } +if test -z "$CCSHARED" +then + case $host in + *-*-hp*) if test "$GCC" = yes + then CCSHARED="-fpic" + else CCSHARED="+z" + fi;; + *-*-linux*) CCSHARED="-fpic";; + *-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";; + *-*-netbsd*) CCSHARED="-fPIC";; + *-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";; + *-*-irix6*) case $CC in + *gcc*) CCSHARED="-shared";; + *) CCSHARED="";; + esac;; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } + +# RPATH is the path used to look for shared library files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking RPATH" >&5 +$as_echo_n "checking RPATH... " >&6; } +if test -z "$RPATH" +then + case $host in + *-*-solaris*) RPATH='-R. -R$(exec_prefix)/lib';; + *-*-irix*) RPATH='-rpath .:$(exec_prefix)/lib';; + *-*-linux*) RPATH='-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .';; + *) RPATH='';; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPATH" >&5 +$as_echo "$RPATH" >&6; } + +# LINKFORSHARED are the flags passed to the $(CC) command that links +# the a few executables -- this is only needed for a few systems + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } +if test -z "$LINKFORSHARED" +then + case $host in + *-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';; + *-*-hp*) + LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; + *-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";; + *-*-next*) LINKFORSHARED="-u libsys_s";; + *-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; + *-*-irix6*) LINKFORSHARED="-all";; + esac +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } + +# Optional CFLAGS used to silence/enhance compiler warnings on some platforms. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking PLATFLAGS" >&5 +$as_echo_n "checking PLATFLAGS... " >&6; } +case $host in + *-*-solaris*) if test "$GCC" = yes + then PLATFLAGS= + else PLATFLAGS= + # else PLATFLAGS="-errtags=yes" # Need more work as C examples use ld for linking + fi;; + *) PLATFLAGS= +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PLATFLAGS" >&5 +$as_echo "$PLATFLAGS" >&6; } + +# Set info about shared libraries. + + + + + + + + + +# This variation is needed on OS-X because there is no (apparent) consistency in shared library naming. +# Sometimes .bundle works, but sometimes .so is needed. It depends on the target language + + +case $host in + *-*-mingw*) PYTHON_SO=.pyd;; + *-*-darwin*) PYTHON_SO=.so;; + *) PYTHON_SO=$SO;; +esac + + +case $host in + *-*-darwin*) TCL_SO=.dylib;; + *) TCL_SO=$SO;; +esac + + +case $host in + *-*-darwin*) GUILE_SO=.so;; + *) GUILE_SO=$SO;; +esac + + +case $host in + *-*-darwin*) PHP_SO=.so;; + *) PHP_SO=$SO;; +esac + + +case $host in + *) MZSCHEME_SO=.so;; +esac + + +case $host in + *-*-darwin*) LUA_SO=.so;; + *) LUA_SO=$SO;; +esac + +# Check for specific libraries. Used for SWIG examples +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if ${ac_cv_lib_dl_dlopen+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDL 1 +_ACEOF + + LIBS="-ldl $LIBS" + +fi + # Dynamic linking for SunOS/Solaris and SYSV +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if ${ac_cv_lib_dld_shl_load+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldld $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDLD 1 +_ACEOF + + LIBS="-ldld $LIBS" + +fi + # Dynamic linking for HP-UX + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing t_open" >&5 +$as_echo_n "checking for library containing t_open... " >&6; } +if ${ac_cv_search_t_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char t_open (); +int +main () +{ +return t_open (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_t_open=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_t_open+:} false; then : + break +fi +done +if ${ac_cv_search_t_open+:} false; then : + +else + ac_cv_search_t_open=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_t_open" >&5 +$as_echo "$ac_cv_search_t_open" >&6; } +ac_res=$ac_cv_search_t_open +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + # SVR4 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5 +$as_echo_n "checking for library containing gethostbyname... " >&6; } +if ${ac_cv_search_gethostbyname+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' inet; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_gethostbyname=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_gethostbyname+:} false; then : + break +fi +done +if ${ac_cv_search_gethostbyname+:} false; then : + +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5 +$as_echo "$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + # Sequent +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing socket" >&5 +$as_echo_n "checking for library containing socket... " >&6; } +if ${ac_cv_search_socket+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_socket=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_socket+:} false; then : + break +fi +done +if ${ac_cv_search_socket+:} false; then : + +else + ac_cv_search_socket=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_socket" >&5 +$as_echo "$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + # SVR4 sockets + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for swill_init in -lswill" >&5 +$as_echo_n "checking for swill_init in -lswill... " >&6; } +if ${ac_cv_lib_swill_swill_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lswill $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char swill_init (); +int +main () +{ +return swill_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_swill_swill_init=yes +else + ac_cv_lib_swill_swill_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_swill_swill_init" >&5 +$as_echo "$ac_cv_lib_swill_swill_init" >&6; } +if test "x$ac_cv_lib_swill_swill_init" = xyes; then : + SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL" +fi + + + + +# check for --with-libm=... + +LIBM=-lm + +# Check whether --with-libm was given. +if test "${with_libm+set}" = set; then : + withval=$with_libm; +if test "$withval" != yes +then LIBM=$withval +else as_fn_error $? "proper usage is --with-libm=STRING" "$LINENO" 5 +fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lieee" >&5 +$as_echo_n "checking for main in -lieee... " >&6; } +if ${ac_cv_lib_ieee_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lieee $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ieee_main=yes +else + ac_cv_lib_ieee_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ieee_main" >&5 +$as_echo "$ac_cv_lib_ieee_main" >&6; } +if test "x$ac_cv_lib_ieee_main" = xyes; then : + LIBM="-lieee $LIBM" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 +$as_echo_n "checking for crypt in -lcrypt... " >&6; } +if ${ac_cv_lib_crypt_crypt+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcrypt $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char crypt (); +int +main () +{ +return crypt (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_crypt_crypt=yes +else + ac_cv_lib_crypt_crypt=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 +$as_echo "$ac_cv_lib_crypt_crypt" >&6; } +if test "x$ac_cv_lib_crypt_crypt" = xyes; then : + LIBCRYPT="-lcrypt" +fi + + + +# check for --with-libc=... + + +# Check whether --with-libc was given. +if test "${with_libc+set}" = set; then : + withval=$with_libc; +if test "$withval" != yes +then LIBC=$withval +else as_fn_error $? "proper usage is --with-libc=STRING" "$LINENO" 5 +fi +fi + + +#-------------------------------------------------------------------- +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +#-------------------------------------------------------------------- + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } + + +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + case $x_includes,$x_libraries in #( + *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : + $as_echo_n "(cached) " >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -f -r conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + cat >Imakefile <<'_ACEOF' +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ac_x_includes= ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /usr/lib64 | /lib | /lib64) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -f -r conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R7/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R7 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R7/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R7 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Xlib.h. + # First, try using that file with no special directory specified. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <X11/Xlib.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # We can compile using X headers with no special include directory. +ac_x_includes= +else + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Xlib.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.i conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <X11/Xlib.h> +int +main () +{ +XrmInitialize () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac +fi +;; #( + *) have_x=yes;; + esac + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } +fi + +not_really_there="" +if test "$no_x" = ""; then + if test "$x_includes" = ""; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <X11/XIntrinsic.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + not_really_there="yes" +fi +rm -f conftest.err conftest.i conftest.$ac_ext + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi +fi +if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 header files" >&5 +$as_echo_n "checking for X11 header files... " >&6; } + XINCLUDES="# no special path needed" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <X11/Intrinsic.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + XINCLUDES="" +fi +rm -f conftest.err conftest.i conftest.$ac_ext + if test -z "$XINCLUDES"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include /usr/X11R6/include /usr/include/X11R6" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + XINCLUDES=" -I$i" + break + fi + done + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XINCLUDES" >&5 +$as_echo "$XINCLUDES" >&6; } +else + if test "$x_includes" != ""; then + XINCLUDES=-I$x_includes + else + XINCLUDES="# no special path needed" + fi +fi +if test -z "$XINCLUDES"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any!" >&5 +$as_echo "couldn't find any!" >&6; } + XINCLUDES="# no include files found" +fi + +if test "$no_x" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11 libraries" >&5 +$as_echo_n "checking for X11 libraries... " >&6; } + XLIBSW= + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/X11R6/lib /usr/lib/X11R6 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } + XLIBSW="-L$i -lX11" + break + fi + done +else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi +fi +if test -z "$XLIBSW" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCreateWindow in -lXwindow" >&5 +$as_echo_n "checking for XCreateWindow in -lXwindow... " >&6; } +if ${ac_cv_lib_Xwindow_XCreateWindow+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXwindow $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XCreateWindow (); +int +main () +{ +return XCreateWindow (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xwindow_XCreateWindow=yes +else + ac_cv_lib_Xwindow_XCreateWindow=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 +$as_echo "$ac_cv_lib_Xwindow_XCreateWindow" >&6; } +if test "x$ac_cv_lib_Xwindow_XCreateWindow" = xyes; then : + XLIBSW=-lXwindow +fi + +fi +if test -z "$XLIBSW" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: couldn't find any! Using -lX11." >&5 +$as_echo "couldn't find any! Using -lX11." >&6; } + XLIBSW=-lX11 +fi + + + + + +# Check whether --with-alllang was given. +if test "${with_alllang+set}" = set; then : + withval=$with_alllang; with_alllang="$withval" +fi + + +#-------------------------------------------------------------------- +# Look for Tcl +#-------------------------------------------------------------------- + +TCLINCLUDE= +TCLLIB= +TCLPACKAGE= + + +# Check whether --with-tclconfig was given. +if test "${with_tclconfig+set}" = set; then : + withval=$with_tclconfig; with_tclconfig="$withval" +else + with_tclconfig= +fi + + +# Check whether --with-tcl was given. +if test "${with_tcl+set}" = set; then : + withval=$with_tcl; + TCLPACKAGE="$withval" +else + TCLPACKAGE=yes +fi + + +# Check whether --with-tclincl was given. +if test "${with_tclincl+set}" = set; then : + withval=$with_tclincl; + TCLINCLUDE="$ISYSTEM$withval" +else + TCLINCLUDE= +fi + + +# Check whether --with-tcllib was given. +if test "${with_tcllib+set}" = set; then : + withval=$with_tcllib; + TCLLIB="-L$withval" +else + TCLLIB= +fi + + +# First, check for "--without-tcl" or "--with-tcl=no". +if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Tcl" >&5 +$as_echo "$as_me: Disabling Tcl" >&6;} +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl configuration" >&5 +$as_echo_n "checking for Tcl configuration... " >&6; } +# First check to see if --with-tclconfig was specified. +if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + TCLCONFIG=`(cd ${with_tclconfig}; pwd)` + else + as_fn_error $? "${with_tcl} directory doesn't contain tclConfig.sh" "$LINENO" 5 + fi +fi +# check in a few common install locations +if test x"${TCLCONFIG}" = x ; then + for i in `ls -d /usr/lib/ 2>/dev/null` \ + `ls -d -r /usr/lib/tcl*/ 2>/dev/null` \ + `ls -d /usr/local/lib/ 2>/dev/null` \ + `ls -d -r /usr/local/lib/tcl*/ 2>/dev/null` ; do + if test -f $i"tclConfig.sh" ; then + TCLCONFIG=`(cd $i; pwd)` + break + fi + done +fi +if test x"${TCLCONFIG}" = x ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found $TCLCONFIG/tclConfig.sh" >&5 +$as_echo "found $TCLCONFIG/tclConfig.sh" >&6; } + . $TCLCONFIG/tclConfig.sh + if test -z "$TCLINCLUDE"; then + TCLINCLUDE=`echo $TCL_INCLUDE_SPEC | sed "s/-I/$ISYSTEM/"` + fi + if test -z "$TCLLIB"; then + TCLLIB=$TCL_LIB_SPEC + fi +fi + +if test -z "$TCLINCLUDE"; then + if test "x$TCLPACKAGE" != xyes; then + TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include" + fi +fi + +if test -z "$TCLLIB"; then + if test "x$TCLPACKAGE" != xyes; then + TCLLIB="-L$TCLPACKAGE/lib -ltcl" + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl header files" >&5 +$as_echo_n "checking for Tcl header files... " >&6; } +if test -z "$TCLINCLUDE"; then +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <tcl.h> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + TCLINCLUDE="" +fi +rm -f conftest.err conftest.i conftest.$ac_ext +if test -z "$TCLINCLUDE"; then + dirs="/usr/local/include /usr/include /opt/local/include" + for i in $dirs ; do + if test -r $i/tcl.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } + TCLINCLUDE="$ISYSTEM$i" + break + fi + done +fi +if test -z "$TCLINCLUDE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } +fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLINCLUDE" >&5 +$as_echo "$TCLINCLUDE" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Tcl library" >&5 +$as_echo_n "checking for Tcl library... " >&6; } +if test -z "$TCLLIB"; then +dirs="/usr/local/lib /usr/lib /opt/local/lib" +for i in $dirs ; do + if test -r $i/libtcl.a; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } + TCLLIB="-L$i -ltcl" + break + fi +done +if test -z "$TCLLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } +fi +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TCLLIB" >&5 +$as_echo "$TCLLIB" >&6; } +fi + +# Cygwin (Windows) needs the library for dynamic linking +case $host in +*-*-cygwin* | *-*-mingw*) TCLDYNAMICLINKING="$TCLLIB";; +*)TCLDYNAMICLINKING="";; +esac + +case $host in +*-*-darwin*) + TCLLDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace' + TCLCXXSHARED='$(CXX) -dynamiclib -undefined suppress -flat_namespace' + ;; +*) + TCLLDSHARED='$(LDSHARED)' + TCLCXXSHARED='$(CXXSHARED)' + ;; +esac + +fi + + + + + + + +#---------------------------------------------------------------- +# Look for Python +#---------------------------------------------------------------- + +PYINCLUDE= +PYLIB= +PYPACKAGE= + + +# Check whether --with-python was given. +if test "${with_python+set}" = set; then : + withval=$with_python; PYBIN="$withval" +else + PYBIN=yes +fi + + +# First, check for "--without-python" or "--with-python=no". +if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Python" >&5 +$as_echo "$as_me: Disabling Python" >&6;} +else + # First figure out the name of the Python executable + if test "x$PYBIN" = xyes; then + for ac_prog in python python2.8 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PYTHON"; then + ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PYTHON="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PYTHON=$ac_cv_prog_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PYTHON" && break +done + + else + PYTHON="$PYBIN" + fi + + if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python prefix" >&5 +$as_echo_n "checking for Python prefix... " >&6; } + PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYPREFIX" >&5 +$as_echo "$PYPREFIX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python exec-prefix" >&5 +$as_echo_n "checking for Python exec-prefix... " >&6; } + PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYEPREFIX" >&5 +$as_echo "$PYEPREFIX" >&6; } + + + # Note: I could not think of a standard way to get the version string from different versions. + # This trick pulls it out of the file location for a standard library file. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python version" >&5 +$as_echo_n "checking for Python version... " >&6; } + + # Need to do this hack since autoconf replaces __file__ with the name of the configure file + filehack="file__" + PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYVERSION" >&5 +$as_echo "$PYVERSION" >&6; } + + # Find the directory for libraries this is necessary to deal with + # platforms that can have apps built for multiple archs: e.g. x86_64 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python lib dir" >&5 +$as_echo_n "checking for Python lib dir... " >&6; } + PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null` + if test -z "$PYLIBDIR"; then + # Fedora patch Python to add sys.lib, for other distros we assume "lib". + PYLIBDIR="lib" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYLIBDIR" >&5 +$as_echo "$PYLIBDIR" >&6; } + + # Set the include directory + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python header files" >&5 +$as_echo_n "checking for Python header files... " >&6; } + if test -r $PYPREFIX/include/$PYVERSION/Python.h; then + PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config" + fi + if test -z "$PYINCLUDE"; then + if test -r $PYPREFIX/include/Py/Python.h; then + PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib" + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYINCLUDE" >&5 +$as_echo "$PYINCLUDE" >&6; } + + # Set the library directory blindly. This probably won't work with older versions + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library" >&5 +$as_echo_n "checking for Python library... " >&6; } + dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR" + for i in $dirs; do + if test -d $PYEPREFIX/$PYLIBDIR/$i; then + PYLIB="$PYEPREFIX/$PYLIBDIR/$i" + break + fi + done + if test -z "$PYLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 +$as_echo "Not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYLIB" >&5 +$as_echo "$PYLIB" >&6; } + fi + + PYLINK="-l$PYVERSION" + fi + + # Cygwin (Windows) needs the library for dynamic linking + case $host in + *-*-cygwin* | *-*-mingw*) + PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK" + DEFS="-DUSE_DL_IMPORT $DEFS" + ;; + *)PYTHONDYNAMICLINKING="";; + esac +fi + + + + + + + +#---------------------------------------------------------------- +# Look for Python 3.x +#---------------------------------------------------------------- + +# mostly copy & pasted from "Look for Python" section, +# did some trim, fix and rename + +PY3INCLUDE= +PY3LIB= +PY3PACKAGE= + + +# Check whether --with-python3 was given. +if test "${with_python3+set}" = set; then : + withval=$with_python3; PY3BIN="$withval" +else + PY3BIN=yes +fi + + +# First, check for "--without-python3" or "--with-python3=no". +if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Python 3.x support" >&5 +$as_echo "$as_me: Disabling Python 3.x support" >&6;} +else + for py_ver in 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0; do + for ac_prog in python$py_ver +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PYTHON3+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PYTHON3"; then + ac_cv_prog_PYTHON3="$PYTHON3" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PYTHON3="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PYTHON3=$ac_cv_prog_PYTHON3 +if test -n "$PYTHON3"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON3" >&5 +$as_echo "$PYTHON3" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PYTHON3" && break +done + + if test -n "$PYTHON3"; then + for ac_prog in $PYTHON3-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PY3CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PY3CONFIG"; then + ac_cv_prog_PY3CONFIG="$PY3CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PY3CONFIG="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PY3CONFIG=$ac_cv_prog_PY3CONFIG +if test -n "$PY3CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3CONFIG" >&5 +$as_echo "$PY3CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PY3CONFIG" && break +done + + if test -n "$PY3CONFIG"; then + break + fi + fi + done + + if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3.x prefix" >&5 +$as_echo_n "checking for Python 3.x prefix... " >&6; } + PY3PREFIX=`($PY3CONFIG --prefix) 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3PREFIX" >&5 +$as_echo "$PY3PREFIX" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3.x exec-prefix" >&5 +$as_echo_n "checking for Python 3.x exec-prefix... " >&6; } + PY3EPREFIX=`($PY3CONFIG --exec-prefix) 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3EPREFIX" >&5 +$as_echo "$PY3EPREFIX" >&6; } + + # Note: I could not think of a standard way to get the version string from different versions. + # This trick pulls it out of the file location for a standard library file. + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3.x version" >&5 +$as_echo_n "checking for Python 3.x version... " >&6; } + + # Need to do this hack since autoconf replaces __file__ with the name of the configure file + filehack="file__" + PY3VERSION=`($PYTHON3 -c "import string,operator,os.path; print(operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1))")` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3VERSION" >&5 +$as_echo "$PY3VERSION" >&6; } + + # Find the directory for libraries this is necessary to deal with + # platforms that can have apps built for multiple archs: e.g. x86_64 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3.x lib dir" >&5 +$as_echo_n "checking for Python 3.x lib dir... " >&6; } + PY3LIBDIR=`($PYTHON3 -c "import sys; print(sys.lib)") 2>/dev/null` + if test -z "$PY3LIBDIR"; then + # some dists don't have sys.lib so the best we can do is assume lib + PY3LIBDIR="lib" + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3LIBDIR" >&5 +$as_echo "$PY3LIBDIR" >&6; } + + # Set the include directory + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3.x header files" >&5 +$as_echo_n "checking for Python 3.x header files... " >&6; } + PY3INCLUDE=`($PY3CONFIG --includes) 2>/dev/null` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3INCLUDE" >&5 +$as_echo "$PY3INCLUDE" >&6; } + + # Set the library directory blindly. This probably won't work with older versions + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python 3.x library" >&5 +$as_echo_n "checking for Python 3.x library... " >&6; } + dirs="$PY3VERSION/config $PY3VERSION/$PY3LIBDIR python/$PY3LIBDIR" + for i in $dirs; do + if test -d $PY3EPREFIX/$PY3LIBDIR/$i; then + PY3LIB="$PY3EPREFIX/$PY3LIBDIR/$i" + break + fi + done + if test -z "$PY3LIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5 +$as_echo "Not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PY3LIB" >&5 +$as_echo "$PY3LIB" >&6; } + fi + + PY3LINK="-l$PY3VERSION" + fi + + # Cygwin (Windows) needs the library for dynamic linking + case $host in + *-*-cygwin* | *-*-mingw*) + PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK" + DEFS="-DUSE_DL_IMPORT $DEFS" + ;; + *)PYTHON3DYNAMICLINKING="";; + esac +fi + + + + + + + +#---------------------------------------------------------------- +# Look for Perl5 +#---------------------------------------------------------------- + +PERLBIN= + + +# Check whether --with-perl5 was given. +if test "${with_perl5+set}" = set; then : + withval=$with_perl5; PERLBIN="$withval" +else + PERLBIN=yes +fi + + +# First, check for "--without-perl5" or "--with-perl5=no". +if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Perl5" >&5 +$as_echo "$as_me: Disabling Perl5" >&6;} +PERL= +else + +# First figure out what the name of Perl5 is + +if test "x$PERLBIN" = xyes; then +for ac_prog in perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PERL"; then + ac_cv_prog_PERL="$PERL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PERL="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PERL=$ac_cv_prog_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PERL" && break +done + +else +PERL="$PERLBIN" +fi + + +# This could probably be simplified as for all platforms and all versions of Perl the following apparently should be run to get the compilation options: +# perl -MExtUtils::Embed -e ccopts +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 header files" >&5 +$as_echo_n "checking for Perl5 header files... " >&6; } +if test -n "$PERL"; then + PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null` + if test -n "$PERL5DIR" ; then + dirs="$PERL5DIR $PERL5DIR/CORE" + PERL5EXT=none + for i in $dirs; do + if test -r $i/perl.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } + PERL5EXT="$i" + break + fi + done + if test "$PERL5EXT" = none; then + PERL5EXT="$PERL5DIR/CORE" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not locate perl.h...using $PERL5EXT" >&5 +$as_echo "could not locate perl.h...using $PERL5EXT" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 library" >&5 +$as_echo_n "checking for Perl5 library... " >&6; } + PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; s/\.$Config{so}.*//; print $_, "\n"') 2>/dev/null` + if test -z "$PERL5LIB" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5LIB" >&5 +$as_echo "$PERL5LIB" >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 ccflags" >&5 +$as_echo_n "checking for Perl5 ccflags... " >&6; } + PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-Wdeclaration-after-statement//" | sed "s/-I/$ISYSTEM/") 2>/dev/null` + if test -z "$PERL5CCFLAGS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5CCFLAGS" >&5 +$as_echo "$PERL5CCFLAGS" >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 ccdlflags" >&5 +$as_echo_n "checking for Perl5 ccdlflags... " >&6; } + PERL5CCDLFLAGS=`($PERL -e 'use Config; print $Config{ccdlflags}, "\n"') 2>/dev/null` + if test -z "$PERL5CCDLFLAGS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5CCDLFLAGS" >&5 +$as_echo "$PERL5CCDLFLAGS" >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 cccdlflags" >&5 +$as_echo_n "checking for Perl5 cccdlflags... " >&6; } + PERL5CCCDLFLAGS=`($PERL -e 'use Config; print $Config{cccdlflags}, "\n"') 2>/dev/null` + if test -z "$PERL5CCCDLFLAGS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5CCCDLFLAGS" >&5 +$as_echo "$PERL5CCCDLFLAGS" >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl5 ldflags" >&5 +$as_echo_n "checking for Perl5 ldflags... " >&6; } + PERL5LDFLAGS=`($PERL -e 'use Config; print $Config{ldflags}, "\n"') 2>/dev/null` + if test -z "$PERL5LDFLAGS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL5LDFLAGS" >&5 +$as_echo "$PERL5LDFLAGS" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unable to determine perl5 configuration" >&5 +$as_echo "unable to determine perl5 configuration" >&6; } + PERL5EXT=$PERL5DIR + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not figure out how to run perl5" >&5 +$as_echo "could not figure out how to run perl5" >&6; } +fi + +# Cygwin (Windows) needs the library for dynamic linking +case $host in +*-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";; +*)PERL5DYNAMICLINKING="";; +esac +fi + + + + + + + + + + +#---------------------------------------------------------------- +# Look for Octave +#---------------------------------------------------------------- + +OCTAVEBIN= +OCTAVE_SO=.oct + + +# Check whether --with-octave was given. +if test "${with_octave+set}" = set; then : + withval=$with_octave; OCTAVEBIN="$withval" +else + OCTAVEBIN=yes +fi + + +# First, check for "--without-octave" or "--with-octave=no". +if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Octave" >&5 +$as_echo "$as_me: Disabling Octave" >&6;} + OCTAVE= + +# First figure out what the name of Octave is +elif test "x$OCTAVEBIN" = xyes; then + # Extract the first word of "octave", so it can be a program name with args. +set dummy octave; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_OCTAVE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $OCTAVE in + [\\/]* | ?:[\\/]*) + ac_cv_path_OCTAVE="$OCTAVE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_OCTAVE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +OCTAVE=$ac_cv_path_OCTAVE +if test -n "$OCTAVE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE" >&5 +$as_echo "$OCTAVE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +else + OCTAVE="$OCTAVEBIN" +fi + +if test -n "$OCTAVE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mkoctfile" >&5 +$as_echo_n "checking for mkoctfile... " >&6; } + mkoctfile="`dirname ${OCTAVE}`/mkoctfile" + if test -x "${mkoctfile}"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${mkoctfile}" >&5 +$as_echo "${mkoctfile}" >&6; } + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, disabling Octave" >&5 +$as_echo "not found, disabling Octave" >&6; } + OCTAVE= + +fi +fi +if test -n "$OCTAVE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Octave preprocessor flags" >&5 +$as_echo_n "checking for Octave preprocessor flags... " >&6; } + OCTAVE_CPPFLAGS= + for n in CPPFLAGS INCFLAGS; do + OCTAVE_CPPFLAGS="${OCTAVE_CPPFLAGS} "`${mkoctfile} -p $n` + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_CPPFLAGS" >&5 +$as_echo "$OCTAVE_CPPFLAGS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Octave compiler flags" >&5 +$as_echo_n "checking for Octave compiler flags... " >&6; } + OCTAVE_CXXFLAGS= + for n in ALL_CXXFLAGS; do + OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} "`${mkoctfile} -p $n` + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_CXXFLAGS" >&5 +$as_echo "$OCTAVE_CXXFLAGS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Octave linker flags" >&5 +$as_echo_n "checking for Octave linker flags... " >&6; } + OCTAVE_LDFLAGS= + for n in RDYNAMIC_FLAG LFLAGS RLD_FLAG OCTAVE_LIBS LIBS; do + OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`${mkoctfile} -p $n` + done + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_LDFLAGS" >&5 +$as_echo "$OCTAVE_LDFLAGS" >&6; } + for octave_opt in --silent --norc --no-history --no-window-system; do + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Octave option '${octave_opt}' is supported" >&5 +$as_echo_n "checking if Octave option '${octave_opt}' is supported... " >&6; } + octave_out=`${OCTAVE} ${octave_opt} /dev/null 2>&1 | sed -n '1{/unrecognized/p}'` + if test "x${octave_out}" = x; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + OCTAVE="${OCTAVE} ${octave_opt}" + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi + done +fi + + + + + + + +#---------------------------------------------------------------- +# Look for java +#---------------------------------------------------------------- + + +# Check whether --with-java was given. +if test "${with_java+set}" = set; then : + withval=$with_java; JAVABIN="$withval" +else + JAVABIN=yes +fi + + +# Check whether --with-javac was given. +if test "${with_javac+set}" = set; then : + withval=$with_javac; JAVACBIN="$withval" +else + JAVACBIN= +fi + + +# First, check for "--without-java" or "--with-java=no". +if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Java" >&5 +$as_echo "$as_me: Disabling Java" >&6;} +JAVA= +else + +if test "x$JAVABIN" = xyes; then + for ac_prog in java kaffe guavac +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAVA+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$JAVA"; then + ac_cv_prog_JAVA="$JAVA" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_JAVA="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAVA=$ac_cv_prog_JAVA +if test -n "$JAVA"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA" >&5 +$as_echo "$JAVA" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVA" && break +done + +else + JAVA="$JAVABIN" +fi + +if test -z "$JAVACBIN"; then + for ac_prog in javac +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_JAVAC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$JAVAC"; then + ac_cv_prog_JAVAC="$JAVAC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_JAVAC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +JAVAC=$ac_cv_prog_JAVAC +if test -n "$JAVAC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAC" >&5 +$as_echo "$JAVAC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$JAVAC" && break +done + +else + JAVAC="$JAVACBIN" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for java include file jni.h" >&5 +$as_echo_n "checking for java include file jni.h... " >&6; } + +# Check whether --with-javaincl was given. +if test "${with_javaincl+set}" = set; then : + withval=$with_javaincl; JAVAINCDIR="$withval" +else + JAVAINCDIR= +fi + + +if test -z "$JAVAINCDIR" ; then + JAVAINCDIR="/usr/j2sdk*/include /usr/local/j2sdk*/include /usr/jdk*/include /usr/local/jdk*/include /opt/j2sdk*/include /opt/jdk*/include /usr/java/include /usr/java/j2sdk*/include /usr/java/jdk*/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/lib/java/include /usr/lib/jvm/java*/include /usr/include/kaffe /usr/local/include/kaffe /usr/include" + + # Add in default installation directory on Windows for Cygwin + case $host in + *-*-cygwin* | *-*-mingw*) JAVAINCDIR="c:/Program*Files/Java/jdk*/include d:/Program*Files/Java/jdk*/include c:/j2sdk*/include d:/j2sdk*/include c:/jdk*/include d:/jdk*/include $JAVAINCDIR";; + *-*-darwin*) JAVAINCDIR="/System/Library/Frameworks/JavaVM.framework/Headers $JAVAINCDIR";; + *);; + esac +fi + +JAVAINC="" +for d in $JAVAINCDIR ; do + if test -r "$d/jni.h" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $d" >&5 +$as_echo "$d" >&6; } + JAVAINCDIR=$d + JAVAINC=-I\"$d\" + break + fi +done + +if test "$JAVAINC" = "" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } +else + # now look for <arch>/jni_md.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for java include file jni_md.h" >&5 +$as_echo_n "checking for java include file jni_md.h... " >&6; } + JAVAMDDIR=`find "$JAVAINCDIR" -follow -name jni_md.h -print` + if test "$JAVAMDDIR" = "" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1` + JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\"" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAMDDIR" >&5 +$as_echo "$JAVAMDDIR" >&6; } + fi +fi + +# java.exe on Cygwin requires the Windows standard (Pascal) calling convention as it is a normal Windows executable and not a Cygwin built executable +case $host in +*-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + JAVADYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias" + JAVACFLAGS="-mno-cygwin -mthreads" + else + JAVADYNAMICLINKING="" + JAVACFLAGS="" + fi ;; +*-*-darwin*) + JAVADYNAMICLINKING="-dynamiclib -framework JavaVM" + JAVACFLAGS="" + ;; +*) + JAVADYNAMICLINKING="" + JAVACFLAGS="" + ;; +esac + +# Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls +case $host in +*-*-cygwin* | *-*-mingw*) JAVALIBRARYPREFIX="";; +*)JAVALIBRARYPREFIX="lib";; +esac + +# Java on Mac OS X tweaks +case $host in +*-*-darwin*) + JAVASO=".jnilib" + JAVALDSHARED='$(CC)' + JAVACXXSHARED='$(CXX)' + ;; +*) + JAVASO=$SO + JAVALDSHARED='$(LDSHARED)' + JAVACXXSHARED='$(CXXSHARED)' + ;; +esac +fi + + + + + + + + + + + +#---------------------------------------------------------------- +# Look for gcj +#---------------------------------------------------------------- + + +# Check whether --with-gcj was given. +if test "${with_gcj+set}" = set; then : + withval=$with_gcj; GCJBIN="$withval" +else + GCJBIN=yes +fi + + +# Check whether --with-gcjh was given. +if test "${with_gcjh+set}" = set; then : + withval=$with_gcjh; GCJHBIN="$withval" +else + GCJHBIN= +fi + + +# First, check for "--without-gcj" or "--with-gcj=no". +if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling GCJ" >&5 +$as_echo "$as_me: Disabling GCJ" >&6;} +else + if test "x$GCJBIN" = xyes; then + for ac_prog in gcj +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GCJ+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GCJ"; then + ac_cv_prog_GCJ="$GCJ" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_GCJ="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GCJ=$ac_cv_prog_GCJ +if test -n "$GCJ"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCJ" >&5 +$as_echo "$GCJ" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GCJ" && break +done + + else + GCJ="$GCJBIN" + fi + + if test -z "$GCJCBIN"; then + for ac_prog in gcjh +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GCJH+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GCJH"; then + ac_cv_prog_GCJH="$GCJH" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_GCJH="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GCJH=$ac_cv_prog_GCJH +if test -n "$GCJH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCJH" >&5 +$as_echo "$GCJH" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GCJH" && break +done + + else + GCJH="$GCJHBIN" + fi +fi + + + + +#---------------------------------------------------------------- +# Look for Android +#---------------------------------------------------------------- + + +# Check whether --with-android was given. +if test "${with_android+set}" = set; then : + withval=$with_android; ANDROIDBIN="$withval" +else + ANDROIDBIN=yes +fi + + +# Check whether --with-adb was given. +if test "${with_adb+set}" = set; then : + withval=$with_adb; ADBBIN="$withval" +else + ADBBIN= +fi + + +# Check whether --with-ant was given. +if test "${with_ant+set}" = set; then : + withval=$with_ant; ANTBIN="$withval" +else + ANTBIN= +fi + + +# Check whether --with-ndk-build was given. +if test "${with_ndk_build+set}" = set; then : + withval=$with_ndk_build; NDKBUILDBIN="$withval" +else + NDKBUILDBIN= +fi + + +# First, check for "--without-android" or "--with-android=no". +if test x"${ANDROIDBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Android" >&5 +$as_echo "$as_me: Disabling Android" >&6;} + ANDROID= +else + if test "x$ANDROIDBIN" = xyes; then + for ac_prog in android +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ANDROID+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ANDROID"; then + ac_cv_prog_ANDROID="$ANDROID" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ANDROID="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ANDROID=$ac_cv_prog_ANDROID +if test -n "$ANDROID"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANDROID" >&5 +$as_echo "$ANDROID" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ANDROID" && break +done + + else + ANDROID="$ANDROIDBIN" + fi + + if test -z "$ADBBIN"; then + for ac_prog in adb +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ADB+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ADB"; then + ac_cv_prog_ADB="$ADB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ADB="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ADB=$ac_cv_prog_ADB +if test -n "$ADB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ADB" >&5 +$as_echo "$ADB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ADB" && break +done + + else + ADB="$ADBBIN" + fi + + if test -z "$ANTBIN"; then + for ac_prog in ant +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ANT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ANT"; then + ac_cv_prog_ANT="$ANT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ANT="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ANT=$ac_cv_prog_ANT +if test -n "$ANT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANT" >&5 +$as_echo "$ANT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ANT" && break +done + + else + ANT="$ANTBIN" + fi + + if test -z "$NDKBUILDBIN"; then + for ac_prog in ndk-build +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_NDKBUILD+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$NDKBUILD"; then + ac_cv_prog_NDKBUILD="$NDKBUILD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NDKBUILD="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NDKBUILD=$ac_cv_prog_NDKBUILD +if test -n "$NDKBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NDKBUILD" >&5 +$as_echo "$NDKBUILD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$NDKBUILD" && break +done + + else + NDKBUILD="$NDKBUILDBIN" + fi +fi + + + + + + +#---------------------------------------------------------------- +# Look for Guile +#---------------------------------------------------------------- + +GUILE= +GUILE_CFLAGS= +GUILE_LIBS= + + +# Check whether --with-guile-config was given. +if test "${with_guile_config+set}" = set; then : + withval=$with_guile_config; GUILE_CONFIG="$withval" +else + GUILE_CONFIG= +fi + + +# Check whether --with-guile was given. +if test "${with_guile+set}" = set; then : + withval=$with_guile; + GUILE="$withval" +else + GUILE=yes +fi + + +# Check whether --with-guile-cflags was given. +if test "${with_guile_cflags+set}" = set; then : + withval=$with_guile_cflags; + GUILE_CFLAGS="$withval" +fi + + +# Check whether --with-guile-libs was given. +if test "${with_guile_libs+set}" = set; then : + withval=$with_guile_libs; + GUILE_LIBS="$withval" +fi + + +# First, check for "--without-guile" or "--with-guile=no". +if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Guile" >&5 +$as_echo "$as_me: Disabling Guile" >&6;} +else + if test -z "$GUILE_CONFIG" ; then + # Extract the first word of "guile-config", so it can be a program name with args. +set dummy guile-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GUILE_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GUILE_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GUILE_CONFIG="$GUILE_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GUILE_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GUILE_CONFIG=$ac_cv_path_GUILE_CONFIG +if test -n "$GUILE_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_CONFIG" >&5 +$as_echo "$GUILE_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + if test -n "$GUILE_CONFIG" ; then + if test x"$GUILE" = xyes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for guile bindir" >&5 +$as_echo_n "checking for guile bindir... " >&6; } + guile_bindir="`$GUILE_CONFIG info bindir`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $guile_bindir" >&5 +$as_echo "$guile_bindir" >&6; } + GUILE=$guile_bindir/guile + if ! test -f "$GUILE" ; then + GUILE= + # Extract the first word of "guile", so it can be a program name with args. +set dummy guile; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_GUILE+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $GUILE in + [\\/]* | ?:[\\/]*) + ac_cv_path_GUILE="$GUILE" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_GUILE="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +GUILE=$ac_cv_path_GUILE +if test -n "$GUILE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE" >&5 +$as_echo "$GUILE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + fi + + if test -f "$GUILE" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for guile version" >&5 +$as_echo_n "checking for guile version... " >&6; } + guile_version=`$GUILE -c '(display (effective-version))'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $guile_version" >&5 +$as_echo "$guile_version" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for guile version >= 1.8" >&5 +$as_echo_n "checking for guile version >= 1.8... " >&6; } + guile_good_version=`$GUILE -c '(if (>= (string->number (effective-version)) 1.8) (display "yes") (display "no"))'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $guile_good_version" >&5 +$as_echo "$guile_good_version" >&6; } + if test x"$guile_good_version" != xyes ; then + GUILE= + fi + fi + + if test -z "$GUILE_CFLAGS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for guile compile flags" >&5 +$as_echo_n "checking for guile compile flags... " >&6; } + GUILE_CFLAGS="`$GUILE_CONFIG compile`" # Note that this can sometimes be empty + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_CFLAGS" >&5 +$as_echo "$GUILE_CFLAGS" >&6; } + fi + + if test -z "$GUILE_LIBS" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for guile link flags" >&5 +$as_echo_n "checking for guile link flags... " >&6; } + GUILE_LIBS="`$GUILE_CONFIG link`" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GUILE_LIBS" >&5 +$as_echo "$GUILE_LIBS" >&6; } + fi + fi +fi + + + + + +#---------------------------------------------------------------- +# Look for MzScheme +#---------------------------------------------------------------- + + +# Check whether --with-mzscheme was given. +if test "${with_mzscheme+set}" = set; then : + withval=$with_mzscheme; MZSCHEMEBIN="$withval" +else + MZSCHEMEBIN=yes +fi + + +# Check whether --with-mzc was given. +if test "${with_mzc+set}" = set; then : + withval=$with_mzc; MZCBIN="$withval" +else + MZCBIN= +fi + + +# First, check for "--without-mzscheme" or "--with-mzscheme=no". +if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling MzScheme" >&5 +$as_echo "$as_me: Disabling MzScheme" >&6;} + MZC= +else + if test "x$MZSCHEMEBIN" = xyes; then + # Extract the first word of "mzscheme", so it can be a program name with args. +set dummy mzscheme; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MZSCHEME+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MZSCHEME in + [\\/]* | ?:[\\/]*) + ac_cv_path_MZSCHEME="$MZSCHEME" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MZSCHEME="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MZSCHEME=$ac_cv_path_MZSCHEME +if test -n "$MZSCHEME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MZSCHEME" >&5 +$as_echo "$MZSCHEME" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MZSCHEME="$MZSCHEMEBIN" + fi + + if test -z "$MZCBIN"; then + # Extract the first word of "mzc", so it can be a program name with args. +set dummy mzc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MZC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MZC in + [\\/]* | ?:[\\/]*) + ac_cv_path_MZC="$MZC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_MZC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MZC=$ac_cv_path_MZC +if test -n "$MZC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MZC" >&5 +$as_echo "$MZC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + + if test -n "$MZSCHEME"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MzScheme dynext object" >&5 +$as_echo_n "checking for MzScheme dynext object... " >&6; } + MZDYNOBJ=`$MZSCHEME --eval '(begin (require dynext/link) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (printf "~a" x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` + if test -f "$MZDYNOBJ"; then + : + else + # older versions (3.72 approx and earlier) + MZDYNOBJ=`$MZSCHEME --mute-banner --version --eval '(begin (require (lib "link.ss" "dynext")) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) ((current-make-standard-link-libraries)))) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` + fi + if test -f "$MZDYNOBJ"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MZDYNOBJ" >&5 +$as_echo "$MZDYNOBJ" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + MZDYNOBJ="" + fi + fi +fi + + +#---------------------------------------------------------------- +# Look for Ruby +#---------------------------------------------------------------- + +RUBYBIN= + + +# Check whether --with-ruby was given. +if test "${with_ruby+set}" = set; then : + withval=$with_ruby; RUBYBIN="$withval" +else + RUBYBIN=yes +fi + + +# First, check for "--without-ruby" or "--with-ruby=no". +if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Ruby" >&5 +$as_echo "$as_me: Disabling Ruby" >&6;} +RUBY= +else + +# First figure out what the name of Ruby is + +if test "x$RUBYBIN" = xyes; then + for ac_prog in ruby +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_RUBY+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$RUBY"; then + ac_cv_prog_RUBY="$RUBY" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RUBY="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RUBY=$ac_cv_prog_RUBY +if test -n "$RUBY"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY" >&5 +$as_echo "$RUBY" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$RUBY" && break +done + +else + RUBY="$RUBYBIN" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ruby header files" >&5 +$as_echo_n "checking for Ruby header files... " >&6; } +if test -n "$RUBY"; then + # Try Ruby1.9 first + RUBYDIR=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG["rubyhdrdir"] || $rubyhdrdir') 2>/dev/null` + if test x"$RUBYDIR" = x"" || test x"$RUBYDIR" = x"nil"; then + RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG["archdir"] || $archdir') 2>/dev/null` + else + RUBYARCH=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG["arch"] || $arch') 2>/dev/null` + fi + if test x"$RUBYDIR" != x""; then + dirs="$RUBYDIR" + RUBYINCLUDE=none + for i in $dirs; do + if test -r $i/ruby.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } + RUBYINCLUDE="-I$i" + break + fi + done + if test x"$RUBYARCH" != x""; then + RUBYINCLUDE="-I$RUBYDIR -I$RUBYDIR/$RUBYARCH" + fi + if test "$RUBYINCLUDE" = none; then + RUBYINCLUDE="-I$RUBYDIR" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not locate ruby.h...using $RUBYINCLUDE" >&5 +$as_echo "could not locate ruby.h...using $RUBYINCLUDE" >&6; } + fi + + # Find library and path for linking. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ruby library" >&5 +$as_echo_n "checking for Ruby library... " >&6; } + RUBYLIB="" + rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG["libdir"]') 2>/dev/null` + rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG["bindir"]') 2>/dev/null` + dirs="$dirs $rb_libdir $rb_bindir" + + rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG["LIBRUBY_A"]') 2>/dev/null` + RUBYLINK=`($RUBY -rrbconfig -e ' + c = Config::CONFIG + if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x + if c["LIBRUBY"] == c["LIBRUBY_A"] + link = c["LIBRUBYARG_STATIC"] + else + link = c["LIBRUBYARG_SHARED"] + end + else # 1.6.x + link = "-l" + c["RUBY_INSTALL_NAME"] + end + + # Get the target Ruby was built for + target = c["target"] + + if target == "i386-pc-mswin32" + # Need to change msvcrt-ruby*.lib to -lmsvcrt-ruby* + ext = File.extname(link) + # Get index that counts backwards from end of string + index = -1 - ext.size + # Strip off the extension + link = link.slice(0..index) + puts "-l#{link}" + else + puts link + end') 2>/dev/null` + + if test "$rb_libruby" != ""; then + for i in $dirs; do + if (test -r $i/$rb_libruby;) then + RUBYLIB="$i" + break + fi + done + fi + if test "$RUBYLIB" = ""; then + RUBYLIB="$RUBYDIR" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found... using $RUBYDIR" >&5 +$as_echo "not found... using $RUBYDIR" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBYLINK in $RUBYLIB" >&5 +$as_echo "$RUBYLINK in $RUBYLIB" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unable to determine ruby configuration" >&5 +$as_echo "unable to determine ruby configuration" >&6; } + RUBYINCLUDE="-I$RUBYDIR" + RUBYLIB="$RUBYDIR" + fi + + case $host in + *-*-mingw*) ;; # do nothing, the default windows libraries are already included + *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG["LIBS"]') 2>/dev/null`";; + esac + + RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG["CCDLFLAGS"]') 2>/dev/null` + RUBYSO=.`($RUBY -rrbconfig -e 'print Config::CONFIG["DLEXT"]') 2>/dev/null` +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: could not figure out how to run ruby" >&5 +$as_echo "could not figure out how to run ruby" >&6; } + RUBYINCLUDE="-I/usr/local/lib/ruby/1.4/arch" + RUBYLIB="/usr/local/lib/ruby/1.4/arch" + RUBYLINK="-lruby -lm" +fi + +case $host in +*-*-cygwin* | *-*-mingw*) RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";; +*) RUBYDYNAMICLINKING="";; +esac +fi + + + + + + + + +#------------------------------------------------------------------------- +# Look for PHP +#------------------------------------------------------------------------- + +PHPBIN= + + +# Check whether --with-php was given. +if test "${with_php+set}" = set; then : + withval=$with_php; PHPBIN="$withval" +else + PHPBIN=yes +fi + + +# First, check for "--without-php" or "--with-php=no". +if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling PHP" >&5 +$as_echo "$as_me: Disabling PHP" >&6;} + PHP= +else + + if test "x$PHPBIN" = xyes; then + for ac_prog in php5 php +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PHP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PHP"; then + ac_cv_prog_PHP="$PHP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PHP="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PHP=$ac_cv_prog_PHP +if test -n "$PHP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP" >&5 +$as_echo "$PHP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PHP" && break +done + + else + PHP=$PHPBIN + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PHP header files" >&5 +$as_echo_n "checking for PHP header files... " >&6; } + case $PHP in + *5) + PHPCONFIG=`echo "$PHP"|sed 's/5$/-config5/'` ;; + *) + PHPCONFIG=$PHP-config ;; + esac + php_version=`$PHPCONFIG --version 2>/dev/null` + case $php_version in + 5*) + PHPINC=`$PHPCONFIG --includes 2>/dev/null` + if test -n "$PHPINC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHPINC" >&5 +$as_echo "$PHPINC" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found PHP $version, but only PHP 5 is supported" >&5 +$as_echo "found PHP $version, but only PHP 5 is supported" >&6; } ;; + esac +fi + + + +#---------------------------------------------------------------- +# Look for ocaml +#---------------------------------------------------------------- + + +# Check whether --with-ocaml was given. +if test "${with_ocaml+set}" = set; then : + withval=$with_ocaml; OCAMLBIN="$withval" +else + OCAMLBIN=yes +fi + + +# Check whether --with-ocamlc was given. +if test "${with_ocamlc+set}" = set; then : + withval=$with_ocamlc; OCAMLC="$withval" +else + OCAMLC= +fi + + +# Check whether --with-ocamldlgen was given. +if test "${with_ocamldlgen+set}" = set; then : + withval=$with_ocamldlgen; OCAMLDLGEN="$withval" +else + OCAMLDLGEN= +fi + + +# Check whether --with-ocamlfind was given. +if test "${with_ocamlfind+set}" = set; then : + withval=$with_ocamlfind; OCAMLFIND="$withval" +else + OCAMLFIND= +fi + + +# Check whether --with-ocamlmktop was given. +if test "${with_ocamlmktop+set}" = set; then : + withval=$with_ocamlmktop; OCAMLMKTOP="$withval" +else + OCAMLMKTOP= +fi + + +# First, check for "--without-ocaml" or "--with-ocaml=no". +if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling OCaml" >&5 +$as_echo "$as_me: Disabling OCaml" >&6;} + OCAMLBIN= +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml DL load generator" >&5 +$as_echo_n "checking for Ocaml DL load generator... " >&6; } + if test -z "$OCAMLDLGEN"; then + for ac_prog in ocamldlgen +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLDLGEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLDLGEN"; then + ac_cv_prog_OCAMLDLGEN="$OCAMLDLGEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OCAMLDLGEN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLDLGEN=$ac_cv_prog_OCAMLDLGEN +if test -n "$OCAMLDLGEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDLGEN" >&5 +$as_echo "$OCAMLDLGEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OCAMLDLGEN" && break +done +test -n "$OCAMLDLGEN" || OCAMLDLGEN=":" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml package tool" >&5 +$as_echo_n "checking for Ocaml package tool... " >&6; } + if test -z "$OCAMLFIND"; then + for ac_prog in ocamlfind +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLFIND+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLFIND"; then + ac_cv_prog_OCAMLFIND="$OCAMLFIND" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OCAMLFIND="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLFIND=$ac_cv_prog_OCAMLFIND +if test -n "$OCAMLFIND"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLFIND" >&5 +$as_echo "$OCAMLFIND" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OCAMLFIND" && break +done +test -n "$OCAMLFIND" || OCAMLFIND=":" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml compiler" >&5 +$as_echo_n "checking for Ocaml compiler... " >&6; } + if test -z "$OCAMLC"; then + for ac_prog in ocamlc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLC"; then + ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OCAMLC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLC=$ac_cv_prog_OCAMLC +if test -n "$OCAMLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 +$as_echo "$OCAMLC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OCAMLC" && break +done +test -n "$OCAMLC" || OCAMLC=":" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml interpreter" >&5 +$as_echo_n "checking for Ocaml interpreter... " >&6; } + if test "x$OCAMLBIN" = xyes; then + for ac_prog in ocaml +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLBIN"; then + ac_cv_prog_OCAMLBIN="$OCAMLBIN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OCAMLBIN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLBIN=$ac_cv_prog_OCAMLBIN +if test -n "$OCAMLBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBIN" >&5 +$as_echo "$OCAMLBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OCAMLBIN" && break +done +test -n "$OCAMLBIN" || OCAMLBIN=":" + + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml toplevel creator" >&5 +$as_echo_n "checking for Ocaml toplevel creator... " >&6; } + if test -z "$OCAMLMKTOP"; then + for ac_prog in ocamlmktop +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLMKTOP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLMKTOP"; then + ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_OCAMLMKTOP="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP +if test -n "$OCAMLMKTOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 +$as_echo "$OCAMLMKTOP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$OCAMLMKTOP" && break +done +test -n "$OCAMLMKTOP" || OCAMLMKTOP=":" + + fi + + OCAMLLOC=loc + if test "$OCAMLC" != ":" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml header files" >&5 +$as_echo_n "checking for Ocaml header files... " >&6; } + dirs="/usr/lib/ocaml/caml /usr/local/lib/ocaml/caml" + dir="`$OCAMLC -where 2>/dev/null`" + if test "$dir"; then + dirs="$dir/caml $dirs" + fi + for i in $dirs; do + if test -r $i/mlvalues.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i" >&5 +$as_echo "$i" >&6; } + OCAMLEXT="$i" + OCAMLINC="-I$OCAMLEXT" + break + fi + done + if test -z "$OCAMLINC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ocaml version 3.08.2 or higher" >&5 +$as_echo_n "checking for Ocaml version 3.08.2 or higher... " >&6; } + OCAMLVER=`$OCAMLC -version | sed -e 's/.*version //g'` + + # Split the version into units. + ver_a="$OCAMLVER" + ver_b="3.08.2" + nodots_a=`echo $ver_a | sed -e 's/\./ /g'` + condition="equal" + isolate_b_regex='\([0-9]\+\).*' + for ver_part in $nodots_a ; do + b_ver_part=`echo "$ver_b" | sed -e 's/'"$isolate_b_regex"'/\1/'` + if test \( "$ver_part" -lt "$b_ver_part" \) -a \( "x$condition" = "xequal" \) ; then + condition=less + elif test \( "$ver_part" -gt "$b_ver_part" \) -a \( "x$condition" = "xequal" \) ; then + condition=greater + fi + isolate_b_regex='[0-9]\+\.'"$isolate_b_regex" + done + + if test "x$condition" = "xequal" ; then + : + elif test "x$condition" = "xless" ; then + : + elif test "x$condition" = "xgreater" ; then + OCAMLLOC=_loc + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLVER" >&5 +$as_echo "$OCAMLVER" >&6; } + fi +fi # Disabling ocaml + +export OCAMLLOC +export OCAMLVER +export OCAMLINC +export OCAMLBIN +export OCAMLC +export OCAMLDLGEN +export OCAMLFIND +export OCAMLMKTOP + + + + + + + + + + +#---------------------------------------------------------------- +# Look for Pike +#---------------------------------------------------------------- + +# Identify the name of the Pike executable +# Priority: configure option, automatic search +PIKEBIN= + +# Check whether --with-pike was given. +if test "${with_pike+set}" = set; then : + withval=$with_pike; PIKEBIN="$withval" +else + PIKEBIN=yes +fi + + +# First, check for "--without-pike" or "--with-pike=no". +if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Pike" >&5 +$as_echo "$as_me: Disabling Pike" >&6;} + PIKEBIN= +else + +if test "x$PIKEBIN" = xyes; then + for ac_prog in pike pike7.8 pike7.6 pike7.4 pike7.2 +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PIKE+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PIKE"; then + ac_cv_prog_PIKE="$PIKE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PIKE="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PIKE=$ac_cv_prog_PIKE +if test -n "$PIKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PIKE" >&5 +$as_echo "$PIKE" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PIKE" && break +done + +else + PIKE="$PIKEBIN" +fi + + +# Check for pike-config +# Priority: configure option, guessed from $PIKE, search from list + +# Check whether --with-pike-config was given. +if test "${with_pike_config+set}" = set; then : + withval=$with_pike_config; PIKECONFIG="$withval" +else + PIKECONFIG="" +fi + + +if test -z "$PIKECONFIG" -a -n "$PIKE"; then + for ac_prog in $PIKE-config pike-config \ + pike7.6-config pike7.4-config pike7.2-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PIKECONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PIKECONFIG"; then + ac_cv_prog_PIKECONFIG="$PIKECONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PIKECONFIG="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PIKECONFIG=$ac_cv_prog_PIKECONFIG +if test -n "$PIKECONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PIKECONFIG" >&5 +$as_echo "$PIKECONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PIKECONFIG" && break +done + +fi + +# Check for a --with-pikeincl option to configure +# Priority: configure option, info from $PIKECONFIG, guessed by pike script + +# Check whether --with-pikeincl was given. +if test "${with_pikeincl+set}" = set; then : + withval=$with_pikeincl; PIKEINCLUDE="-I$withval" +else + PIKEINCLUDE= +fi + + +if test -n "$PIKE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Pike header files" >&5 +$as_echo_n "checking for Pike header files... " >&6; } + if test -z "$PIKEINCLUDE" -a -n "$PIKECONFIG"; then + PIKEINCLUDE=`$PIKECONFIG --cflags` + fi + if test -z "$PIKEINCLUDE" -a -n "$PIKE"; then + PIKEINCLUDE=`$PIKE -x cflags` + if test -z "$PIKEINCLUDE"; then + PIKEPATH=`which $PIKE` + PIKEINCLUDE=`$PIKE Tools/check-include-path.pike $PIKEPATH` + PIKEINCLUDE="-I$PIKEINCLUDE" + fi + fi + + if test -z "$PIKEINCLUDE"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PIKEINCLUDE" >&5 +$as_echo "$PIKEINCLUDE" >&6; } + fi +fi +fi + + + +#---------------------------------------------------------------- +# Look for CHICKEN +#---------------------------------------------------------------- + +CHICKEN= +CHICKEN_CONFIG= +CHICKENHOME= +CHICKENOPTS= +CHICKENLIB= + + + +# Check whether --with-chicken was given. +if test "${with_chicken+set}" = set; then : + withval=$with_chicken; CHICKENBIN="$withval" +else + CHICKENBIN=yes +fi + + +# First, check for "--without-chicken" or "--with-chicken=no". +if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling CHICKEN" >&5 +$as_echo "$as_me: Disabling CHICKEN" >&6;} +else + +if test "x$CHICKENBIN" = xyes; then +for ac_prog in chicken +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CHICKEN+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CHICKEN"; then + ac_cv_prog_CHICKEN="$CHICKEN" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CHICKEN="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CHICKEN=$ac_cv_prog_CHICKEN +if test -n "$CHICKEN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHICKEN" >&5 +$as_echo "$CHICKEN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHICKEN" && break +done + +else +CHICKEN="$CHICKENBIN" +fi + + +# Check whether --with-chickencsc was given. +if test "${with_chickencsc+set}" = set; then : + withval=$with_chickencsc; CHICKEN_CSC="$withval" +else + CHICKEN_CSC= +fi + + +if test -z "$CHICKEN_CSC"; then + for ac_prog in csc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CHICKEN_CSC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CHICKEN_CSC"; then + ac_cv_prog_CHICKEN_CSC="$CHICKEN_CSC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CHICKEN_CSC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CHICKEN_CSC=$ac_cv_prog_CHICKEN_CSC +if test -n "$CHICKEN_CSC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHICKEN_CSC" >&5 +$as_echo "$CHICKEN_CSC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHICKEN_CSC" && break +done + + # Both the Microsoft C# compiler and chicken have an executable called csc, so check that this csc is really the chicken one + if test -n "$CHICKEN_CSC" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether csc is the chicken compiler" >&5 +$as_echo_n "checking whether csc is the chicken compiler... " >&6; } + $CHICKEN_CSC -version 2>/dev/null | grep "chicken" > /dev/null || CHICKEN_CSC="" + if test -z "$CHICKEN_CSC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + fi +fi + + +# Check whether --with-chickencsi was given. +if test "${with_chickencsi+set}" = set; then : + withval=$with_chickencsi; CHICKEN_CSI="$withval" +else + CHICKEN_CSI= +fi + + +if test -z "$CHICKEN_CSI"; then +for ac_prog in csi +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CHICKEN_CSI+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CHICKEN_CSI"; then + ac_cv_prog_CHICKEN_CSI="$CHICKEN_CSI" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CHICKEN_CSI="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CHICKEN_CSI=$ac_cv_prog_CHICKEN_CSI +if test -n "$CHICKEN_CSI"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHICKEN_CSI" >&5 +$as_echo "$CHICKEN_CSI" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CHICKEN_CSI" && break +done + +fi + +if test -n "$CHICKEN_CSC" ; then + + +# Check whether --with-chickenopts was given. +if test "${with_chickenopts+set}" = set; then : + withval=$with_chickenopts; + CHICKENOPTS="$withval" +else + CHICKENOPTS= +fi + + +# Check whether --with-chickensharedlib was given. +if test "${with_chickensharedlib+set}" = set; then : + withval=$with_chickensharedlib; + CHICKENSHAREDLIB="$withval" +else + CHICKENSHAREDLIB= +fi + + +# Check whether --with-chickenlib was given. +if test "${with_chickenlib+set}" = set; then : + withval=$with_chickenlib; + CHICKENLIB="$withval" +else + CHICKENLIB= +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler options for static CHICKEN generated code" >&5 +$as_echo_n "checking for compiler options for static CHICKEN generated code... " >&6; } + if test -z "$CHICKENOPTS"; then + CHICKENOPTS="`$CHICKEN_CSC -cflags`" + else + CHICKENOPTS="`$CHICKEN_CSC -cflags` $CHICKENOPTS" + fi + if test -z "$CHICKENOPTS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHICKENOPTS" >&5 +$as_echo "$CHICKENOPTS" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker options for shared CHICKEN generated code" >&5 +$as_echo_n "checking for linker options for shared CHICKEN generated code... " >&6; } + if test -z "$CHICKENSHAREDLIB"; then + CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs`" + else + CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs` $CHICKENSHAREDLIB" + fi + if test -z "$CHICKENSHAREDLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHICKENSHAREDLIB" >&5 +$as_echo "$CHICKENSHAREDLIB" >&6; } + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker options for static CHICKEN generated code" >&5 +$as_echo_n "checking for linker options for static CHICKEN generated code... " >&6; } + if test -z "$CHICKENLIB"; then + CHICKENLIB="`$CHICKEN_CSC -libs`" + else + CHICKENLIB="`$CHICKEN_CSC -libs` $CHICKENLIB" + fi + if test -z "$CHICKENLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CHICKENLIB" >&5 +$as_echo "$CHICKENLIB" >&6; } + fi + +fi # have CHICKEN_CONFIG +fi # Check for --without-chicken + + + + + + + + +#---------------------------------------------------------------- +# Look for C# +#---------------------------------------------------------------- + + +# Check whether --with-csharp was given. +if test "${with_csharp+set}" = set; then : + withval=$with_csharp; with_csharp="$withval" +else + with_csharp=yes +fi + + +# Check whether --with-cil-interpreter was given. +if test "${with_cil_interpreter+set}" = set; then : + withval=$with_cil_interpreter; CSHARPBIN="$withval" +else + CSHARPBIN= +fi + + +# Check whether --with-csharp-compiler was given. +if test "${with_csharp_compiler+set}" = set; then : + withval=$with_csharp_compiler; CSHARPCOMPILERBIN="$withval" +else + CSHARPCOMPILERBIN= +fi + + +# First, check for "--without-csharp" or "--with-csharp=no". +if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling CSharp" >&5 +$as_echo "$as_me: Disabling CSharp" >&6;} +CSHARPCOMPILER= +else + +if test -z "$CSHARPCOMPILERBIN" ; then + case $host in + *-*-cygwin* | *-*-mingw*) + # prefer Mono gmcs (.NET 2.0) over mcs (.NET 1.1) - note mcs-1.2.3 has major pinvoke bug + for ac_prog in csc mono-csc gmcs mcs cscc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CSHARPCOMPILER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CSHARPCOMPILER"; then + ac_cv_prog_CSHARPCOMPILER="$CSHARPCOMPILER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CSHARPCOMPILER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CSHARPCOMPILER=$ac_cv_prog_CSHARPCOMPILER +if test -n "$CSHARPCOMPILER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSHARPCOMPILER" >&5 +$as_echo "$CSHARPCOMPILER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CSHARPCOMPILER" && break +done + + if test -n "$CSHARPCOMPILER" && test "$CSHARPCOMPILER" = "csc" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether csc is the Microsoft CSharp compiler" >&5 +$as_echo_n "checking whether csc is the Microsoft CSharp compiler... " >&6; } + csc 2>/dev/null | grep "C#" > /dev/null || CSHARPCOMPILER="" + if test -z "$CSHARPCOMPILER" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + for ac_prog in mono-csc gmcs mcs cscc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CSHARPCOMPILER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CSHARPCOMPILER"; then + ac_cv_prog_CSHARPCOMPILER="$CSHARPCOMPILER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CSHARPCOMPILER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CSHARPCOMPILER=$ac_cv_prog_CSHARPCOMPILER +if test -n "$CSHARPCOMPILER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSHARPCOMPILER" >&5 +$as_echo "$CSHARPCOMPILER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CSHARPCOMPILER" && break +done + + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + fi + ;; + *)for ac_prog in mono-csc gmcs mcs cscc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CSHARPCOMPILER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CSHARPCOMPILER"; then + ac_cv_prog_CSHARPCOMPILER="$CSHARPCOMPILER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CSHARPCOMPILER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CSHARPCOMPILER=$ac_cv_prog_CSHARPCOMPILER +if test -n "$CSHARPCOMPILER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSHARPCOMPILER" >&5 +$as_echo "$CSHARPCOMPILER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CSHARPCOMPILER" && break +done +;; + esac +else + CSHARPCOMPILER="$CSHARPCOMPILERBIN" +fi + +CSHARPPATHSEPARATOR="/" +CSHARPCYGPATH_W=echo +if test -z "$CSHARPBIN" ; then + CSHARPCILINTERPRETER="" + CSHARPCILINTERPRETER_FLAGS="" + if test "cscc" = "$CSHARPCOMPILER" ; then + for ac_prog in ilrun +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CSHARPCILINTERPRETER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CSHARPCILINTERPRETER"; then + ac_cv_prog_CSHARPCILINTERPRETER="$CSHARPCILINTERPRETER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CSHARPCILINTERPRETER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CSHARPCILINTERPRETER=$ac_cv_prog_CSHARPCILINTERPRETER +if test -n "$CSHARPCILINTERPRETER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSHARPCILINTERPRETER" >&5 +$as_echo "$CSHARPCILINTERPRETER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CSHARPCILINTERPRETER" && break +done + + else + if test "mcs" = "$CSHARPCOMPILER"; then + # Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version' + # The Mono compiler should emit: Mono C# compiler version a.b.c.d + csharp_version_raw=`(mcs --version) 2>/dev/null` + csharp_version_searched=`(mcs --version | sed -e "/C#/b" -e "/Mono/b" -e d) 2>/dev/null` # return string if contains 'Mono' or 'C#' + CSHARPCOMPILER="" + if test -n "$csharp_version_raw" ; then + if test "$csharp_version_raw" = "$csharp_version_searched" ; then + CSHARPCOMPILER="mcs" + fi + fi + if test "mcs" != "$CSHARPCOMPILER" ; then + echo "mcs is not a working Mono C# compiler" + fi + fi + if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then + for ac_prog in mono +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_CSHARPCILINTERPRETER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CSHARPCILINTERPRETER"; then + ac_cv_prog_CSHARPCILINTERPRETER="$CSHARPCILINTERPRETER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CSHARPCILINTERPRETER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CSHARPCILINTERPRETER=$ac_cv_prog_CSHARPCILINTERPRETER +if test -n "$CSHARPCILINTERPRETER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSHARPCILINTERPRETER" >&5 +$as_echo "$CSHARPCILINTERPRETER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CSHARPCILINTERPRETER" && break +done + # Mono JIT + CSHARPCILINTERPRETER_FLAGS="--debug" + else + if test "csc" = "$CSHARPCOMPILER"; then + CSHARPPATHSEPARATOR="\\\\" + CSHARPCYGPATH_W='cygpath -w' + fi + fi + fi +else + CSHARPCILINTERPRETER="$CSHARPBIN" +fi + +# Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable +case $host in +*-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + CSHARPDYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias" + CSHARPCFLAGS="-mno-cygwin -mthreads" + else + CSHARPDYNAMICLINKING="" + CSHARPCFLAGS="" + fi ;; +*) + CSHARPDYNAMICLINKING="" + CSHARPCFLAGS="" + ;; +esac + +# CSharp on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls +case $host in +*-*-cygwin* | *-*-mingw*) CSHARPLIBRARYPREFIX="";; +*)CSHARPLIBRARYPREFIX="lib";; +esac + +# C#/Mono on Mac OS X tweaks +case $host in +*-*-darwin*) + CSHARPSO=".so" + ;; +*) + CSHARPSO=$SO + ;; +esac +fi + + + + + + + + # Is this going to be used? + + + +#---------------------------------------------------------------- +# Look for Lua +#---------------------------------------------------------------- + +LUABIN= +LUAINCLUDE= +LUALIB= +LUADYNAMICLOADLIB= +LUAFLAGS= +LUALINK= +# note: if LUABIN is empty then lua tests will not be done +# LUABIN will be cleared if certain dependencies cannot be found + + +# Check whether --with-lua was given. +if test "${with_lua+set}" = set; then : + withval=$with_lua; LUABIN="$withval" +else + LUABIN=yes +fi + + +# Check whether --with-luaincl was given. +if test "${with_luaincl+set}" = set; then : + withval=$with_luaincl; + LUAINCLUDE="$withval" +else + LUAINCLUDE= +fi + + +# Check whether --with-lualib was given. +if test "${with_lualib+set}" = set; then : + withval=$with_lualib; + LUALIB="$withval" +else + LUALIB= +fi + + +# First, check for "--without-lua" or "--with-lua=no". +if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Lua" >&5 +$as_echo "$as_me: Disabling Lua" >&6;} +else + +# can we find lua? +if test "x$LUABIN" = xyes; then + # We look for a versioned Lua binary first, as there can be + # multiple versions of Lua installed on some systems (like Debian). + # The search order should match the include-file and library search + # orders below (a Lua shared library built for one version may not + # work with a Lua binary of a different version). + for ac_prog in lua5.2 lua5.1 lua +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_LUABIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $LUABIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_LUABIN="$LUABIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_LUABIN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +LUABIN=$ac_cv_path_LUABIN +if test -n "$LUABIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LUABIN" >&5 +$as_echo "$LUABIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$LUABIN" && break +done + +fi + +# check version: we need Lua 5.x +if test "$LUABIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Lua version" >&5 +$as_echo_n "checking Lua version... " >&6; } + # if version 5.x + LUAV5=`$LUABIN -e 'if string.sub(_VERSION,5,5)=="5" then print "1" end'` + # if not version 5.0 + LUAV51=`$LUABIN -e 'if string.sub(_VERSION,5,7)~="5.0" then print "1" end'` + + if test -z "$LUAV5"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Not Lua 5.x" >&5 +$as_echo "$as_me: WARNING: Not Lua 5.x" >&2;} + LUABIN="" + elif test -z "$LUAV51"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Lua 5.0.x" >&5 +$as_echo "Lua 5.0.x" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Lua 5.1 or later" >&5 +$as_echo "Lua 5.1 or later" >&6; } + fi +fi + +if test "$LUABIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Lua dynamic loading is enabled" >&5 +$as_echo_n "checking whether Lua dynamic loading is enabled... " >&6; } + # using Lua to check Lua + # lua 5.0 & 5.1 have different fn names + if test -z "$LUAV51"; then + LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=loadlib("no_such_lib","") if c~="absent" then print "1" end'` + else + LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'` + fi + + if test -z "$LUADYNAMICLOADLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi +fi + +# look for the header files & set LUAFLAGS accordingly +# will clear LUABIN if not present +if test -n "$LUAINCLUDE"; then + as_ac_File=`$as_echo "ac_cv_file_$LUAINCLUDE/lua.h" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LUAINCLUDE/lua.h" >&5 +$as_echo_n "checking for $LUAINCLUDE/lua.h... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$LUAINCLUDE/lua.h"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + LUAFLAGS="$ISYSTEM$LUAINCLUDE" +else + LUABIN= +fi + +else + LUA_OK="1" + ac_fn_c_check_header_mongrel "$LINENO" "lua.h" "ac_cv_header_lua_h" "$ac_includes_default" +if test "x$ac_cv_header_lua_h" = xyes; then : + LUAFLAGS="" +else + LUA_OK="" +fi + + + # if we didn't get it, going to have to look elsewhere (the hard way) + if test -z "$LUA_OK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua.h in other locations" >&5 +$as_echo_n "checking for lua.h in other locations... " >&6; } + # note: Debian/Ubuntu seem to like /usr/include/lua5.1/lua.h + # The ordering of the include directories to search should match + # the ordering of libraries to search in the library test below. + inc=/usr/include + dirs="$inc/lua5.2 $inc/lua5.1 $inc/lua51 $inc/lua5.0 $inc/lua50 /usr/local/include" + for i in $dirs; do + #echo "$i" + if test -r $i/lua.h; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $i/lua.h" >&5 +$as_echo "$i/lua.h" >&6; } + LUAFLAGS="$ISYSTEM$i" + break + fi + done + if test -z "$LUAFLAGS"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + LUABIN="" # clear the bin + fi + fi +fi + +# look for the library files & set LUALINK accordingly +# will clear LUABIN if not present +lua_save_LIBS=$LIBS # the code seems to disrupt LIBS, so saving + +if test -n "$LUALIB"; then + as_ac_File=`$as_echo "ac_cv_file_$LUALIB/liblua.a" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LUALIB/liblua.a" >&5 +$as_echo_n "checking for $LUALIB/liblua.a... " >&6; } +if eval \${$as_ac_File+:} false; then : + $as_echo_n "(cached) " >&6 +else + test "$cross_compiling" = yes && + as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 +if test -r "$LUALIB/liblua.a"; then + eval "$as_ac_File=yes" +else + eval "$as_ac_File=no" +fi +fi +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +if eval test \"x\$"$as_ac_File"\" = x"yes"; then : + LUALINK="-L$LUALIB -llua" +else + LUABIN= +fi + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing lua_close" >&5 +$as_echo_n "checking for library containing lua_close... " >&6; } +if ${ac_cv_search_lua_close+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char lua_close (); +int +main () +{ +return lua_close (); + ; + return 0; +} +_ACEOF +for ac_lib in '' lua lua5.2 lua5.1 lua51 lua5.0 lua50; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_lua_close=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_lua_close+:} false; then : + break +fi +done +if ${ac_cv_search_lua_close+:} false; then : + +else + ac_cv_search_lua_close=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_lua_close" >&5 +$as_echo "$ac_cv_search_lua_close" >&6; } +ac_res=$ac_cv_search_lua_close +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + LUALINK="-l$ac_lib" +else + LUABIN= +fi + +fi + +# adding lualib for lua 5.0 +if test -z "$LUAV51"; then # extra for lua 5.0 + LUALINK="$LUALINK -llualib" +fi + +LIBS=$lua_save_LIBS # restore LIBS + +fi # if not disabled + + + + + + +#---------------------------------------------------------------- +# Look for Allegro Common Lisp +#---------------------------------------------------------------- + +ALLEGROCLBIN= + + +# Check whether --with-allegrocl was given. +if test "${with_allegrocl+set}" = set; then : + withval=$with_allegrocl; ALLEGROCLBIN="$withval" +else + ALLEGROCLBIN=yes +fi + + +# First, check for "--without-allegrocl" or "--with-allegrocl=no". +if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Allegro CL" >&5 +$as_echo "$as_me: Disabling Allegro CL" >&6;} +ALLEGROCLBIN= +else + +# can we find allegrocl? +if test "x$ALLEGROCLBIN" = xyes; then + # Extract the first word of "alisp", so it can be a program name with args. +set dummy alisp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ALLEGROCLBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ALLEGROCLBIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_ALLEGROCLBIN="$ALLEGROCLBIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_ALLEGROCLBIN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ALLEGROCLBIN=$ac_cv_path_ALLEGROCLBIN +if test -n "$ALLEGROCLBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ALLEGROCLBIN" >&5 +$as_echo "$ALLEGROCLBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +fi + + + +#---------------------------------------------------------------- +# Look for GNU CLISP +#---------------------------------------------------------------- + +CLISPBIN= + + +# Check whether --with-clisp was given. +if test "${with_clisp+set}" = set; then : + withval=$with_clisp; CLISPBIN="$withval" +else + CLISPBIN=yes +fi + + +# First, check for "--without-clisp" or "--with-clisp=no". +if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling CLISP" >&5 +$as_echo "$as_me: Disabling CLISP" >&6;} +CLISPBIN= +else + +# can we find clisp? +if test "x$CLISPBIN" = xyes; then + # Extract the first word of "clisp", so it can be a program name with args. +set dummy clisp; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_CLISPBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $CLISPBIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_CLISPBIN="$CLISPBIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_CLISPBIN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +CLISPBIN=$ac_cv_path_CLISPBIN +if test -n "$CLISPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CLISPBIN" >&5 +$as_echo "$CLISPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +fi + + + +#---------------------------------------------------------------- +# Look for GNU R +#---------------------------------------------------------------- + +RBIN= + + +# Check whether --with-r was given. +if test "${with_r+set}" = set; then : + withval=$with_r; RBIN="$withval" +else + RBIN=yes +fi + + +# First, check for "--without-r" or "--with-r=no". +if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: Disabling R" >&5 +$as_echo "$as_me: Disabling R" >&6;} +RBIN= +else + +# can we find R? +if test "x$RBIN" = xyes; then + # Extract the first word of "R", so it can be a program name with args. +set dummy R; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_RBIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $RBIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_RBIN="$RBIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_RBIN="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +RBIN=$ac_cv_path_RBIN +if test -n "$RBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RBIN" >&5 +$as_echo "$RBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +fi + + + +#---------------------------------------------------------------- +# Look for Go compilers +#---------------------------------------------------------------- + + +# Check whether --with-go was given. +if test "${with_go+set}" = set; then : + withval=$with_go; GOBIN="$withval" +else + GOBIN=yes +fi + + +if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling Go" >&5 +$as_echo "$as_me: Disabling Go" >&6;} + GO= + GOC= + GO1=false + GOGCC=false + GOOPT= + GOVERSIONOPTION= +else + + if test "x$GOBIN" = xyes; then + for ac_prog in go 6g 8g gccgo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_GO+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$GO"; then + ac_cv_prog_GO="$GO" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_GO="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +GO=$ac_cv_prog_GO +if test -n "$GO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GO" >&5 +$as_echo "$GO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$GO" && break +done + + else + GO="$GOBIN" + fi + + GOGCC=false + GO1=false + GOOPT= + GOVERSIONOPTION= + if test -n "$GO" ; then + if $GO --help 2>/dev/null | grep gccgo >/dev/null 2>&1 ; then + GOGCC=true + GOVERSIONOPTION=--version + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gccgo version is too old" >&5 +$as_echo_n "checking whether gccgo version is too old... " >&6; } + go_version=`$GO $GOVERSIONOPTION | sed -e 's/^0-9* \(0-9.*\) .*$/\1/' -e 's/.//g'` + if test "$go_version" -lt 470; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - minimum version is 4.7.0" >&5 +$as_echo "yes - minimum version is 4.7.0" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + if test "$go_version" -lt 480; then + GOOPT="-intgosize 32" + else + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if ${ac_cv_sizeof_void_p+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (void *) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + + if test "$ac_cv_sizeof_void_p" = "8"; then + GOOPT="-intgosize 64" + else + GOOPT="-intgosize 32" + fi + fi + fi + elif test "`echo $GO | sed -e 's|.*/||'`" = "go"; then + GO1=true + GOVERSIONOPTION=version + GOC=$(sh -c "$(go env) && echo \$GOCHAR")c + go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //') + case $go_version in + go1.0*) GOOPT="-intgosize 32" ;; + *) if test "$GOC" = "6c"; then + GOOPT="-intgosize 64" + else + GOOPT="-intgosize 32" + fi + ;; + esac + else + GOC=`echo $GO | sed -e 's/g/c/'` + GOVERSIONOPTION=-V + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Go ($GO) version is too old" >&5 +$as_echo_n "checking whether Go ($GO) version is too old... " >&6; } + go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([0-9]*\).*/\1/'` + go_min_version=7077 + if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - minimum version is $go_min_version" >&5 +$as_echo "yes - minimum version is $go_min_version" >&6; } + GO= + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + GOOPT="-intgosize 32" + fi + fi +fi + + + + + + + + +#---------------------------------------------------------------- +# Look for D +#---------------------------------------------------------------- + + +# Check whether --with-d was given. +if test "${with_d+set}" = set; then : + withval=$with_d; with_d="$withval" +else + with_d=yes +fi + + +# Check whether --with-d1-compiler was given. +if test "${with_d1_compiler+set}" = set; then : + withval=$with_d1_compiler; D1COMPILERBIN="$withval" +else + D1COMPILERBIN= +fi + + +# Check whether --with-d2-compiler was given. +if test "${with_d2_compiler+set}" = set; then : + withval=$with_d2_compiler; D2COMPILERBIN="$withval" +else + D2COMPILERBIN= +fi + + + +# First, check for "--without-d" or "--with-d=no". +if test x"${with_d}" = xno -o x"${with_alllang}" = xno ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Disabling D" >&5 +$as_echo "$as_me: Disabling D" >&6;} + D1COMPILER= + D2COMPILER= +else + old_ac_ext=$ac_ext + ac_ext=d + + if test -z "$D1COMPILERBIN" ; then + for ac_prog in dmd ldmd gdmd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_D1COMPILER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$D1COMPILER"; then + ac_cv_prog_D1COMPILER="$D1COMPILER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_D1COMPILER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +D1COMPILER=$ac_cv_prog_D1COMPILER +if test -n "$D1COMPILER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $D1COMPILER" >&5 +$as_echo "$D1COMPILER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$D1COMPILER" && break +done + + + if test -n "$D1COMPILER" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D1/Tango compiler works" >&5 +$as_echo_n "checking whether the D1/Tango compiler works... " >&6; } + cat > conftest.$ac_ext <<_ACEOF +import tango.io.Stdout; +void main() { +} +_ACEOF + rm -f conftest.$ac_objext + if { { ac_try="$D1COMPILER conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$D1COMPILER conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test ! -s conftest.err && test -s conftest.$ac_objext; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + D1COMPILER= + +fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else + D1COMPILER="$D1COMPILERBIN" + fi + + if test -z "$D2COMPILERBIN" ; then + for ac_prog in dmd gdmd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_D2COMPILER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$D2COMPILER"; then + ac_cv_prog_D2COMPILER="$D2COMPILER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_D2COMPILER="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +D2COMPILER=$ac_cv_prog_D2COMPILER +if test -n "$D2COMPILER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $D2COMPILER" >&5 +$as_echo "$D2COMPILER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$D2COMPILER" && break +done + + + if test -n "$D2COMPILER" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the D2 compiler works" >&5 +$as_echo_n "checking whether the D2 compiler works... " >&6; } + cat > conftest.$ac_ext <<_ACEOF +import std.algorithm; +void main() { +} +_ACEOF + rm -f conftest.$ac_objext + if { { ac_try="$D2COMPILER conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$D2COMPILER conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test ! -s conftest.err && test -s conftest.$ac_objext; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + D2COMPILER= + +fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else + D2COMPILER="$D2COMPILERBIN" + fi + + ac_ext=$old_ac_ext +fi + +if test -n "$D1COMPILER"; then + DDEFAULTVERSION=1 +elif test -n "$D2COMPILER"; then + DDEFAULTVERSION=2 +fi + +# Do not prefix library file names with "lib" on Windows. +case $host in +*-*-cygwin* | *-*-mingw*) DLIBPREFIX="";; +*)DLIBPREFIX="lib";; +esac + + + + + + +#---------------------------------------------------------------- +# Determine which languages to use for examples/test-suite +#---------------------------------------------------------------- + +SKIP_TCL= +if test -z "$TCLINCLUDE" || test -z "$TCLLIB" ; then + SKIP_TCL="1" +fi + + + +SKIP_PERL5= +if test -z "$PERL" || test -z "$PERL5EXT" ; then + SKIP_PERL5="1" +fi + + + +SKIP_OCTAVE= +if test -z "$OCTAVE" ; then + SKIP_OCTAVE="1" +fi + + + +SKIP_PYTHON= +if (test -z "$PYINCLUDE") && + (test -z "$PY3INCLUDE") ; then + SKIP_PYTHON="1" +fi + + +SKIP_PYTHON3= +if test -z "$PY3INCLUDE" ; then + SKIP_PYTHON3="1" +fi + + +SKIP_JAVA= +if test -z "$JAVA" || test -z "$JAVAC" || test -z "$JAVAINC" ; then + SKIP_JAVA="1" +fi + + + +SKIP_GUILE= +if test -z "$GUILE" || test -z "$GUILE_LIBS" ; then + SKIP_GUILE="1" +fi + + + +SKIP_MZSCHEME= +if test -z "$MZC" || test -z "$MZDYNOBJ" ; then + SKIP_MZSCHEME="1" +fi + + + +SKIP_RUBY= +if test -z "$RUBY" || test -z "$RUBYINCLUDE" || test -z "$RUBYLIB" ; then + SKIP_RUBY="1" +fi + + + +SKIP_PHP= +if test -z "$PHP" || test -z "$PHPINC" ; then + SKIP_PHP="1" +fi + + + +SKIP_OCAML= +if test -z "$OCAMLBIN" || test -z "$OCAMLINC" ; then + SKIP_OCAML="1" +fi + + + +SKIP_PIKE= +if test -z "$PIKE" || test -z "$PIKEINCLUDE" ; then + SKIP_PIKE="1" +fi + + + +SKIP_CHICKEN= +if test -z "$CHICKEN_CSC" || test -z "$CHICKEN"; then + SKIP_CHICKEN="1" +fi + + + +SKIP_CSHARP= +if test -z "$CSHARPCOMPILER" ; then + SKIP_CSHARP="1" +else + if test "cscc" = "$CSHARPCOMPILER" && test -z "$CSHARPCILINTERPRETER" ; then + SKIP_CSHARP="1" + fi +fi + + +SKIP_MODULA3="1" # Always skipped! + + +SKIP_LUA= +# we need LUABIN & dynamic loading +if test -z "$LUABIN" || test -z "$LUADYNAMICLOADLIB"; then + SKIP_LUA="1" +fi + + +SKIP_ALLEGROCL= +if test -z "$ALLEGROCLBIN" ; then + SKIP_ALLEGROCL="1" +fi + + +SKIP_CLISP= +if test -z "$CLISPBIN" ; then + SKIP_CLISP="1" +fi + + +SKIP_R= +if test -z "$RBIN" ; then + SKIP_R="1" +fi + + +SKIP_CFFI= +#if test -z "$CFFIBIN" ; then + SKIP_CFFI="1" +#fi + + +SKIP_UFFI= +#if test -z "$UFFIBIN" ; then + SKIP_UFFI="1" +#fi + + +SKIP_GO= +if test -z "$GO" ; then + SKIP_GO="1" +fi + + +SKIP_D= +if test -z "$DDEFAULTVERSION" ; then + SKIP_D="1" +fi + + +#---------------------------------------------------------------- +# Additional language dependencies +#---------------------------------------------------------------- +SKIP_GCJ= +if test -z "$GCJ" || test -z "$GCJH" ; then + SKIP_GCJ="1" +else + if test "$GCC" != yes; then + SKIP_GCJ="1" + fi +fi + + + +SKIP_ANDROID= +if test -z "$ANDROID" || test -z "$ADB" || test -z "$ANT" || test -z "$NDKBUILD" ; then + SKIP_ANDROID="1" +fi + + + + +#---------------------------------------------------------------- +# Miscellaneous +#---------------------------------------------------------------- + + +# Root directory +# Translate path for native Windows compilers for use with 'make check' +ROOT_DIR=`pwd` +case $host in +*-*-cygwin* | *-*-mingw*) + if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then + ROOT_DIR=`cygpath --mixed $ROOT_DIR` + fi + # Extra files generated by some Windows compilers + EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk" + ;; +esac + + + + + +# Configure SWIG_LIB path + + +# Check whether --with-swiglibdir was given. +if test "${with_swiglibdir+set}" = set; then : + withval=$with_swiglibdir; swig_lib="$withval" +else + swig_lib="${datadir}/swig/${PACKAGE_VERSION}" +fi + + + + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$swig_lib\"" + eval ac_define_dir="\"$ac_define_dir\"" + SWIG_LIB="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define SWIG_LIB "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + +case $build in + # Windows does not understand unix directories. Convert into a windows directory with drive letter. + *-*-mingw*) SWIG_LIB_WIN_UNIX=`cmd //c echo $SWIG_LIB | sed -e "s/ *$//"`;; # This echo converts unix to mixed paths. Then zap unexpected trailing space. + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; +esac + +cat >>confdefs.h <<_ACEOF +#define SWIG_LIB_WIN_UNIX "$SWIG_LIB_WIN_UNIX" +_ACEOF + + +ac_config_files="$ac_config_files Makefile swig.spec Source/Makefile Examples/Makefile Examples/xml/Makefile Examples/test-suite/chicken/Makefile Examples/test-suite/csharp/Makefile Examples/test-suite/d/Makefile Examples/test-suite/guile/Makefile Examples/test-suite/java/Makefile Examples/test-suite/mzscheme/Makefile Examples/test-suite/ocaml/Makefile Examples/test-suite/octave/Makefile Examples/test-suite/perl5/Makefile Examples/test-suite/php/Makefile Examples/test-suite/pike/Makefile Examples/test-suite/python/Makefile Examples/test-suite/ruby/Makefile Examples/test-suite/tcl/Makefile Examples/test-suite/lua/Makefile Examples/test-suite/allegrocl/Makefile Examples/test-suite/clisp/Makefile Examples/test-suite/cffi/Makefile Examples/test-suite/uffi/Makefile Examples/test-suite/r/Makefile Examples/test-suite/go/Makefile Lib/ocaml/swigp4.ml" + +ac_config_files="$ac_config_files preinst-swig" + +ac_config_files="$ac_config_files CCache/ccache_swig_config.h" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + if test "x$cache_file" != "x/dev/null"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: "${CONFIG_STATUS=./config.status}" +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +as_myself= +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by swig $as_me 2.0.11, which was +generated by GNU Autoconf 2.68. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to <http://www.swig.org>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +swig config.status 2.0.11 +configured by $0, generated by GNU Autoconf 2.68, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=?*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "Source/Include/swigconfig.h") CONFIG_HEADERS="$CONFIG_HEADERS Source/Include/swigconfig.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "swig.spec") CONFIG_FILES="$CONFIG_FILES swig.spec" ;; + "Source/Makefile") CONFIG_FILES="$CONFIG_FILES Source/Makefile" ;; + "Examples/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/Makefile" ;; + "Examples/xml/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/xml/Makefile" ;; + "Examples/test-suite/chicken/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/chicken/Makefile" ;; + "Examples/test-suite/csharp/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/csharp/Makefile" ;; + "Examples/test-suite/d/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/d/Makefile" ;; + "Examples/test-suite/guile/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/guile/Makefile" ;; + "Examples/test-suite/java/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/java/Makefile" ;; + "Examples/test-suite/mzscheme/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/mzscheme/Makefile" ;; + "Examples/test-suite/ocaml/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/ocaml/Makefile" ;; + "Examples/test-suite/octave/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/octave/Makefile" ;; + "Examples/test-suite/perl5/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/perl5/Makefile" ;; + "Examples/test-suite/php/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/php/Makefile" ;; + "Examples/test-suite/pike/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/pike/Makefile" ;; + "Examples/test-suite/python/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/python/Makefile" ;; + "Examples/test-suite/ruby/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/ruby/Makefile" ;; + "Examples/test-suite/tcl/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/tcl/Makefile" ;; + "Examples/test-suite/lua/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/lua/Makefile" ;; + "Examples/test-suite/allegrocl/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/allegrocl/Makefile" ;; + "Examples/test-suite/clisp/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/clisp/Makefile" ;; + "Examples/test-suite/cffi/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/cffi/Makefile" ;; + "Examples/test-suite/uffi/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/uffi/Makefile" ;; + "Examples/test-suite/r/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/r/Makefile" ;; + "Examples/test-suite/go/Makefile") CONFIG_FILES="$CONFIG_FILES Examples/test-suite/go/Makefile" ;; + "Lib/ocaml/swigp4.ml") CONFIG_FILES="$CONFIG_FILES Lib/ocaml/swigp4.ml" ;; + "preinst-swig") CONFIG_FILES="$CONFIG_FILES preinst-swig" ;; + "CCache/ccache_swig_config.h") CONFIG_FILES="$CONFIG_FILES CCache/ccache_swig_config.h" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= ac_tmp= + trap 'exit_status=$? + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' <conf$$subs.awk | sed ' +/^[^""]/{ + N + s/\n// +} +' >>$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$ac_tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' <confdefs.h | sed ' +s/'"$ac_delim"'/"\\\ +"/g' >>$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$ac_tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$ac_tmp/stdin" + case $ac_file in + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "preinst-swig":F) chmod +x preinst-swig ;; + + esac +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi + +# +# CONFIG_SUBDIRS section. +# +if test "$no_recursion" != yes; then + + # Remove --cache-file, --srcdir, and --disable-option-checking arguments + # so they do not pile up. + ac_sub_configure_args= + ac_prev= + eval "set x $ac_configure_args" + shift + for ac_arg + do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case $ac_arg in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ + | --c=*) + ;; + --config-cache | -C) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + ;; + --disable-option-checking) + ;; + *) + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_sub_configure_args " '$ac_arg'" ;; + esac + done + + # Always prepend --prefix to ensure using the same prefix + # in subdir configurations. + ac_arg="--prefix=$prefix" + case $ac_arg in + *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args" + + # Pass --silent + if test "$silent" = yes; then + ac_sub_configure_args="--silent $ac_sub_configure_args" + fi + + # Always prepend --disable-option-checking to silence warnings, since + # different subdirs can have different --enable and --with options. + ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args" + + ac_popdir=`pwd` + for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + test -d "$srcdir/$ac_dir" || continue + + ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)" + $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5 + $as_echo "$ac_msg" >&6 + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + cd "$ac_dir" + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f "$ac_srcdir/configure.gnu"; then + ac_sub_configure=$ac_srcdir/configure.gnu + elif test -f "$ac_srcdir/configure"; then + ac_sub_configure=$ac_srcdir/configure + elif test -f "$ac_srcdir/configure.in"; then + # This should be Cygnus configure. + ac_sub_configure=$ac_aux_dir/configure + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5 +$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + # Make the cache file name correct relative to the subdirectory. + case $cache_file in + [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; + *) # Relative name. + ac_sub_cache_file=$ac_top_build_prefix$cache_file ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 +$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} + # The eval makes quoting arguments work. + eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \ + --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" || + as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5 + fi + + cd "$ac_popdir" + done +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/configure.ac Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2451 @@ +dnl Process this file with autoconf to produce a configure script. +dnl The macros which aren't shipped with the autotools are stored in the +dnl Tools/config directory in .m4 files. + +AC_INIT([swig],[2.0.11],[http://www.swig.org]) + +dnl NB: When this requirement is increased to 2.60 or later, AC_PROG_SED +dnl definition below can be removed +AC_PREREQ(2.58) + +AC_CONFIG_SRCDIR([Source/Swig/swig.h]) +AC_CONFIG_AUX_DIR([Tools/config]) +AC_CONFIG_HEADERS([Source/Include/swigconfig.h]) +AC_CANONICAL_HOST +AM_INIT_AUTOMAKE + +dnl Some extra defines for the config file +AH_BOTTOM([ +/* Default language */ +#define SWIG_LANG "-tcl" + +/* Deal with Microsofts attempt at deprecating C standard runtime functions */ +#if defined(_MSC_VER) +# define _CRT_SECURE_NO_DEPRECATE +#endif +]) + +dnl Check for programs that a user requires to build SWIG +AC_PROG_CC +AC_PROG_CXX +AC_EXEEXT +AC_OBJEXT +AM_PROG_CC_C_O # Needed for subdir-objects in AUTOMAKE_OPTIONS + +AC_COMPILE_WARNINGS # Increase warning levels + +AC_DEFINE_UNQUOTED(SWIG_CXX, ["$CXX"], [Compiler that built SWIG]) +AC_DEFINE_UNQUOTED(SWIG_PLATFORM, ["$host"], [Platform that SWIG is built for]) + +dnl Checks for header files. +AC_HEADER_STDC + +dnl Checks for types. +AC_LANG_PUSH([C++]) +AC_CHECK_TYPES([bool]) +AC_LANG_POP([C++]) + +dnl Look for popen +AC_ARG_WITH(popen, AS_HELP_STRING([--without-popen], [Disable popen]), with_popen="$withval") +if test x"${with_popen}" = xno ; then +AC_MSG_NOTICE([Disabling popen]) +else +AC_CHECK_FUNC(popen, AC_DEFINE(HAVE_POPEN, 1, [Define if popen is available]), AC_MSG_NOTICE([Disabling popen])) +fi + +dnl PCRE + +dnl AX_PATH_GENERIC() relies on AC_PROG_SED() but it is defined only in +dnl autoconf 2.60 so trivially predefine it ourselves for the older versions +m4_ifdef([AC_PROG_SED],, [AC_DEFUN([AC_PROG_SED], [AC_PATH_PROG([SED], sed)])]) + +AC_ARG_WITH([pcre], + [AS_HELP_STRING([--without-pcre], + [Disable support for regular expressions using PCRE])], + [], + [with_pcre=yes]) + +AC_MSG_CHECKING([whether to enable PCRE support]) +AC_MSG_RESULT([$with_pcre]) + +dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script +if test x"${with_pcre}" = xyes ; then + AC_MSG_CHECKING([whether to use local PCRE]) + local_pcre_config=no + if test -z $PCRE_CONFIG; then + if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then + PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config + local_pcre_config=$PCRE_CONFIG + fi + fi + AC_MSG_RESULT([$local_pcre_config]) +fi +AS_IF([test "x$with_pcre" != xno], + [AX_PATH_GENERIC([pcre], + [], dnl Minimal version of PCRE we need -- accept any + [], dnl custom sed script for version parsing is not needed + [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library]) + LIBS="$LIBS $PCRE_LIBS" + CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS" + ], + [AC_MSG_FAILURE([ + Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions) + library package. This dependency is needed for configure to complete, + Either: + - Install the PCRE developer package on your system (preferred approach). + - Download the PCRE source tarball, build and install on your system + as you would for any package built from source distribution. + - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically + link against. Run 'Tools/pcre-build.sh --help' for instructions. + (quite easy and does not require privileges to install PCRE on your system) + - Use configure --without-pcre to disable regular expressions support in SWIG + (not recommended).]) + ]) + ]) + + +dnl CCache +AC_ARG_ENABLE([ccache], AS_HELP_STRING([--disable-ccache], [disable building and installation of ccache-swig executable (default enabled)]), [enable_ccache=$enableval], [enable_ccache=yes]) +AC_MSG_CHECKING([whether to enable ccache-swig]) +AC_MSG_RESULT([$enable_ccache]) + +if test "$enable_ccache" = yes; then + AC_CONFIG_SUBDIRS(CCache) + ENABLE_CCACHE=1 +fi +AC_SUBST(ENABLE_CCACHE) + + +echo "" +echo "Checking packages required for SWIG developers." +echo "Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball" +echo "" + +AC_PROG_YACC +AC_PROG_RANLIB +AC_CHECK_PROGS(AR, ar aal, ar) +AC_SUBST(AR) +AC_CHECK_PROGS(YODL2MAN, yodl2man) +AC_CHECK_PROGS(YODL2HTML, yodl2html) + +if test -n "$YODL2MAN"; then + AC_MSG_CHECKING([yodl2man version >= 2.02]) + yodl_version=`$YODL2MAN --version 2>&1 | grep 'yodl version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.*[0-9]*\).*/\1/g'` + AX_COMPARE_VERSION([$yodl_version],[ge],[2.02], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no - $yodl_version found])]) +fi + +if test -n "$YODL2HTML"; then + AC_MSG_CHECKING([yodl2html version >= 2.02]) + yodl_version=`$YODL2HTML --version 2>&1 | grep 'yodl version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'` + AX_COMPARE_VERSION([$yodl_version],[ge],[2.02], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no - $yodl_version found])]) +fi + +echo "" +echo "Checking for installed target languages and other information in order to compile and run" +echo "the examples and test-suite invoked by 'make check'." +echo "Note : None of the following packages are required for users to compile and install SWIG from the distributed tarball" +echo "" + +dnl Some test cases require Boost +AX_BOOST_BASE(,,,) +AC_SUBST(BOOST_CPPFLAGS) + +dnl How to specify include directories that may be system directories. +# -I should not be used on system directories (GCC) +if test "$GCC" = yes; then + ISYSTEM="-isystem " +else + ISYSTEM="-I" +fi +AC_MSG_NOTICE(ISYSTEM: $ISYSTEM) + +dnl Info for building shared libraries ... in order to run the examples + +# SO is the extension of shared libraries (including the dot!) +AC_MSG_CHECKING(SO) +if test -z "$SO" +then + case $host in + *-*-hp*) SO=.sl;; + *-*-darwin*) SO=.bundle;; + *-*-cygwin* | *-*-mingw*) SO=.dll;; + *) SO=.so;; + esac +fi +AC_MSG_RESULT($SO) + +# LDSHARED is the ld *command* used to create shared library +# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 +# (Shared libraries in this instance are shared modules to be loaded into +# Python, as opposed to building Python itself as a shared library.) +AC_MSG_CHECKING(LDSHARED) +if test -z "$LDSHARED" +then + case $host in + *-*-aix*) LDSHARED="\$(srcdir)/ld_so_aix \$(CC)";; + *-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + LDSHARED="$CC -shared" + else + if test "cl" = $CC ; then + # Microsoft Visual C++ (MSVC) + LDSHARED="$CC -nologo -LD" + else + # Unknown compiler try gcc approach + LDSHARED="$CC -shared" + fi + fi ;; + *-*-irix5*) LDSHARED="ld -shared";; + *-*-irix6*) LDSHARED="ld ${SGI_ABI} -shared -all";; + *-*-sunos4*) LDSHARED="ld";; + *-*-solaris*) LDSHARED="ld -G";; + *-*-hp*) LDSHARED="ld -b";; + *-*-osf*) LDSHARED="ld -shared -expect_unresolved \"*\"";; + *-sequent-sysv4) LDSHARED="ld -G";; + *-*-next*) + if test "$ns_dyld" + then LDSHARED='$(CC) $(LDFLAGS) -bundle -prebind' + else LDSHARED='$(CC) $(CFLAGS) -nostdlib -r' + fi + if test "$with_next_framework" ; then + LDSHARED="$LDSHARED \$(LDLIBRARY)" + fi ;; + *-*-linux*) LDSHARED="gcc -shared";; + *-*-dgux*) LDSHARED="ld -G";; + *-*-freebsd3*) LDSHARED="gcc -shared";; + *-*-freebsd* | *-*-openbsd*) LDSHARED="ld -Bshareable";; + *-*-netbsd*) + if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]] + then + LDSHARED="cc -shared" + else + LDSHARED="ld -Bshareable" + fi;; + *-sco-sysv*) LDSHARED="cc -G -KPIC -Ki486 -belf -Wl,-Bexport";; + *-*-darwin*) LDSHARED="cc -bundle -undefined suppress -flat_namespace";; + *) LDSHARED="ld";; + esac +fi +AC_MSG_RESULT($LDSHARED) +# CXXSHARED is the ld *command* used to create C++ shared library +# -- "ld" on SunOS 4.x.x, "ld -G" on SunOS 5.x, "ld -shared" on IRIX 5 +# (Shared libraries in this instance are shared modules to be loaded into +# Python, as opposed to building Python itself as a shared library.) +AC_MSG_CHECKING(CXXSHARED) +if test -z "$CXXSHARED" +then + CXXSHARED="$LDSHARED" +fi +AC_MSG_RESULT($CXXSHARED) + +# +AC_MSG_CHECKING(TRYLINKINGWITHCXX) +if test -z "$TRYLINKINGWITHCXX" +then + case $host in + *-*-solaris*) if test "$GCC" = yes + then TRYLINKINGWITHCXX="CXXSHARED= $CXX -Wl,-G" + else TRYLINKINGWITHCXX="CXXSHARED= $CXX -G -L/opt/SUNWspro/lib -lCrun -lCstd" + fi;; + *-*-hp*) TRYLINKINGWITHCXX="CXXSHARED= $CXX +z ";; + *-*-darwin*) TRYLINKINGWITHCXX="CXXSHARED= $CXX -bundle -undefined suppress -flat_namespace";; + *-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared " + else + if test "cl" = $CXX ; then + # Microsoft Visual C++ (MSVC) + TRYLINKINGWITHCXX="CXXSHARED= $CXX -nologo -LD" + else + TRYLINKINGWITHCXX="#unknown Windows compiler" + fi + fi ;; + *) TRYLINKINGWITHCXX="CXXSHARED= $CXX -shared ";; + esac +fi +AC_MSG_RESULT($TRYLINKINGWITHCXX) +# CCSHARED are the C *flags* used to create objects to go into a shared +# library (module) -- this is only needed for a few systems +AC_MSG_CHECKING(CCSHARED) +if test -z "$CCSHARED" +then + case $host in + *-*-hp*) if test "$GCC" = yes + then CCSHARED="-fpic" + else CCSHARED="+z" + fi;; + *-*-linux*) CCSHARED="-fpic";; + *-*-freebsd* | *-*-openbsd*) CCSHARED="-fpic";; + *-*-netbsd*) CCSHARED="-fPIC";; + *-sco-sysv*) CCSHARED="-KPIC -dy -Bdynamic";; + *-*-irix6*) case $CC in + *gcc*) CCSHARED="-shared";; + *) CCSHARED="";; + esac;; + esac +fi +AC_MSG_RESULT($CCSHARED) + +# RPATH is the path used to look for shared library files. +AC_MSG_CHECKING(RPATH) +if test -z "$RPATH" +then + case $host in + *-*-solaris*) RPATH='-R. -R$(exec_prefix)/lib';; + *-*-irix*) RPATH='-rpath .:$(exec_prefix)/lib';; + *-*-linux*) RPATH='-Xlinker -rpath $(exec_prefix)/lib -Xlinker -rpath .';; + *) RPATH='';; + esac +fi +AC_MSG_RESULT($RPATH) + +# LINKFORSHARED are the flags passed to the $(CC) command that links +# the a few executables -- this is only needed for a few systems + +AC_MSG_CHECKING(LINKFORSHARED) +if test -z "$LINKFORSHARED" +then + case $host in + *-*-aix*) LINKFORSHARED='-Wl,-bE:$(srcdir)/python.exp -lld';; + *-*-hp*) + LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; + *-*-linux*) LINKFORSHARED="-Xlinker -export-dynamic";; + *-*-next*) LINKFORSHARED="-u libsys_s";; + *-sco-sysv*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";; + *-*-irix6*) LINKFORSHARED="-all";; + esac +fi +AC_MSG_RESULT($LINKFORSHARED) + +# Optional CFLAGS used to silence/enhance compiler warnings on some platforms. +AC_MSG_CHECKING(PLATFLAGS) +case $host in + *-*-solaris*) if test "$GCC" = yes + then PLATFLAGS= + else PLATFLAGS= + # else PLATFLAGS="-errtags=yes" # Need more work as C examples use ld for linking + fi;; + *) PLATFLAGS= +esac +AC_MSG_RESULT($PLATFLAGS) + +# Set info about shared libraries. +AC_SUBST(SO) +AC_SUBST(LDSHARED) +AC_SUBST(CCSHARED) +AC_SUBST(CXXSHARED) +AC_SUBST(TRYLINKINGWITHCXX) +AC_SUBST(RPATH) +AC_SUBST(PLATFLAGS) +AC_SUBST(LINKFORSHARED) + +# This variation is needed on OS-X because there is no (apparent) consistency in shared library naming. +# Sometimes .bundle works, but sometimes .so is needed. It depends on the target language + +AC_SUBST(PYTHON_SO) +case $host in + *-*-mingw*) PYTHON_SO=.pyd;; + *-*-darwin*) PYTHON_SO=.so;; + *) PYTHON_SO=$SO;; +esac + +AC_SUBST(TCL_SO) +case $host in + *-*-darwin*) TCL_SO=.dylib;; + *) TCL_SO=$SO;; +esac + +AC_SUBST(GUILE_SO) +case $host in + *-*-darwin*) GUILE_SO=.so;; + *) GUILE_SO=$SO;; +esac + +AC_SUBST(PHP_SO) +case $host in + *-*-darwin*) PHP_SO=.so;; + *) PHP_SO=$SO;; +esac + +AC_SUBST(MZSCHEME_SO) +case $host in + *) MZSCHEME_SO=.so;; +esac + +AC_SUBST(LUA_SO) +case $host in + *-*-darwin*) LUA_SO=.so;; + *) LUA_SO=$SO;; +esac + +# Check for specific libraries. Used for SWIG examples +AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV +AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX + +dnl The following three libraries (nsl,inet,socket) are needed on Sequent, +dnl and must be checked for in this order since each library depends on the +dnl preceding one. +dnl +dnl Most SVR4 platforms will need -lsocket and -lnsl. However on SGI IRIX 5, +dnl these exist but are broken, so we use AC_SEARCH_LIBS which will only try +dnl the library if the function isn't already available without it. +AC_SEARCH_LIBS(t_open, nsl) # SVR4 +AC_SEARCH_LIBS(gethostbyname, inet) # Sequent +AC_SEARCH_LIBS(socket, socket) # SVR4 sockets + +AC_CHECK_LIB(swill, swill_init, [SWIGLIBS="-lswill $LIBS" SWILL="-DSWIG_SWILL"]) +AC_SUBST(SWIGLIBS) +AC_SUBST(SWILL) + +# check for --with-libm=... +AC_SUBST(LIBM) +LIBM=-lm +AC_ARG_WITH(libm, [ --with-libm=STRING math library], [ +if test "$withval" != yes +then LIBM=$withval +else AC_MSG_ERROR([proper usage is --with-libm=STRING]) +fi]) +AC_CHECK_LIB(ieee, main, [LIBM="-lieee $LIBM"]) +AC_CHECK_LIB(crypt,crypt, [LIBCRYPT="-lcrypt"]) +AC_SUBST(LIBCRYPT) + +# check for --with-libc=... +AC_SUBST(LIBC) +AC_ARG_WITH(libc, [ --with-libc=STRING C library], [ +if test "$withval" != yes +then LIBC=$withval +else AC_MSG_ERROR([proper usage is --with-libc=STRING]) +fi]) + +#-------------------------------------------------------------------- +# Locate the X11 header files and the X11 library archive. Try +# the ac_path_x macro first, but if it doesn't find the X stuff +# (e.g. because there's no xmkmf program) then check through +# a list of possible directories. Under some conditions the +# autoconf macro will return an include directory that contains +# no include files, so double-check its result just to be safe. +#-------------------------------------------------------------------- + +AC_PATH_X +not_really_there="" +if test "$no_x" = ""; then + if test "$x_includes" = ""; then + AC_TRY_CPP([#include <X11/XIntrinsic.h>], , not_really_there="yes") + else + if test ! -r $x_includes/X11/Intrinsic.h; then + not_really_there="yes" + fi + fi +fi +if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then + AC_MSG_CHECKING(for X11 header files) + XINCLUDES="# no special path needed" + AC_TRY_CPP([#include <X11/Intrinsic.h>], , XINCLUDES="") + if test -z "$XINCLUDES"; then + dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include /usr/sww/include /usr/X11R6/include /usr/include/X11R6" + for i in $dirs ; do + if test -r $i/X11/Intrinsic.h; then + XINCLUDES=" -I$i" + break + fi + done + fi + AC_MSG_RESULT($XINCLUDES) +else + if test "$x_includes" != ""; then + XINCLUDES=-I$x_includes + else + XINCLUDES="# no special path needed" + fi +fi +if test -z "$XINCLUDES"; then + AC_MSG_RESULT(couldn't find any!) + XINCLUDES="# no include files found" +fi + +if test "$no_x" = yes; then + AC_MSG_CHECKING(for X11 libraries) + XLIBSW= + dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/X11R6/lib /usr/lib/X11R6 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" + for i in $dirs ; do + if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then + AC_MSG_RESULT($i) + XLIBSW="-L$i -lX11" + break + fi + done +else + if test "$x_libraries" = ""; then + XLIBSW=-lX11 + else + XLIBSW="-L$x_libraries -lX11" + fi +fi +if test -z "$XLIBSW" ; then + AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) +fi +if test -z "$XLIBSW" ; then + AC_MSG_RESULT(couldn't find any! Using -lX11.) + XLIBSW=-lX11 +fi + +AC_SUBST(XINCLUDES) +AC_SUBST(XLIBSW) + +AC_ARG_WITH(alllang, AS_HELP_STRING([--without-alllang], [Disable all languages]), with_alllang="$withval") + +#-------------------------------------------------------------------- +# Look for Tcl +#-------------------------------------------------------------------- + +TCLINCLUDE= +TCLLIB= +TCLPACKAGE= + +AC_ARG_WITH(tclconfig, AS_HELP_STRING([--without-tcl], [Disable Tcl]) +AS_HELP_STRING([--with-tclconfig=path], [Set location of tclConfig.sh]), [with_tclconfig="$withval"], [with_tclconfig=]) +AC_ARG_WITH(tcl, + [ --with-tcl=path Set location of Tcl package],[ + TCLPACKAGE="$withval"], [TCLPACKAGE=yes]) +AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[ + TCLINCLUDE="$ISYSTEM$withval"], [TCLINCLUDE=]) +AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[ + TCLLIB="-L$withval"], [TCLLIB=]) + +# First, check for "--without-tcl" or "--with-tcl=no". +if test x"${TCLPACKAGE}" = xno -o x"${with_alllang}" = xno; then +AC_MSG_NOTICE([Disabling Tcl]) +else +AC_MSG_CHECKING([for Tcl configuration]) +# First check to see if --with-tclconfig was specified. +if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + TCLCONFIG=`(cd ${with_tclconfig}; pwd)` + else + AC_MSG_ERROR([${with_tcl} directory doesn't contain tclConfig.sh]) + fi +fi +# check in a few common install locations +if test x"${TCLCONFIG}" = x ; then + for i in `ls -d /usr/lib/ 2>/dev/null` \ + `ls -d -r /usr/lib/tcl*/ 2>/dev/null` \ + `ls -d /usr/local/lib/ 2>/dev/null` \ + `ls -d -r /usr/local/lib/tcl*/ 2>/dev/null` ; do + if test -f $i"tclConfig.sh" ; then + TCLCONFIG=`(cd $i; pwd)` + break + fi + done +fi +if test x"${TCLCONFIG}" = x ; then + AC_MSG_RESULT(no) +else + AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh) + . $TCLCONFIG/tclConfig.sh + if test -z "$TCLINCLUDE"; then + TCLINCLUDE=`echo $TCL_INCLUDE_SPEC | sed "s/-I/$ISYSTEM/"` + fi + if test -z "$TCLLIB"; then + TCLLIB=$TCL_LIB_SPEC + fi +fi + +if test -z "$TCLINCLUDE"; then + if test "x$TCLPACKAGE" != xyes; then + TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include" + fi +fi + +if test -z "$TCLLIB"; then + if test "x$TCLPACKAGE" != xyes; then + TCLLIB="-L$TCLPACKAGE/lib -ltcl" + fi +fi + +AC_MSG_CHECKING(for Tcl header files) +if test -z "$TCLINCLUDE"; then +AC_TRY_CPP([#include <tcl.h>], , TCLINCLUDE="") +if test -z "$TCLINCLUDE"; then + dirs="/usr/local/include /usr/include /opt/local/include" + for i in $dirs ; do + if test -r $i/tcl.h; then + AC_MSG_RESULT($i) + TCLINCLUDE="$ISYSTEM$i" + break + fi + done +fi +if test -z "$TCLINCLUDE"; then + AC_MSG_RESULT(not found) +fi +else + AC_MSG_RESULT($TCLINCLUDE) +fi + +AC_MSG_CHECKING(for Tcl library) +if test -z "$TCLLIB"; then +dirs="/usr/local/lib /usr/lib /opt/local/lib" +for i in $dirs ; do + if test -r $i/libtcl.a; then + AC_MSG_RESULT($i) + TCLLIB="-L$i -ltcl" + break + fi +done +if test -z "$TCLLIB"; then + AC_MSG_RESULT(not found) +fi +else +AC_MSG_RESULT($TCLLIB) +fi + +# Cygwin (Windows) needs the library for dynamic linking +case $host in +*-*-cygwin* | *-*-mingw*) TCLDYNAMICLINKING="$TCLLIB";; +*)TCLDYNAMICLINKING="";; +esac + +case $host in +*-*-darwin*) + TCLLDSHARED='$(CC) -dynamiclib -undefined suppress -flat_namespace' + TCLCXXSHARED='$(CXX) -dynamiclib -undefined suppress -flat_namespace' + ;; +*) + TCLLDSHARED='$(LDSHARED)' + TCLCXXSHARED='$(CXXSHARED)' + ;; +esac + +fi + +AC_SUBST(TCLINCLUDE) +AC_SUBST(TCLLIB) +AC_SUBST(TCLDYNAMICLINKING) +AC_SUBST(TCLLDSHARED) +AC_SUBST(TCLCXXSHARED) + +#---------------------------------------------------------------- +# Look for Python +#---------------------------------------------------------------- + +PYINCLUDE= +PYLIB= +PYPACKAGE= + +AC_ARG_WITH(python, AS_HELP_STRING([--without-python], [Disable Python]) +AS_HELP_STRING([--with-python=path], [Set location of Python executable]),[ PYBIN="$withval"], [PYBIN=yes]) + +# First, check for "--without-python" or "--with-python=no". +if test x"${PYBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Python]) +else + # First figure out the name of the Python executable + if test "x$PYBIN" = xyes; then + AC_CHECK_PROGS(PYTHON, [python python2.8 python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python1.4]) + else + PYTHON="$PYBIN" + fi + + if test -n "$PYTHON"; then + AC_MSG_CHECKING(for Python prefix) + PYPREFIX=`($PYTHON -c "import sys; print sys.prefix") 2>/dev/null` + AC_MSG_RESULT($PYPREFIX) + AC_MSG_CHECKING(for Python exec-prefix) + PYEPREFIX=`($PYTHON -c "import sys; print sys.exec_prefix") 2>/dev/null` + AC_MSG_RESULT($PYEPREFIX) + + + # Note: I could not think of a standard way to get the version string from different versions. + # This trick pulls it out of the file location for a standard library file. + + AC_MSG_CHECKING(for Python version) + + # Need to do this hack since autoconf replaces __file__ with the name of the configure file + filehack="file__" + PYVERSION=`($PYTHON -c "import string,operator,os.path; print operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1)")` + AC_MSG_RESULT($PYVERSION) + + # Find the directory for libraries this is necessary to deal with + # platforms that can have apps built for multiple archs: e.g. x86_64 + AC_MSG_CHECKING(for Python lib dir) + PYLIBDIR=`($PYTHON -c "import sys; print sys.lib") 2>/dev/null` + if test -z "$PYLIBDIR"; then + # Fedora patch Python to add sys.lib, for other distros we assume "lib". + PYLIBDIR="lib" + fi + AC_MSG_RESULT($PYLIBDIR) + + # Set the include directory + + AC_MSG_CHECKING(for Python header files) + if test -r $PYPREFIX/include/$PYVERSION/Python.h; then + PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config" + fi + if test -z "$PYINCLUDE"; then + if test -r $PYPREFIX/include/Py/Python.h; then + PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib" + fi + fi + AC_MSG_RESULT($PYINCLUDE) + + # Set the library directory blindly. This probably won't work with older versions + AC_MSG_CHECKING(for Python library) + dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR" + for i in $dirs; do + if test -d $PYEPREFIX/$PYLIBDIR/$i; then + PYLIB="$PYEPREFIX/$PYLIBDIR/$i" + break + fi + done + if test -z "$PYLIB"; then + AC_MSG_RESULT(Not found) + else + AC_MSG_RESULT($PYLIB) + fi + + PYLINK="-l$PYVERSION" + fi + + # Cygwin (Windows) needs the library for dynamic linking + case $host in + *-*-cygwin* | *-*-mingw*) + PYTHONDYNAMICLINKING="-L$PYLIB $PYLINK" + DEFS="-DUSE_DL_IMPORT $DEFS" + ;; + *)PYTHONDYNAMICLINKING="";; + esac +fi + +AC_SUBST(PYINCLUDE) +AC_SUBST(PYLIB) +AC_SUBST(PYLINK) +AC_SUBST(PYTHONDYNAMICLINKING) + + +#---------------------------------------------------------------- +# Look for Python 3.x +#---------------------------------------------------------------- + +# mostly copy & pasted from "Look for Python" section, +# did some trim, fix and rename + +PY3INCLUDE= +PY3LIB= +PY3PACKAGE= + +AC_ARG_WITH(python3, AS_HELP_STRING([--without-python3], [Disable Python 3.x support]) +AS_HELP_STRING([--with-python3=path], [Set location of Python 3.x executable]),[ PY3BIN="$withval"], [PY3BIN=yes]) + +# First, check for "--without-python3" or "--with-python3=no". +if test x"${PY3BIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Python 3.x support]) +else + for py_ver in 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0; do + AC_CHECK_PROGS(PYTHON3, [python$py_ver]) + if test -n "$PYTHON3"; then + AC_CHECK_PROGS(PY3CONFIG, [$PYTHON3-config]) + if test -n "$PY3CONFIG"; then + break + fi + fi + done + + if test -n "$PYTHON3" -a -n "$PY3CONFIG"; then + AC_MSG_CHECKING([for Python 3.x prefix]) + PY3PREFIX=`($PY3CONFIG --prefix) 2>/dev/null` + AC_MSG_RESULT($PY3PREFIX) + AC_MSG_CHECKING(for Python 3.x exec-prefix) + PY3EPREFIX=`($PY3CONFIG --exec-prefix) 2>/dev/null` + AC_MSG_RESULT($PY3EPREFIX) + + # Note: I could not think of a standard way to get the version string from different versions. + # This trick pulls it out of the file location for a standard library file. + + AC_MSG_CHECKING([for Python 3.x version]) + + # Need to do this hack since autoconf replaces __file__ with the name of the configure file + filehack="file__" + PY3VERSION=`($PYTHON3 -c "import string,operator,os.path; print(operator.getitem(os.path.split(operator.getitem(os.path.split(string.__$filehack),0)),1))")` + AC_MSG_RESULT($PY3VERSION) + + # Find the directory for libraries this is necessary to deal with + # platforms that can have apps built for multiple archs: e.g. x86_64 + AC_MSG_CHECKING([for Python 3.x lib dir]) + PY3LIBDIR=`($PYTHON3 -c "import sys; print(sys.lib)") 2>/dev/null` + if test -z "$PY3LIBDIR"; then + # some dists don't have sys.lib so the best we can do is assume lib + PY3LIBDIR="lib" + fi + AC_MSG_RESULT($PY3LIBDIR) + + # Set the include directory + + AC_MSG_CHECKING([for Python 3.x header files]) + PY3INCLUDE=`($PY3CONFIG --includes) 2>/dev/null` + AC_MSG_RESULT($PY3INCLUDE) + + # Set the library directory blindly. This probably won't work with older versions + AC_MSG_CHECKING([for Python 3.x library]) + dirs="$PY3VERSION/config $PY3VERSION/$PY3LIBDIR python/$PY3LIBDIR" + for i in $dirs; do + if test -d $PY3EPREFIX/$PY3LIBDIR/$i; then + PY3LIB="$PY3EPREFIX/$PY3LIBDIR/$i" + break + fi + done + if test -z "$PY3LIB"; then + AC_MSG_RESULT([Not found]) + else + AC_MSG_RESULT($PY3LIB) + fi + + PY3LINK="-l$PY3VERSION" + fi + + # Cygwin (Windows) needs the library for dynamic linking + case $host in + *-*-cygwin* | *-*-mingw*) + PYTHON3DYNAMICLINKING="-L$PYLIB $PY3LINK" + DEFS="-DUSE_DL_IMPORT $DEFS" + ;; + *)PYTHON3DYNAMICLINKING="";; + esac +fi + +AC_SUBST(PY3INCLUDE) +AC_SUBST(PY3LIB) +AC_SUBST(PY3LINK) +AC_SUBST(PYTHON3DYNAMICLINKING) + + +#---------------------------------------------------------------- +# Look for Perl5 +#---------------------------------------------------------------- + +PERLBIN= + +AC_ARG_WITH(perl5, AS_HELP_STRING([--without-perl5], [Disable Perl5]) +AS_HELP_STRING([--with-perl5=path], [Set location of Perl5 executable]),[ PERLBIN="$withval"], [PERLBIN=yes]) + +# First, check for "--without-perl5" or "--with-perl5=no". +if test x"${PERLBIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling Perl5]) +PERL= +else + +# First figure out what the name of Perl5 is + +if test "x$PERLBIN" = xyes; then +AC_CHECK_PROGS(PERL, perl perl5.6.1 perl5.6.0 perl5.004 perl5.003 perl5.002 perl5.001 perl5 perl) +else +PERL="$PERLBIN" +fi + + +# This could probably be simplified as for all platforms and all versions of Perl the following apparently should be run to get the compilation options: +# perl -MExtUtils::Embed -e ccopts +AC_MSG_CHECKING(for Perl5 header files) +if test -n "$PERL"; then + PERL5DIR=`($PERL -e 'use Config; print $Config{archlib}, "\n";') 2>/dev/null` + if test -n "$PERL5DIR" ; then + dirs="$PERL5DIR $PERL5DIR/CORE" + PERL5EXT=none + for i in $dirs; do + if test -r $i/perl.h; then + AC_MSG_RESULT($i) + PERL5EXT="$i" + break + fi + done + if test "$PERL5EXT" = none; then + PERL5EXT="$PERL5DIR/CORE" + AC_MSG_RESULT(could not locate perl.h...using $PERL5EXT) + fi + + AC_MSG_CHECKING(for Perl5 library) + PERL5LIB=`($PERL -e 'use Config; $_=$Config{libperl}; s/^lib//; s/$Config{_a}$//; s/\.$Config{so}.*//; print $_, "\n"') 2>/dev/null` + if test -z "$PERL5LIB" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PERL5LIB) + fi + AC_MSG_CHECKING(for Perl5 ccflags) + PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}, "\n"' | sed "s/-Wdeclaration-after-statement//" | sed "s/-I/$ISYSTEM/") 2>/dev/null` + if test -z "$PERL5CCFLAGS" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PERL5CCFLAGS) + fi + AC_MSG_CHECKING(for Perl5 ccdlflags) + PERL5CCDLFLAGS=`($PERL -e 'use Config; print $Config{ccdlflags}, "\n"') 2>/dev/null` + if test -z "$PERL5CCDLFLAGS" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PERL5CCDLFLAGS) + fi + AC_MSG_CHECKING(for Perl5 cccdlflags) + PERL5CCCDLFLAGS=`($PERL -e 'use Config; print $Config{cccdlflags}, "\n"') 2>/dev/null` + if test -z "$PERL5CCCDLFLAGS" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PERL5CCCDLFLAGS) + fi + AC_MSG_CHECKING(for Perl5 ldflags) + PERL5LDFLAGS=`($PERL -e 'use Config; print $Config{ldflags}, "\n"') 2>/dev/null` + if test -z "$PERL5LDFLAGS" ; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PERL5LDFLAGS) + fi + else + AC_MSG_RESULT(unable to determine perl5 configuration) + PERL5EXT=$PERL5DIR + fi +else + AC_MSG_RESULT(could not figure out how to run perl5) +fi + +# Cygwin (Windows) needs the library for dynamic linking +case $host in +*-*-cygwin* | *-*-mingw*) PERL5DYNAMICLINKING="-L$PERL5EXT -l$PERL5LIB";; +*)PERL5DYNAMICLINKING="";; +esac +fi + +AC_SUBST(PERL) +AC_SUBST(PERL5EXT) +AC_SUBST(PERL5DYNAMICLINKING) +AC_SUBST(PERL5LIB) +AC_SUBST(PERL5CCFLAGS) +AC_SUBST(PERL5CCDLFLAGS) +AC_SUBST(PERL5CCCDLFLAGS) +AC_SUBST(PERL5LDFLAGS) + +#---------------------------------------------------------------- +# Look for Octave +#---------------------------------------------------------------- + +OCTAVEBIN= +OCTAVE_SO=.oct + +AC_ARG_WITH(octave, AS_HELP_STRING([--without-octave], [Disable Octave]) +AS_HELP_STRING([--with-octave=path], [Set location of Octave executable]),[OCTAVEBIN="$withval"], [OCTAVEBIN=yes]) + +# First, check for "--without-octave" or "--with-octave=no". +if test x"${OCTAVEBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Octave]) + OCTAVE= + +# First figure out what the name of Octave is +elif test "x$OCTAVEBIN" = xyes; then + AC_PATH_PROG(OCTAVE, [octave]) + +else + OCTAVE="$OCTAVEBIN" +fi + +if test -n "$OCTAVE"; then + AC_MSG_CHECKING([for mkoctfile]) + mkoctfile="`dirname ${OCTAVE}`/mkoctfile" + AS_IF([test -x "${mkoctfile}"],[ + AC_MSG_RESULT([${mkoctfile}]) + ],[ + AC_MSG_RESULT([not found, disabling Octave]) + OCTAVE= + ]) +fi +if test -n "$OCTAVE"; then + AC_MSG_CHECKING([for Octave preprocessor flags]) + OCTAVE_CPPFLAGS= + for n in CPPFLAGS INCFLAGS; do + OCTAVE_CPPFLAGS="${OCTAVE_CPPFLAGS} "`${mkoctfile} -p $n` + done + AC_MSG_RESULT([$OCTAVE_CPPFLAGS]) + AC_MSG_CHECKING([for Octave compiler flags]) + OCTAVE_CXXFLAGS= + for n in ALL_CXXFLAGS; do + OCTAVE_CXXFLAGS="${OCTAVE_CXXFLAGS} "`${mkoctfile} -p $n` + done + AC_MSG_RESULT([$OCTAVE_CXXFLAGS]) + AC_MSG_CHECKING([for Octave linker flags]) + OCTAVE_LDFLAGS= + for n in RDYNAMIC_FLAG LFLAGS RLD_FLAG OCTAVE_LIBS LIBS; do + OCTAVE_LDFLAGS="${OCTAVE_LDFLAGS} "`${mkoctfile} -p $n` + done + AC_MSG_RESULT([$OCTAVE_LDFLAGS]) + for octave_opt in --silent --norc --no-history --no-window-system; do + AC_MSG_CHECKING([if Octave option '${octave_opt}' is supported]) + octave_out=`${OCTAVE} ${octave_opt} /dev/null 2>&1 | sed -n '1{/unrecognized/p}'` + AS_IF([test "x${octave_out}" = x],[ + AC_MSG_RESULT([yes]) + OCTAVE="${OCTAVE} ${octave_opt}" + ],[ + AC_MSG_RESULT([no]) + ]) + done +fi + +AC_SUBST(OCTAVE) +AC_SUBST(OCTAVE_SO) +AC_SUBST(OCTAVE_CPPFLAGS) +AC_SUBST(OCTAVE_CXXFLAGS) +AC_SUBST(OCTAVE_LDFLAGS) + +#---------------------------------------------------------------- +# Look for java +#---------------------------------------------------------------- + +AC_ARG_WITH(java, AS_HELP_STRING([--without-java], [Disable Java]) +AS_HELP_STRING([--with-java=path], [Set location of java executable]),[JAVABIN="$withval"], [JAVABIN=yes]) +AC_ARG_WITH(javac, [ --with-javac=path Set location of javac executable],[JAVACBIN="$withval"], [JAVACBIN=]) + +# First, check for "--without-java" or "--with-java=no". +if test x"${JAVABIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling Java]) +JAVA= +else + +if test "x$JAVABIN" = xyes; then + AC_CHECK_PROGS(JAVA, java kaffe guavac) +else + JAVA="$JAVABIN" +fi + +if test -z "$JAVACBIN"; then + AC_CHECK_PROGS(JAVAC, javac) +else + JAVAC="$JAVACBIN" +fi + +AC_MSG_CHECKING(for java include file jni.h) +AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=]) + +if test -z "$JAVAINCDIR" ; then + JAVAINCDIR="/usr/j2sdk*/include /usr/local/j2sdk*/include /usr/jdk*/include /usr/local/jdk*/include /opt/j2sdk*/include /opt/jdk*/include /usr/java/include /usr/java/j2sdk*/include /usr/java/jdk*/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/lib/java/include /usr/lib/jvm/java*/include /usr/include/kaffe /usr/local/include/kaffe /usr/include" + + # Add in default installation directory on Windows for Cygwin + case $host in + *-*-cygwin* | *-*-mingw*) JAVAINCDIR="c:/Program*Files/Java/jdk*/include d:/Program*Files/Java/jdk*/include c:/j2sdk*/include d:/j2sdk*/include c:/jdk*/include d:/jdk*/include $JAVAINCDIR";; + *-*-darwin*) JAVAINCDIR="/System/Library/Frameworks/JavaVM.framework/Headers $JAVAINCDIR";; + *);; + esac +fi + +JAVAINC="" +for d in $JAVAINCDIR ; do + if test -r "$d/jni.h" ; then + AC_MSG_RESULT($d) + JAVAINCDIR=$d + JAVAINC=-I\"$d\" + break + fi +done + +if test "$JAVAINC" = "" ; then + AC_MSG_RESULT(not found) +else + # now look for <arch>/jni_md.h + AC_MSG_CHECKING(for java include file jni_md.h) + JAVAMDDIR=`find "$JAVAINCDIR" -follow -name jni_md.h -print` + if test "$JAVAMDDIR" = "" ; then + AC_MSG_RESULT(not found) + else + JAVAMDDIR=`dirname "$JAVAMDDIR" | tail -1` + JAVAINC="${JAVAINC} -I\"$JAVAMDDIR\"" + AC_MSG_RESULT($JAVAMDDIR) + fi +fi + +# java.exe on Cygwin requires the Windows standard (Pascal) calling convention as it is a normal Windows executable and not a Cygwin built executable +case $host in +*-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + JAVADYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias" + JAVACFLAGS="-mno-cygwin -mthreads" + else + JAVADYNAMICLINKING="" + JAVACFLAGS="" + fi ;; +*-*-darwin*) + JAVADYNAMICLINKING="-dynamiclib -framework JavaVM" + JAVACFLAGS="" + ;; +*) + JAVADYNAMICLINKING="" + JAVACFLAGS="" + ;; +esac + +# Java on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls +case $host in +*-*-cygwin* | *-*-mingw*) JAVALIBRARYPREFIX="";; +*)JAVALIBRARYPREFIX="lib";; +esac + +# Java on Mac OS X tweaks +case $host in +*-*-darwin*) + JAVASO=".jnilib" + JAVALDSHARED='$(CC)' + JAVACXXSHARED='$(CXX)' + ;; +*) + JAVASO=$SO + JAVALDSHARED='$(LDSHARED)' + JAVACXXSHARED='$(CXXSHARED)' + ;; +esac +fi + +AC_SUBST(JAVA) +AC_SUBST(JAVAC) +AC_SUBST(JAVAINC) +AC_SUBST(JAVADYNAMICLINKING) +AC_SUBST(JAVALIBRARYPREFIX) +AC_SUBST(JAVASO) +AC_SUBST(JAVALDSHARED) +AC_SUBST(JAVACXXSHARED) +AC_SUBST(JAVACFLAGS) + +#---------------------------------------------------------------- +# Look for gcj +#---------------------------------------------------------------- + +AC_ARG_WITH(gcj, AS_HELP_STRING([--without-gcj], [Disable GCJ]) +AS_HELP_STRING([--with-gcj=path], [Set location of gcj executable]),[GCJBIN="$withval"], [GCJBIN=yes]) +AC_ARG_WITH(gcjh, [ --with-gcjh=path Set location of gcjh executable],[GCJHBIN="$withval"], [GCJHBIN=]) + +# First, check for "--without-gcj" or "--with-gcj=no". +if test x"${GCJBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling GCJ]) +else + if test "x$GCJBIN" = xyes; then + AC_CHECK_PROGS(GCJ, gcj) + else + GCJ="$GCJBIN" + fi + + if test -z "$GCJCBIN"; then + AC_CHECK_PROGS(GCJH, gcjh) + else + GCJH="$GCJHBIN" + fi +fi + +AC_SUBST(GCJ) +AC_SUBST(GCJH) + +#---------------------------------------------------------------- +# Look for Android +#---------------------------------------------------------------- + +AC_ARG_WITH(android, AS_HELP_STRING([--without-android], [Disable Android]) +AS_HELP_STRING([--with-android=path], [Set location of android executable]),[ANDROIDBIN="$withval"], [ANDROIDBIN=yes]) +AC_ARG_WITH(adb, [ --with-adb=path Set location of adb executable - Android Debug Bridge],[ADBBIN="$withval"], [ADBBIN=]) +AC_ARG_WITH(ant, [ --with-ant=path Set location of ant executable for Android],[ANTBIN="$withval"], [ANTBIN=]) +AC_ARG_WITH(ndk-build, [ --with-ndk-build=path Set location of Android ndk-build executable],[NDKBUILDBIN="$withval"], [NDKBUILDBIN=]) + +# First, check for "--without-android" or "--with-android=no". +if test x"${ANDROIDBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Android]) + ANDROID= +else + if test "x$ANDROIDBIN" = xyes; then + AC_CHECK_PROGS(ANDROID, android) + else + ANDROID="$ANDROIDBIN" + fi + + if test -z "$ADBBIN"; then + AC_CHECK_PROGS(ADB, adb) + else + ADB="$ADBBIN" + fi + + if test -z "$ANTBIN"; then + AC_CHECK_PROGS(ANT, ant) + else + ANT="$ANTBIN" + fi + + if test -z "$NDKBUILDBIN"; then + AC_CHECK_PROGS(NDKBUILD, ndk-build) + else + NDKBUILD="$NDKBUILDBIN" + fi +fi + +AC_SUBST(ANDROID) +AC_SUBST(ADB) +AC_SUBST(ANT) +AC_SUBST(NDKBUILD) + +#---------------------------------------------------------------- +# Look for Guile +#---------------------------------------------------------------- + +GUILE= +GUILE_CFLAGS= +GUILE_LIBS= + +AC_ARG_WITH(guile-config, AS_HELP_STRING([--without-guile], [Disable Guile]) + AS_HELP_STRING([--with-guile-config=path], [Set location of guile-config]),[ GUILE_CONFIG="$withval"], [GUILE_CONFIG=]) +AC_ARG_WITH(guile,[ --with-guile=path Set location of Guile executable],[ + GUILE="$withval"], [GUILE=yes]) +AC_ARG_WITH(guile-cflags,[ --with-guile-cflags=cflags Set cflags required to compile against Guile],[ + GUILE_CFLAGS="$withval"]) +AC_ARG_WITH(guile-libs,[ --with-guile-libs=ldflags Set ldflags needed to link with Guile],[ + GUILE_LIBS="$withval"]) + +# First, check for "--without-guile" or "--with-guile=no". +if test x"${GUILE}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Guile]) +else + if test -z "$GUILE_CONFIG" ; then + AC_PATH_PROG(GUILE_CONFIG, guile-config) + fi + if test -n "$GUILE_CONFIG" ; then + if test x"$GUILE" = xyes; then + AC_MSG_CHECKING([for guile bindir]) + guile_bindir="`$GUILE_CONFIG info bindir`" + AC_MSG_RESULT([$guile_bindir]) + GUILE=$guile_bindir/guile + if ! test -f "$GUILE" ; then + GUILE= + AC_PATH_PROG(GUILE, guile) + fi + fi + + if test -f "$GUILE" ; then + AC_MSG_CHECKING([for guile version]) + guile_version=`$GUILE -c '(display (effective-version))'` + AC_MSG_RESULT([$guile_version]) + AC_MSG_CHECKING([for guile version >= 1.8]) + guile_good_version=`$GUILE -c '(if (>= (string->number (effective-version)) 1.8) (display "yes") (display "no"))'` + AC_MSG_RESULT([$guile_good_version]) + if test x"$guile_good_version" != xyes ; then + GUILE= + fi + fi + + if test -z "$GUILE_CFLAGS" ; then + AC_MSG_CHECKING([for guile compile flags]) + GUILE_CFLAGS="`$GUILE_CONFIG compile`" # Note that this can sometimes be empty + AC_MSG_RESULT([$GUILE_CFLAGS]) + fi + + if test -z "$GUILE_LIBS" ; then + AC_MSG_CHECKING([for guile link flags]) + GUILE_LIBS="`$GUILE_CONFIG link`" + AC_MSG_RESULT([$GUILE_LIBS]) + fi + fi +fi + +AC_SUBST(GUILE) +AC_SUBST(GUILE_CFLAGS) +AC_SUBST(GUILE_LIBS) + +#---------------------------------------------------------------- +# Look for MzScheme +#---------------------------------------------------------------- + +AC_ARG_WITH(mzscheme, AS_HELP_STRING([--without-mzscheme], [Disable MzScheme]) +AS_HELP_STRING([--with-mzscheme=path], [Set location of MzScheme executable]),[ MZSCHEMEBIN="$withval"], [MZSCHEMEBIN=yes]) +AC_ARG_WITH(mzc, AS_HELP_STRING([--with-mzc=path], [Set location of MzScheme's mzc]), [ MZCBIN="$withval"], [MZCBIN=]) + +# First, check for "--without-mzscheme" or "--with-mzscheme=no". +if test x"${MZSCHEMEBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling MzScheme]) + MZC= +else + if test "x$MZSCHEMEBIN" = xyes; then + AC_PATH_PROG(MZSCHEME, mzscheme) + else + MZSCHEME="$MZSCHEMEBIN" + fi + + if test -z "$MZCBIN"; then + AC_PATH_PROG(MZC, mzc) + fi + + if test -n "$MZSCHEME"; then + AC_MSG_CHECKING(for MzScheme dynext object) + MZDYNOBJ=`$MZSCHEME --eval '(begin (require dynext/link) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (printf "~a" x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` + if test -f "$MZDYNOBJ"; then + : + else + # older versions (3.72 approx and earlier) + MZDYNOBJ=`$MZSCHEME --mute-banner --version --eval '(begin (require (lib "link.ss" "dynext")) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x) (display " ")) ((current-make-standard-link-libraries)))) (with-handlers (((lambda args #t) (lambda args #f))) (for-each (lambda (x) (display x)) (expand-for-link-variant (current-standard-link-libraries)))))' 2>/dev/null` + fi + if test -f "$MZDYNOBJ"; then + AC_MSG_RESULT($MZDYNOBJ) + else + AC_MSG_RESULT(not found) + MZDYNOBJ="" + fi + fi +fi +AC_SUBST(MZDYNOBJ) + +#---------------------------------------------------------------- +# Look for Ruby +#---------------------------------------------------------------- + +RUBYBIN= + +AC_ARG_WITH(ruby, AS_HELP_STRING([--without-ruby], [Disable Ruby]) +AS_HELP_STRING([--with-ruby=path], [Set location of Ruby executable]),[ RUBYBIN="$withval"], [RUBYBIN=yes]) + +# First, check for "--without-ruby" or "--with-ruby=no". +if test x"${RUBYBIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling Ruby]) +RUBY= +else + +# First figure out what the name of Ruby is + +if test "x$RUBYBIN" = xyes; then + AC_CHECK_PROGS(RUBY, ruby) +else + RUBY="$RUBYBIN" +fi + +AC_MSG_CHECKING(for Ruby header files) +if test -n "$RUBY"; then + # Try Ruby1.9 first + RUBYDIR=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["rubyhdrdir"]] || $rubyhdrdir') 2>/dev/null` + if test x"$RUBYDIR" = x"" || test x"$RUBYDIR" = x"nil"; then + RUBYDIR=`($RUBY -rmkmf -e 'print Config::CONFIG[["archdir"]] || $archdir') 2>/dev/null` + else + RUBYARCH=`($RUBY -rrbconfig -e 'print RbConfig::CONFIG[["arch"]] || $arch') 2>/dev/null` + fi + if test x"$RUBYDIR" != x""; then + dirs="$RUBYDIR" + RUBYINCLUDE=none + for i in $dirs; do + if test -r $i/ruby.h; then + AC_MSG_RESULT($i) + RUBYINCLUDE="-I$i" + break + fi + done + if test x"$RUBYARCH" != x""; then + RUBYINCLUDE="-I$RUBYDIR -I$RUBYDIR/$RUBYARCH" + fi + if test "$RUBYINCLUDE" = none; then + RUBYINCLUDE="-I$RUBYDIR" + AC_MSG_RESULT(could not locate ruby.h...using $RUBYINCLUDE) + fi + + # Find library and path for linking. + AC_MSG_CHECKING(for Ruby library) + RUBYLIB="" + rb_libdir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["libdir"]]') 2>/dev/null` + rb_bindir=`($RUBY -rrbconfig -e 'print Config::CONFIG[["bindir"]]') 2>/dev/null` + dirs="$dirs $rb_libdir $rb_bindir" + + rb_libruby=`($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBRUBY_A"]]') 2>/dev/null` + RUBYLINK=`($RUBY -rrbconfig -e ' + c = Config::CONFIG + if c.has_key? "LIBRUBYARG_STATIC" # 1.8.x + if c[["LIBRUBY"]] == c[["LIBRUBY_A"]] + link = c[["LIBRUBYARG_STATIC"]] + else + link = c[["LIBRUBYARG_SHARED"]] + end + else # 1.6.x + link = "-l" + c[["RUBY_INSTALL_NAME"]] + end + + # Get the target Ruby was built for + target = c[["target"]] + + if target == "i386-pc-mswin32" + # Need to change msvcrt-ruby*.lib to -lmsvcrt-ruby* + ext = File.extname(link) + # Get index that counts backwards from end of string + index = -1 - ext.size + # Strip off the extension + link = link.slice(0..index) + puts "-l#{link}" + else + puts link + end') 2>/dev/null` + + if test "$rb_libruby" != ""; then + for i in $dirs; do + if (test -r $i/$rb_libruby;) then + RUBYLIB="$i" + break + fi + done + fi + if test "$RUBYLIB" = ""; then + RUBYLIB="$RUBYDIR" + AC_MSG_RESULT(not found... using $RUBYDIR) + else + AC_MSG_RESULT($RUBYLINK in $RUBYLIB) + fi + else + AC_MSG_RESULT(unable to determine ruby configuration) + RUBYINCLUDE="-I$RUBYDIR" + RUBYLIB="$RUBYDIR" + fi + + case $host in + *-*-mingw*) ;; # do nothing, the default windows libraries are already included + *) RUBYLINK="$RUBYLINK `($RUBY -rrbconfig -e 'print Config::CONFIG[["LIBS"]]') 2>/dev/null`";; + esac + + RUBYCCDLFLAGS=`($RUBY -rrbconfig -e 'print Config::CONFIG[["CCDLFLAGS"]]') 2>/dev/null` + RUBYSO=.`($RUBY -rrbconfig -e 'print Config::CONFIG[["DLEXT"]]') 2>/dev/null` +else + AC_MSG_RESULT(could not figure out how to run ruby) + RUBYINCLUDE="-I/usr/local/lib/ruby/1.4/arch" + RUBYLIB="/usr/local/lib/ruby/1.4/arch" + RUBYLINK="-lruby -lm" +fi + +case $host in +*-*-cygwin* | *-*-mingw*) RUBYDYNAMICLINKING="-L$RUBYLIB $RUBYLINK";; +*) RUBYDYNAMICLINKING="";; +esac +fi + +AC_SUBST(RUBYINCLUDE) +AC_SUBST(RUBYLIB) +AC_SUBST(RUBYLINK) +AC_SUBST(RUBYCCDLFLAGS) +AC_SUBST(RUBYSO) +AC_SUBST(RUBYDYNAMICLINKING) + +#------------------------------------------------------------------------- +# Look for PHP +#------------------------------------------------------------------------- + +PHPBIN= + +AC_ARG_WITH(php, AS_HELP_STRING([--without-php], [Disable PHP]) +AS_HELP_STRING([--with-php=path], [Set location of PHP executable]),[ PHPBIN="$withval"], [PHPBIN=yes]) + +# First, check for "--without-php" or "--with-php=no". +if test x"${PHPBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling PHP]) + PHP= +else + + if test "x$PHPBIN" = xyes; then + AC_CHECK_PROGS(PHP, [php5 php]) + else + PHP=$PHPBIN + fi + + AC_MSG_CHECKING(for PHP header files) + dnl /usr/bin/php5 -> /usr/bin/php-config5 + case $PHP in + *5) + PHPCONFIG=`echo "$PHP"|sed 's/5$/-config5/'` ;; + *) + PHPCONFIG=$PHP-config ;; + esac + php_version=`$PHPCONFIG --version 2>/dev/null` + case $php_version in + 5*) + PHPINC=`$PHPCONFIG --includes 2>/dev/null` + if test -n "$PHPINC"; then + AC_MSG_RESULT($PHPINC) + else + AC_MSG_RESULT(not found) + fi + ;; + *) + AC_MSG_RESULT([found PHP $version, but only PHP 5 is supported]) ;; + esac +fi +AC_SUBST(PHP) +AC_SUBST(PHPINC) + +#---------------------------------------------------------------- +# Look for ocaml +#---------------------------------------------------------------- + +AC_ARG_WITH(ocaml, AS_HELP_STRING([--without-ocaml], [Disable OCaml]) +AS_HELP_STRING([--with-ocaml=path], [Set location of ocaml executable]),[ OCAMLBIN="$withval"], [OCAMLBIN=yes]) +AC_ARG_WITH(ocamlc,[ --with-ocamlc=path Set location of ocamlc executable],[ OCAMLC="$withval"], [OCAMLC=]) +AC_ARG_WITH(ocamldlgen,[ --with-ocamldlgen=path Set location of ocamldlgen],[ OCAMLDLGEN="$withval" ], [OCAMLDLGEN=]) +AC_ARG_WITH(ocamlfind,[ --with-ocamlfind=path Set location of ocamlfind],[OCAMLFIND="$withval"],[OCAMLFIND=]) +AC_ARG_WITH(ocamlmktop,[ --with-ocamlmktop=path Set location of ocamlmktop executable],[ OCAMLMKTOP="$withval"], [OCAMLMKTOP=]) + +# First, check for "--without-ocaml" or "--with-ocaml=no". +if test x"${OCAMLBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling OCaml]) + OCAMLBIN= +else + + AC_MSG_CHECKING(for Ocaml DL load generator) + if test -z "$OCAMLDLGEN"; then + AC_CHECK_PROGS(OCAMLDLGEN, ocamldlgen, :) + fi + + AC_MSG_CHECKING(for Ocaml package tool) + if test -z "$OCAMLFIND"; then + AC_CHECK_PROGS(OCAMLFIND, ocamlfind, :) + fi + + AC_MSG_CHECKING(for Ocaml compiler) + if test -z "$OCAMLC"; then + AC_CHECK_PROGS(OCAMLC, ocamlc, :) + fi + + AC_MSG_CHECKING(for Ocaml interpreter) + if test "x$OCAMLBIN" = xyes; then + AC_CHECK_PROGS(OCAMLBIN, ocaml, :) + fi + + AC_MSG_CHECKING(for Ocaml toplevel creator) + if test -z "$OCAMLMKTOP"; then + AC_CHECK_PROGS(OCAMLMKTOP, ocamlmktop, :) + fi + + OCAMLLOC=loc + if test "$OCAMLC" != ":" ; then + AC_MSG_CHECKING(for Ocaml header files) + dirs="/usr/lib/ocaml/caml /usr/local/lib/ocaml/caml" + dir="`$OCAMLC -where 2>/dev/null`" + if test "$dir"; then + dirs="$dir/caml $dirs" + fi + for i in $dirs; do + if test -r $i/mlvalues.h; then + AC_MSG_RESULT($i) + OCAMLEXT="$i" + OCAMLINC="-I$OCAMLEXT" + break + fi + done + if test -z "$OCAMLINC"; then + AC_MSG_RESULT(not found) + fi + + AC_MSG_CHECKING(for Ocaml version 3.08.2 or higher) + OCAMLVER=`$OCAMLC -version | sed -e 's/.*version //g'` + AC_COMPARE_VERSION([$OCAMLVER],[3.08.2],[:],[:],[OCAMLLOC=_loc]) + AC_MSG_RESULT($OCAMLVER) + fi +fi # Disabling ocaml + +export OCAMLLOC +export OCAMLVER +export OCAMLINC +export OCAMLBIN +export OCAMLC +export OCAMLDLGEN +export OCAMLFIND +export OCAMLMKTOP + +AC_SUBST(OCAMLLOC) +AC_SUBST(OCAMLVER) +AC_SUBST(OCAMLINC) +AC_SUBST(OCAMLBIN) +AC_SUBST(OCAMLC) +AC_SUBST(OCAMLDLGEN) +AC_SUBST(OCAMLFIND) +AC_SUBST(OCAMLMKTOP) + +#---------------------------------------------------------------- +# Look for Pike +#---------------------------------------------------------------- + +# Identify the name of the Pike executable +# Priority: configure option, automatic search +PIKEBIN= +AC_ARG_WITH(pike, AS_HELP_STRING([--without-pike], [Disable Pike]) +AS_HELP_STRING([--with-pike=path], [Set location of Pike executable]),[PIKEBIN="$withval"], [PIKEBIN=yes]) + +# First, check for "--without-pike" or "--with-pike=no". +if test x"${PIKEBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Pike]) + PIKEBIN= +else + +if test "x$PIKEBIN" = xyes; then + AC_CHECK_PROGS(PIKE, pike pike7.8 pike7.6 pike7.4 pike7.2) +else + PIKE="$PIKEBIN" +fi + + +# Check for pike-config +# Priority: configure option, guessed from $PIKE, search from list +AC_ARG_WITH(pike-config, AS_HELP_STRING([--with-pike-config=path], + [Set location of pike-config script]), + [PIKECONFIG="$withval"], [PIKECONFIG=""]) + +if test -z "$PIKECONFIG" -a -n "$PIKE"; then + AC_CHECK_PROGS(PIKECONFIG, $PIKE-config pike-config \ + pike7.6-config pike7.4-config pike7.2-config) +fi + +# Check for a --with-pikeincl option to configure +# Priority: configure option, info from $PIKECONFIG, guessed by pike script +AC_ARG_WITH(pikeincl, AS_HELP_STRING([--with-pikeincl=path], + [Set location of Pike include directory]), + [PIKEINCLUDE="-I$withval"], [PIKEINCLUDE=]) + +if test -n "$PIKE"; then + AC_MSG_CHECKING([for Pike header files]) + if test -z "$PIKEINCLUDE" -a -n "$PIKECONFIG"; then + PIKEINCLUDE=`$PIKECONFIG --cflags` + fi + if test -z "$PIKEINCLUDE" -a -n "$PIKE"; then + PIKEINCLUDE=`$PIKE -x cflags` + if test -z "$PIKEINCLUDE"; then + PIKEPATH=`which $PIKE` + PIKEINCLUDE=`$PIKE Tools/check-include-path.pike $PIKEPATH` + PIKEINCLUDE="-I$PIKEINCLUDE" + fi + fi + + if test -z "$PIKEINCLUDE"; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($PIKEINCLUDE) + fi +fi +fi + +AC_SUBST(PIKEINCLUDE) +AC_SUBST(PIKECCDLFLAGS) dnl XXX: where is this used/defined? +AC_SUBST(PIKEDYNAMICLINKING) dnl XXX: where is this used/defined? + +#---------------------------------------------------------------- +# Look for CHICKEN +#---------------------------------------------------------------- + +CHICKEN= +CHICKEN_CONFIG= +CHICKENHOME= +CHICKENOPTS= +CHICKENLIB= + + +AC_ARG_WITH(chicken, AS_HELP_STRING([--without-chicken], [Disable CHICKEN]) +AS_HELP_STRING([--with-chicken=path], [Set location of CHICKEN executable]),[ CHICKENBIN="$withval"], [CHICKENBIN=yes]) + +# First, check for "--without-chicken" or "--with-chicken=no". +if test x"${CHICKENBIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling CHICKEN]) +else + +if test "x$CHICKENBIN" = xyes; then +AC_CHECK_PROGS(CHICKEN, chicken) +else +CHICKEN="$CHICKENBIN" +fi + +AC_ARG_WITH(chickencsc,[ --with-chickencsc=path Set location of csc executable],[ CHICKEN_CSC="$withval"], [CHICKEN_CSC=]) + +if test -z "$CHICKEN_CSC"; then + AC_CHECK_PROGS(CHICKEN_CSC, csc) + # Both the Microsoft C# compiler and chicken have an executable called csc, so check that this csc is really the chicken one + if test -n "$CHICKEN_CSC" ; then + AC_MSG_CHECKING(whether csc is the chicken compiler) + $CHICKEN_CSC -version 2>/dev/null | grep "chicken" > /dev/null || CHICKEN_CSC="" + if test -z "$CHICKEN_CSC"; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + fi + fi +fi + +AC_ARG_WITH(chickencsi,[ --with-chickencsi=path Set location of csi executable],[ CHICKEN_CSI="$withval"], [CHICKEN_CSI=]) + +if test -z "$CHICKEN_CSI"; then +AC_CHECK_PROGS(CHICKEN_CSI, csi) +fi + +if test -n "$CHICKEN_CSC" ; then + + AC_ARG_WITH(chickenopts,[ --with-chickenopts=args Set compiler options for static CHICKEN generated code],[ + CHICKENOPTS="$withval"], [CHICKENOPTS=]) + AC_ARG_WITH(chickensharedlib,[ --with-chickensharedlib=args Set linker options for shared CHICKEN generated code],[ + CHICKENSHAREDLIB="$withval"], [CHICKENSHAREDLIB=]) + AC_ARG_WITH(chickenlib,[ --with-chickenlib=args Set linker options for static CHICKEN generated code],[ + CHICKENLIB="$withval"], [CHICKENLIB=]) + + AC_MSG_CHECKING(for compiler options for static CHICKEN generated code) + if test -z "$CHICKENOPTS"; then + CHICKENOPTS="`$CHICKEN_CSC -cflags`" + else + CHICKENOPTS="`$CHICKEN_CSC -cflags` $CHICKENOPTS" + fi + if test -z "$CHICKENOPTS"; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($CHICKENOPTS) + fi + + AC_MSG_CHECKING(for linker options for shared CHICKEN generated code) + if test -z "$CHICKENSHAREDLIB"; then + CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs`" + else + CHICKENSHAREDLIB="`$CHICKEN_CSC -shared -libs` $CHICKENSHAREDLIB" + fi + if test -z "$CHICKENSHAREDLIB"; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($CHICKENSHAREDLIB) + fi + + AC_MSG_CHECKING(for linker options for static CHICKEN generated code) + if test -z "$CHICKENLIB"; then + CHICKENLIB="`$CHICKEN_CSC -libs`" + else + CHICKENLIB="`$CHICKEN_CSC -libs` $CHICKENLIB" + fi + if test -z "$CHICKENLIB"; then + AC_MSG_RESULT(not found) + else + AC_MSG_RESULT($CHICKENLIB) + fi + +fi # have CHICKEN_CONFIG +fi # Check for --without-chicken + +AC_SUBST(CHICKEN) +AC_SUBST(CHICKEN_CSC) +AC_SUBST(CHICKEN_CSI) +AC_SUBST(CHICKENOPTS) +AC_SUBST(CHICKENLIB) +AC_SUBST(CHICKENSHAREDLIB) + +#---------------------------------------------------------------- +# Look for C# +#---------------------------------------------------------------- + +AC_ARG_WITH(csharp, AS_HELP_STRING([--without-csharp], [Disable CSharp]), [with_csharp="$withval"], [with_csharp=yes]) +AC_ARG_WITH(cil-interpreter, [ --with-cil-interpreter=path Set location of CIL interpreter for CSharp],[CSHARPBIN="$withval"], [CSHARPBIN=]) +AC_ARG_WITH(csharp-compiler, [ --with-csharp-compiler=path Set location of CSharp compiler],[CSHARPCOMPILERBIN="$withval"], [CSHARPCOMPILERBIN=]) + +# First, check for "--without-csharp" or "--with-csharp=no". +if test x"${with_csharp}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling CSharp]) +CSHARPCOMPILER= +else + +if test -z "$CSHARPCOMPILERBIN" ; then + case $host in + *-*-cygwin* | *-*-mingw*) + # prefer Mono gmcs (.NET 2.0) over mcs (.NET 1.1) - note mcs-1.2.3 has major pinvoke bug + AC_CHECK_PROGS(CSHARPCOMPILER, csc mono-csc gmcs mcs cscc) + if test -n "$CSHARPCOMPILER" && test "$CSHARPCOMPILER" = "csc" ; then + AC_MSG_CHECKING(whether csc is the Microsoft CSharp compiler) + csc 2>/dev/null | grep "C#" > /dev/null || CSHARPCOMPILER="" + if test -z "$CSHARPCOMPILER" ; then + AC_MSG_RESULT(no) + AC_CHECK_PROGS(CSHARPCOMPILER, mono-csc gmcs mcs cscc) + else + AC_MSG_RESULT(yes) + fi + fi + ;; + *)AC_CHECK_PROGS(CSHARPCOMPILER, mono-csc gmcs mcs cscc);; + esac +else + CSHARPCOMPILER="$CSHARPCOMPILERBIN" +fi + +CSHARPPATHSEPARATOR="/" +CSHARPCYGPATH_W=echo +if test -z "$CSHARPBIN" ; then + CSHARPCILINTERPRETER="" + CSHARPCILINTERPRETER_FLAGS="" + if test "cscc" = "$CSHARPCOMPILER" ; then + AC_CHECK_PROGS(CSHARPCILINTERPRETER, ilrun) + else + if test "mcs" = "$CSHARPCOMPILER"; then + # Check that mcs is the C# compiler and not the Unix mcs utility by examining the output of 'mcs --version' + # The Mono compiler should emit: Mono C# compiler version a.b.c.d + csharp_version_raw=`(mcs --version) 2>/dev/null` + csharp_version_searched=`(mcs --version | sed -e "/C#/b" -e "/Mono/b" -e d) 2>/dev/null` # return string if contains 'Mono' or 'C#' + CSHARPCOMPILER="" + if test -n "$csharp_version_raw" ; then + if test "$csharp_version_raw" = "$csharp_version_searched" ; then + CSHARPCOMPILER="mcs" + fi + fi + if test "mcs" != "$CSHARPCOMPILER" ; then + echo "mcs is not a working Mono C# compiler" + fi + fi + if test "mcs" = "$CSHARPCOMPILER" || test "gmcs" = "$CSHARPCOMPILER"; then + AC_CHECK_PROGS(CSHARPCILINTERPRETER, mono) # Mono JIT + CSHARPCILINTERPRETER_FLAGS="--debug" + else + if test "csc" = "$CSHARPCOMPILER"; then + CSHARPPATHSEPARATOR="\\\\" + CSHARPCYGPATH_W='cygpath -w' + fi + fi + fi +else + CSHARPCILINTERPRETER="$CSHARPBIN" +fi + +# Cygwin requires the Windows standard (Pascal) calling convention as it is a Windows executable and not a Cygwin built executable +case $host in +*-*-cygwin* | *-*-mingw*) + if test "$GCC" = yes; then + CSHARPDYNAMICLINKING=" -mno-cygwin -mthreads -Wl,--add-stdcall-alias" + CSHARPCFLAGS="-mno-cygwin -mthreads" + else + CSHARPDYNAMICLINKING="" + CSHARPCFLAGS="" + fi ;; +*) + CSHARPDYNAMICLINKING="" + CSHARPCFLAGS="" + ;; +esac + +# CSharp on Windows platforms including Cygwin doesn't use libname.dll, rather name.dll when loading dlls +case $host in +*-*-cygwin* | *-*-mingw*) CSHARPLIBRARYPREFIX="";; +*)CSHARPLIBRARYPREFIX="lib";; +esac + +# C#/Mono on Mac OS X tweaks +case $host in +*-*-darwin*) + CSHARPSO=".so" + ;; +*) + CSHARPSO=$SO + ;; +esac +fi + +AC_SUBST(CSHARPCILINTERPRETER_FLAGS) +AC_SUBST(CSHARPCILINTERPRETER) +AC_SUBST(CSHARPPATHSEPARATOR) +AC_SUBST(CSHARPCYGPATH_W) +AC_SUBST(CSHARPCOMPILER) +AC_SUBST(CSHARPDYNAMICLINKING) +AC_SUBST(CSHARPLIBRARYPREFIX) # Is this going to be used? +AC_SUBST(CSHARPCFLAGS) +AC_SUBST(CSHARPSO) + +#---------------------------------------------------------------- +# Look for Lua +#---------------------------------------------------------------- + +LUABIN= +LUAINCLUDE= +LUALIB= +LUADYNAMICLOADLIB= +LUAFLAGS= +LUALINK= +# note: if LUABIN is empty then lua tests will not be done +# LUABIN will be cleared if certain dependencies cannot be found + +AC_ARG_WITH(lua, AS_HELP_STRING([--without-lua], [Disable Lua]) +AS_HELP_STRING([--with-lua=path], [Set location of Lua executable]),[ LUABIN="$withval"], [LUABIN=yes]) +AC_ARG_WITH(luaincl,[ --with-luaincl=path Set location of Lua include directory],[ + LUAINCLUDE="$withval"], [LUAINCLUDE=]) +AC_ARG_WITH(lualib,[ --with-lualib=path Set location of Lua library directory],[ + LUALIB="$withval"], [LUALIB=]) + +# First, check for "--without-lua" or "--with-lua=no". +if test x"${LUABIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling Lua]) +else + +# can we find lua? +if test "x$LUABIN" = xyes; then + # We look for a versioned Lua binary first, as there can be + # multiple versions of Lua installed on some systems (like Debian). + # The search order should match the include-file and library search + # orders below (a Lua shared library built for one version may not + # work with a Lua binary of a different version). + AC_PATH_PROGS(LUABIN, [lua5.2 lua5.1 lua]) +fi + +# check version: we need Lua 5.x +if test "$LUABIN"; then + AC_MSG_CHECKING(Lua version) + # if version 5.x + LUAV5=`$LUABIN -e 'if string.sub(_VERSION,5,5)=="5" then print "1" end'` + # if not version 5.0 + LUAV51=`$LUABIN -e 'if string.sub(_VERSION,5,7)~="5.0" then print "1" end'` + + if test -z "$LUAV5"; then + AC_MSG_WARN(Not Lua 5.x, SWIG does not support this version of Lua) + LUABIN="" + elif test -z "$LUAV51"; then + AC_MSG_RESULT(Lua 5.0.x) + else + AC_MSG_RESULT(Lua 5.1 or later) + fi +fi + +if test "$LUABIN"; then + AC_MSG_CHECKING(whether Lua dynamic loading is enabled) + # using Lua to check Lua + # lua 5.0 & 5.1 have different fn names + if test -z "$LUAV51"; then + LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=loadlib("no_such_lib","") if c~="absent" then print "1" end'` + else + LUADYNAMICLOADLIB=`$LUABIN -e '_,_,c=package.loadlib("no_such_lib","") if c~="absent" then print "1" end'` + fi + + if test -z "$LUADYNAMICLOADLIB"; then + AC_MSG_RESULT(no) + else + AC_MSG_RESULT(yes) + fi +fi + +# look for the header files & set LUAFLAGS accordingly +# will clear LUABIN if not present +if test -n "$LUAINCLUDE"; then + AC_CHECK_FILE($LUAINCLUDE/lua.h,[LUAFLAGS="$ISYSTEM$LUAINCLUDE"],[LUABIN=]) +else + LUA_OK="1" + AC_CHECK_HEADER(lua.h,[LUAFLAGS=""],[LUA_OK=""]) + # if we didn't get it, going to have to look elsewhere (the hard way) + if test -z "$LUA_OK"; then + AC_MSG_CHECKING(for lua.h in other locations) + # note: Debian/Ubuntu seem to like /usr/include/lua5.1/lua.h + # The ordering of the include directories to search should match + # the ordering of libraries to search in the library test below. + inc=/usr/include + dirs="$inc/lua5.2 $inc/lua5.1 $inc/lua51 $inc/lua5.0 $inc/lua50 /usr/local/include" + for i in $dirs; do + #echo "$i" + if test -r $i/lua.h; then + AC_MSG_RESULT($i/lua.h) + LUAFLAGS="$ISYSTEM$i" + break + fi + done + if test -z "$LUAFLAGS"; then + AC_MSG_RESULT(not found) + LUABIN="" # clear the bin + fi + fi +fi + +# look for the library files & set LUALINK accordingly +# will clear LUABIN if not present +lua_save_LIBS=$LIBS # the code seems to disrupt LIBS, so saving + +if test -n "$LUALIB"; then + AC_CHECK_FILE($LUALIB/liblua.a,[LUALINK="-L$LUALIB -llua"],[LUABIN=]) +else + AC_SEARCH_LIBS(lua_close, [lua lua5.2 lua5.1 lua51 lua5.0 lua50], [LUALINK="-l$ac_lib"],[LUABIN=]) +fi + +# adding lualib for lua 5.0 +if test -z "$LUAV51"; then # extra for lua 5.0 + LUALINK="$LUALINK -llualib" +fi + +LIBS=$lua_save_LIBS # restore LIBS + +fi # if not disabled + +AC_SUBST(LUADYNAMICLINKING) +AC_SUBST(LUAFLAGS) +AC_SUBST(LUALINK) +AC_SUBST(LUABIN) + +#---------------------------------------------------------------- +# Look for Allegro Common Lisp +#---------------------------------------------------------------- + +ALLEGROCLBIN= + +AC_ARG_WITH(allegrocl, AS_HELP_STRING([--without-allegrocl], [Disable Allegro CL]) +AS_HELP_STRING([--with-allegrocl=path], [Set location of Allegro CL executable (alisp)]),[ ALLEGROCLBIN="$withval"], [ALLEGROCLBIN=yes]) + +# First, check for "--without-allegrocl" or "--with-allegrocl=no". +if test x"${ALLEGROCLBIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling Allegro CL]) +ALLEGROCLBIN= +else + +# can we find allegrocl? +if test "x$ALLEGROCLBIN" = xyes; then + AC_PATH_PROG(ALLEGROCLBIN, alisp) +fi +fi + +AC_SUBST(ALLEGROCLBIN) + +#---------------------------------------------------------------- +# Look for GNU CLISP +#---------------------------------------------------------------- + +CLISPBIN= + +AC_ARG_WITH(clisp, AS_HELP_STRING([--without-clisp], [Disable CLISP]) +AS_HELP_STRING([--with-clisp=path], [Set location of CLISP executable (clisp)]),[ CLISPBIN="$withval"], [CLISPBIN=yes]) + +# First, check for "--without-clisp" or "--with-clisp=no". +if test x"${CLISPBIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling CLISP]) +CLISPBIN= +else + +# can we find clisp? +if test "x$CLISPBIN" = xyes; then + AC_PATH_PROG(CLISPBIN, clisp) +fi +fi + +AC_SUBST(CLISPBIN) + +#---------------------------------------------------------------- +# Look for GNU R +#---------------------------------------------------------------- + +RBIN= + +AC_ARG_WITH(r, AS_HELP_STRING([--without-r], [Disable R]) +AS_HELP_STRING([--with-r=path], [Set location of R executable (r)]),[ RBIN="$withval"], [RBIN=yes]) + +# First, check for "--without-r" or "--with-r=no". +if test x"${RBIN}" = xno -o x"${with_alllang}" = xno ; then +AC_MSG_NOTICE([Disabling R]) +RBIN= +else + +# can we find R? +if test "x$RBIN" = xyes; then + AC_PATH_PROG(RBIN, R) +fi +fi + +AC_SUBST(RBIN) + +#---------------------------------------------------------------- +# Look for Go compilers +#---------------------------------------------------------------- + +AC_ARG_WITH(go, AS_HELP_STRING([--without-go], [Disable Go]) +AS_HELP_STRING([--with-go=path], [Set location of Go compiler]),[GOBIN="$withval"], [GOBIN=yes]) + +if test x"${GOBIN}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling Go]) + GO= + GOC= + GO1=false + GOGCC=false + GOOPT= + GOVERSIONOPTION= +else + + if test "x$GOBIN" = xyes; then + AC_CHECK_PROGS(GO, go 6g 8g gccgo) + else + GO="$GOBIN" + fi + + GOGCC=false + GO1=false + GOOPT= + GOVERSIONOPTION= + if test -n "$GO" ; then + if $GO --help 2>/dev/null | grep gccgo >/dev/null 2>&1 ; then + GOGCC=true + GOVERSIONOPTION=--version + AC_MSG_CHECKING([whether gccgo version is too old]) + go_version=`$GO $GOVERSIONOPTION | sed -e 's/[^0-9]* \([0-9.]*\) .*$/\1/' -e 's/[.]//g'` + if test "$go_version" -lt 470; then + AC_MSG_RESULT([yes - minimum version is 4.7.0]) + else + AC_MSG_RESULT([no]) + if test "$go_version" -lt 480; then + GOOPT="-intgosize 32" + else + AC_CHECK_SIZEOF([void *], [4]) + if test "$ac_cv_sizeof_void_p" = "8"; then + GOOPT="-intgosize 64" + else + GOOPT="-intgosize 32" + fi + fi + fi + elif test "`echo $GO | sed -e 's|.*/||'`" = "go"; then + GO1=true + GOVERSIONOPTION=version + GOC=$(sh -c "$(go env) && echo \$GOCHAR")c + go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //') + case $go_version in + go1.0*) GOOPT="-intgosize 32" ;; + *) if test "$GOC" = "6c"; then + GOOPT="-intgosize 64" + else + GOOPT="-intgosize 32" + fi + ;; + esac + else + GOC=`echo $GO | sed -e 's/g/c/'` + GOVERSIONOPTION=-V + AC_MSG_CHECKING([whether Go ($GO) version is too old]) + go_version=`$GO $GOVERSIONOPTION 2>/dev/null | sed -e 's/.*version.* \([[0-9]]*\).*/\1/'` + go_min_version=7077 + if test "$go_version" != "" -a "$go_version" -lt $go_min_version; then + AC_MSG_RESULT([yes - minimum version is $go_min_version]) + GO= + else + AC_MSG_RESULT([no]) + fi + GOOPT="-intgosize 32" + fi + fi +fi + +AC_SUBST(GOGCC) +AC_SUBST(GO) +AC_SUBST(GOC) +AC_SUBST(GO1) +AC_SUBST(GOOPT) +AC_SUBST(GOVERSIONOPTION) + +#---------------------------------------------------------------- +# Look for D +#---------------------------------------------------------------- + +AC_ARG_WITH(d, AS_HELP_STRING([--without-d], [Disable D]), [with_d="$withval"], [with_d=yes]) +AC_ARG_WITH(d1-compiler, [ --with-d1-compiler=path Set location of D1/Tango compiler (DMD compatible)],[D1COMPILERBIN="$withval"], [D1COMPILERBIN=]) +AC_ARG_WITH(d2-compiler, [ --with-d2-compiler=path Set location of D2 compiler (DMD compatible)],[D2COMPILERBIN="$withval"], [D2COMPILERBIN=]) + + +# First, check for "--without-d" or "--with-d=no". +if test x"${with_d}" = xno -o x"${with_alllang}" = xno ; then + AC_MSG_NOTICE([Disabling D]) + D1COMPILER= + D2COMPILER= +else + old_ac_ext=$ac_ext + ac_ext=d + + if test -z "$D1COMPILERBIN" ; then + AC_CHECK_PROGS(D1COMPILER, dmd ldmd gdmd) + + if test -n "$D1COMPILER" ; then + AC_MSG_CHECKING(whether the D1/Tango compiler works) + cat > conftest.$ac_ext <<_ACEOF +import tango.io.Stdout; +void main() { +} +_ACEOF + rm -f conftest.$ac_objext + AS_IF( + [_AC_DO_STDERR($D1COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext], + [AC_MSG_RESULT([yes])], + [_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no]) + D1COMPILER=] + ) + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else + D1COMPILER="$D1COMPILERBIN" + fi + + if test -z "$D2COMPILERBIN" ; then + AC_CHECK_PROGS(D2COMPILER, dmd gdmd) + + if test -n "$D2COMPILER" ; then + AC_MSG_CHECKING(whether the D2 compiler works) + cat > conftest.$ac_ext <<_ACEOF +import std.algorithm; +void main() { +} +_ACEOF + rm -f conftest.$ac_objext + AS_IF( + [_AC_DO_STDERR($D2COMPILER conftest.$ac_ext) && test ! -s conftest.err && test -s conftest.$ac_objext], + [AC_MSG_RESULT([yes])], + [_AC_MSG_LOG_CONFTEST AC_MSG_RESULT([no]) + D2COMPILER=] + ) + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + else + D2COMPILER="$D2COMPILERBIN" + fi + + ac_ext=$old_ac_ext +fi + +if test -n "$D1COMPILER"; then + DDEFAULTVERSION=1 +elif test -n "$D2COMPILER"; then + DDEFAULTVERSION=2 +fi + +# Do not prefix library file names with "lib" on Windows. +case $host in +*-*-cygwin* | *-*-mingw*) DLIBPREFIX="";; +*)DLIBPREFIX="lib";; +esac + +AC_SUBST(D1COMPILER) +AC_SUBST(D2COMPILER) +AC_SUBST(DDEFAULTVERSION) +AC_SUBST(DLIBPREFIX) + +#---------------------------------------------------------------- +# Determine which languages to use for examples/test-suite +#---------------------------------------------------------------- + +SKIP_TCL= +if test -z "$TCLINCLUDE" || test -z "$TCLLIB" ; then + SKIP_TCL="1" +fi +AC_SUBST(SKIP_TCL) + + +SKIP_PERL5= +if test -z "$PERL" || test -z "$PERL5EXT" ; then + SKIP_PERL5="1" +fi +AC_SUBST(SKIP_PERL5) + + +SKIP_OCTAVE= +if test -z "$OCTAVE" ; then + SKIP_OCTAVE="1" +fi +AC_SUBST(SKIP_OCTAVE) + + +SKIP_PYTHON= +if (test -z "$PYINCLUDE") && + (test -z "$PY3INCLUDE") ; then + SKIP_PYTHON="1" +fi +AC_SUBST(SKIP_PYTHON) + +SKIP_PYTHON3= +if test -z "$PY3INCLUDE" ; then + SKIP_PYTHON3="1" +fi +AC_SUBST(SKIP_PYTHON3) + +SKIP_JAVA= +if test -z "$JAVA" || test -z "$JAVAC" || test -z "$JAVAINC" ; then + SKIP_JAVA="1" +fi +AC_SUBST(SKIP_JAVA) + + +SKIP_GUILE= +if test -z "$GUILE" || test -z "$GUILE_LIBS" ; then + SKIP_GUILE="1" +fi +AC_SUBST(SKIP_GUILE) + + +SKIP_MZSCHEME= +if test -z "$MZC" || test -z "$MZDYNOBJ" ; then + SKIP_MZSCHEME="1" +fi +AC_SUBST(SKIP_MZSCHEME) + + +SKIP_RUBY= +if test -z "$RUBY" || test -z "$RUBYINCLUDE" || test -z "$RUBYLIB" ; then + SKIP_RUBY="1" +fi +AC_SUBST(SKIP_RUBY) + + +SKIP_PHP= +if test -z "$PHP" || test -z "$PHPINC" ; then + SKIP_PHP="1" +fi +AC_SUBST(SKIP_PHP) + + +SKIP_OCAML= +if test -z "$OCAMLBIN" || test -z "$OCAMLINC" ; then + SKIP_OCAML="1" +fi +AC_SUBST(SKIP_OCAML) + + +SKIP_PIKE= +if test -z "$PIKE" || test -z "$PIKEINCLUDE" ; then + SKIP_PIKE="1" +fi +AC_SUBST(SKIP_PIKE) + + +SKIP_CHICKEN= +if test -z "$CHICKEN_CSC" || test -z "$CHICKEN"; then + SKIP_CHICKEN="1" +fi +AC_SUBST(SKIP_CHICKEN) + + +SKIP_CSHARP= +if test -z "$CSHARPCOMPILER" ; then + SKIP_CSHARP="1" +else + if test "cscc" = "$CSHARPCOMPILER" && test -z "$CSHARPCILINTERPRETER" ; then + SKIP_CSHARP="1" + fi +fi +AC_SUBST(SKIP_CSHARP) + +SKIP_MODULA3="1" # Always skipped! +AC_SUBST(SKIP_MODULA3) + +SKIP_LUA= +# we need LUABIN & dynamic loading +if test -z "$LUABIN" || test -z "$LUADYNAMICLOADLIB"; then + SKIP_LUA="1" +fi +AC_SUBST(SKIP_LUA) + +SKIP_ALLEGROCL= +if test -z "$ALLEGROCLBIN" ; then + SKIP_ALLEGROCL="1" +fi +AC_SUBST(SKIP_ALLEGROCL) + +SKIP_CLISP= +if test -z "$CLISPBIN" ; then + SKIP_CLISP="1" +fi +AC_SUBST(SKIP_CLISP) + +SKIP_R= +if test -z "$RBIN" ; then + SKIP_R="1" +fi +AC_SUBST(SKIP_R) + +SKIP_CFFI= +#if test -z "$CFFIBIN" ; then + SKIP_CFFI="1" +#fi +AC_SUBST(SKIP_CFFI) + +SKIP_UFFI= +#if test -z "$UFFIBIN" ; then + SKIP_UFFI="1" +#fi +AC_SUBST(SKIP_UFFI) + +SKIP_GO= +if test -z "$GO" ; then + SKIP_GO="1" +fi +AC_SUBST(SKIP_GO) + +SKIP_D= +if test -z "$DDEFAULTVERSION" ; then + SKIP_D="1" +fi +AC_SUBST(SKIP_D) + +#---------------------------------------------------------------- +# Additional language dependencies +#---------------------------------------------------------------- +SKIP_GCJ= +if test -z "$GCJ" || test -z "$GCJH" ; then + SKIP_GCJ="1" +else + if test "$GCC" != yes; then + SKIP_GCJ="1" + fi +fi +AC_SUBST(SKIP_GCJ) + + +SKIP_ANDROID= +if test -z "$ANDROID" || test -z "$ADB" || test -z "$ANT" || test -z "$NDKBUILD" ; then + SKIP_ANDROID="1" +fi +AC_SUBST(SKIP_ANDROID) + + + +#---------------------------------------------------------------- +# Miscellaneous +#---------------------------------------------------------------- + + +# Root directory +# Translate path for native Windows compilers for use with 'make check' +ROOT_DIR=`pwd` +case $host in +*-*-cygwin* | *-*-mingw*) + if (cygpath --mixed $ROOT_DIR) >/dev/null 2>/dev/null; then + ROOT_DIR=`cygpath --mixed $ROOT_DIR` + fi + # Extra files generated by some Windows compilers + EXTRA_CLEAN="*.stackdump *.exp *.lib *.pdb *.ilk" + ;; +esac + +AC_SUBST(ROOT_DIR) +AC_SUBST(EXTRA_CLEAN) +AC_SUBST(ac_aux_dir) + +# Configure SWIG_LIB path + +AC_ARG_WITH(swiglibdir,[ --with-swiglibdir=DIR Put SWIG system-independent libraries into DIR.], + [swig_lib="$withval"], [swig_lib="${datadir}/swig/${PACKAGE_VERSION}"]) +AC_SUBST(swig_lib) +AC_DEFINE_DIR(SWIG_LIB, swig_lib, [Directory for SWIG system-independent libraries]) + +case $build in + # Windows does not understand unix directories. Convert into a windows directory with drive letter. + *-*-mingw*) SWIG_LIB_WIN_UNIX=`cmd //c echo $SWIG_LIB | sed -e "s/[ ]*$//"`;; # This echo converts unix to mixed paths. Then zap unexpected trailing space. + *-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; + *) SWIG_LIB_WIN_UNIX="";; +esac +AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) + +AC_CONFIG_FILES([ \ + Makefile \ + swig.spec \ + Source/Makefile \ + Examples/Makefile \ + Examples/xml/Makefile \ + Examples/test-suite/chicken/Makefile \ + Examples/test-suite/csharp/Makefile \ + Examples/test-suite/d/Makefile \ + Examples/test-suite/guile/Makefile \ + Examples/test-suite/java/Makefile \ + Examples/test-suite/mzscheme/Makefile \ + Examples/test-suite/ocaml/Makefile \ + Examples/test-suite/octave/Makefile \ + Examples/test-suite/perl5/Makefile \ + Examples/test-suite/php/Makefile \ + Examples/test-suite/pike/Makefile \ + Examples/test-suite/python/Makefile \ + Examples/test-suite/ruby/Makefile \ + Examples/test-suite/tcl/Makefile \ + Examples/test-suite/lua/Makefile \ + Examples/test-suite/allegrocl/Makefile \ + Examples/test-suite/clisp/Makefile \ + Examples/test-suite/cffi/Makefile \ + Examples/test-suite/uffi/Makefile \ + Examples/test-suite/r/Makefile \ + Examples/test-suite/go/Makefile \ + Lib/ocaml/swigp4.ml +]) +AC_CONFIG_FILES([preinst-swig], [chmod +x preinst-swig]) +AC_CONFIG_FILES([CCache/ccache_swig_config.h]) + +AC_OUTPUT +dnl configure.ac ends here diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/example.i --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/example.i Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,6 @@ +%module example +%{ +#include "example.h" +%} +int gcd(int x, int y); +extern double Foo; \ No newline at end of file diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/example_wrap.cxx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/example_wrap.cxx Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2304 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.11 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGLUA +#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA +#define SWIG_LUA_MODULE_GLOBAL + + +#ifdef __cplusplus +/* SwigValueWrapper is described in swig.swg */ +template<typename T> class SwigValueWrapper { + struct SwigMovePointer { + T *ptr; + SwigMovePointer(T *p) : ptr(p) { } + ~SwigMovePointer() { delete ptr; } + SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; } + } pointer; + SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs); + SwigValueWrapper(const SwigValueWrapper<T>& rhs); +public: + SwigValueWrapper() : pointer(0) { } + SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; } + operator T&() const { return *pointer.ptr; } + T *operator&() { return pointer.ptr; } +}; + +template <typename T> T SwigValueInit() { + return T(); +} +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic C API SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "4" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the SWIG runtime code. + In 99.9% of the cases, SWIG just needs to declare them as 'static'. + + But only do this if strictly necessary, ie, if you have problems + with your compiler or suchlike. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 +#define SWIG_CAST_NEW_MEMORY 0x2 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The SWIG conversion methods, as ConvertPtr, return an integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old versions of SWIG, code such as the following was usually written: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + which is the same really, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + also requires SWIG_ConvertPtr to return new result values, such as + + int SWIG_ConvertPtr(obj, ptr,...) { + if (<obj is ok>) { + if (<need new object>) { + *ptr = <ptr to new allocated object>; + return SWIG_NEWOBJ; + } else { + *ptr = <ptr to old object>; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + SWIG errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() +*/ + +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast(r) (r) +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + +#include <string.h> + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *, int *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store information on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class<int>" == "Class<int >", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (int)((l1 - f1) - (l2 - f2)); +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCmp(const char *nb, const char *tb) { + int equiv = 1; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (equiv != 0 && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = SWIG_TypeNameComp(nb, ne, tb, te); + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like <name1>|<name2>|... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; +} + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (strcmp(iter->type->name, c) == 0) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { + if (ty) { + swig_cast_info *iter = ty->cast; + while (iter) { + if (iter->type == from) { + if (iter == ty->cast) + return iter; + /* Move iter to the top of the linked list */ + iter->prev->next = iter->next; + if (iter->next) + iter->next->prev = iter->prev; + iter->next = ty->cast; + iter->prev = 0; + if (ty->cast) ty->cast->prev = iter; + ty->cast = iter; + return iter; + } + iter = iter->next; + } + } + return 0; +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* ----------------------------------------------------------------------------- + * luarun.swg + * + * This file contains the runtime support for Lua modules + * and includes code for managing global variables and pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "lua.h" +#include "lauxlib.h" +#include <stdlib.h> /* for malloc */ +#include <assert.h> /* for a few sanity tests */ + +/* ----------------------------------------------------------------------------- + * Lua flavors + * ----------------------------------------------------------------------------- */ + +#define SWIG_LUA_FLAVOR_LUA 1 +#define SWIG_LUA_FLAVOR_ELUA 2 +#define SWIG_LUA_FLAVOR_ELUAC 3 + +#if !defined(SWIG_LUA_TARGET) +# error SWIG_LUA_TARGET not defined +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C) +# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C) +# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C) +#else /* SWIG_LUA_FLAVOR_LUA */ +# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0 +# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0 +# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0 +# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0 +#endif + +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC) +# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING} +# define LSTRVAL LRO_STRVAL +#endif + +/* ----------------------------------------------------------------------------- + * compatibility defines + * ----------------------------------------------------------------------------- */ + +/* History of Lua C API length functions: In Lua 5.0 (and before?) + there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen", + but a compatibility define of "lua_strlen" was added. In Lua 5.2, + this function was again renamed, to "lua_rawlen" (to emphasize that + it doesn't call the "__len" metamethod), and the compatibility + define of lua_strlen was removed. All SWIG uses have been updated + to "lua_rawlen", and we add our own defines of that here for older + versions of Lua. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501 +# define lua_rawlen lua_strlen +#elif LUA_VERSION_NUM == 501 +# define lua_rawlen lua_objlen +#endif + + +/* lua_pushglobaltable is the recommended "future-proof" way to get + the global table for Lua 5.2 and later. Here we define + lua_pushglobaltable ourselves for Lua versions before 5.2. */ +#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502 +# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX) +#endif + + +/* -------------------------------------------------------------------------- + * Helper functions for error handling + * -------------------------------------------------------------------------- */ + +/* Push the string STR on the Lua stack, like lua_pushstring, but + prefixed with the the location of the innermost Lua call-point + (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pusherrstring (lua_State *L, const char *str) +{ + luaL_where (L, 1); + lua_pushstring (L, str); + lua_concat (L, 2); +} + +/* Push a formatted string generated from FMT and following args on + the Lua stack, like lua_pushfstring, but prefixed with the the + location of the innermost Lua call-point (as formated by luaL_where). */ +SWIGRUNTIME void +SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); +} + + +/* ----------------------------------------------------------------------------- + * global swig types + * ----------------------------------------------------------------------------- */ +/* Constant table */ +#define SWIG_LUA_INT 1 +#define SWIG_LUA_FLOAT 2 +#define SWIG_LUA_STRING 3 +#define SWIG_LUA_POINTER 4 +#define SWIG_LUA_BINARY 5 +#define SWIG_LUA_CHAR 6 + +/* Structure for variable linking table */ +typedef struct { + const char *name; + lua_CFunction get; + lua_CFunction set; +} swig_lua_var_info; + +/* Constant information structure */ +typedef struct { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_lua_const_info; + +typedef struct { + const char *name; + lua_CFunction method; +} swig_lua_method; + +typedef struct { + const char *name; + lua_CFunction getmethod; + lua_CFunction setmethod; +} swig_lua_attribute; + +// Can be used to create namespaces. Currently used to +// wrap class static methods/variables/constants +typedef struct { + const char *name; + swig_lua_method *ns_methods; + swig_lua_attribute *ns_attributes; + swig_lua_const_info *ns_constants; +} swig_lua_namespace; + +typedef struct swig_lua_class { + const char *name; + swig_type_info **type; + lua_CFunction constructor; + void (*destructor)(void *); + swig_lua_method *methods; + swig_lua_attribute *attributes; + swig_lua_namespace cls_static; + struct swig_lua_class **bases; + const char **base_names; +} swig_lua_class; + +/* this is the struct for wrapping all pointers in SwigLua +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + void *ptr; +} swig_lua_userdata; + +/* this is the struct for wrapping arbitrary packed binary data +(currently it is only used for member function pointers) +the data ordering is similar to swig_lua_userdata, but it is currently not possible +to tell the two structures apart within SWIG, other than by looking at the type +*/ +typedef struct { + swig_type_info *type; + int own; /* 1 if owned & must be destroyed */ + char data[1]; /* arbitary amount of data */ +} swig_lua_rawdata; + +/* Common SWIG API */ +#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner) +#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags) +#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname) +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty) +#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type) + +/* Runtime API */ +#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata)) +#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer) +#define SWIG_MODULE_CLIENTDATA_TYPE lua_State* + +/* Contract support */ +#define SWIG_contract_assert(expr, msg) \ + if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else + + +/* helper #defines */ +#define SWIG_fail {goto fail;} +#define SWIG_fail_arg(func_name,argnum,type) \ + {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\ + func_name,argnum,type,SWIG_Lua_typename(L,argnum));\ + goto fail;} +#define SWIG_fail_ptr(func_name,argnum,type) \ + SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*") +#define SWIG_check_num_args(func_name,a,b) \ + if (lua_gettop(L)<a || lua_gettop(L)>b) \ + {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\ + goto fail;} + + +#define SWIG_Lua_get_table(L,n) \ + (lua_pushstring(L, n), lua_rawget(L,-2)) + +#define SWIG_Lua_add_function(L,n,f) \ + (lua_pushstring(L, n), \ + lua_pushcfunction(L, f), \ + lua_rawset(L,-3)) + +/* special helper for allowing 'nil' for usertypes */ +#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I)) + +#ifdef __cplusplus +/* Special helper for member function pointers +it gets the address, casts it, then dereferences it */ +//#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) +#endif + +/* storing/access of swig_module_info */ +SWIGRUNTIME swig_module_info * +SWIG_Lua_GetModule(lua_State* L) { + swig_module_info *ret = 0; + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_rawget(L,LUA_REGISTRYINDEX); + if (lua_islightuserdata(L,-1)) + ret=(swig_module_info*)lua_touserdata(L,-1); + lua_pop(L,1); /* tidy */ + return ret; +} + +SWIGRUNTIME void +SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) { + /* add this all into the Lua registry: */ + lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME); + lua_pushlightuserdata(L,(void*)module); + lua_rawset(L,LUA_REGISTRYINDEX); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: modules + * ----------------------------------------------------------------------------- */ + +/* this function is called when trying to set an immutable. +default action is to print an error. +This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */ +SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L) +{ +/* there should be 1 param passed in: the new value */ +#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE + lua_pop(L,1); /* remove it */ + luaL_error(L,"This variable is immutable"); +#endif + return 0; /* should not return anything */ +} + +/* the module.get method used for getting linked data */ +SWIGINTERN int SWIG_Lua_module_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute + printf("SWIG_Lua_module_get %p(%s) '%s'\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2)); +*/ + /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,1)); /* just in case */ +#else + assert(lua_istable(L,1)); /* default Lua action */ +#endif + lua_getmetatable(L,1); /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,-1)); /* just in case */ +#else + assert(lua_istable(L,-1)); +#endif + SWIG_Lua_get_table(L,".get"); /* get the .get table */ + lua_remove(L,3); /* remove metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + if (lua_isrotable(L,-1)) +#else + if (lua_istable(L,-1)) +#endif + { + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,3); /* remove .get */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); + return 1; + } + lua_pop(L,1); /* remove the top */ + } + lua_pop(L,1); /* remove the .get */ + lua_pushnil(L); /* return a nil */ + return 1; +} + +/* the module.set method used for setting linked data */ +SWIGINTERN int SWIG_Lua_module_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,1)); /* just in case */ +#else + assert(lua_istable(L,1)); /* default Lua action */ +#endif + lua_getmetatable(L,1); /* get the metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + assert(lua_isrotable(L,-1)); /* just in case */ +#else + assert(lua_istable(L,-1)); +#endif + SWIG_Lua_get_table(L,".set"); /* get the .set table */ + lua_remove(L,4); /* remove metatable */ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) + if (lua_isrotable(L,-1)) +#else + if (lua_istable(L,-1)) +#endif + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,4); /* remove .set */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } +#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) + else { + return 0; // Exits stoically if an invalid key is initialized. + } +#endif + } + lua_settop(L,3); /* reset back to start */ + /* we now have the table, key & new value, so just set directly */ + lua_rawset(L,1); /* add direct */ + return 0; +} + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* registering a module in lua. Pushes the module table on the stack. */ +SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name) +{ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushstring(L,name); + lua_newtable(L); /* the table */ + /* add meta table */ + lua_newtable(L); /* the meta table */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set); + lua_pushstring(L,".get"); + lua_newtable(L); /* the .get table */ + lua_rawset(L,-3); /* add .get into metatable */ + lua_pushstring(L,".set"); + lua_newtable(L); /* the .set table */ + lua_rawset(L,-3); /* add .set into metatable */ + lua_setmetatable(L,-2); /* sets meta table in module */ +#ifdef SWIG_LUA_MODULE_GLOBAL + /* If requested, install the module directly into the global namespace. */ + lua_rawset(L,-3); /* add module into parent */ + SWIG_Lua_get_table(L,name); /* get the table back out */ +#else + /* Do not install the module table as global name. The stack top has + the module table with the name below. We pop the top and replace + the name with it. */ + lua_replace(L,-2); +#endif +} + +/* ending the register */ +SWIGINTERN void SWIG_Lua_module_end(lua_State* L) +{ + lua_pop(L,1); /* tidy stack (remove module) */ +} + +/* adding a linked variable to the module */ +SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + lua_getmetatable(L,-1); /* get the metatable */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) /* if there is a set fn */ + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* should be a table: */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } + lua_pop(L,1); /* tidy stack (remove meta) */ +} +#endif + +/* adding a function module */ +SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn) +{ + SWIG_Lua_add_function(L,name,fn); +} + +/* ----------------------------------------------------------------------------- + * global variable support code: namespaces + * ----------------------------------------------------------------------------- */ + +SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) table (not the meta table) + (2) string name of the attribute +*/ + assert(lua_istable(L,-2)); /* just in case */ + lua_getmetatable(L,-2); + assert(lua_istable(L,-1)); + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + return 0; +} + +SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +*/ + + assert(lua_istable(L,1)); + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,3); /* value */ + lua_call(L,1,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + return 0; +} + +SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration +SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration + +/* helper function - register namespace methods and attributes into namespace */ +SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns) +{ + int i = 0; + assert(lua_istable(L,-1)); + /* There must be table at the top of the stack */ + SWIG_Lua_InstallConstants(L, ns->ns_constants); + + lua_getmetatable(L,-1); + + /* add fns */ + for(i=0;ns->ns_attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod); + } + + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;ns->ns_methods[i].name;i++){ + SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method); + } + lua_pop(L,1); + + /* clear stack - remove metatble */ + lua_pop(L,1); + +} + +/* helper function. creates namespace table and add it to module table */ +SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns) +{ + assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */ + lua_checkstack(L,5); + lua_pushstring(L, ns->name); + lua_newtable(L); /* namespace itself */ + lua_newtable(L); /* metatable for namespace */ + + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + lua_rawset(L,-3); + + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set); + + lua_setmetatable(L,-2); /* set metatable */ + lua_rawset(L,-3); /* add namespace to module table */ +} +/* ----------------------------------------------------------------------------- + * global variable support code: classes + * ----------------------------------------------------------------------------- */ + +/* the class.get method, performs the lookup of class attributes */ +SWIGINTERN int SWIG_Lua_class_get(lua_State* L) +{ +/* there should be 2 params passed in + (1) userdata (not the meta table) + (2) string name of the attribute +*/ + assert(lua_isuserdata(L,-2)); /* just in case */ + lua_getmetatable(L,-2); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + /* look for the key in the .get table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + lua_remove(L,-2); /* stack tidy, remove .get table */ + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* ok, so try the .fn table */ + SWIG_Lua_get_table(L,".fn"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); /* look for the fn */ + lua_remove(L,-2); /* stack tidy, remove .fn table */ + if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */ + { /* found it so return the fn & let lua call it */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + lua_pop(L,1); /* remove whatever was there */ + /* NEW: looks for the __getitem() fn + this is a user provided get fn */ + SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; /* sorry not known */ +} + +/* the class.set method, performs the lookup of class attributes */ +SWIGINTERN int SWIG_Lua_class_set(lua_State* L) +{ +/* there should be 3 params passed in + (1) table (not the meta table) + (2) string name of the attribute + (3) any for the new value +printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n", + lua_topointer(L,1),lua_typename(L,lua_type(L,1)), + lua_tostring(L,2), + lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/ + + assert(lua_isuserdata(L,1)); /* just in case */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + if (lua_istable(L,-1)) + { + /* look for the key in the .set table */ + lua_pushvalue(L,2); /* key */ + lua_rawget(L,-2); + if (lua_iscfunction(L,-1)) + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* userdata */ + lua_pushvalue(L,3); /* value */ + lua_call(L,2,0); + return 0; + } + lua_pop(L,1); /* remove the value */ + } + lua_pop(L,1); /* remove the value .set table */ + /* NEW: looks for the __setitem() fn + this is a user provided set fn */ + SWIG_Lua_get_table(L,"__setitem"); /* find the fn */ + if (lua_iscfunction(L,-1)) /* if its there */ + { /* found it so call the fn & return its value */ + lua_pushvalue(L,1); /* the userdata */ + lua_pushvalue(L,2); /* the parameter */ + lua_pushvalue(L,3); /* the value */ + lua_call(L,3,0); /* 3 values in ,0 out */ + lua_remove(L,-2); /* stack tidy, remove metatable */ + return 1; + } + return 0; +} + +/* the class.destruct method called by the interpreter */ +SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + swig_lua_class* clss; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + /* if must be destroyed & has a destructor */ + if (usr->own) /* if must be destroyed */ + { + clss=(swig_lua_class*)usr->type->clientdata; /* get the class */ + if (clss && clss->destructor) /* there is a destroy fn */ + { + clss->destructor(usr->ptr); /* bye bye */ + } + } + return 0; +} + +/* the class.__tostring method called by the interpreter and print */ +SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L) +{ +/* there should be 1 param passed in + (1) userdata (not the metatable) */ + assert(lua_isuserdata(L,1)); /* just in case */ + unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */ + lua_getmetatable(L,1); /* get the meta table */ + assert(lua_istable(L,-1)); /* just in case */ + + lua_getfield(L, -1, ".type"); + const char* className = lua_tostring(L, -1); + + char output[256]; + sprintf(output, "<%s userdata: %lX>", className, userData); + + lua_pushstring(L, (const char*)output); + return 1; +} + +/* to manually disown some userdata */ +SWIGINTERN int SWIG_Lua_class_disown(lua_State* L) +{ +/* there should be 1 params passed in + (1) userdata (not the meta table) */ + swig_lua_userdata* usr; + assert(lua_isuserdata(L,-1)); /* just in case */ + usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */ + + usr->own = 0; /* clear our ownership */ + return 0; +} + +/* Constructor proxy. Used when class name entry in module is not class constructor, +but special table instead. */ +SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L) +{ + /* unlimited number of parameters + First one is our proxy table and we should remove it + Other we should pass to real constructor + */ + assert(lua_istable(L,1)); + lua_pushstring(L,".constructor"); + lua_rawget(L,1); + assert(!lua_isnil(L,-1)); + lua_replace(L,1); /* replace our table with real constructor */ + lua_call(L,lua_gettop(L)-1,1); + return 1; +} + +/* gets the swig class registry (or creates it) */ +SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L) +{ + /* add this all into the swig registry: */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */ + if (!lua_istable(L,-1)) /* not there */ + { /* must be first time, so add it */ + lua_pop(L,1); /* remove the result */ + lua_pushstring(L,"SWIG"); + lua_newtable(L); + lua_rawset(L,LUA_REGISTRYINDEX); + /* then get it */ + lua_pushstring(L,"SWIG"); + lua_rawget(L,LUA_REGISTRYINDEX); + } +} + +/* helper fn to get the classes metatable from the register */ +SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname) +{ + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,cname); /* get the name */ + lua_rawget(L,-2); /* get it */ + lua_remove(L,-2); /* tidy up (remove registry) */ +} + +/* helper add a variable to a registered class */ +SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn) +{ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_get_table(L,".get"); /* find the .get table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,getFn); + lua_pop(L,1); /* tidy stack (remove table) */ + if (setFn) + { + SWIG_Lua_get_table(L,".set"); /* find the .set table */ + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,name,setFn); + lua_pop(L,1); /* tidy stack (remove table) */ + } +} + +/* helper to recursively add class static details (static attributes, operations and constants) */ +SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss) +{ + int i = 0; + /* The class namespace table must be on the top of the stack */ + assert(lua_istable(L,-1)); + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_static_details(L,clss->bases[i]); + } + + SWIG_Lua_add_namespace_details(L, &clss->cls_static); +} + +/* helper to recursively add class details (attributes & operations) */ +SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss) +{ + int i; + /* call all the base classes first: we can then override these later: */ + for(i=0;clss->bases[i];i++) + { + SWIG_Lua_add_class_details(L,clss->bases[i]); + } + /* add fns */ + for(i=0;clss->attributes[i].name;i++){ + SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod); + } + /* add methods to the metatable */ + SWIG_Lua_get_table(L,".fn"); /* find the .fn table */ + assert(lua_istable(L,-1)); /* just in case */ + for(i=0;clss->methods[i].name;i++){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + lua_pop(L,1); /* tidy stack (remove table) */ + /* add operator overloads + these look ANY method which start with "__" and assume they + are operator overloads & add them to the metatable + (this might mess up is someone defines a method __gc (the destructor)*/ + for(i=0;clss->methods[i].name;i++){ + if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){ + SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method); + } + } +} + +/* set up the base classes pointers. +Each class structure has a list of pointers to the base class structures. +This function fills them. +It cannot be done at compile time, as this will not work with hireachies +spread over more than one swig file. +Therefore it must be done at runtime, querying the SWIG type system. +*/ +SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss) +{ + int i=0; + swig_module_info* module=SWIG_GetModule(L); + for(i=0;clss->base_names[i];i++) + { + if (clss->bases[i]==0) /* not found yet */ + { + /* lookup and cache the base class */ + swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]); + if (info) clss->bases[i] = (swig_lua_class *) info->clientdata; + } + } +} + +/* Register class static methods,attributes etc as well as constructor proxy */ +SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss) +{ + lua_checkstack(L,5); /* just in case */ + assert(lua_istable(L,-1)); /* just in case */ + assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */ + + SWIG_Lua_namespace_register(L,&clss->cls_static); + + SWIG_Lua_get_table(L,clss->name); // Get namespace table back + assert(lua_istable(L,-1)); /* just in case */ + + /* add its constructor to module with the name of the class + so you can do MyClass(...) as well as new_MyClass(...) + BUT only if a constructor is defined + (this overcomes the problem of pure virtual classes without constructors)*/ + if (clss->constructor) + { + SWIG_Lua_add_function(L,".constructor", clss->constructor); + lua_getmetatable(L,-1); + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy); + lua_pop(L,1); + } + + assert(lua_istable(L,-1)); /* just in case */ + SWIG_Lua_add_class_static_details(L, clss); + + /* clear stack */ + lua_pop(L,1); +} + +/* performs the entire class registration process */ +SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss) +{ + SWIG_Lua_class_register_static(L,clss); + + SWIG_Lua_get_class_registry(L); /* get the registry */ + lua_pushstring(L,clss->name); /* get the name */ + lua_newtable(L); /* create the metatable */ + /* add string of class name called ".type" */ + lua_pushstring(L,".type"); + lua_pushstring(L,clss->name); + lua_rawset(L,-3); + /* add a table called ".get" */ + lua_pushstring(L,".get"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".set" */ + lua_pushstring(L,".set"); + lua_newtable(L); + lua_rawset(L,-3); + /* add a table called ".fn" */ + lua_pushstring(L,".fn"); + lua_newtable(L); + /* add manual disown method */ + SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown); + lua_rawset(L,-3); + /* add accessor fns for using the .get,.set&.fn */ + SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get); + SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set); + SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct); + /* add tostring method for better output */ + SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring); + /* add it */ + lua_rawset(L,-3); /* metatable into registry */ + lua_pop(L,1); /* tidy stack (remove registry) */ + + SWIG_Lua_get_class_metatable(L,clss->name); + SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */ + lua_pop(L,1); /* tidy stack (remove class metatable) */ +} + +/* ----------------------------------------------------------------------------- + * Class/structure conversion fns + * ----------------------------------------------------------------------------- */ + +/* helper to add metatable to new lua object */ +SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type) +{ + if (type->clientdata) /* there is clientdata: so add the metatable */ + { + SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name); + if (lua_istable(L,-1)) + { + lua_setmetatable(L,-2); + } + else + { + lua_pop(L,1); + } + } +} + +/* pushes a new object into the lua stack */ +SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own) +{ + swig_lua_userdata* usr; + if (!ptr){ + lua_pushnil(L); + return; + } + usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */ + usr->ptr=ptr; /* set the ptr */ + usr->type=type; + usr->own=own; +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +#endif +} + +/* takes a object from the lua stack & converts it into an object of the correct type + (if possible) */ +SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags) +{ + swig_lua_userdata* usr; + swig_cast_info *cast; + if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */ + usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */ + if (usr) + { + if (flags & SWIG_POINTER_DISOWN) /* must disown the object */ + { + usr->own=0; + } + if (!type) /* special cast void*, no casting fn */ + { + *ptr=usr->ptr; + return SWIG_OK; /* ok */ + } + cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */ + if (cast) + { + int newmemory = 0; + *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ + return SWIG_OK; /* ok */ + } + } + return SWIG_ERROR; /* error */ +} + +SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags, + int argnum,const char* func_name){ + void* result; + if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){ + luaL_error (L,"Error in %s, expected a %s at argument number %d\n", + func_name,(type && type->str)?type->str:"void*",argnum); + } + return result; +} + +/* pushes a packed userdata. user for member fn pointers only */ +SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + assert(ptr); /* not acceptable to pass in a NULL value */ + raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */ + raw->type=type; + raw->own=0; + memcpy(raw->data,ptr,size); /* copy the data */ + _SWIG_Lua_AddMetatable(L,type); /* add metatable */ +} + +/* converts a packed userdata. user for member fn pointers only */ +SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type) +{ + swig_lua_rawdata* raw; + raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */ + if (!raw) return SWIG_ERROR; /* error */ + if (type==0 || type==raw->type) /* void* or identical type */ + { + memcpy(ptr,raw->data,size); /* copy it */ + return SWIG_OK; /* ok */ + } + return SWIG_ERROR; /* error */ +} + +/* a function to get the typestring of a piece of data */ +SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp) +{ + swig_lua_userdata* usr; + if (lua_isuserdata(L,tp)) + { + usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */ + if (usr && usr->type && usr->type->str) + return usr->type->str; + return "userdata (unknown type)"; + } + return lua_typename(L,lua_type(L,tp)); +} + +/* lua callable function to get the userdata's type */ +SWIGRUNTIME int SWIG_Lua_type(lua_State* L) +{ + lua_pushstring(L,SWIG_Lua_typename(L,1)); + return 1; +} + +/* lua callable function to compare userdata's value +the issue is that two userdata may point to the same thing +but to lua, they are different objects */ +SWIGRUNTIME int SWIG_Lua_equal(lua_State* L) +{ + int result; + swig_lua_userdata *usr1,*usr2; + if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */ + return 0; /* nil reply */ + usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */ + usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */ + /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/ + result=(usr1->ptr==usr2->ptr); + lua_pushboolean(L,result); + return 1; +} + +/* ----------------------------------------------------------------------------- + * global variable support code: class/struct typemap functions + * ----------------------------------------------------------------------------- */ + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) +/* Install Constants */ +SWIGINTERN void +SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) { + int i; + for (i = 0; constants[i].type; i++) { + switch(constants[i].type) { + case SWIG_LUA_INT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_FLOAT: + lua_pushstring(L,constants[i].name); + lua_pushnumber(L,(lua_Number)constants[i].dvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_CHAR: + lua_pushstring(L,constants[i].name); + lua_pushfstring(L,"%c",(char)constants[i].lvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_STRING: + lua_pushstring(L,constants[i].name); + lua_pushstring(L,(char *) constants[i].pvalue); + lua_rawset(L,-3); + break; + case SWIG_LUA_POINTER: + lua_pushstring(L,constants[i].name); + SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0); + lua_rawset(L,-3); + break; + case SWIG_LUA_BINARY: + lua_pushstring(L,constants[i].name); + SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype); + lua_rawset(L,-3); + break; + default: + break; + } + } +} +#endif + +/* ----------------------------------------------------------------------------- + * executing lua code from within the wrapper + * ----------------------------------------------------------------------------- */ + +#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */ +#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S) +#endif +/* Executes a C string in Lua which is a really simple way of calling lua from C +Unfortunately lua keeps changing its APIs, so we need a conditional compile +In lua 5.0.X its lua_dostring() +In lua 5.1.X its luaL_dostring() +*/ +SWIGINTERN int +SWIG_Lua_dostring(lua_State *L, const char* str) { + int ok,top; + if (str==0 || str[0]==0) return 0; /* nothing to do */ + top=lua_gettop(L); /* save stack */ +#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501)) + ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */ +#else + ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */ +#endif + if (ok!=0) { + SWIG_DOSTRING_FAIL(lua_tostring(L,-1)); + } + lua_settop(L,top); /* restore the stack */ + return ok; +} + +#ifdef __cplusplus +} +#endif + +/* ------------------------------ end luarun.swg ------------------------------ */ + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +static swig_type_info *swig_types[1]; +static swig_module_info swig_module = {swig_types, 0, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#define SWIG_name "example" +#define SWIG_init luaopen_example +#define SWIG_init_user luaopen_example_user + +#define SWIG_LUACODE luaopen_example_luacode + +namespace swig { +typedef struct{} LANGUAGE_OBJ; +} + + +#include "example.h" + +#ifdef __cplusplus +extern "C" { +#endif +static int _wrap_gcd(lua_State* L) { + int SWIG_arg = 0; + int arg1 ; + int arg2 ; + int result; + + SWIG_check_num_args("gcd",2,2) + if(!lua_isnumber(L,1)) SWIG_fail_arg("gcd",1,"int"); + if(!lua_isnumber(L,2)) SWIG_fail_arg("gcd",2,"int"); + arg1 = (int)lua_tonumber(L, 1); + arg2 = (int)lua_tonumber(L, 2); + result = (int)gcd(arg1,arg2); + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Foo_set(lua_State* L) { + int SWIG_arg = 0; + double arg1 ; + + SWIG_check_num_args("Foo",1,1) + if(!lua_isnumber(L,1)) SWIG_fail_arg("Foo",1,"double"); + arg1 = (double)lua_tonumber(L, 1); + Foo = arg1; + + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +static int _wrap_Foo_get(lua_State* L) { + int SWIG_arg = 0; + double result; + + SWIG_check_num_args("Foo",0,0) + result = (double)Foo; + lua_pushnumber(L, (lua_Number) result); SWIG_arg++; + return SWIG_arg; + + if(0) SWIG_fail; + +fail: + lua_error(L); + return SWIG_arg; +} + + +#ifdef __cplusplus +} +#endif + +static const struct luaL_Reg swig_commands[] = { + { "gcd", _wrap_gcd}, + {0,0} +}; + +static swig_lua_var_info swig_variables[] = { + { "Foo", _wrap_Foo_get, _wrap_Foo_set }, + {0,0,0} +}; + +static swig_lua_const_info swig_constants[] = { + {0,0,0,0,0,0} +}; + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + + +static swig_type_info *swig_type_initial[] = { + NULL +}; + + +static swig_cast_info *swig_cast_initial[] = { + NULL +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found, init; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + init = 1; + } else { + init = 0; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* When multiple interpreters are used, a module could have already been initialized in + a different interpreter, but not yet have a pointer in this interpreter. + In this case, we do not want to continue adding types... everything should be + set up already */ + if (init == 0) return; + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ /* c-mode */ +#endif +} +#endif + + + +/* Forward declaration of where the user's %init{} gets inserted */ +void SWIG_init_user(lua_State* L ); + +#ifdef __cplusplus +extern "C" { +#endif +/* this is the initialization function + added at the very end of the code + the function is always called SWIG_init, but an earlier #define will rename it +*/ +#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)) +LUALIB_API int SWIG_init(lua_State* L) +#else +SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */ +#endif +{ +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */ + int i; + /* start with global table */ + lua_pushglobaltable (L); + /* SWIG's internal initalisation */ + SWIG_InitializeModule((void*)L); + SWIG_PropagateClientData(); +#endif + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) + /* add a global fn */ + SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type); + SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal); + /* begin the module (its a table with the same name as the module) */ + SWIG_Lua_module_begin(L,SWIG_name); + /* add commands/functions */ + for (i = 0; swig_commands[i].name; i++){ + SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func); + } + /* add variables */ + for (i = 0; swig_variables[i].name; i++){ + SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set); + } +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* set up base class pointers (the hierarchy) */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } + /* additional registration structs & classes in lua */ + for (i = 0; swig_types[i]; i++){ + if (swig_types[i]->clientdata){ + SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata)); + } + } +#endif + +#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) + /* constants */ + SWIG_Lua_InstallConstants(L,swig_constants); +#endif + +#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) + /* invoke user-specific initialization */ + SWIG_init_user(L); + /* end module */ + /* Note: We do not clean up the stack here (Lua will do this for us). At this + point, we have the globals table and out module table on the stack. Returning + one value makes the module table the result of the require command. */ + return 1; +#else + return 0; +#endif +} + +#ifdef __cplusplus +} +#endif + + +const char* SWIG_LUACODE= + ""; + +void SWIG_init_user(lua_State* L) +{ + /* exec Lua code if applicable */ + SWIG_Lua_dostring(L,SWIG_LUACODE); +} + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/preinst-swig.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/preinst-swig.in Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,7 @@ +#!/bin/sh +builddir=`dirname $0` +srcdir=`cd "$builddir" && cd '@srcdir@' && pwd` +SWIG_LIB=$srcdir/Lib +#SWIG_LIB=`cygpath -w $srcdir/Lib` # For native Windows version of SWIG +export SWIG_LIB +exec "$builddir/swig" $* diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/swig test.bat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/swig test.bat Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2 @@ +swig -c++ -lua example.i +pause \ No newline at end of file diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/swig.exe Binary file lib/swig/swigwin-2.0.11/swig.exe has changed diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/swig.spec.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/swig.spec.in Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,70 @@ +# You can build the package from Git using something like: +# tar -czf swig-@PACKAGE_VERSION@.tar.gz swig-@PACKAGE_VERSION@ && rpmbuild -tb swig-@PACKAGE_VERSION@.tar.gz +# @configure_input@ + +%define ver @PACKAGE_VERSION@ +%define rel 1 +%define prefix /usr +%define home_page http://www.swig.org +%define docprefix %{prefix}/share + +###################################################################### +# Usually, nothing needs to be changed below here between releases +###################################################################### +Summary: Simplified Wrapper and Interface Generator +Name: swig +Version: %{ver} +Release: %{rel} +URL: %{home_page} +Source0: %{name}-%{version}.tar.gz +License: BSD +Group: Development/Tools +BuildRoot: %{_tmppath}/%{name}-root + +%description +SWIG is a software development tool that connects programs written in C and C++ +with a variety of high-level programming languages. SWIG is primarily used with +common scripting languages such as Perl, Python, Tcl/Tk, and Ruby, however the +list of supported languages also includes non-scripting languages such as Java, +OCAML and C#. Also several interpreted and compiled Scheme implementations +(Guile, MzScheme, Chicken) are supported. SWIG is most commonly used to create +high-level interpreted or compiled programming environments, user interfaces, +and as a tool for testing and prototyping C/C++ software. SWIG can also export +its parse tree in the form of XML and Lisp s-expressions. + +%prep +%setup -q -n %{name}-%{version} + +%build +# so we can build package from Git source too +[ ! -r configure ] && ./autogen.sh +%configure +make + +%install +rm -rf ${RPM_BUILD_ROOT} +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(-,root,root) +%doc ANNOUNCE CHANGES INSTALL LICENSE LICENSE-GPL LICENSE-UNIVERSITIES README RELEASENOTES +%doc Doc/* +%{_bindir}/* +%{prefix}/share/* + +%changelog +* Thu Sep 16 2004 Marcelo Matus <mmatus@acms.arizona.edu> +- Small fixes needed after removing the runtime package +* Tue Jul 20 2004 William Fulton <wsf@fultondesigns.co.uk> +- Update for SWIG-1.3.22 - Removed runtime package +* Wed Mar 03 2004 Robert H De Vries +- Update to work with Fedora Core 1 rpm 4.2.1 +* Wed Jul 24 2002 Sam Liddicott <sam@liddicott.com> +- Added runtime package of runtime libs +* Mon Sep 10 2001 Tony Seward <anthony.seward@ieee.org> +- Merge Red Hat's and Dustin Mitchell's .spec files. +- Install all of the examples in the documentation directory. +- Auto create the list of installed files. diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/aaareadme.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/aaareadme.txt Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,18 @@ +Port on OpenVMS 7.3 using CC 6.5 and CXX 6.5 + + +Building procedure: +$ @logicals +$ @build_all + +the logicals swig_root is defined by the procedure logicals.com. +The logicals.com procedure can be invoke with an optional argument +for the define command, for example: +$ @logicals "/system/exec" + + +genbuild.py is the python program use to generate all the procedures in the +[vms.scripts] directory. + + +jf.pieronne@laposte.net diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/build_end.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/build_end.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,21 @@ +$ set def swig_root:[vms] +$ +$ file = f$search("swig_root:[vms.o_alpha]*.obj") +$ newobj = 0 +$ if file .nes. "" +$ then +$ v = f$verify(1) +$ library/replace swig_root:[vms.o_alpha]swig.olb swig_root:[vms.o_alpha]*.obj +$ delete swig_root:[vms.o_alpha]*.obj;* +$ v = f$verify(v) +$ newobj = 1 +$ endif +$ file = f$search("swig_root:[vms]swig.exe") +$ if file .eqs. "" .or. newobj +$ then +$ v = f$verify(1) +$ cxxlink/exe=swig_root:[vms]swig.exe - + /repo=swig_root:[source.modules1_1.cxx_repository] - + swig_root:[vms.o_alpha]swig.olb/include=swigmain +$ v = f$verify(v) +$ endif diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/build_init.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/build_init.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,13 @@ +$ set def swig_root:[vms] +$ +$ swiglib = "swig_root:[vms.o_alpha]swig.olb +$ +$ if (f$search("swig_root:[vms]o_alpha.dir") .eqs. "") then $ - + create/dir swig_root:[vms.o_alpha] +$ +$ copy swigconfig.h [-.source.include] +$ copy swigver.h [-.source.include] +$ +$ if (f$search("''swiglib'") .eqs. "") then $ - + library/create/object 'swiglib' +$ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/build_swig.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/build_swig.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,1 @@ +$ @swig_root:[vms.scripts]build_all diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/genbuild.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/genbuild.py Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,155 @@ +import os.path, string, posix, pyvms +# +# + +IDIR = ['swig_root:[source.swig]', 'swig_root:[source.doh.include]', + 'swig_root:[source.include]', 'swig_root:[source.preprocessor]'] + +def new_file(fg, dirname): + global IDIR + fn = 'swig_root:[vms.scripts]compil_' + os.path.basename(dirname) + '.com' + print >> fg, '$ @' + fn + f = open(fn, 'w') + print >> f, '$!' + print >> f, '$! Generated by genbuild.py' + print >> f, '$!' + print >> f, '$ libname = "swig_root:[vms.o_alpha]swig.olb"' + print >> f, '$' + print >> f, '$ set default', pyvms.crtl_to_vms(dirname)[0][0] + print >> f, '$' + print >> f, "$ idir := ", IDIR[0] + for i in range(1, len(IDIR)): + print >> f, '$ idir = idir + ",' + IDIR[i] + '"' + print >> f, '$' + print >> f, "$ iflags = \"/include=(''idir', sys$disk:[])\"" + print >> f, '$ oflags = \"/object=swig_root:[vms.o_alpha]' + print >> f, "$ cflags = \"''oflags'''iflags'''dflags'\"" + print >> f, "$ cxxflags = \"''oflags'''iflags'''dflags'\"" + print >> f, '$' + return f + + +def end_file(f): + print >>f,"""$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 = Source file +$! P4 - P8 What it depends on +$ +$ modname = f$parse(p3,,,"name") +$ set noon +$ set message/nofacility/noident/noseverity/notext +$ libr/lis=swig_root:[vms]swiglib.tmp/full/width=132/only='modname' 'libname' +$ set message/facility/ident/severity/text +$ on error then exit +$ open/read swigtmp swig_root:[vms]swiglib.tmp +$! skip header +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$! +$ +$ read/end=module_not_found swigtmp r +$ modfound = 1 +$ Time = f$cvtime(f$extract(49, 20, r)) +$ goto end_search_module +$ module_not_found: +$ modfound = 0 +$ +$ end_search_module: +$ close swigtmp +$ delete swig_root:[vms]swiglib.tmp;* +$ +$ if modfound .eq. 0 then $ goto Makeit +$ +$! Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(1) +$ 'P2' 'P3' +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE""" + + +def listRep(args, dirname, filenames): + fg = args[0] + first = 1 + for fn in filenames: + if fn[-2:] == '.c': + if first: + first = 0 + fc = new_file(fg, dirname) + + cstr = "\"cc ''cflags'\" " + line = "$ call make swig_root:[vms.o_alpha]" + line += fn[:-1] + 'obj -' + print >> fc, line + line = "\t" + cstr + fn + print >> fc, line + elif fn[-4:] == '.cxx': + if first: + first = 0 + fc = new_file(fg, dirname) + + cstr = "\"cxx ''cxxflags'\" " + line = "$ call make swig_root:[vms.o_alpha]" + line += fn[:-3] + 'obj -' + print >> fc, line + line = "\t" + cstr + fn + print >> fc, line + if first == 0: + end_file(fc) + fc.close() +# +def genbuild(f, dir): + os.path.walk(dir, listRep, (f,)) + cmd = 'set default swig_root:[vms]' +# +f = open('swig_root:[vms.scripts]build_all.com','w') +print >> f, '$!' +print >> f, '$! Generated by genbuild.py' +print >> f, '$!' +print >> f, '$ set default swig_root:[vms]' +print >> f, '$' +print >> f, '$ @swig_root:[vms]build_init' +# +genbuild(f, '/swig_root/source') +print >> f, '$' +print >> f, '$ set default swig_root:[vms]' +print >> f, '$' +print >> f, '$ @swig_root:[vms]build_end' +f.close diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/logicals.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/logicals.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,18 @@ +$! +$! +$! +$ proc = f$environment("PROCEDURE") +$ proc = f$parse(proc,"sys$disk:[]",,,"NO_CONCEAL") +$ cur_dev = f$parse(proc,,,"DEVICE","SYNTAX_ONLY") +$ cur_dir = f$parse(proc,,,"DIRECTORY","SYNTAX_ONLY") +$ cur_dir = f$extract(1,f$length(cur_dir)-2,cur_dir) +$ cur_dir = cur_dir - "[" +$ cur_dir = cur_dir - "]" +$ cur_dir = cur_dir - "<" +$ cur_dir = cur_dir - ">" +$ +$! remove trealing .VMS +$ root_dir = f$extract(0,f$length(cur_dir)-4,cur_dir) +$ +$ define 'p1' /trans=concealed swig_root 'cur_dev'['root_dir'.] + diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/scripts/build_all.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/scripts/build_all.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,15 @@ +$! +$! Generated by genbuild.py +$! +$ set default swig_root:[vms] +$ +$ @swig_root:[vms]build_init +$ @swig_root:[vms.scripts]compil_cparse.com +$ @swig_root:[vms.scripts]compil_doh.com +$ @swig_root:[vms.scripts]compil_modules1_1.com +$ @swig_root:[vms.scripts]compil_preprocessor.com +$ @swig_root:[vms.scripts]compil_swig.com +$ +$ set default swig_root:[vms] +$ +$ @swig_root:[vms]build_end diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/scripts/compil_cparse.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/scripts/compil_cparse.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,98 @@ +$! +$! Generated by genbuild.py +$! +$ libname = "swig_root:[vms.o_alpha]swig.olb" +$ +$ set default SWIG_ROOT:[SOURCE.CPARSE] +$ +$ idir := swig_root:[source.swig] +$ idir = idir + ",swig_root:[source.doh.include]" +$ idir = idir + ",swig_root:[source.include]" +$ idir = idir + ",swig_root:[source.preprocessor]" +$ +$ iflags = "/include=(''idir', sys$disk:[])" +$ oflags = "/object=swig_root:[vms.o_alpha] +$ cflags = "''oflags'''iflags'''dflags'" +$ cxxflags = "''oflags'''iflags'''dflags'" +$ +$ call make swig_root:[vms.o_alpha]cscanner.obj - + "cc ''cflags'" cscanner.c +$ call make swig_root:[vms.o_alpha]parser.obj - + "cc ''cflags'" parser.c +$ call make swig_root:[vms.o_alpha]templ.obj - + "cc ''cflags'" templ.c +$ call make swig_root:[vms.o_alpha]util.obj - + "cc ''cflags'" util.c +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 = Source file +$! P4 - P8 What it depends on +$ +$ modname = f$parse(p3,,,"name") +$ set noon +$ set message/nofacility/noident/noseverity/notext +$ libr/lis=swig_root:[vms]swiglib.tmp/full/width=132/only='modname' 'libname' +$ set message/facility/ident/severity/text +$ on error then exit +$ open/read swigtmp swig_root:[vms]swiglib.tmp +$! skip header +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$! +$ +$ read/end=module_not_found swigtmp r +$ modfound = 1 +$ Time = f$cvtime(f$extract(49, 20, r)) +$ goto end_search_module +$ module_not_found: +$ modfound = 0 +$ +$ end_search_module: +$ close swigtmp +$ delete swig_root:[vms]swiglib.tmp;* +$ +$ if modfound .eq. 0 then $ goto Makeit +$ +$! Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(1) +$ 'P2' 'P3' +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/scripts/compil_doh.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/scripts/compil_doh.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,106 @@ +$! +$! Generated by genbuild.py +$! +$ libname = "swig_root:[vms.o_alpha]swig.olb" +$ +$ set default SWIG_ROOT:[SOURCE.DOH.DOH] +$ +$ idir := swig_root:[source.swig] +$ idir = idir + ",swig_root:[source.doh.include]" +$ idir = idir + ",swig_root:[source.include]" +$ idir = idir + ",swig_root:[source.preprocessor]" +$ +$ iflags = "/include=(''idir', sys$disk:[])" +$ oflags = "/object=swig_root:[vms.o_alpha] +$ cflags = "''oflags'''iflags'''dflags'" +$ cxxflags = "''oflags'''iflags'''dflags'" +$ +$ call make swig_root:[vms.o_alpha]base.obj - + "cc ''cflags'" base.c +$ call make swig_root:[vms.o_alpha]file.obj - + "cc ''cflags'" file.c +$ call make swig_root:[vms.o_alpha]fio.obj - + "cc ''cflags'" fio.c +$ call make swig_root:[vms.o_alpha]hash.obj - + "cc ''cflags'" hash.c +$ call make swig_root:[vms.o_alpha]list.obj - + "cc ''cflags'" list.c +$ call make swig_root:[vms.o_alpha]memory.obj - + "cc ''cflags'" memory.c +$ call make swig_root:[vms.o_alpha]string.obj - + "cc ''cflags'" string.c +$ call make swig_root:[vms.o_alpha]void.obj - + "cc ''cflags'" void.c +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 = Source file +$! P4 - P8 What it depends on +$ +$ modname = f$parse(p3,,,"name") +$ set noon +$ set message/nofacility/noident/noseverity/notext +$ libr/lis=swig_root:[vms]swiglib.tmp/full/width=132/only='modname' 'libname' +$ set message/facility/ident/severity/text +$ on error then exit +$ open/read swigtmp swig_root:[vms]swiglib.tmp +$! skip header +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$! +$ +$ read/end=module_not_found swigtmp r +$ modfound = 1 +$ Time = f$cvtime(f$extract(49, 20, r)) +$ goto end_search_module +$ module_not_found: +$ modfound = 0 +$ +$ end_search_module: +$ close swigtmp +$ delete swig_root:[vms]swiglib.tmp;* +$ +$ if modfound .eq. 0 then $ goto Makeit +$ +$! Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(1) +$ 'P2' 'P3' +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/scripts/compil_modules1_1.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/scripts/compil_modules1_1.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,132 @@ +$! +$! Generated by genbuild.py +$! +$ libname = "swig_root:[vms.o_alpha]swig.olb" +$ +$ set default SWIG_ROOT:[SOURCE.MODULES1_1] +$ +$ idir := swig_root:[source.swig] +$ idir = idir + ",swig_root:[source.doh.include]" +$ idir = idir + ",swig_root:[source.include]" +$ idir = idir + ",swig_root:[source.preprocessor]" +$ +$ iflags = "/include=(''idir', sys$disk:[])" +$ oflags = "/object=swig_root:[vms.o_alpha] +$ cflags = "''oflags'''iflags'''dflags'" +$ cxxflags = "''oflags'''iflags'''dflags'" +$ +$ call make swig_root:[vms.o_alpha]allocate.obj - + "cxx ''cxxflags'" allocate.cxx +$ call make swig_root:[vms.o_alpha]browser.obj - + "cxx ''cxxflags'" browser.cxx +$ call make swig_root:[vms.o_alpha]contract.obj - + "cxx ''cxxflags'" contract.cxx +$ call make swig_root:[vms.o_alpha]emit.obj - + "cxx ''cxxflags'" emit.cxx +$ call make swig_root:[vms.o_alpha]guile.obj - + "cxx ''cxxflags'" guile.cxx +$ call make swig_root:[vms.o_alpha]java.obj - + "cxx ''cxxflags'" java.cxx +$ call make swig_root:[vms.o_alpha]lang.obj - + "cxx ''cxxflags'" lang.cxx +$ call make swig_root:[vms.o_alpha]main.obj - + "cxx ''cxxflags'" main.cxx +$ call make swig_root:[vms.o_alpha]module.obj - + "cxx ''cxxflags'" module.cxx +$ call make swig_root:[vms.o_alpha]mzscheme.obj - + "cxx ''cxxflags'" mzscheme.cxx +$ call make swig_root:[vms.o_alpha]ocaml.obj - + "cxx ''cxxflags'" ocaml.cxx +$ call make swig_root:[vms.o_alpha]overload.obj - + "cxx ''cxxflags'" overload.cxx +$ call make swig_root:[vms.o_alpha]perl5.obj - + "cxx ''cxxflags'" perl5.cxx +$ call make swig_root:[vms.o_alpha]php4.obj - + "cxx ''cxxflags'" php4.cxx +$ call make swig_root:[vms.o_alpha]pike.obj - + "cxx ''cxxflags'" pike.cxx +$ call make swig_root:[vms.o_alpha]python.obj - + "cxx ''cxxflags'" python.cxx +$ call make swig_root:[vms.o_alpha]ruby.obj - + "cxx ''cxxflags'" ruby.cxx +$ call make swig_root:[vms.o_alpha]swigmain.obj - + "cxx ''cxxflags'" swigmain.cxx +$ call make swig_root:[vms.o_alpha]tcl8.obj - + "cxx ''cxxflags'" tcl8.cxx +$ call make swig_root:[vms.o_alpha]typepass.obj - + "cxx ''cxxflags'" typepass.cxx +$ call make swig_root:[vms.o_alpha]xml.obj - + "cxx ''cxxflags'" xml.cxx +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 = Source file +$! P4 - P8 What it depends on +$ +$ modname = f$parse(p3,,,"name") +$ set noon +$ set message/nofacility/noident/noseverity/notext +$ libr/lis=swig_root:[vms]swiglib.tmp/full/width=132/only='modname' 'libname' +$ set message/facility/ident/severity/text +$ on error then exit +$ open/read swigtmp swig_root:[vms]swiglib.tmp +$! skip header +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$! +$ +$ read/end=module_not_found swigtmp r +$ modfound = 1 +$ Time = f$cvtime(f$extract(49, 20, r)) +$ goto end_search_module +$ module_not_found: +$ modfound = 0 +$ +$ end_search_module: +$ close swigtmp +$ delete swig_root:[vms]swiglib.tmp;* +$ +$ if modfound .eq. 0 then $ goto Makeit +$ +$! Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(1) +$ 'P2' 'P3' +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/scripts/compil_preprocessor.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/scripts/compil_preprocessor.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,94 @@ +$! +$! Generated by genbuild.py +$! +$ libname = "swig_root:[vms.o_alpha]swig.olb" +$ +$ set default SWIG_ROOT:[SOURCE.PREPROCESSOR] +$ +$ idir := swig_root:[source.swig] +$ idir = idir + ",swig_root:[source.doh.include]" +$ idir = idir + ",swig_root:[source.include]" +$ idir = idir + ",swig_root:[source.preprocessor]" +$ +$ iflags = "/include=(''idir', sys$disk:[])" +$ oflags = "/object=swig_root:[vms.o_alpha] +$ cflags = "''oflags'''iflags'''dflags'" +$ cxxflags = "''oflags'''iflags'''dflags'" +$ +$ call make swig_root:[vms.o_alpha]cpp.obj - + "cc ''cflags'" cpp.c +$ call make swig_root:[vms.o_alpha]expr.obj - + "cc ''cflags'" expr.c +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 = Source file +$! P4 - P8 What it depends on +$ +$ modname = f$parse(p3,,,"name") +$ set noon +$ set message/nofacility/noident/noseverity/notext +$ libr/lis=swig_root:[vms]swiglib.tmp/full/width=132/only='modname' 'libname' +$ set message/facility/ident/severity/text +$ on error then exit +$ open/read swigtmp swig_root:[vms]swiglib.tmp +$! skip header +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$! +$ +$ read/end=module_not_found swigtmp r +$ modfound = 1 +$ Time = f$cvtime(f$extract(49, 20, r)) +$ goto end_search_module +$ module_not_found: +$ modfound = 0 +$ +$ end_search_module: +$ close swigtmp +$ delete swig_root:[vms]swiglib.tmp;* +$ +$ if modfound .eq. 0 then $ goto Makeit +$ +$! Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(1) +$ 'P2' 'P3' +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/scripts/compil_swig.com --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/scripts/compil_swig.com Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,122 @@ +$! +$! Generated by genbuild.py +$! +$ libname = "swig_root:[vms.o_alpha]swig.olb" +$ +$ set default SWIG_ROOT:[SOURCE.SWIG] +$ +$ idir := swig_root:[source.swig] +$ idir = idir + ",swig_root:[source.doh.include]" +$ idir = idir + ",swig_root:[source.include]" +$ idir = idir + ",swig_root:[source.preprocessor]" +$ +$ iflags = "/include=(''idir', sys$disk:[])" +$ oflags = "/object=swig_root:[vms.o_alpha] +$ cflags = "''oflags'''iflags'''dflags'" +$ cxxflags = "''oflags'''iflags'''dflags'" +$ +$ call make swig_root:[vms.o_alpha]cwrap.obj - + "cc ''cflags'" cwrap.c +$ call make swig_root:[vms.o_alpha]error.obj - + "cc ''cflags'" error.c +$ call make swig_root:[vms.o_alpha]fragment.obj - + "cc ''cflags'" fragment.c +$ call make swig_root:[vms.o_alpha]getopt.obj - + "cc ''cflags'" getopt.c +$ call make swig_root:[vms.o_alpha]include.obj - + "cc ''cflags'" include.c +$ call make swig_root:[vms.o_alpha]misc.obj - + "cc ''cflags'" misc.c +$ call make swig_root:[vms.o_alpha]naming.obj - + "cc ''cflags'" naming.c +$ call make swig_root:[vms.o_alpha]parms.obj - + "cc ''cflags'" parms.c +$ call make swig_root:[vms.o_alpha]scanner.obj - + "cc ''cflags'" scanner.c +$ call make swig_root:[vms.o_alpha]stype.obj - + "cc ''cflags'" stype.c +$ call make swig_root:[vms.o_alpha]symbol.obj - + "cc ''cflags'" symbol.c +$ call make swig_root:[vms.o_alpha]tree.obj - + "cc ''cflags'" tree.c +$ call make swig_root:[vms.o_alpha]typemap.obj - + "cc ''cflags'" typemap.c +$ call make swig_root:[vms.o_alpha]typesys.obj - + "cc ''cflags'" typesys.c +$ call make swig_root:[vms.o_alpha]warn.obj - + "cc ''cflags'" warn.c +$ call make swig_root:[vms.o_alpha]wrapfunc.obj - + "cc ''cflags'" wrapfunc.c +$ exit +$! +$! +$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES +$ V = 'F$Verify(0) +$! P1 = What we are trying to make +$! P2 = Command to make it +$! P3 = Source file +$! P4 - P8 What it depends on +$ +$ modname = f$parse(p3,,,"name") +$ set noon +$ set message/nofacility/noident/noseverity/notext +$ libr/lis=swig_root:[vms]swiglib.tmp/full/width=132/only='modname' 'libname' +$ set message/facility/ident/severity/text +$ on error then exit +$ open/read swigtmp swig_root:[vms]swiglib.tmp +$! skip header +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$ read swigtmp r +$! +$ +$ read/end=module_not_found swigtmp r +$ modfound = 1 +$ Time = f$cvtime(f$extract(49, 20, r)) +$ goto end_search_module +$ module_not_found: +$ modfound = 0 +$ +$ end_search_module: +$ close swigtmp +$ delete swig_root:[vms]swiglib.tmp;* +$ +$ if modfound .eq. 0 then $ goto Makeit +$ +$! Time = F$CvTime(F$File(P1,"RDT")) +$arg=3 +$Loop: +$ Argument = P'arg +$ If Argument .Eqs. "" Then Goto Exit +$ El=0 +$Loop2: +$ File = F$Element(El," ",Argument) +$ If File .Eqs. " " Then Goto Endl +$ AFile = "" +$Loop3: +$ OFile = AFile +$ AFile = F$Search(File) +$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl +$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit +$ Goto Loop3 +$NextEL: +$ El = El + 1 +$ Goto Loop2 +$EndL: +$ arg=arg+1 +$ If arg .Le. 8 Then Goto Loop +$ Goto Exit +$ +$Makeit: +$ VV=F$VERIFY(1) +$ 'P2' 'P3' +$ VV='F$Verify(VV) +$Exit: +$ If V Then Set Verify +$ENDSUBROUTINE diff -r 1a1c4040bee4 -r 4cae2d58cfb4 lib/swig/swigwin-2.0.11/vms/swigconfig.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/swig/swigwin-2.0.11/vms/swigconfig.h Mon Oct 21 17:24:10 2013 +0600 @@ -0,0 +1,2 @@ + +/* Note that this file has changed. TODO Get the latest from the original version. */ diff -r 1a1c4040bee4 -r 4cae2d58cfb4 mm7_3.cpp --- a/mm7_3.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/mm7_3.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -1093,7 +1093,7 @@ for ( i = 0; v31 < ai_arrays_size; ++v31 ) { v33 = ai_near_actors_ids[v31]; - if ( v33 != v75 && _46DF1A_collide_against_actor(v33, 40) ) + if ( v33 != v75 && Actor::_46DF1A_collide_against_actor(v33, 40) ) ++i; } v71 = i > 1; @@ -1833,7 +1833,7 @@ _46E44E_collide_against_faces_and_portals(1u); _46E0B2_collide_against_decorations(); for ( v80 = 0; v80 < (signed int)uNumActors; ++v80 ) - _46DF1A_collide_against_actor(v80, 0); + Actor::_46DF1A_collide_against_actor(v80, 0); if ( _46F04E_collide_against_portals() ) break; ++v73; @@ -2685,7 +2685,7 @@ _46E26D_collide_against_sprites(v38, v37); _46ED8A_collide_against_sprite_objects(4u); for ( i = 0; i < (signed int)uNumActors; ++i ) - _46DF1A_collide_against_actor(i, 0); + Actor::_46DF1A_collide_against_actor(i, 0); if ( stru_721530.field_7C >= stru_721530.field_6C ) { _angle_x = stru_721530.normal2.x; diff -r 1a1c4040bee4 -r 4cae2d58cfb4 mm7_6.cpp --- a/mm7_6.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/mm7_6.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -399,7 +399,7 @@ if ( pActor->pMonsterInfo.uSpecialAbilityType == 2 && pActor->pMonsterInfo.uSpecialAbilityDamageDiceBonus < 3u && rand() % 100 < 5 ) - pActor->_44FD29(a2); + pActor->SummonMinion(a2); v4 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell1ID); v5 = v3->_427102(pActor, pActor->pMonsterInfo.uSpell2ID); if ( v4 && pActor->pMonsterInfo.uSpell1UseChance && rand() % 100 < pActor->pMonsterInfo.uSpell1UseChance ) diff -r 1a1c4040bee4 -r 4cae2d58cfb4 mm7_data.cpp --- a/mm7_data.cpp Mon Oct 21 17:23:59 2013 +0600 +++ b/mm7_data.cpp Mon Oct 21 17:24:10 2013 +0600 @@ -348,7 +348,6 @@ int (__stdcall *off_4DAFDC)(char); // weak char asc_4DB724[777]; // idb int dword_4DBD94; // weak -std::array<int, 5> dword_4DF380 = {{0,1024,2560,5120,10240}}; // weak //int dword_4DF390; // weak char Str2[777]; // idb diff -r 1a1c4040bee4 -r 4cae2d58cfb4 mm7_data.h --- a/mm7_data.h Mon Oct 21 17:23:59 2013 +0600 +++ b/mm7_data.h Mon Oct 21 17:24:10 2013 +0600 @@ -307,7 +307,6 @@ extern int (__stdcall *off_4DAFDC)(char); // weak extern char asc_4DB724[]; // idb extern int dword_4DBD94; // weak -extern std::array<int, 5> dword_4DF380; // weak extern int dword_4DF390; // weak extern char Str2[]; // idb @@ -1283,7 +1282,6 @@ int __fastcall sub_46D8E3(int a1, signed int a2, int a3, int a4); void ODM_GetTerrainNormalAt(int pos_x, int pos_z, Vec3_int_ *out); unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID); -int __fastcall _46DF1A_collide_against_actor(int, int); // weak void _46E0B2_collide_against_decorations(); void __fastcall _46E26D_collide_against_sprites(signed int a1, signed int a2); int _46E44E_collide_against_faces_and_portals(unsigned int b1); // idb