From stefan at fresco.org Thu May 1 03:55:56 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] Fresco/Berlin/include/Berlin/nurbs nurbs.hh,1.2,1.3 Message-ID: Update of /cvs/fresco/Fresco/Berlin/include/Berlin/nurbs In directory purcel:/tmp/cvs-serv8994 Modified Files: nurbs.hh Log Message: some refinements Index: nurbs.hh =================================================================== RCS file: /cvs/fresco/Fresco/Berlin/include/Berlin/nurbs/nurbs.hh,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- nurbs.hh 25 Apr 2003 18:41:13 -0000 1.2 +++ nurbs.hh 1 May 2003 03:55:54 -0000 1.3 @@ -26,7 +26,6 @@ #include #include #include -#include namespace Berlin { @@ -111,17 +110,16 @@ } template -Weighted eval_at(const domain &ctrls, - const domain weights, - const array °rees, - const array, P> &knots, - const array &steps, - array params, - array idxs, - size_t r) +Weighted evaluate_at(const domain &ctrls, + const domain weights, + const array °rees, + const array, P> &knots, + array params, + array idxs, + size_t r) { Weighted sum; - sum.numerator = 0.; + assign(sum.numerator, 0.); sum.denominator = 0.; if(r > 1) @@ -132,8 +130,8 @@ params[r - 1], knots[r - 1]); if(basis != 0.) { - Weighted point = eval_at(ctrls, weights, degrees, knots, steps, - params, idxs, r - 1); + Weighted point = evaluate_at(ctrls, weights, degrees, knots, + params, idxs, r - 1); sum.numerator += point.numerator * basis; sum.denominator += point.denominator * basis; } @@ -156,28 +154,26 @@ } template -T eval_at(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps, - const array ¶ms) +T evaluate_at(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> &knots, + const array ¶ms) { array idx(0); - Weighted point = eval_at(ctrls, weights, degrees, knots, steps, - params, idx, P); + Weighted point = evaluate_at(ctrls, weights, degrees, knots, params, idx, P); return point.numerator / point.denominator; } template -void eval(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps, - array params, - size_t r, - std::vector &points) +void evaluate(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> &knots, + const array &steps, + array params, + size_t r, + std::vector &points) { size_t step = steps[r - 1]; size_t length = ctrls.size(r - 1) + 1; @@ -214,20 +210,18 @@ for(size_t i = index; i < plength; ++i) { params[r - 1] = pvalues[i]; - if(r == 1) - points.push_back(eval_at(ctrls, weights, degrees, knots, steps, - params)); - else eval(ctrls, weights, degrees, knots, steps, - params, r - 1, points); + if(r == 1) points.push_back(evaluate_at(ctrls, weights, degrees, knots, params)); + else evaluate(ctrls, weights, degrees, knots, steps, params, r - 1, points); } } +//. return a P-dimensional domain of points template -domain *eval(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps) +domain *evaluate(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> &knots, + const array &steps) { std::vector points; array length; @@ -240,81 +234,41 @@ (ctrls.size(i) - degrees[i]) * (steps[i] - 1); } - eval(ctrls, weights, degrees, knots, steps, params, P, points); + evaluate(ctrls, weights, degrees, knots, steps, params, P, points); domain *retn = new domain(length.data()); for(size_t i = 0; i < points.size(); ++i) (*retn)[i] = points[i]; return retn; } +//. return a P-dimensional domain of points +//. assume uniform knots template -array -eval_with_derivations_at(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps, - const array ¶ms) -{ - array idx(0); - array, P + 1> points = eval_with_derivations_at(ctrls, weights, - degrees, knots, steps, - params, idx, P); - T numerator = points[0].numerator; - double denominator = points[0].denominator; - - array derivations; - - for(size_t k = 1; k < P + 1; ++k) - { - derivations[k] = points[k].numerator * denominator; - derivations[k] -= numerator * points[k].denominator; - if(denominator != 0) derivations[k] /= denominator * denominator; - else assign(derivations[k], 0.); - } - - if(denominator != 0) derivations[0] = numerator / denominator; - else assign(derivations[0], 0.); - return derivations; -} - -template -domain, P> * -eval_with_derivations(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps) +domain *evaluate(const domain &ctrls, + const domain &weights, + const array °rees, + const array &steps) { - array length; - array params; - + array, P> knots; for(size_t i = 0; i < P; ++i) { - params[i] = knots[i][0]; - length[i] = ctrls.size(i) - degrees[i] + 1 + - (ctrls.size(i) - degrees[i]) * (steps[i] - 1); + knots[i].resize(ctrls.size(i) + degrees[i] + 1); + double delta = 1. / (ctrls.size(i) + degrees[i]); + for (size_t j = 0; j != ctrls.size(i) + degrees[i] + 1; ++j) + knots[i][j] = j * delta; } - - std::vector > points; - eval_with_derivations(ctrls, weights, degrees, knots, steps, - params, P, points); - - domain, P> *retn = new domain, P>(length.data()); - for(size_t i = 0; i < points.size(); ++i) (*retn)[i] = points[i]; - return retn; + return evaluate(ctrls, weights, degrees, knots, steps); } template array, P + 1> -eval_with_derivations_at(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps, - array params, - array idxs, - size_t r) +evaluate_with_derivations_at(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> &knots, + array params, + array idxs, + size_t r) { array, P + 1> sum; for(size_t i = 0; i < P + 1; ++i) @@ -332,8 +286,8 @@ double basis = basis_function(idxs[r - 1], degrees[r - 1], params[r - 1], knots[r - 1]); if(basis != 0 || derivative != 0) - points = eval_with_derivations_at(ctrls, weights, degrees, knots, steps, - params, idxs, r - 1); + points = evaluate_with_derivations_at(ctrls, weights, degrees, knots, + params, idxs, r - 1); if(basis != 0) { sum[0].numerator += points[0].numerator * basis; @@ -391,14 +345,44 @@ } template -void eval_with_derivations(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> knots, - const array &steps, - array params, - size_t r, - std::vector > &points) +array +evaluate_with_derivations_at(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> &knots, + const array ¶ms) +{ + array idx(0); + array, P + 1> points = evaluate_with_derivations_at(ctrls, weights, + degrees, knots, + params, idx, P); + T numerator = points[0].numerator; + double denominator = points[0].denominator; + + array derivations; + + for(size_t k = 1; k < P + 1; ++k) + { + derivations[k] = points[k].numerator * denominator; + derivations[k] -= numerator * points[k].denominator; + if(denominator != 0) derivations[k] /= denominator * denominator; + else assign(derivations[k], 0.); + } + + if(denominator != 0) derivations[0] = numerator / denominator; + else assign(derivations[0], 0.); + return derivations; +} + +template +void evaluate_with_derivations(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> knots, + const array &steps, + array params, + size_t r, + std::vector > &points) { size_t step = steps[r - 1]; size_t length = ctrls.size(r - 1) + 1; @@ -435,46 +419,44 @@ params[r - 1] = pvalues[i]; if(r == 1) { - points.push_back(eval_with_derivations_at(ctrls, weights, degrees, - knots, steps, params)); + points.push_back(evaluate_with_derivations_at(ctrls, weights, degrees, knots, + params)); } - else eval_with_derivations(ctrls, weights, degrees, knots, steps, - params, r - 1, points); + else evaluate_with_derivations(ctrls, weights, degrees, knots, steps, + params, r - 1, points); } } -//. return a P-dimensional domain of points -//. assume uniform knots +//. return a P-dimensional domain of points arrays +//. each array contains the actual point and the P derivatives template -domain *evaluate(const domain &ctrls, - const domain &weights, - const array °rees, - const array &steps) +domain, P> * +evaluate_with_derivations(const domain &ctrls, + const domain &weights, + const array °rees, + const array, P> &knots, + const array &steps) { - array, P> knots; + array length; + array params; + for(size_t i = 0; i < P; ++i) { - knots[i].resize(ctrls.size(i) + degrees[i] + 1); - double delta = 1. / (ctrls.size(i) + degrees[i]); - for (size_t j = 0; j != ctrls.size(i) + degrees[i] + 1; ++j) - knots[i][j] = j * delta; + params[i] = knots[i][0]; + length[i] = ctrls.size(i) - degrees[i] + 1 + + (ctrls.size(i) - degrees[i]) * (steps[i] - 1); } - return eval(ctrls, weights, degrees, knots, steps); -} + + std::vector > points; + evaluate_with_derivations(ctrls, weights, degrees, knots, steps, params, P, points); -//. return a P-dimensional domain of points -template -domain *evaluate(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps) -{ - return eval(ctrls, weights, degrees, knots, steps); + domain, P> *retn = new domain, P>(length.data()); + for(size_t i = 0; i < points.size(); ++i) (*retn)[i] = points[i]; + return retn; } //. return a P-dimensional domain of points arrays -//. each array contains the actual point and the P derivatives +//. each array contains the actual point and the P derivatives. //. assume uniform knots template domain, P> * @@ -491,20 +473,7 @@ for (size_t j = 0; j != ctrls.size(i) + degrees[i] + 1; ++j) knots[i][j] = j * delta; } - return eval_with_derivations(ctrls, weights, degrees, knots, steps); -} - -//. return a P-dimensional domain of points arrays -//. each array contains the actual point and the P derivatives -template -domain, P> * -evaluate_with_derivations(const domain &ctrls, - const domain &weights, - const array °rees, - const array, P> &knots, - const array &steps) -{ - return eval_with_derivations(ctrls, weights, degrees, knots, steps); + return evaluate_with_derivations(ctrls, weights, degrees, knots, steps); } } From stefan at fresco.org Thu May 1 03:57:30 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] Fresco/Berlin/test/nurbs fresco-curve.cc,1.2,1.3 Message-ID: Update of /cvs/fresco/Fresco/Berlin/test/nurbs In directory purcel:/tmp/cvs-serv9075 Modified Files: fresco-curve.cc Log Message: draw multiple connected segments which are aligned relative to each other Index: fresco-curve.cc =================================================================== RCS file: /cvs/fresco/Fresco/Berlin/test/nurbs/fresco-curve.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- fresco-curve.cc 25 Apr 2003 18:41:14 -0000 1.2 +++ fresco-curve.cc 1 May 2003 03:57:28 -0000 1.3 @@ -33,16 +33,26 @@ #include const unsigned int PARAMS = 1; +const unsigned int DEGREE = 3; const unsigned int CTRLPOINTS = 10; using namespace Fresco; -using namespace Berlin::nurbs; +using Berlin::nurbs; + +typedef _CORBA_Unbounded_Sequence Polyline; +struct Nurbs +{ + CORBA::UShort degree; + _CORBA_Unbounded_Sequence controls; + _CORBA_Unbounded_Sequence_w_FixSizeElement weights; + _CORBA_Unbounded_Sequence_w_FixSizeElement knots; +}; typedef Vertex Vector; -typedef domain Ctrl; -typedef domain, PARAMS> Points; -typedef domain Weights; +typedef nurbs::domain Ctrl; +typedef nurbs::domain Points; +typedef nurbs::domain Weights; bool animationFlag = false; // 'a' bool drawingPointsFlag = true; // 'p' @@ -50,8 +60,8 @@ bool drawingCtrlPointsFlag = true; // 'c' bool drawingDerivativesFlag = false; // 'd' -Ctrl *ctrls; -Points *points; +Ctrl *ctrls[4]; +Points *points[4]; void polar_view(GLdouble twist, GLdouble elevation, GLdouble azimuth) { @@ -92,6 +102,7 @@ void display() { + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if(animationFlag) { @@ -100,64 +111,87 @@ glRotatef(1.0, 1.0, 0.0, 0.0); } - if(drawingCtrlPointsFlag) - { - glColor3f(0.2, 0.8, 0.2); - for(size_t i = 0; i < ctrls->length(); ++i) - { - const Vertex &p = (*ctrls)[i]; - glPushMatrix(); - glTranslatef(p.x, p.y, p.z); - glutSolidSphere(0.1, 6, 6); - glPopMatrix(); - } - } - if(drawingQuadsFlag) { glColor3f(0.8, 0.2, 0.2); - glBegin(GL_LINE_STRIP); - for(size_t i = 0; i < points->size(0); ++i) + for(size_t j = 0; j < 4; ++j) { - glVertex3f((*points)(Points::index[i])[0].x, - (*points)(Points::index[i])[0].y, - (*points)(Points::index[i])[0].z); + glBegin(GL_LINE_STRIP); + for(size_t i = 0; i < points[j]->size(0); ++i) + { + glVertex3f((*points[j])(Points::index[i]).x, + (*points[j])(Points::index[i]).y, + (*points[j])(Points::index[i]).z); + } + glEnd(); } - glEnd(); } if(drawingPointsFlag) { glColor3f(0.8, 0.4, 0.2); glBegin(GL_POINTS); - for(size_t i = 0; i < points->length(); ++i) + for(size_t i = 0; i < points[0]->length(); ++i) { - glVertex3f((*points)[i][0].x, - (*points)[i][0].y, - (*points)[i][0].z); + glVertex3f((*points[0])[i].x, + (*points[0])[i].y, + (*points[0])[i].z); + } + for(size_t i = 0; i < points[1]->length(); ++i) + { + glVertex3f((*points[1])[i].x, + (*points[1])[i].y, + (*points[1])[i].z); + } + for(size_t i = 0; i < points[2]->length(); ++i) + { + glVertex3f((*points[2])[i].x, + (*points[2])[i].y, + (*points[2])[i].z); + } + for(size_t i = 0; i < points[3]->length(); ++i) + { + glVertex3f((*points[3])[i].x, + (*points[3])[i].y, + (*points[3])[i].z); } glEnd(); } - if(drawingDerivativesFlag) - { - for(size_t i = 0; i < points->length(); ++i) - { - Vertex p = (*points)[i][0]; - for(size_t j = 1; j < PARAMS + 1; ++j) - { - Vector deriv = (*points)[i][j]; - deriv /= 2 * norm(deriv); +// if(drawingDerivativesFlag) +// { +// for(size_t i = 0; i < points->length(); ++i) +// { +// Vertex p = (*points)[i][0]; +// for(size_t j = 1; j < PARAMS + 1; ++j) +// { +// Vector deriv = (*points)[i][j]; +// deriv /= 2 * norm(deriv); - glBegin(GL_LINE_STRIP); - glColor3f(0.8, 0.8, 0.8); - glVertex3f(p.x, p.y, p.z); - glColor3f(0.8, 0.2, 0.2); - glVertex3f(p.x + deriv.x, p.y + deriv.y, p.z + deriv.z); - glEnd(); - } - } +// glBegin(GL_LINE_STRIP); +// glColor3f(0.8, 0.8, 0.8); +// glVertex3f(p.x, p.y, p.z); +// glColor3f(0.8, 0.2, 0.2); +// glVertex3f(p.x + deriv.x, p.y + deriv.y, p.z + deriv.z); +// glEnd(); +// } +// } +// } + + if(drawingCtrlPointsFlag) + { + glColor3f(0.2, 0.8, 0.2); + for (size_t j = 0; j != 4; ++j) + for(size_t i = 0; i < (*ctrls[j]).length(); ++i) + { + const Vertex &p = (*ctrls[j])[i]; + glPushMatrix(); + glTranslatef(p.x, p.y, p.z); + glutSolidSphere(0.1, 6, 6); + glPopMatrix(); + } } + glutSwapBuffers(); } @@ -173,7 +207,7 @@ glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(40., static_cast(w)/static_cast(h), 1, 1000); - gluLookAt(0, 0, 20, 0, 0, 0, 0, 1, 0); + gluLookAt(0, 0, 40, 0, 0, 0, 0, 1, 0); glViewport(0, 0, static_cast(w), static_cast(h)); glMatrixMode(GL_MODELVIEW); } @@ -213,23 +247,184 @@ } int main(int argc, char *argv[]) -{ - ctrls = new Ctrl(Ctrl::index[CTRLPOINTS]); - Weights weights(Weights::index[CTRLPOINTS]); - srand(time(0)); - for(size_t i = 0; i < CTRLPOINTS; ++i) +{ + // define first segment + Polyline polyline1; { - (*ctrls)[i] = make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., - static_cast(rand() % 500) / 100. -1., - 0.); - weights[i] = 1.0; + polyline1.length(4); + polyline1[0].x = 0.; + polyline1[0].y = 0.; + polyline1[0].z = 0.; + polyline1[1].x = 1.; + polyline1[1].y = 1.; + polyline1[1].z = 0.; + polyline1[2].x = 2.; + polyline1[2].y = 0.; + polyline1[2].z = 0.; + polyline1[3].x = 3.; + polyline1[3].y = 2.; + polyline1[3].z = 1.; } - array degrees(3); - array steps(4); + // define second segment + Nurbs nurbs1; + { + nurbs1.degree = DEGREE; + nurbs1.controls.length(CTRLPOINTS); + nurbs1.weights.length(CTRLPOINTS); + srand(time(0)); + for(size_t i = 0; i < CTRLPOINTS; ++i) + { + nurbs1.controls[i] = nurbs::make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., + static_cast(rand() % 500) / 100. -1., + 0.); + nurbs1.weights[i] = 1.0; + } + nurbs1.knots.length(CTRLPOINTS + DEGREE + 1); + double delta = 1. / (CTRLPOINTS + DEGREE); + for (size_t i = 0; i != nurbs1.knots.length(); ++i) nurbs1.knots[i] = i * delta; + } + // define third segment + Polyline polyline2; + { + polyline2.length(4); + polyline2[0].x = 0.; + polyline2[0].y = 0.; + polyline2[0].z = 0.; + polyline2[1].x = 1.; + polyline2[1].y = 1.; + polyline2[1].z = 0.; + polyline2[2].x = 2.; + polyline2[2].y = 0.; + polyline2[2].z = 0.; + polyline2[3].x = 3.; + polyline2[3].y = 2.; + polyline2[3].z = 1.; + } + // define forth segment + Nurbs nurbs2; + { + nurbs2.degree = DEGREE; + nurbs2.controls.length(CTRLPOINTS); + nurbs2.weights.length(CTRLPOINTS); + srand(time(0)); + for(size_t i = 0; i < CTRLPOINTS; ++i) + { + nurbs2.controls[i] = nurbs::make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., + static_cast(rand() % 500) / 100. -1., + 0.); + nurbs2.weights[i] = 1.0; + } + nurbs2.knots.length(CTRLPOINTS + DEGREE + 1); + double delta = 1. / (CTRLPOINTS + DEGREE); + for (size_t i = 0; i != nurbs2.knots.length(); ++i) nurbs2.knots[i] = i * delta; + } + + nurbs::array steps(4); + + // evaluation... + { + size_t length = polyline1.length(); + points[0] = new Points(&length); + for (size_t i = 0; i != 4; ++i) (*points[0])[i] = polyline1[i]; + ctrls[0] = new Ctrl(&length); + for (size_t i = 0; i != 4; ++i) (*ctrls[0])[i] = polyline1[i]; + } + { + size_t length = nurbs1.controls.length(); + ctrls[1] = new Ctrl(&length); + for (size_t i = 0; i != length; ++i) + (*ctrls[1])[i] = nurbs1.controls[i]; + length = nurbs1.weights.length(); + nurbs::domain weights(&length); + for (size_t i = 0; i != nurbs1.weights.length(); ++i) + weights[i] = nurbs1.weights[i]; + nurbs::array degrees(nurbs1.degree); + nurbs::array, PARAMS> knots; + knots[0].resize(nurbs1.knots.length()); + for (size_t i = 0; i != knots[0].size(); ++i) + knots[0][i] = nurbs1.knots[i]; + + // compute the first point of this segment + nurbs::array param(knots[0][DEGREE]); + Vertex first = nurbs::evaluate_at(*ctrls[1], weights, degrees, knots, param); + + param[0] = knots[0][knots[0].size() - 1]; + Vertex last = nurbs::evaluate_at(*ctrls[1], weights, degrees, knots, param); + + // now translate the curve to superpose the first point of this segment + // with the last point of the last segment + Vertex delta = (*points[0])[3]; + delta.x -= first.x, delta.y -= first.y, delta.z -= first.z; + for (size_t i = 0; i != length; ++i) + { + (*ctrls[1])[i].x += delta.x; + (*ctrls[1])[i].y += delta.y; + (*ctrls[1])[i].z += delta.z; + } + // evaluate the segment + points[1] = nurbs::evaluate(*ctrls[1], weights, degrees, knots, steps); + } + { + size_t length = polyline2.length(); + points[2] = new Points(&length); + for (size_t i = 0; i != 4; ++i) (*points[2])[i] = polyline2[i]; + ctrls[2] = new Ctrl(&length); + for (size_t i = 0; i != 4; ++i) (*ctrls[2])[i] = polyline2[i]; + + // now translate the curve to superpose the first point of this segment + // with the last point of the last segment + Vertex delta = (*points[1])[points[1]->length() - 1]; + delta.x -= (*points[2])[0].x; + delta.y -= (*points[2])[0].y; + delta.z -= (*points[2])[0].z; + for (size_t i = 0; i != length; ++i) + { + (*points[2])[i].x += delta.x; + (*points[2])[i].y += delta.y; + (*points[2])[i].z += delta.z; + (*ctrls[2])[i].x += delta.x; + (*ctrls[2])[i].y += delta.y; + (*ctrls[2])[i].z += delta.z; + } + + { + size_t length = nurbs2.controls.length(); + ctrls[3] = new Ctrl(&length); + for (size_t i = 0; i != length; ++i) + (*ctrls[3])[i] = nurbs2.controls[i]; + length = nurbs2.weights.length(); + nurbs::domain weights(&length); + for (size_t i = 0; i != nurbs2.weights.length(); ++i) + weights[i] = nurbs2.weights[i]; + nurbs::array degrees(nurbs2.degree); + nurbs::array, PARAMS> knots; + knots[0].resize(nurbs2.knots.length()); + for (size_t i = 0; i != knots[0].size(); ++i) + knots[0][i] = nurbs2.knots[i]; + + // compute the first point of this segment + nurbs::array param(knots[0][DEGREE]); + Vertex first = nurbs::evaluate_at(*ctrls[3], weights, degrees, knots, param); + + param[0] = knots[0][knots[0].size() - 1]; + Vertex last = nurbs::evaluate_at(*ctrls[3], weights, degrees, knots, param); + + // now translate the curve to superpose the first point of this segment + // with the last point of the last segment + Vertex delta = (*points[2])[3]; + delta.x -= first.x, delta.y -= first.y, delta.z -= first.z; + for (size_t i = 0; i != length; ++i) + { + (*ctrls[3])[i].x += delta.x; + (*ctrls[3])[i].y += delta.y; + (*ctrls[3])[i].z += delta.z; + } + // evaluate the segment + points[3] = nurbs::evaluate(*ctrls[3], weights, degrees, knots, steps); + } + } - points = evaluate_with_derivations(*ctrls, weights, degrees, steps); - startGL (argc, argv); return 0; } From stefan at fresco.org Thu May 1 04:13:03 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] Fresco/Berlin/test/nurbs fresco-curve.cc,1.3,1.4 Message-ID: Update of /cvs/fresco/Fresco/Berlin/test/nurbs In directory purcel:/tmp/cvs-serv9514 Modified Files: fresco-curve.cc Log Message: simplification Index: fresco-curve.cc =================================================================== RCS file: /cvs/fresco/Fresco/Berlin/test/nurbs/fresco-curve.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- fresco-curve.cc 1 May 2003 03:57:28 -0000 1.3 +++ fresco-curve.cc 1 May 2003 04:13:01 -0000 1.4 @@ -37,7 +37,7 @@ const unsigned int CTRLPOINTS = 10; using namespace Fresco; -using Berlin::nurbs; +using namespace Berlin::nurbs; typedef _CORBA_Unbounded_Sequence Polyline; struct Nurbs @@ -50,9 +50,9 @@ typedef Vertex Vector; -typedef nurbs::domain Ctrl; -typedef nurbs::domain Points; -typedef nurbs::domain Weights; +typedef domain Ctrl; +typedef domain Points; +typedef domain Weights; bool animationFlag = false; // 'a' bool drawingPointsFlag = true; // 'p' @@ -275,9 +275,9 @@ srand(time(0)); for(size_t i = 0; i < CTRLPOINTS; ++i) { - nurbs1.controls[i] = nurbs::make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., - static_cast(rand() % 500) / 100. -1., - 0.); + nurbs1.controls[i] = make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., + static_cast(rand() % 500) / 100. -1., + 0.); nurbs1.weights[i] = 1.0; } nurbs1.knots.length(CTRLPOINTS + DEGREE + 1); @@ -310,9 +310,9 @@ srand(time(0)); for(size_t i = 0; i < CTRLPOINTS; ++i) { - nurbs2.controls[i] = nurbs::make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., - static_cast(rand() % 500) / 100. -1., - 0.); + nurbs2.controls[i] = make_vertex(static_cast(i) - (CTRLPOINTS - 1)/2., + static_cast(rand() % 500) / 100. -1., + 0.); nurbs2.weights[i] = 1.0; } nurbs2.knots.length(CTRLPOINTS + DEGREE + 1); @@ -320,7 +320,7 @@ for (size_t i = 0; i != nurbs2.knots.length(); ++i) nurbs2.knots[i] = i * delta; } - nurbs::array steps(4); + array steps(4); // evaluation... { @@ -336,34 +336,30 @@ for (size_t i = 0; i != length; ++i) (*ctrls[1])[i] = nurbs1.controls[i]; length = nurbs1.weights.length(); - nurbs::domain weights(&length); + domain weights(&length); for (size_t i = 0; i != nurbs1.weights.length(); ++i) weights[i] = nurbs1.weights[i]; - nurbs::array degrees(nurbs1.degree); - nurbs::array, PARAMS> knots; + array degrees(nurbs1.degree); + array, PARAMS> knots; knots[0].resize(nurbs1.knots.length()); for (size_t i = 0; i != knots[0].size(); ++i) knots[0][i] = nurbs1.knots[i]; // compute the first point of this segment - nurbs::array param(knots[0][DEGREE]); - Vertex first = nurbs::evaluate_at(*ctrls[1], weights, degrees, knots, param); + array param(knots[0][DEGREE]); + Vertex first = evaluate_at(*ctrls[1], weights, degrees, knots, param); param[0] = knots[0][knots[0].size() - 1]; - Vertex last = nurbs::evaluate_at(*ctrls[1], weights, degrees, knots, param); + Vertex last = evaluate_at(*ctrls[1], weights, degrees, knots, param); // now translate the curve to superpose the first point of this segment // with the last point of the last segment Vertex delta = (*points[0])[3]; - delta.x -= first.x, delta.y -= first.y, delta.z -= first.z; + delta -= first; for (size_t i = 0; i != length; ++i) - { - (*ctrls[1])[i].x += delta.x; - (*ctrls[1])[i].y += delta.y; - (*ctrls[1])[i].z += delta.z; - } + (*ctrls[1])[i] += delta; // evaluate the segment - points[1] = nurbs::evaluate(*ctrls[1], weights, degrees, knots, steps); + points[1] = evaluate(*ctrls[1], weights, degrees, knots, steps); } { size_t length = polyline2.length(); @@ -375,17 +371,11 @@ // now translate the curve to superpose the first point of this segment // with the last point of the last segment Vertex delta = (*points[1])[points[1]->length() - 1]; - delta.x -= (*points[2])[0].x; - delta.y -= (*points[2])[0].y; - delta.z -= (*points[2])[0].z; + delta -= (*points[2])[0]; for (size_t i = 0; i != length; ++i) { - (*points[2])[i].x += delta.x; - (*points[2])[i].y += delta.y; - (*points[2])[i].z += delta.z; - (*ctrls[2])[i].x += delta.x; - (*ctrls[2])[i].y += delta.y; - (*ctrls[2])[i].z += delta.z; + (*points[2])[i] += delta; + (*ctrls[2])[i] += delta; } { @@ -394,21 +384,21 @@ for (size_t i = 0; i != length; ++i) (*ctrls[3])[i] = nurbs2.controls[i]; length = nurbs2.weights.length(); - nurbs::domain weights(&length); + domain weights(&length); for (size_t i = 0; i != nurbs2.weights.length(); ++i) weights[i] = nurbs2.weights[i]; - nurbs::array degrees(nurbs2.degree); - nurbs::array, PARAMS> knots; + array degrees(nurbs2.degree); + array, PARAMS> knots; knots[0].resize(nurbs2.knots.length()); for (size_t i = 0; i != knots[0].size(); ++i) knots[0][i] = nurbs2.knots[i]; // compute the first point of this segment - nurbs::array param(knots[0][DEGREE]); - Vertex first = nurbs::evaluate_at(*ctrls[3], weights, degrees, knots, param); + array param(knots[0][DEGREE]); + Vertex first = evaluate_at(*ctrls[3], weights, degrees, knots, param); param[0] = knots[0][knots[0].size() - 1]; - Vertex last = nurbs::evaluate_at(*ctrls[3], weights, degrees, knots, param); + Vertex last = evaluate_at(*ctrls[3], weights, degrees, knots, param); // now translate the curve to superpose the first point of this segment // with the last point of the last segment @@ -421,7 +411,7 @@ (*ctrls[3])[i].z += delta.z; } // evaluate the segment - points[3] = nurbs::evaluate(*ctrls[3], weights, degrees, knots, steps); + points[3] = evaluate(*ctrls[3], weights, degrees, knots, steps); } } From tobias at fresco.org Sat May 3 08:06:11 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] Fresco README,1.18,1.19 Message-ID: Update of /cvs/fresco/Fresco In directory purcel:/tmp/cvs-serv23854 Modified Files: README Log Message: Replace explicit version number of 0.3 with more vague 'not beta yet' and mention the issuetracker. Index: README =================================================================== RCS file: /cvs/fresco/Fresco/README,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- README 17 Jul 2002 04:05:31 -0000 1.18 +++ README 3 May 2003 08:06:09 -0000 1.19 @@ -1,10 +1,10 @@ Welcome to the Fresco windowing system -The current release is 0.3, which means it is not even into the stage -where the most adventuresome users will gain any productivity from -it. It's a *developer's* release. If you want to help develop fresco, -you can work off this release with some modicum of confidence and -convenience. Please read the INSTALL file for further instructions about +The current release is not even refered to as 'beta', which means it is +not even into the stage where the most adventuresome users will gain any +productivity from it. It's a *developer's* release. If you want to help +develop fresco, you can work off this release with some modicum of confidence +and convenience. Please read the INSTALL file for further instructions about how to build the system. Please do not hesitate to customize the build process for an @@ -19,6 +19,9 @@ Archives of the mailing list & FAQ are on our web site: http://www.fresco.org + +Please report bugs at: + http://issues.fresco.org/ Hope you enjoy it -graydon From nicholas at fresco.org Sat May 3 14:41:28 2003 From: nicholas at fresco.org (Nick Lewycky) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] Fresco/Fresco-C++/config Makefile.tao.in,1.9,1.10 Message-ID: Update of /cvs/fresco/Fresco/Fresco-C++/config In directory purcel:/tmp/cvs-serv8026/Fresco-C++/config Modified Files: Makefile.tao.in Log Message: It's called RasterKit, not ImageKit. Index: Makefile.tao.in =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-C++/config/Makefile.tao.in,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Makefile.tao.in 7 Jan 2003 02:20:37 -0000 1.9 +++ Makefile.tao.in 3 May 2003 14:41:25 -0000 1.10 @@ -63,7 +63,7 @@ Input.idl Focus.idl Subject.idl Observer.idl Controller.idl MainController.idl View.idl \ Drawable.idl DrawingKit.idl Grid.idl Viewport.idl Stage.idl LayoutKit.idl \ Telltale.idl StreamBuffer.idl Trigger.idl Canvas.idl State.idl ToolKit.idl \ - Widget.idl WidgetKit.idl GadgetKit.idl Raster.idl ImageKit.idl Figure.idl \ + Widget.idl WidgetKit.idl GadgetKit.idl Raster.idl RasterKit.idl Figure.idl \ Image.idl FigureKit.idl Command.idl CommandKit.idl \ TextKit.idl Desktop.idl Window.idl DesktopKit.idl \ DrawingKit3D.idl Primitive.idl PrimitiveKit.idl UnidrawKit.idl \ From tobias at fresco.org Sun May 4 12:29:47 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] web configure.ac,1.4,1.5 Message-ID: Update of /cvs/fresco/web In directory purcel:/tmp/cvs-serv25599 Modified Files: configure.ac Log Message: Initialize your variables or you will have trouble if you don't pass in --with-fresco-doc. Index: configure.ac =================================================================== RCS file: /cvs/fresco/web/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.ac 21 Jan 2003 21:06:03 -0000 1.4 +++ configure.ac 4 May 2003 12:29:45 -0000 1.5 @@ -36,7 +36,7 @@ AC_ARG_WITH(fresco-doc, AC_HELP_STRING([--with-fresco-doc],[build online tutorial]), - [fresco_doc="$withval"]) + [fresco_doc="$withval"], [fresco_doc=""]) AC_SUBST(fresco_doc) AC_CONFIG_FILES([config.mk]) From tobias at fresco.org Sun May 4 12:52:29 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] web/hosts/www Makefile.in,1.27,1.28 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv26260 Modified Files: Makefile.in Log Message: Let there be glyphs... Index: Makefile.in =================================================================== RCS file: /cvs/fresco/web/hosts/www/Makefile.in,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Makefile.in 4 Mar 2003 19:30:35 -0000 1.27 +++ Makefile.in 4 May 2003 12:52:27 -0000 1.28 @@ -37,7 +37,10 @@ cp $(topdir)/data/irc-logs/*.html $(sitedir)/root/irc-logs if [ ! -e $(sitedir)/root/docs ] ; then \ ln -s $(topdir)/data/docs $(sitedir)/root/docs ; \ - fi + fi ; \ + if [ ! -e $(sitedir)/root/glyphs ] ; then \ + ln -s $(topdir)/data/glyphs $(sitedir)/root/glyphs ; \ + fi ifdef fresco_doc $(MAKE) -C tutorial install sitedir=$(sitedir) endif From tobias at fresco.org Sun May 4 13:12:24 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] web/hosts/www Makefile.in,1.28,1.29 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv27610 Modified Files: Makefile.in Log Message: Let there really be glyphs:-) Stupid typo in the test made make fail the secound time round. Index: Makefile.in =================================================================== RCS file: /cvs/fresco/web/hosts/www/Makefile.in,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- Makefile.in 4 May 2003 12:52:27 -0000 1.28 +++ Makefile.in 4 May 2003 13:12:22 -0000 1.29 @@ -39,7 +39,7 @@ ln -s $(topdir)/data/docs $(sitedir)/root/docs ; \ fi ; \ if [ ! -e $(sitedir)/root/glyphs ] ; then \ - ln -s $(topdir)/data/glyphs $(sitedir)/root/glyphs ; \ + ln -s $(topdir)/glyphs $(sitedir)/root/glyphs ; \ fi ifdef fresco_doc $(MAKE) -C tutorial install sitedir=$(sitedir) From tobias at fresco.org Sun May 4 13:13:22 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] web/data links.xml,1.45,1.46 Message-ID: Update of /cvs/fresco/web/data In directory purcel:/tmp/cvs-serv27688 Modified Files: links.xml Log Message: Force the refmanuals to be on www2. Index: links.xml =================================================================== RCS file: /cvs/fresco/web/data/links.xml,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- links.xml 24 Mar 2003 17:49:46 -0000 1.45 +++ links.xml 4 May 2003 13:13:20 -0000 1.46 @@ -281,115 +281,115 @@ - refmanuals/Prague + refmanuals/Prague Prague POSIX, IPC, ... - refmanuals/Babylon + refmanuals/Babylon Babylon Unicode - refmanuals/Fresco + refmanuals/Fresco Fresco Interfaces - refmanuals/Berlin + refmanuals/Berlin Berlin Implementation - refmanuals/kits/Drawing/openGL + refmanuals/kits/Drawing/openGL GLDrawingKit openGL DrawingKit - refmanuals/kits/Drawing/libArt + refmanuals/kits/Drawing/libArt libArtDrawingKit - refmanuals/kits/Drawing/PostScript + refmanuals/kits/Drawing/PostScript PSDrawingKit PostScript DrawingKit - refmanuals/kits/Layout + refmanuals/kits/Layout LayoutKit - refmanuals/kits/Commands + refmanuals/kits/Commands CommandKit - refmanuals/kits/Tools + refmanuals/kits/Tools ToolKit - - refmanuals/kits/Images + + refmanuals/kits/Raster ImageKit - refmanuals/kits/Figures + refmanuals/kits/Figures FigureKit - refmanuals/kits/Primitives + refmanuals/kits/Primitives PrimitiveKit - refmanuals/kits/Text + refmanuals/kits/Text TextKit - refmanuals/kits/Widgets/Motif + refmanuals/kits/Widgets/Motif WidgetKit Motif style WidgetKit - refmanuals/kits/Gadgets + refmanuals/kits/Gadgets GadgetKit - refmanuals/kits/Desktop + refmanuals/kits/Desktop DesktopKit - refmanuals/kits/Unidraw + refmanuals/kits/Unidraw UnidrawKit - refmanuals/kits/GGI + refmanuals/kits/GGI GGIKit From tobias at fresco.org Sun May 4 13:32:34 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] web/xsl link.xsl,1.21,1.22 Message-ID: Update of /cvs/fresco/web/xsl In directory purcel:/tmp/cvs-serv28252 Modified Files: link.xsl Log Message: Honour site-part of link-item in lists. Index: link.xsl =================================================================== RCS file: /cvs/fresco/web/xsl/link.xsl,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- link.xsl 10 Nov 2002 19:15:35 -0000 1.21 +++ link.xsl 4 May 2003 13:32:31 -0000 1.22 @@ -72,6 +72,7 @@
  • + From tobias at fresco.org Sun May 4 13:39:30 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] web/data links.xml,1.46,1.47 Message-ID: Update of /cvs/fresco/web/data In directory purcel:/tmp/cvs-serv28429/data Modified Files: links.xml Log Message: Just link to the bugtracker frontpage. At least we won't get a templating error that way. Index: links.xml =================================================================== RCS file: /cvs/fresco/web/data/links.xml,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- links.xml 4 May 2003 13:13:20 -0000 1.46 +++ links.xml 4 May 2003 13:39:28 -0000 1.47 @@ -454,7 +454,7 @@ - + Bug tracker Bug tracker at issues.fresco.org From tobias at fresco.org Sun May 4 16:52:25 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:22 2005 Subject: [Fresco-changes] Fresco INSTALL,1.27,1.28 Message-ID: Update of /cvs/fresco/Fresco In directory purcel:/tmp/cvs-serv2354 Modified Files: INSTALL Log Message: Merge the information on BERLIN_FONT_CHOOSER from troubleshooting.txt into INSTALL and remove the former which is outdated. Closes bug169. Index: INSTALL =================================================================== RCS file: /cvs/fresco/Fresco/INSTALL,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- INSTALL 23 Apr 2003 21:02:19 -0000 1.27 +++ INSTALL 4 May 2003 16:52:22 -0000 1.28 @@ -305,6 +305,14 @@ environment variable and will not attempt to use the nameserver or filesystem. +Another common problem is that there are NO FONTS: Currently Fresco uses +the last font freetype can handle which does not necessarily need to +contain all the ASCII characters. To get around this problem try specifying +which default font the server is to use by setting the environment variable +'BERLIN_FONT_CHOOSER' to the empty string and reruning the server. On +startup, it should present you with a list of fonts to choose from on the +console from where you started up the server. + If you're running two servers together, one with the id "FrescoServer" (as per default) and the other with the id "nested", then to start a client in nested from the Terminal Demo in FrescoServer, run From tobias at fresco.org Sun May 4 16:52:25 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/doc/install troubleshooting.txt,1.1,NONE Message-ID: Update of /cvs/fresco/Fresco/doc/install In directory purcel:/tmp/cvs-serv2354/doc/install Removed Files: troubleshooting.txt Log Message: Merge the information on BERLIN_FONT_CHOOSER from troubleshooting.txt into INSTALL and remove the former which is outdated. Closes bug169. --- troubleshooting.txt DELETED --- From tobias at fresco.org Sun May 4 17:28:17 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] web/hosts/issues/html milestone.item,1.8,1.9 Message-ID: Update of /cvs/fresco/web/hosts/issues/html In directory purcel:/tmp/cvs-serv3484 Modified Files: milestone.item Log Message: Turn the history around ;-) Index: milestone.item =================================================================== RCS file: /cvs/fresco/web/hosts/issues/html/milestone.item,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- milestone.item 21 Feb 2003 01:37:46 -0000 1.8 +++ milestone.item 4 May 2003 17:28:15 -0000 1.9 @@ -214,7 +214,7 @@ - + From tobias at fresco.org Sun May 4 18:25:33 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] web/hosts/www Makefile.in,1.29,1.30 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv5860 Modified Files: Makefile.in Log Message: Write the date for the last update into a file that can be get via WWW. Mirrorsites can use this information to decide wether they need to rebuild themselves. Index: Makefile.in =================================================================== RCS file: /cvs/fresco/web/hosts/www/Makefile.in,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Makefile.in 4 May 2003 13:12:22 -0000 1.29 +++ Makefile.in 4 May 2003 18:25:30 -0000 1.30 @@ -37,10 +37,11 @@ cp $(topdir)/data/irc-logs/*.html $(sitedir)/root/irc-logs if [ ! -e $(sitedir)/root/docs ] ; then \ ln -s $(topdir)/data/docs $(sitedir)/root/docs ; \ - fi ; \ + fi ; if [ ! -e $(sitedir)/root/glyphs ] ; then \ - ln -s $(topdir)/glyphs $(sitedir)/root/glyphs ; \ - fi + ln -s $(topdir)/glyphs $(sitedir)/root/glyphs ; \ + fi ; + date > $(sitedir)/root/last_updated.txt ifdef fresco_doc $(MAKE) -C tutorial install sitedir=$(sitedir) endif From tobias at fresco.org Sun May 4 19:42:31 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] web/hosts/www index.xml,1.14,1.15 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv8654 Modified Files: index.xml Log Message: A very small change to test the website mirroring on SF. Index: index.xml =================================================================== RCS file: /cvs/fresco/web/hosts/www/index.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- index.xml 20 Nov 2002 08:31:36 -0000 1.14 +++ index.xml 4 May 2003 19:42:29 -0000 1.15 @@ -21,7 +21,7 @@ earlier incarnations to the status of a full windowing system, in command of the video hardware (via , SDL, SDL or DirectFB or GLUT) and processing user input directly rather than From tobias at fresco.org Sun May 4 19:46:36 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] web/hosts/www index.xml,1.15,1.16 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv8818 Modified Files: index.xml Log Message: Fix the small test-fix:-( Index: index.xml =================================================================== RCS file: /cvs/fresco/web/hosts/www/index.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- index.xml 4 May 2003 19:42:29 -0000 1.15 +++ index.xml 4 May 2003 19:46:33 -0000 1.16 @@ -21,11 +21,11 @@ earlier incarnations to the status of a full windowing system, in command of the video hardware (via , SDL or SDL, DirectFB or GLUT) and processing user input directly rather than - peering with a host windowing system. + peering with a host windowing system like X. Additionally, Fresco's extensions include a From tobias at fresco.org Sun May 4 20:46:01 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] web/hosts/www index.xml,1.16,1.17 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv11172 Modified Files: index.xml Log Message: Backout test-patch (which in turn will trigger another rebuild of the website... and be another test:-) Index: index.xml =================================================================== RCS file: /cvs/fresco/web/hosts/www/index.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- index.xml 4 May 2003 19:46:33 -0000 1.16 +++ index.xml 4 May 2003 20:45:58 -0000 1.17 @@ -25,7 +25,7 @@ href="http://www.directfb.org">DirectFB or GLUT) and processing user input directly rather than - peering with a host windowing system like X. + peering with a host windowing system. Additionally, Fresco's extensions include a From tobias at fresco.org Mon May 5 07:42:48 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] web/hosts/www Makefile.in,1.30,1.31 Message-ID: Update of /cvs/fresco/web/hosts/www In directory purcel:/tmp/cvs-serv1260 Modified Files: Makefile.in Log Message: Make sure that the screenshots will show up. Index: Makefile.in =================================================================== RCS file: /cvs/fresco/web/hosts/www/Makefile.in,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- Makefile.in 4 May 2003 18:25:30 -0000 1.30 +++ Makefile.in 5 May 2003 07:42:46 -0000 1.31 @@ -35,11 +35,15 @@ cp snapshots-header.html $(sitedir)/root/snapshots/header.html mkdir -p $(sitedir)/root/irc-logs cp $(topdir)/data/irc-logs/*.html $(sitedir)/root/irc-logs + mkdir -p $(sitedir)/root/data if [ ! -e $(sitedir)/root/docs ] ; then \ ln -s $(topdir)/data/docs $(sitedir)/root/docs ; \ fi ; if [ ! -e $(sitedir)/root/glyphs ] ; then \ ln -s $(topdir)/glyphs $(sitedir)/root/glyphs ; \ + fi ; + if [ ! -e $(sitedir)/root/data/screenshots ] ; then \ + ln -s $(topdir)/data/screenshots $(sitedir)/root/data/screenshots ; \ fi ; date > $(sitedir)/root/last_updated.txt ifdef fresco_doc From stefan at fresco.org Wed May 7 02:24:20 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Berlin/test/nurbs fresco-curve.cc,1.4,1.5 Message-ID: Update of /cvs/fresco/Fresco/Berlin/test/nurbs In directory purcel:/tmp/cvs-serv3533 Modified Files: fresco-curve.cc Log Message: add simple quadric segment Index: fresco-curve.cc =================================================================== RCS file: /cvs/fresco/Fresco/Berlin/test/nurbs/fresco-curve.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- fresco-curve.cc 1 May 2003 04:13:01 -0000 1.4 +++ fresco-curve.cc 7 May 2003 02:24:18 -0000 1.5 @@ -40,6 +40,11 @@ using namespace Berlin::nurbs; typedef _CORBA_Unbounded_Sequence Polyline; +struct Quadric +{ + double a, b; // this should be a real 3x3 matrix, actually + double phi1, phi2; +}; struct Nurbs { CORBA::UShort degree; @@ -60,8 +65,10 @@ bool drawingCtrlPointsFlag = true; // 'c' bool drawingDerivativesFlag = false; // 'd' -Ctrl *ctrls[4]; -Points *points[4]; +const short SEGMENTS = 5; + +Ctrl *ctrls[SEGMENTS]; +Points *points[SEGMENTS]; void polar_view(GLdouble twist, GLdouble elevation, GLdouble azimuth) { @@ -114,7 +121,7 @@ if(drawingQuadsFlag) { glColor3f(0.8, 0.2, 0.2); - for(size_t j = 0; j < 4; ++j) + for(size_t j = 0; j < SEGMENTS; ++j) { glBegin(GL_LINE_STRIP); for(size_t i = 0; i < points[j]->size(0); ++i) @@ -130,32 +137,17 @@ if(drawingPointsFlag) { glColor3f(0.8, 0.4, 0.2); - glBegin(GL_POINTS); - for(size_t i = 0; i < points[0]->length(); ++i) - { - glVertex3f((*points[0])[i].x, - (*points[0])[i].y, - (*points[0])[i].z); - } - for(size_t i = 0; i < points[1]->length(); ++i) - { - glVertex3f((*points[1])[i].x, - (*points[1])[i].y, - (*points[1])[i].z); - } - for(size_t i = 0; i < points[2]->length(); ++i) - { - glVertex3f((*points[2])[i].x, - (*points[2])[i].y, - (*points[2])[i].z); - } - for(size_t i = 0; i < points[3]->length(); ++i) + for (size_t j = 0; j != SEGMENTS; ++j) { - glVertex3f((*points[3])[i].x, - (*points[3])[i].y, - (*points[3])[i].z); + glBegin(GL_POINTS); + for(size_t i = 0; i < points[j]->length(); ++i) + { + glVertex3f((*points[j])[i].x, + (*points[j])[i].y, + (*points[j])[i].z); + } + glEnd(); } - glEnd(); } // if(drawingDerivativesFlag) @@ -181,7 +173,7 @@ if(drawingCtrlPointsFlag) { glColor3f(0.2, 0.8, 0.2); - for (size_t j = 0; j != 4; ++j) + for (size_t j = 0; j != SEGMENTS; ++j) for(size_t i = 0; i < (*ctrls[j]).length(); ++i) { const Vertex &p = (*ctrls[j])[i]; @@ -301,7 +293,7 @@ polyline2[3].y = 2.; polyline2[3].z = 1.; } - // define forth segment + // define fourth segment Nurbs nurbs2; { nurbs2.degree = DEGREE; @@ -319,6 +311,14 @@ double delta = 1. / (CTRLPOINTS + DEGREE); for (size_t i = 0; i != nurbs2.knots.length(); ++i) nurbs2.knots[i] = i * delta; } + // define third segment + Quadric quadric1; + { + quadric1.a = 5; + quadric1.b = 2.; + quadric1.phi1 = 0.; + quadric1.phi2 = 3.142; + } array steps(4); @@ -412,6 +412,29 @@ } // evaluate the segment points[3] = evaluate(*ctrls[3], weights, degrees, knots, steps); + } + } + { + size_t length = 10; + points[4] = new Points(&length); + double phi = quadric1.phi1; + double dphi = (quadric1.phi2 - quadric1.phi1)/10; + for (size_t i = 0; i != 10; ++i, phi += dphi) + (*points[4])[i] = make_vertex(quadric1.a * sin(phi), + quadric1.b * cos(phi), + 0.); + for (size_t i = 0; i != 10; ++i) std::cout << (*points[4])[i].x << ' ' << (*points[4])[i].y << std::endl; + ctrls[4] = new Ctrl(&length); + for (size_t i = 0; i != 10; ++i) (*ctrls[4])[i] = (*points[4])[0]; + + // now translate the curve to superpose the first point of this segment + // with the last point of the last segment + Vertex delta = (*points[3])[points[3]->length() - 1]; + delta -= (*points[4])[0]; + for (size_t i = 0; i != length; ++i) + { + (*points[4])[i] += delta; + (*ctrls[4])[i] += delta; } } From stefan at fresco.org Thu May 8 03:21:12 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/demo/Thread Thread.cc,1.4,1.5 Message-ID: Update of /cvs/fresco/Fresco/Prague/demo/Thread In directory purcel:/tmp/cvs-serv22129/demo/Thread Modified Files: Thread.cc Log Message: some API clarifications for Threads, and minor updates to enhance coding standard conformity Index: Thread.cc =================================================================== RCS file: /cvs/fresco/Fresco/Prague/demo/Thread/Thread.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Thread.cc 25 Mar 2001 08:25:16 -0000 1.4 +++ Thread.cc 8 May 2003 03:21:10 -0000 1.5 @@ -52,27 +52,37 @@ int main(int, char **) { - long l = 42; - Thread thread1(task1, &l); - Thread thread2(task2, &l); - Thread thread3(task3, &l); - Thread thread4(task3, &l); // never start... - thread0.start(); - thread1.start(); - thread2.start(); - thread3.start(); - void *r; - thread1.join(&r); - if (thread1.state() == Thread::canceled) std::cout << "thread 1 canceled" << std::endl; - else std::cout << "thread 1 finished, return value is " << *static_cast(r) << std::endl; - thread2.join(&r); - if (thread2.state() == Thread::canceled) std::cout << "thread 2 canceled" << std::endl; - else std::cout << "thread 2 finished, return value is '" << static_cast(r) << '\'' << std::endl; - std::cout << "cancelling thread 3..." << std::endl; - thread3.cancel(); - thread3.join(&r); - if (thread3.state() == Thread::canceled) std::cout << "thread 3 canceled" << std::endl; - else std::cout << "thread 3 finished, return value is '" << static_cast(r) << '\'' << std::endl; -// thread0.join(0); - while (true) sleep(1); + try + { + long l = 42; + Thread thread1(task1, &l); + Thread thread2(task2, &l); + Thread thread3(task3, &l); + Thread thread4(task3, &l); // never start... + thread0.start(); + thread1.start(); + thread2.start(); + thread3.start(); + void *r; + thread1.join(&r); + if (r == Thread::CANCELED) std::cout << "thread 1 canceled" << std::endl; + else std::cout << "thread 1 finished, return value is " << *static_cast(r) << std::endl; + thread2.join(&r); + if (r == Thread::CANCELED) std::cout << "thread 2 canceled" << std::endl; + else std::cout << "thread 2 finished, return value is '" << static_cast(r) << '\'' << std::endl; + std::cout << "cancelling thread 3..." << std::endl; + thread3.cancel(); + thread3.join(&r); + if (r == Thread::CANCELED) std::cout << "thread 3 canceled" << std::endl; + else std::cout << "thread 3 finished, return value is '" << static_cast(r) << '\'' << std::endl; + thread0.join(0); + } + catch (const Thread::Exception &e) + { + std::cerr << "Thread Exception : " << e.what() << std::endl; + } + catch (const std::exception &e) + { + std::cerr << "std::exception : " << e.what() << std::endl; + } } From stefan at fresco.org Thu May 8 03:21:13 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/include/Prague/IPC Dispatcher.hh,1.9,1.10 Message-ID: Update of /cvs/fresco/Fresco/Prague/include/Prague/IPC In directory purcel:/tmp/cvs-serv22129/include/Prague/IPC Modified Files: Dispatcher.hh Log Message: some API clarifications for Threads, and minor updates to enhance coding standard conformity Index: Dispatcher.hh =================================================================== RCS file: /cvs/fresco/Fresco/Prague/include/Prague/IPC/Dispatcher.hh,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Dispatcher.hh 25 Mar 2001 08:25:16 -0000 1.9 +++ Dispatcher.hh 8 May 2003 03:21:10 -0000 1.10 @@ -1,8 +1,8 @@ /*$Id$ * - * This source file is a part of the Berlin Project. - * Copyright (C) 1999, 2000 Stefan Seefeld - * http://www.berlin-consortium.org + * This source file is a part of the Fresco Project. + * Copyright (C) 1999, 2000 Stefan Seefeld + * http://www.fresco.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace Prague @@ -38,21 +39,21 @@ //. This implementation uses a thread pool for the actual callbacks. class Dispatcher { +public: + //. Dispatcher being a singleton, return the instance. + static Dispatcher *instance(); + //. bind an Agent to events according to the provided filedescriptor fd, + //. and the mask + void bind(Agent *, int fd, Agent::iomask mask) throw(std::invalid_argument); + //. release an Agent from channel fd, or the whole Agent, if fd is -1 + void release(Agent *, int fd = -1); +private: typedef std::vector alist_t; - struct task - { - task() : fd(-1), agent(0), mask(Agent::none), released(false) {} - task(int ffd, Agent *a, Agent::iomask m) : fd(ffd), agent(a), mask(m) {} - bool operator < (const task &t) const { return fd < t.fd;} - int fd; - Agent *agent; - Agent::iomask mask; - bool released; - }; + struct task; typedef std::map repository_t; - struct Handler //. Handler is responsible for calling a specific method //. (determined by the mask) on the agent + struct Handler { Handler(task *tt) : t(tt) {} void process() { dispatcher->process(t);} @@ -62,40 +63,36 @@ struct Acceptor { Handler *consume(task *t) const { return new Handler(t);}}; struct Cleaner { ~Cleaner();}; friend struct Cleaner; -public: - //. Dispatcher being a singleton, return the instance. - static Dispatcher *instance(); - //. bind an Agent to events according to the provided filedescriptor fd, and the mask - void bind(Agent *, int fd, Agent::iomask mask); - //. release an Agent from channel fd, or the whole Agent, if fd is -1 - void release(Agent *, int fd = -1); -private: + typedef Thread::Queue Queue; + typedef ThreadPool Pool; + Dispatcher(); virtual ~Dispatcher(); void wait(); - void notify() { char *c = "c"; write(wakeup[1], c, 1);} + void notify() { char *c = "c"; write(my_wakeup[1], c, 1);} static void *run(void *); void dispatch(task *); void process(task *); void deactivate(task *); void activate(task *); + static Dispatcher *dispatcher; static Mutex singletonMutex; static Cleaner cleaner; - Signal::Notifier *notifier; - Mutex mutex; - FdSet rfds; - FdSet wfds; - FdSet xfds; - alist_t agents; - repository_t rchannel; - repository_t wchannel; - repository_t xchannel; - int wakeup[2]; - Thread::Queue tasks; - Acceptor acceptor; - ThreadPool workers; - Thread server; + + Mutex my_mutex; + FdSet my_rfds; + FdSet my_wfds; + FdSet my_xfds; + alist_t my_agents; + repository_t my_rchannel; + repository_t my_wchannel; + repository_t my_xchannel; + int my_wakeup[2]; + Queue my_tasks; + Acceptor my_acceptor; + Pool my_workers; + Thread my_server; }; }; From stefan at fresco.org Thu May 8 03:21:13 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/include/Prague/Sys Thread.hh,1.21,1.22 Message-ID: Update of /cvs/fresco/Fresco/Prague/include/Prague/Sys In directory purcel:/tmp/cvs-serv22129/include/Prague/Sys Modified Files: Thread.hh Log Message: some API clarifications for Threads, and minor updates to enhance coding standard conformity Index: Thread.hh =================================================================== RCS file: /cvs/fresco/Fresco/Prague/include/Prague/Sys/Thread.hh,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Thread.hh 28 Mar 2003 21:51:00 -0000 1.21 +++ Thread.hh 8 May 2003 03:21:11 -0000 1.22 @@ -30,6 +30,7 @@ #include #include #include +#include namespace Prague { @@ -176,32 +177,30 @@ }; friend struct Guard; public: - enum priority_t {low, normal, high}; - enum state_t {ready, running, terminated, canceled, joined}; + enum priority_t {LOW, NORMAL, HIGH}; + enum state_t {READY, RUNNING, TERMINATED}; + static const void *CANCELED; template class Data; template class Queue; typedef void *(*proc)(void *); - class Attribute// : public pthread_attr_t + class Attribute { public: Attribute() { pthread_attr_init(&impl);} ~Attribute() { pthread_attr_destroy(&impl);} pthread_attr_t impl; }; - class Exception + class Exception : public std::logic_error { public: - Exception(const std::string &m) : _msg(m) {} - const std::string &what() const { return _msg;} - private: - std::string _msg; + Exception(const std::string &m) : std::logic_error(m) {} }; - Thread(proc, void *, priority_t = normal); + Thread(proc, void *, priority_t = NORMAL); ~Thread(); //. return the thread's priority - priority_t priority() { Prague::Guard g(mutex); return _priority;} + priority_t priority() { Prague::Guard g(my_mutex); return my_priority;} //. return the thread's current state - state_t state() { Prague::Guard g(mutex); return _state;} + state_t state() { Prague::Guard g(my_mutex); return my_state;} //. start the thread void start() throw (Exception); //. wait for the thread to finish returning its return value @@ -216,26 +215,29 @@ static bool delay(const Time &); //. cancellation point static void testcancel() { pthread_testcancel();} - //. return a Thread pointer for the calling thread or 0 if it wasn't created by this Thread class + //. return a Thread pointer for the calling thread or 0 + //. if it wasn't created by this Thread class static Thread *self(); //. return a thread id. This gives a valid number even for third party threads static unsigned long id(); private: - Thread(pthread_t pt) : p(0), arg(0), thread(pt), _priority(normal), _state(running), detached(false) {} + Thread(pthread_t); static void *start(void *); - proc p; - void *arg; - pthread_t thread; - priority_t _priority; - state_t _state; - bool detached; - Mutex mutex; + static unsigned long counter; static Thread *main; static Guard guard; static pthread_key_t self_key; static pthread_key_t id_key; static Mutex id_mutex; + + proc my_proc; + void *my_arg; + pthread_t my_thread; + priority_t my_priority; + state_t my_state; + bool my_detached; + Mutex my_mutex; }; inline Thread *Thread::self() From stefan at fresco.org Thu May 8 03:21:13 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/src/IPC Dispatcher.cc,1.15,1.16 Message-ID: Update of /cvs/fresco/Fresco/Prague/src/IPC In directory purcel:/tmp/cvs-serv22129/src/IPC Modified Files: Dispatcher.cc Log Message: some API clarifications for Threads, and minor updates to enhance coding standard conformity Index: Dispatcher.cc =================================================================== RCS file: /cvs/fresco/Fresco/Prague/src/IPC/Dispatcher.cc,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Dispatcher.cc 25 Mar 2001 08:25:16 -0000 1.15 +++ Dispatcher.cc 8 May 2003 03:21:11 -0000 1.16 @@ -1,8 +1,8 @@ /*$Id$ * - * This source file is a part of the Berlin Project. - * Copyright (C) 1999, 2000 Stefan Seefeld - * http://www.berlin-consortium.org + * This source file is a part of the Fresco Project. + * Copyright (C) 1999, 2000 Stefan Seefeld + * http://www.fresco.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -35,13 +35,15 @@ Mutex Dispatcher::singletonMutex; Dispatcher::Cleaner Dispatcher::cleaner; -struct SignalNotifier : Signal::Notifier +struct Dispatcher::task { - virtual void notify(int signum) - { - std::cerr << Signal::name(signum) << std::endl; - exit(1); - } + task() : fd(-1), agent(0), mask(Agent::none), released(false) {} + task(int ffd, Agent *a, Agent::iomask m) : fd(ffd), agent(a), mask(m) {} + bool operator < (const task &t) const { return fd < t.fd;} + int fd; + Agent *agent; + Agent::iomask mask; + bool released; }; Dispatcher::Cleaner::~Cleaner() @@ -57,25 +59,14 @@ return dispatcher; } +//. create a queue of up to 64 tasks +//. and a thread pool with 16 threads Dispatcher::Dispatcher() - //. create a queue of up to 64 tasks - //. and a thread pool with 16 threads - : notifier(new SignalNotifier), - tasks(64), - workers(tasks, acceptor, 4), - server(&Dispatcher::run, this) + : my_tasks(64), + my_workers(my_tasks, my_acceptor, 4), + my_server(&Dispatcher::run, this) { Signal::mask(Signal::pipe); -// Signal::set(Signal::hangup, notifier); -// Signal::set(Signal::interrupt, notifier); -// Signal::set(Signal::quit, notifier); -// Signal::set(Signal::illegal, notifier); -// Signal::set(Signal::abort, notifier); -// Signal::set(Signal::fpe, notifier); -// Signal::set(Signal::bus, notifier); -// // Signal::set(Signal::segv, notifier); -// Signal::set(Signal::iotrap, notifier); -// Signal::set(Signal::terminate, notifier); } Dispatcher::~Dispatcher() @@ -83,62 +74,69 @@ } void Dispatcher::bind(Agent *agent, int fd, Agent::iomask mask) + throw(std::invalid_argument) { Trace trace("Dispatcher::bind"); - if (server.state() != Thread::running) + if (my_server.state() == Thread::READY) + { + pipe(my_wakeup); + my_rfds.set(my_wakeup[0]); + my_server.start(); + } + Prague::Guard guard(my_mutex); + if (find(my_agents.begin(), my_agents.end(), agent) == my_agents.end()) + { + my_agents.push_back(agent); + agent->add_ref(); + } + if (mask & Agent::in) + { + if (mask & Agent::inready) { - pipe(wakeup); - rfds.set(wakeup[0]); - server.start(); + my_wfds.set(fd); + if (my_wchannel.find(fd) == my_wchannel.end()) + my_wchannel[fd] = new task(fd, agent, Agent::inready); + else throw std::invalid_argument("file descriptor already in use"); } - Prague::Guard guard(mutex); - if (find(agents.begin(), agents.end(), agent) == agents.end()) + if (mask & Agent::inexc) { - agents.push_back(agent); - agent->add_ref(); + my_xfds.set(fd); + if (my_xchannel.find(fd) == my_xchannel.end()) + my_xchannel[fd] = new task(fd, agent, Agent::inexc); } - if (mask & Agent::in) + } + if (mask & Agent::out) + { + if (mask & Agent::outready) { - if (mask & Agent::inready) - { - wfds.set(fd); - if (wchannel.find(fd) == wchannel.end()) wchannel[fd] = new task(fd, agent, Agent::inready); - else std::cerr << "Dispatcher::bind() : Error : file descriptor already in use" << std::endl; - } - if (mask & Agent::inexc) - { - xfds.set(fd); - if (xchannel.find(fd) == xchannel.end()) xchannel[fd] = new task(fd, agent, Agent::inexc); - } + my_rfds.set(fd); + if (my_rchannel.find(fd) == my_rchannel.end()) + my_rchannel[fd] = new task(fd, agent, Agent::outready); + else throw std::invalid_argument("file descriptor already in use"); } - if (mask & Agent::out) + if (mask & Agent::outexc) { - if (mask & Agent::outready) - { - rfds.set(fd); - if (rchannel.find(fd) == rchannel.end()) rchannel[fd] = new task(fd, agent, Agent::outready); - else std::cerr << "Dispatcher::bind() : Error : file descriptor already in use" << std::endl; - } - if (mask & Agent::outexc) - { - xfds.set(fd); - if (xchannel.find(fd) == xchannel.end()) xchannel[fd] = new task(fd, agent, Agent::outexc); - } + my_xfds.set(fd); + if (my_xchannel.find(fd) == my_xchannel.end()) + my_xchannel[fd] = new task(fd, agent, Agent::outexc); } + } if (mask & Agent::err) + { + if (mask & Agent::errready) { - if (mask & Agent::errready) - { - rfds.set(fd); - if (rchannel.find(fd) == rchannel.end()) rchannel[fd] = new task(fd, agent, Agent::errready); - else std::cerr << "Dispatcher::bind() : Error : file descriptor already in use" << std::endl; - } - if (mask & Agent::errexc) - { - xfds.set(fd); - if (xchannel.find(fd) == xchannel.end()) xchannel[fd] = new task(fd, agent, Agent::errexc); - } + my_rfds.set(fd); + if (my_rchannel.find(fd) == my_rchannel.end()) + my_rchannel[fd] = new task(fd, agent, Agent::errready); + else throw std::invalid_argument("file descriptor already in use"); } + if (mask & Agent::errexc) + { + my_xfds.set(fd); + if (my_xchannel.find(fd) == my_xchannel.end()) + my_xchannel[fd] = new task(fd, agent, Agent::errexc); + } + } notify(); } @@ -148,50 +146,50 @@ /* * release file descriptors */ - Prague::Guard guard(mutex); - for (repository_t::iterator i = rchannel.begin(); i != rchannel.end(); i++) + Prague::Guard guard(my_mutex); + for (repository_t::iterator i = my_rchannel.begin(); i != my_rchannel.end(); i++) if ((*i).second->agent == agent && (fd == -1 || fd == (*i).second->fd)) - { - deactivate((*i).second); - (*i).second->released = true; - rchannel.erase(i); - } - for (repository_t::iterator i = wchannel.begin(); i != wchannel.end(); i++) + { + deactivate((*i).second); + (*i).second->released = true; + my_rchannel.erase(i); + } + for (repository_t::iterator i = my_wchannel.begin(); i != my_wchannel.end(); i++) if ((*i).second->agent == agent && (fd == -1 || fd == (*i).second->fd)) - { - deactivate((*i).second); - (*i).second->released = true; - wchannel.erase(i); - } - for (repository_t::iterator i = xchannel.begin(); i != xchannel.end(); i++) + { + deactivate((*i).second); + (*i).second->released = true; + my_wchannel.erase(i); + } + for (repository_t::iterator i = my_xchannel.begin(); i != my_xchannel.end(); i++) if ((*i).second->agent == agent && (fd == -1 || fd == (*i).second->fd)) - { - deactivate((*i).second); - (*i).second->released = true; - xchannel.erase(i); - } + { + deactivate((*i).second); + (*i).second->released = true; + my_xchannel.erase(i); + } /* * release Agent if no more file descriptors left */ - for (repository_t::iterator i = rchannel.begin(); i != rchannel.end(); i++) + for (repository_t::iterator i = my_rchannel.begin(); i != my_rchannel.end(); i++) if ((*i).second->agent == agent) return; - for (repository_t::iterator i = wchannel.begin(); i != wchannel.end(); i++) + for (repository_t::iterator i = my_wchannel.begin(); i != my_wchannel.end(); i++) if ((*i).second->agent == agent) return; - for (repository_t::iterator i = xchannel.begin(); i != xchannel.end(); i++) + for (repository_t::iterator i = my_xchannel.begin(); i != my_xchannel.end(); i++) if ((*i).second->agent == agent) return; - alist_t::iterator i = find(agents.begin(), agents.end(), agent); - if (i != agents.end()) - { - agents.erase(i); - agent->remove_ref(); - } + alist_t::iterator i = find(my_agents.begin(), my_agents.end(), agent); + if (i != my_agents.end()) + { + my_agents.erase(i); + agent->remove_ref(); + } } void *Dispatcher::run(void *X) { Dispatcher *dispatcher = reinterpret_cast(X); - dispatcher->workers.start(); + dispatcher->my_workers.start(); do dispatcher->wait(); while (true); return 0; @@ -200,7 +198,7 @@ void Dispatcher::dispatch(task *t) { deactivate(t); - tasks.push(t); + my_tasks.push(t); } void Dispatcher::process(task *t) @@ -212,72 +210,73 @@ bool done = !agent->process(t->fd, t->mask); agent->remove_ref(); // now look whether the agent is released and the task should be deleted - Prague::Guard guard(mutex); + Prague::Guard guard(my_mutex); if (!done) - { - if (t->released) delete t; - else activate(t); - } + { + if (t->released) delete t; + else activate(t); + } } void Dispatcher::deactivate(task *t) { switch (t->mask) - { - case Agent::inready: wfds.clear(t->fd); break; + { + case Agent::inready: my_wfds.clear(t->fd); break; case Agent::outready: - case Agent::errready: rfds.clear(t->fd); break; + case Agent::errready: my_rfds.clear(t->fd); break; case Agent::inexc: case Agent::outexc: - case Agent::errexc: xfds.clear(t->fd); break; + case Agent::errexc: my_xfds.clear(t->fd); break; default: break; - } + } } void Dispatcher::activate(task *t) { switch (t->mask) - { - case Agent::inready: wfds.set(t->fd); break; + { + case Agent::inready: my_wfds.set(t->fd); break; case Agent::outready: - case Agent::errready: rfds.set(t->fd); break; + case Agent::errready: my_rfds.set(t->fd); break; case Agent::inexc: case Agent::outexc: - case Agent::errexc: xfds.set(t->fd); break; + case Agent::errexc: my_xfds.set(t->fd); break; default: break; - } + } notify(); } void Dispatcher::wait() { Trace trace("Dispatcher::wait"); - FdSet tmprfds = rfds; - FdSet tmpwfds = wfds; - FdSet tmpxfds = xfds; - unsigned int fdsize = std::max(std::max(tmprfds.max(), tmpwfds.max()), tmpxfds.max()) + 1; + FdSet tmprfds = my_rfds; + FdSet tmpwfds = my_wfds; + FdSet tmpxfds = my_xfds; + unsigned int fdsize = std::max(std::max(tmprfds.max(), tmpwfds.max()), + tmpxfds.max()) + 1; int nsel = select(fdsize, tmprfds, tmpwfds, tmpxfds, 0); - pthread_testcancel(); + Thread::testcancel(); if (nsel == -1) - { - if (errno == EINTR || errno == EAGAIN) errno = 0; - } + { + if (errno == EINTR || errno == EAGAIN) errno = 0; + } else if (nsel > 0 && fdsize) + { + Prague::Guard guard(my_mutex); + for (repository_t::iterator i = my_rchannel.begin(); i != my_rchannel.end(); i++) + if (tmprfds.isset((*i).first)) + dispatch((*i).second); + for (repository_t::iterator i = my_wchannel.begin(); i != my_wchannel.end(); i++) + if (tmpwfds.isset((*i).first)) + dispatch((*i).second); + for (repository_t::iterator i = my_xchannel.begin(); i != my_xchannel.end(); i++) + if (tmpxfds.isset((*i).first)) + dispatch((*i).second); + if (tmprfds.isset(my_wakeup[0])) { - Prague::Guard guard(mutex); - for (repository_t::iterator i = rchannel.begin(); i != rchannel.end(); i++) - if (tmprfds.isset((*i).first)) - dispatch((*i).second); - for (repository_t::iterator i = wchannel.begin(); i != wchannel.end(); i++) - if (tmpwfds.isset((*i).first)) - dispatch((*i).second); - for (repository_t::iterator i = xchannel.begin(); i != xchannel.end(); i++) - if (tmpxfds.isset((*i).first)) - dispatch((*i).second); - if (tmprfds.isset(wakeup[0])) - { - char c[1]; - read(wakeup[0], c, 1); - } + char c[1]; + read(my_wakeup[0], c, 1); } + } } From stefan at fresco.org Thu May 8 03:21:14 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/src/Sys Signal.cc,1.9,1.10 Thread.cc,1.13,1.14 Timer.cc,1.10,1.11 Message-ID: Update of /cvs/fresco/Fresco/Prague/src/Sys In directory purcel:/tmp/cvs-serv22129/src/Sys Modified Files: Signal.cc Thread.cc Timer.cc Log Message: some API clarifications for Threads, and minor updates to enhance coding standard conformity Index: Signal.cc =================================================================== RCS file: /cvs/fresco/Fresco/Prague/src/Sys/Signal.cc,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Signal.cc 18 Oct 2001 14:37:20 -0000 1.9 +++ Signal.cc 8 May 2003 03:21:11 -0000 1.10 @@ -1,8 +1,8 @@ /*$Id$ * - * This source file is a part of the Berlin Project. - * Copyright (C) 1999 Stefan Seefeld - * http://www.berlin-consortium.org + * This source file is a part of the Fresco Project. + * Copyright (C) 1999 Stefan Seefeld + * http://www.fresco.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -53,7 +53,7 @@ bool Signal::set (int signum, Signal::Notifier *notifier) { - if (server.state() != Thread::running) server.start(); + if (server.state() == Thread::READY) server.start(); if (!notifiers[signum].size()) { struct sigaction sa; Index: Thread.cc =================================================================== RCS file: /cvs/fresco/Fresco/Prague/src/Sys/Thread.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Thread.cc 6 Feb 2001 19:46:17 -0000 1.13 +++ Thread.cc 8 May 2003 03:21:11 -0000 1.14 @@ -1,8 +1,8 @@ /*$Id$ * - * This source file is a part of the Berlin Project. - * Copyright (C) 1999 Stefan Seefeld - * http://www.berlin-consortium.org + * This source file is a part of the Fresco Project. + * Copyright (C) 1999 Stefan Seefeld + * http://www.fresco.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -24,6 +24,7 @@ using namespace Prague; +const void *Thread::CANCELED = PTHREAD_CANCELED; pthread_key_t Thread::self_key; pthread_key_t Thread::id_key; Mutex Thread::id_mutex; @@ -55,73 +56,82 @@ Thread::Guard::~Guard() { - Thread::main->_state = canceled; delete Thread::main; } Thread::Thread(proc pp, void *a, priority_t prio) - : p(pp), arg(a), _priority(prio), _state(ready), detached(false) + : my_proc(pp), + my_arg(a), + my_priority(prio), + my_state(READY), + my_detached(false) +{ +} + +Thread::Thread(pthread_t pt) + : my_proc(0), + my_arg(0), + my_thread(pt), + my_priority(NORMAL), + my_state(RUNNING), + my_detached(false) { } Thread::~Thread() { - if (this != self()) - { - cancel(); - if (!detached) join(0); - } + if (this != self() && state() != READY) + { + cancel(); + if (!my_detached) join(0); + } } void Thread::start() throw (Exception) { - Prague::Guard guard(mutex); - if ((_state) != ready) throw Exception("thread already running"); - if (pthread_create(&thread, 0, &start, this) != 0) throw Exception("can't create thread"); - else _state = running; + Prague::Guard guard(my_mutex); + if ((my_state) != READY) throw Exception("thread already running"); + if (pthread_create(&my_thread, 0, &start, this) != 0) throw Exception("can't create thread"); + else my_state = RUNNING; } void Thread::join(void **status) throw (Exception) { { - Prague::Guard guard(mutex); - if (_state == joined || _state == canceled || _state == ready) return; + Prague::Guard guard(my_mutex); + if (my_state == READY) throw Exception("can't join ready thread"); if (this == self()) throw Exception("can't join thread 'self'"); - if (detached) throw Exception("can't join detached thread"); - _state = joined; + if (my_detached) throw Exception("can't join detached thread"); } void *s; - pthread_join(thread, &s); - if (s == PTHREAD_CANCELED) - { - Prague::Guard guard(mutex); - _state = canceled; - } + pthread_join(my_thread, &s); + Prague::Guard guard(my_mutex); + my_state = READY; if (status) *status = s; } void Thread::cancel() { - if (this != self() && state() == running) - pthread_cancel(thread); + if (this != self() && state() == RUNNING) + pthread_cancel(my_thread); } void Thread::detach() { - mutex.lock(); - detached = true; - mutex.unlock(); - pthread_detach(thread); + my_mutex.lock(); + my_detached = true; + my_mutex.unlock(); + pthread_detach(my_thread); } void Thread::exit(void *r) { Thread *me = self(); if (me) - { - Prague::Guard guard(me->mutex); - me->_state = terminated; - } + { + Prague::Guard guard(me->my_mutex); + me->my_state = TERMINATED; + } pthread_exit(r); } @@ -132,8 +142,7 @@ id_mutex.lock(); pthread_setspecific(id_key, new unsigned long (counter++)); id_mutex.unlock(); - void *ret = thread->p(thread->arg); - return ret; + return thread->my_proc(thread->my_arg); } bool Thread::delay(const Time &time) Index: Timer.cc =================================================================== RCS file: /cvs/fresco/Fresco/Prague/src/Sys/Timer.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Timer.cc 21 Mar 2001 06:28:55 -0000 1.10 +++ Timer.cc 8 May 2003 03:21:11 -0000 1.11 @@ -1,8 +1,8 @@ /*$Id$ * - * This source file is a part of the Berlin Project. - * Copyright (C) 1999 Stefan Seefeld - * http://www.berlin-consortium.org + * This source file is a part of the Fresco Project. + * Copyright (C) 1999 Stefan Seefeld + * http://www.fresco.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -77,7 +77,7 @@ void Timer::schedule(Timer *timer) { - if (server.state() != Thread::running) server.start(); + if (server.state() == Thread::READY) server.start(); Prague::Guard guard(mutex); timers.push_back(timer); push_heap(timers.begin(), timers.end(), comp()); From stefan at fresco.org Thu May 8 04:11:34 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/config socket.m4,1.6,NONE Message-ID: Update of /cvs/fresco/Fresco/config In directory purcel:/tmp/cvs-serv23361/config Removed Files: socket.m4 Log Message: some cleanup in the autoconf stuff --- socket.m4 DELETED --- From stefan at fresco.org Thu May 8 04:11:34 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague configure.ac,1.42,1.43 Message-ID: Update of /cvs/fresco/Fresco/Prague In directory purcel:/tmp/cvs-serv23361/Prague Modified Files: configure.ac Log Message: some cleanup in the autoconf stuff Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/Prague/configure.ac,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- configure.ac 4 Mar 2003 05:44:54 -0000 1.42 +++ configure.ac 8 May 2003 04:11:32 -0000 1.43 @@ -55,7 +55,7 @@ AC_MSG_NOTICE([platform specific system utilities]) AC_CHECK_FUNCS(strsignal) AC_CHECK_HEADERS(string.h) -AC_NEED_DECLARATION(strsignal) +AC_CHECK_DECLS([strsignal]) AC_HEADER_SYS_WAIT AC_SEARCH_LIBS(recv, [socket resolv]) @@ -76,46 +76,29 @@ dnl ------------------------------------------------------------------ AC_MSG_NOTICE([Dynamic Loading Implementation]) -AC_CHECK_HEADERS(dlfcn.h dl.h) +AC_CHECK_HEADERS([dlfcn.h dl.h]) AC_CHECK_LIB(dl, dlopen) AC_LANG(C) -AC_CHECK_FUNCS(dlopen dlsym dlclose shl_load) +AC_CHECK_FUNCS([dlopen dlsym dlclose]) +AC_CHECK_FUNCS([shl_load shl_unload shl_findsym]) AC_LANG(C++) -AC_MSG_NOTICE([plugin method :]) - -AC_IFALLYES([header:dlfcn.h func:dlopen func:dlsym func:dlclose], - [AC_DEFINE(HAVE_DLFCN, 1, [Define if you have the dlfcn family of functions.]) AC_MSG_RESULT([use dlopen family of functions for plugins])]) -AC_IFALLYES([header:dl.h func:shl_load], - [AC_DEFINE(HAVE_DLAIX, 1, [Define if you have the AIX family of functions.]) AC_MSG_RESULT([use AIX shm_load for plugins])]) - dnl ------------------------------------------------------------------ dnl IPC support dnl ------------------------------------------------------------------ AC_MSG_NOTICE([IPC Implementation]) -FRESCO_LIB_SOCKET -AC_CHECK_LIB(util, login, LIBS="$LIBS -lutil") +AC_CHECK_HEADERS([sys/socket.h select.h sys/select.h netinet/in_systm.h netinet/ip.h]) AC_CHECK_HEADERS([pty.h sys/stropts.h libutil.h]) +AC_CHECK_HEADERS([arpa/inet.h sys/un.h]) +AC_CHECK_TYPES([socklen_t]) +AC_SEARCH_LIBS(socket, [socket]) +AC_SEARCH_LIBS(inet_aton, [socket resolv]) +AC_SEARCH_LIBS(login, [util]) AC_LANG(C) AC_CHECK_FUNCS([openpty _getpty]) AC_LANG(C++) -dnl won't work without AC_CANONICAL_HOST -dnl -dnl case "$host" in -dnl *-*-linux*) -dnl no_dev_ptmx=1 -dnl ;; -dnl *-*-sco3.2v4*) -dnl no_dev_ptmx=1 -dnl ;; -dnl *-*-sco3.2v5*) -dnl no_dev_ptmx=1 -dnl ;; -dnl esac -dnl -dnl complete disable no_dev_ptmx=1 if test -z "$no_dev_ptmx" ; then From stefan at fresco.org Thu May 8 04:11:35 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/include/Prague config.hh,1.3,1.4 Message-ID: Update of /cvs/fresco/Fresco/Prague/include/Prague In directory purcel:/tmp/cvs-serv23361/Prague/include/Prague Modified Files: config.hh Log Message: some cleanup in the autoconf stuff Index: config.hh =================================================================== RCS file: /cvs/fresco/Fresco/Prague/include/Prague/config.hh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- config.hh 19 Feb 2003 01:39:26 -0000 1.3 +++ config.hh 8 May 2003 04:11:32 -0000 1.4 @@ -18,7 +18,7 @@ # else inline const char *strsignal(int signo) { return _sys_siglist[signo];} # endif -#elif NEED_DECLARATION_strsignal +#elif !HAVE_DECL_STRSIGNAL extern "C" const char *strsignal(int); #endif From stefan at fresco.org Thu May 8 04:11:35 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/include/Prague/Sys DLL.hh,1.8,1.9 Message-ID: Update of /cvs/fresco/Fresco/Prague/include/Prague/Sys In directory purcel:/tmp/cvs-serv23361/Prague/include/Prague/Sys Modified Files: DLL.hh Log Message: some cleanup in the autoconf stuff Index: DLL.hh =================================================================== RCS file: /cvs/fresco/Fresco/Prague/include/Prague/Sys/DLL.hh,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- DLL.hh 23 Aug 2001 01:57:14 -0000 1.8 +++ DLL.hh 8 May 2003 04:11:33 -0000 1.9 @@ -38,10 +38,10 @@ //. resolve the given symbol void *resolve(const std::string &) throw(std::runtime_error); //. return the library's name - const std::string &name() const throw() { return _name;} + const std::string &name() const throw() { return my_name;} private: - std::string _name; - void *_handle; + std::string my_name; + void *my_handle; }; } From stefan at fresco.org Thu May 8 04:11:35 2003 From: stefan at fresco.org (Stefan Seefeld) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague/src/Sys DLL.cc,1.10,1.11 Message-ID: Update of /cvs/fresco/Fresco/Prague/src/Sys In directory purcel:/tmp/cvs-serv23361/Prague/src/Sys Modified Files: DLL.cc Log Message: some cleanup in the autoconf stuff Index: DLL.cc =================================================================== RCS file: /cvs/fresco/Fresco/Prague/src/Sys/DLL.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- DLL.cc 2 Jun 2002 23:42:24 -0000 1.10 +++ DLL.cc 8 May 2003 04:11:33 -0000 1.11 @@ -1,8 +1,8 @@ /*$Id$ * - * This source file is a part of the Berlin Project. - * Copyright (C) 1999 Stefan Seefeld - * http://www.berlin-consortium.org + * This source file is a part of the Fresco Project. + * Copyright (C) 1999 Stefan Seefeld + * http://www.fresco.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -22,36 +22,36 @@ #include "Prague/config.hh" #include "Prague/Sys/DLL.hh" -#if defined(HAVE_DLFCN) +#if defined(HAVE_DLFCN_H) #include -#elif defined(HAVE_DLAIX) +#elif defined(HAVE_DL_H) #include #endif using namespace Prague; DLL::DLL(const std::string &name, bool now) throw(std::runtime_error, std::logic_error) - : _name(name) + : my_name(name) { - if (!_name.empty()) + if (!my_name.empty()) { -#if defined(HAVE_DLFCN) +#if defined(HAVE_DLOPEN) int flags = now ? RTLD_NOW : RTLD_LAZY; flags |= RTLD_GLOBAL; - _handle = dlopen(_name.c_str(), flags); - if (!_handle) + my_handle = dlopen(my_name.c_str(), flags); + if (!my_handle) { - std::string message = "Failed to load " + _name + ": " + dlerror(); + std::string message = "Failed to load " + my_name + ": " + dlerror(); throw std::runtime_error(message); } -#elif defined(HAVE_DLAIX) - shl_t shl_handle = shl_load (_name.c_str(), (now ? BIND_DEFERRED : BIND_IMMEDIATE) | BIND_NONFATAL | BIND_VERBOSE, 0); +#elif defined(HAVE_SHL_LOAD) + shl_t shl_handle = shl_load(my_name.c_str(), (now ? BIND_DEFERRED : BIND_IMMEDIATE) | BIND_NONFATAL | BIND_VERBOSE, 0); if (!shl_handle) { - std::string message = "Failed to load " + _name + ": " + strerror(errno); + std::string message = "Failed to load " + my_name + ": " + strerror(errno); throw std::runtime_error(message); } - else _handle = shl_handle; + else my_handle = shl_handle; #endif } else throw std::logic_error("empty filename"); @@ -59,31 +59,31 @@ DLL::~DLL() throw() { -#if defined(HAVE_DLFCN) - dlclose(_handle); -#elif defined(HAVE_AIX) - shl_unload (reinterpret_cast(_handle)); +#if defined(HAVE_DLCLOSE) + dlclose(my_handle); +#elif defined(HAVE_SHL_UNLOAD) + shl_unload (reinterpret_cast(my_handle)); #endif } void *DLL::resolve(const std::string &symbol) throw(std::runtime_error) { -#if defined(HAVE_DLFCN) - void *tmp = dlsym(_handle, symbol.c_str()); +#if defined(HAVE_DLSYM) + void *tmp = dlsym(my_handle, symbol.c_str()); if (!tmp) { std::string message = "Failed to resolve \"" + symbol + - "\" in loaded file \"" + _name + + "\" in loaded file \"" + my_name + "\": " + dlerror(); throw std::runtime_error(message); } -#elif defined(HAVE_DLAIX) +#elif defined(HAVE_SHL_FINDSYM) void *tmp; - if (shl_findsym(reinterpret_cast(&_handle), symbol.c_str(), TYPE_UNDEFINED, &tmp) != 0 || _handle == 0 || tmp == 0) + if (shl_findsym(reinterpret_cast(&my_handle), symbol.c_str(), TYPE_UNDEFINED, &tmp) != 0 || my_handle == 0 || tmp == 0) { - istd:string message = "Failed to resolve \"" + symbol + - "\" in loaded file \"" + _name + - "\": " + strerror(errno); + std:string message = "Failed to resolve \"" + symbol + + "\" in loaded file \"" + my_name + + "\": " + strerror(errno); throw std::runtime_error(message); } #endif From tobias at fresco.org Wed May 14 22:42:14 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Fresco-Test configure.ac,1.5,1.6 Message-ID: Update of /cvs/fresco/Fresco/Fresco-Test In directory purcel:/tmp/cvs-serv20833/Fresco-Test Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-Test/configure.ac,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- configure.ac 5 Apr 2003 22:37:34 -0000 1.5 +++ configure.ac 14 May 2003 22:42:11 -0000 1.6 @@ -31,11 +31,12 @@ AC_CONFIG_SRCDIR(LICENSE) AC_CONFIG_AUX_DIR(config) -AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST AC_PROG_MAKE_SET - -AC_PROG_CXX +FRESCO_PROG_CC_CXX +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING FRESCO_FLAG_SO From tobias at fresco.org Wed May 14 22:42:14 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/GGI configure.ac,1.18,1.19 Message-ID: Update of /cvs/fresco/Fresco/GGI In directory purcel:/tmp/cvs-serv20833/GGI Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/GGI/configure.ac,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- configure.ac 4 Mar 2003 05:44:54 -0000 1.18 +++ configure.ac 14 May 2003 22:42:12 -0000 1.19 @@ -33,9 +33,13 @@ AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER(include/Fresco/acconfig.hh:config/acconfig.hh.in) -AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST AC_PROG_MAKE_SET +FRESCO_PROG_CC_CXX +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING +FRESCO_FLAG_SO AC_LANG(C++) dnl ------------------------------------------------------------------ @@ -53,12 +57,6 @@ FRESCO_IDL_PATH AC_SUBST(Fresco_IDL_prefix) - -dnl ------------------------------------------------------------------ -dnl General flags -dnl ------------------------------------------------------------------ - -FRESCO_FLAG_SO dnl ------------------------------------------------------------------ dnl Graphics environment From tobias at fresco.org Wed May 14 22:42:15 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/Prague configure.ac,1.43,1.44 Message-ID: Update of /cvs/fresco/Fresco/Prague In directory purcel:/tmp/cvs-serv20833/Prague Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/Prague/configure.ac,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- configure.ac 8 May 2003 04:11:32 -0000 1.43 +++ configure.ac 14 May 2003 22:42:12 -0000 1.44 @@ -31,17 +31,21 @@ AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER(include/Prague/acconfig.hh:config/acconfig.hh.in) -AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST AC_PROG_MAKE_SET +FRESCO_PROG_CC_CXX +FRESCO_FLAG_SO +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING dnl ------------------------------------------------------------------ dnl Environment (this needs to go before AC_LANG(C++) dnl ------------------------------------------------------------------ +AC_LANG(C) AC_HEADER_STDC AC_CHECK_FUNCS(getenv putenv setenv unsetenv) - AC_LANG(C++) dnl ------------------------------------------------------------------ @@ -61,8 +65,6 @@ AC_SEARCH_LIBS(recv, [socket resolv]) AC_CHECK_LIB(z, gzsetparams, AC_DEFINE(HAVE_ZLIB, 1, [Define if you have the zlib library.]), [AC_MSG_ERROR([update your zlib, please])]) - -FRESCO_FLAG_SO dnl ------------------------------------------------------------------ dnl Thread support From tobias at fresco.org Wed May 14 22:42:15 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/SDL configure.ac,1.10,1.11 Message-ID: Update of /cvs/fresco/Fresco/SDL In directory purcel:/tmp/cvs-serv20833/SDL Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/SDL/configure.ac,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- configure.ac 4 Mar 2003 05:44:55 -0000 1.10 +++ configure.ac 14 May 2003 22:42:13 -0000 1.11 @@ -37,14 +37,14 @@ dnl [Copyright (c) 2000 The Berlin Project ], dnl VERSION) -AC_PROG_MAKE_SET -AC_LANG(C++) - -dnl ------------------------------------------------------------------ -dnl General flags -dnl ------------------------------------------------------------------ +AC_CANONICAL_HOST +AC_PROG_MAKE_SET +FRESCO_PROG_CC_CXX +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING FRESCO_FLAG_SO +AC_LANG(C++) dnl ------------------------------------------------------------------ dnl Graphics environment From tobias at fresco.org Wed May 14 22:42:16 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/config compiler.m4,1.3,1.4 so.m4,1.2,1.3 Message-ID: Update of /cvs/fresco/Fresco/config In directory purcel:/tmp/cvs-serv20833/config Modified Files: compiler.m4 so.m4 Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: compiler.m4 =================================================================== RCS file: /cvs/fresco/Fresco/config/compiler.m4,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- compiler.m4 8 Nov 2000 23:19:43 -0000 1.3 +++ compiler.m4 14 May 2003 22:42:13 -0000 1.4 @@ -1,8 +1,8 @@ dnl $Id$ -dnl This source file is a part of the Berlin Project. +dnl This source file is a part of the Fersco Project. dnl Copyright (c) 1999 Ralf S. Engelschall dnl Copyright (c) 2000 Momchil Velikov -dnl http://www.berlin-consortium.org/ +dnl http://www.fresco.org/ dnl dnl This library is free software; you can redistribute it and/or dnl modify it under the terms of the GNU Library General Public @@ -20,8 +20,7 @@ dnl MA 02139, USA. dnl -AC_DEFUN(AC_PROG_CC_CXX,[dnl - +AC_DEFUN(FRESCO_PROG_CC_CXX, [ user_g_CFLAGS="" user_O_CFLAGS="" user_g_CXXFLAGS="" @@ -29,116 +28,155 @@ for flag in $CFLAGS ; do case $flag in - *-g* ) user_g_CFLAGS="$user_g_CFLAGS $flag" ;; - *-O*|*-f* ) user_O_CFLAGS="$user_O_CFLAGS $flag" ;; + ( *-g* ) user_g_CFLAGS="$user_g_CFLAGS $flag" ;; + ( *-O*|*-f* ) user_O_CFLAGS="$user_O_CFLAGS $flag" ;; esac done for flag in $CXXFLAGS ; do case $flag in - *-g* ) user_g_CXXFLAGS="$user_g_CXXFLAGS $flag" ;; - *-O*|*-f* ) user_O_CXXFLAGS="$user_O_CXXFLAGS $flag" ;; + ( *-g* ) user_g_CXXFLAGS="$user_g_CXXFLAGS $flag" ;; + ( *-O*|*-f* ) user_O_CXXFLAGS="$user_O_CXXFLAGS $flag" ;; esac done AC_PROG_CC AC_PROG_CXX - CFLAGS=`echo "$CFLAGS" \ - | sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` - CXXFLAGS=`echo "$CXXFLAGS" \ - | sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` + CFLAGS=`echo "$CFLAGS" | \ + sed -e "s/ -g / /g" -e "s/ -g$//" \ + -e "s/^-g //g" -e "s/^-g$//"` + CXXFLAGS=`echo "$CXXFLAGS" | \ + sed -e "s/ -g / /g" -e "s/ -g$//" \ + -e "s/^-g //g" -e "s/^-g$//"` + changequote(<<, >>) - CFLAGS=`echo $CFLAGS \ - | sed -e "s/ -O[0-9]* / /g" -e "s/ -O[0-9]*$//" \ - -e "s/^-O[0-9]* //g" -e "s/^-O[0-9]*$//"` - CXXFLAGS=`echo $CXXFLAGS \ - | sed -e "s/ -O[0-9]* / /g" -e "s/ -O[0-9]*$//" \ - -e "s/^-O[0-9]* //g" -e "s/^-O[0-9]*$//"` + CFLAGS=`echo "$CFLAGS" | \ + sed -e "s/ -O[0-9]* / /g" -e "s/ -O[0-9]*$//" \ + -e "s/^-O[0-9]*//g" -e "s/^-O[0-9]*$//"` + CXXFLAGS=`echo "$CXXFLAGS" | \ + sed -e "s/ -O[0-9]* / /g" -e "s/ -O[0-9]*$//" \ + -e "s/^-O[0-9]*//g" -e "s/^-O[0-9]*$//"` changequote([, ]) if test ".$ac_cv_prog_gcc" = ".yes" ; then for flag in "-pipe" ; do case "$CFLAGS" in - *${flag}* ) ;; - *) CFLAGS="$CFLAGS $flag" ;; + ( *${flag}* ) ;; + ( *) CFLAGS="$CFLAGS $flag" ;; esac case "$CXXFLAGS" in - *${flag}* ) ;; - *) CXXFLAGS="$CXXFLAGS $flag" ;; + ( *${flag}* ) ;; + ( *) CXXFLAGS="$CXXFLAGS $flag" ;; esac done fi ]) + +AC_DEFUN(FRESCO_COMPILER_OPTION, [ + AC_CACHE_CHECK([whether compiler option(s) $2 work], + [fresco_cv_stat_compiler_option_$1], + [ + SAVE_CFLAGS="$CFLAGS" + SAVE_CXXFLAGS="$CXXFLAGS" + CFLAGS="$CFLAGS $3" + CXXFLAGS="$CXXFLAGS $3" + AC_TRY_COMPILE([],[], fresco_cv_stat_compiler_option_$1=yes, fresco_cv_stat_compiler_option_$1=no) + CFLAGS="$SAVE_CFLAGS" + CXXFLAGS="$SAVE_CXXFLAGS" + ]) + if test ".$fresco_cv_stat_compiler_option_$1" = .yes; then + [$4] + fi +]) -AC_DEFUN(AC_CHECK_DEBUGGING,[dnl +AC_DEFUN(FRESCO_CHECK_DEBUGGING, [ + AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(debug,dnl -[ --enable-debug build for debugging (default=no)], - [dnl + AC_ARG_ENABLE(debugging, AC_HELP_STRING([--enable-debugging], [build for debugging (default=no)]), + [ if test ".$enableval" = ".yes" ; then + msg="enabled"; if test ".$user_g_CFLAGS" != . ; then CFLAGS="$CFLAGS $user_g_CFLAGS" + msg="$msg, using specified CFLAGS" else - CFLAGS="$CFLAGS -g" if test ".$ac_cv_prog_gcc" = ".yes" ; then - AC_COMPILER_OPTION(cggdb3, -ggdb3, -ggdb3, + AC_LANG_SAVE + AC_LANG(C) + FRESCO_COMPILER_OPTION(cggdb3, [-ggdb3 for C], -ggdb3, CFLAGS="$CFLAGS -ggdb3") + AC_LANG_RESTORE + else + CFLAGS="$CFLAGS -g" fi fi if test ."$user_g_CXXFLAGS" != . ; then CXXFLAGS="$CXXFLAGS $user_g_CXXFLAGS" + msg="$msg, using specified CXXFLAGS" else - CXXFLAGS="$CXXFLAGS -g" if test ."$ac_cv_prog_gcc" = ."yes" ; then AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_COMPILER_OPTION(cxxggdb3, -ggdb3, -ggdb3, + AC_LANG(C++) + FRESCO_COMPILER_OPTION(cxxggdb3, [-ggdb3 for C++], -ggdb3, CXXFLAGS="$CXXFLAGS -ggdb3") AC_LANG_RESTORE + else + CXXFLAGS="$CXXFLAGS -g" fi fi - msg=enabled - AC_DEFINE(DEBUG) + AC_DEFINE(DEBUG, [], [Enable debugging code?]) + AC_SUBST(DEBUG) + AC_MSG_CHECKING(for compilation debug mode) + AC_MSG_RESULT([$msg]) else - msg=disabled + AC_MSG_CHECKING(for compilation debug mode) + AC_MSG_RESULT(disabled, ignoring CFLAGS and CXXFLAGS) + fi + ],[ + msg="Setting none of my own" + if test ."$user_g_CFLAGS" != . ; then + CFLAGS="$CFLAGS $user_g_CFLAGS" + msg="$msg, using specified CFLAGS"; + fi + if test ."$user_g_CXXFLAGS" != . ; then + CXXFLAGS="$CXXFLAGS $user_g_CXXFLAGS" + msg="$msg, using specified CXXFLAGS"; fi AC_MSG_CHECKING(for compilation debug mode) - AC_MSG_RESULT($msg) - ],[dnl - CFLAGS="$CFLAGS $user_g_CFLAGS" - CXXFLAGS="$CXXFLAGS $user_g_CXXFLAGS" - AC_MSG_CHECKING(for compilation debug mode) - AC_MSG_RESULT(default) + AC_MSG_RESULT([$msg]) ]) ]) -AC_DEFUN(AC_CHECK_OPTIMIZE,[dnl - +AC_DEFUN(FRESCO_CHECK_OPTIMIZE, [ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_ENABLE(optimize,dnl -[ --enable-optimize build with optimization (default=no)], - [dnl + AC_ARG_ENABLE(optimization, AC_HELP_STRING([--enable-optimization], [build with optimization (default=no)]), + [ if test ".$enableval" = ".yes" ; then + msg="enabled" if test ".$user_O_CFLAGS" != "." ; then CFLAGS="$CFLAGS $user_O_CFLAGS" + msg="$msg, using specified CFLAGS" else if test ".$ac_cv_prog_gcc" = ".yes" ; then OPT_CFLAGS='-O3 -funroll-loops -fstrength-reduce -fomit-frame-pointer -ffast-math' - AC_COMPILER_OPTION(coptimize_std, + AC_LANG_SAVE + AC_LANG(C) + FRESCO_COMPILER_OPTION(coptimize_std, [-f for C], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS") case $host_cpu in i?86*|?86*) - OPT_CFLAGS='-malign-functions=4 -malign-jumps=4 -malign-loops=4' - AC_COMPILER_OPTION(coptimize_x86, + OPT_CFLAGS='-falign-functions=4 -falign-jumps=4 -falign-loops=4' + FRESCO_COMPILER_OPTION(coptimize_x86, [-f for x86 CPU], $OPT_CFLAGS, CFLAGS="$CFLAGS $OPT_CFLAGS") ;; esac + AC_LANG_RESTORE else CFLAGS="$CFLAGS -O" fi @@ -146,37 +184,47 @@ if test ".$user_O_CXXFLAGS" != "." ; then CXXFLAGS="$CXXFLAGS $user_O_CXXFLAGS" + msg="$msg, using specified CXXFLAGS" else if test ."$ac_cv_prog_gcc" = ."yes" ; then OPT_CXXFLAGS='-O3 -funroll-loops -fstrength-reduce -ffast-math' - AC_COMPILER_OPTION(cxxoptimize_std, + AC_LANG_SAVE + AC_LANG(C++) + FRESCO_COMPILER_OPTION(cxxoptimize_std, [-f for C++], $OPT_CXXFLAGS, CXXFLAGS="$CXXFLAGS $OPT_CXXFLAGS") case $host_cpu in i?86*|?86*) - OPT_CXXFLAGS='-malign-functions=4 -malign-jumps=4 -malign-loops=4' - AC_COMPILER_OPTION(cxxoptimize_x86, + OPT_CXXFLAGS='-falign-functions=4 -falign-jumps=4 -falign-loops=4' + FRESCO_COMPILER_OPTION(cxxoptimize_x86, [-f for x86 CPU], $OPT_CXXFLAGS, CXXFLAGS="$CXXFLAGS $OPT_CXXFLAGS") ;; esac + AC_LANG_RESTORE else CXXFLAGS="$CXXFLAGS -O" fi fi - msg=enabled + AC_MSG_CHECKING(for compilation optimize mode) + AC_MSG_RESULT([$msg]) else - msg=disabled + AC_MSG_CHECKING(for compilation optimize mode) + AC_MSG_RESULT([disabled, ignoring specified CFLAGS and CXXFLAGS]) fi - - AC_MSG_CHECKING(for compilation optimize mode) - AC_MSG_RESULT(msg) - ],[dnl - CFLAGS="$CFLAGS $user_O_CFLAGS" - CXXFLAGS="$CXXFLAGS $user_O_CXXFLAGS" - AC_MSG_CHECKING(for compilation optimize mode) - AC_MSG_RESULT(default) + ],[ + msg="Setting none of my own" + if test ."$user_O_CFLAGS" != . ; then + CFLAGS="$CFLAGS $user_O_CFLAGS" + msg="$msg, using specified CFLAGS"; + fi + if test ."$user_O_CXXFLAGS" != . ; then + CXXFLAGS="$CXXFLAGS $user_O_CXXFLAGS" + msg="$mesgm using specified CXXFLAGS"; + fi + AC_MSG_CHECKING(for compilation optimize mode) + AC_MSG_RESULT([$msg]) ]) ]) Index: so.m4 =================================================================== RCS file: /cvs/fresco/Fresco/config/so.m4,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- so.m4 29 May 2002 06:49:42 -0000 1.2 +++ so.m4 14 May 2003 22:42:13 -0000 1.3 @@ -26,7 +26,7 @@ dnl TODO: Add checks to set the right flag for all compilers SO_CXXFLAGS="-fPIC" - SO_LDFLAGS="-shared -rdynamic" + SO_LDFLAGS="-shared" AC_SUBST(SO_CXXFLAGS) AC_SUBST(SO_LDFLAGS) From tobias at fresco.org Wed May 14 22:42:16 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:23 2005 Subject: [Fresco-changes] Fresco/contrib/daVinci configure.ac,1.4,1.5 Message-ID: Update of /cvs/fresco/Fresco/contrib/daVinci In directory purcel:/tmp/cvs-serv20833/contrib/daVinci Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/contrib/daVinci/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configure.ac 4 Mar 2003 05:44:55 -0000 1.4 +++ configure.ac 14 May 2003 22:42:13 -0000 1.5 @@ -33,14 +33,14 @@ AC_CONFIG_HEADER(include/daVinci/acconfig.hh:config/acconfig.hh.in) AC_CONFIG_AUX_DIR(config) -AC_PROG_MAKE_SET -AC_LANG(C++) - -dnl ------------------------------------------------------------------ -dnl General flags -dnl ------------------------------------------------------------------ +AC_CANONICAL_HOST +AC_PROG_MAKE_SET +FRESCO_PROG_CC_CXX +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING FRESCO_FLAG_SO +AC_LANG(C++) dnl ------------------------------------------------------------------ dnl Prague, Babylon, and Fresco From tobias at fresco.org Wed May 14 22:42:42 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:24 2005 Subject: [Fresco-changes] Fresco Makefile.in,1.42,1.43 configure.ac,1.25,1.26 Message-ID: Update of /cvs/fresco/Fresco In directory purcel:/tmp/cvs-serv20833 Modified Files: Makefile.in configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: Makefile.in =================================================================== RCS file: /cvs/fresco/Fresco/Makefile.in,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- Makefile.in 6 Apr 2003 20:30:03 -0000 1.42 +++ Makefile.in 14 May 2003 22:42:09 -0000 1.43 @@ -34,9 +34,10 @@ contrib/daVinci testbase_dir := $(shell test -d Fresco-Test && echo 'Fresco-Test') -mandatory_dirs := $(foreach package, $(mandatory), $(shell test -d $(package) && echo '$(package)')) -optional_dirs := $(foreach package, $(optional), $(shell test -d $(package) && echo '$(package)')) -subdirs := $(testbase_dir) $(mandatory_dirs) $(optional_dirs) +mandatory_dirs := $(foreach package, $(mandatory), $(shell if test -d $(package) -a -f $(package)/Makefile ; then echo '$(package)'; fi )) +missing_mandatory_dirs := $(foreach package, $(mandatory), $(shell if test ! -d $(package) -o ! -f $(package)/Makefile ; then echo '$(package)'; fi )) +optional_dirs := $(foreach package, $(optional), $(shell test -d $(package) && test -f $(package)/Makefile && echo '$(package)')) +subdirs := $(missing_mandatory_dirs) $(testbase_dir) $(mandatory_dirs) $(optional_dirs) sxrdirs := Prague Babylon Berlin # Overridden by the clean-targets, allowing the same subdirs-rule to be used @@ -48,6 +49,10 @@ clean distclean maintainer-clean all: $(subdirs) + +$(missing_mandatory_dirs): + @echo "The mandatory package \"$@\" not properly configured!" + @exit 1 $(mandatory_dirs): %: %/Makefile @echo "making $(action) in $@" Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/configure.ac,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- configure.ac 4 Mar 2003 05:44:50 -0000 1.25 +++ configure.ac 14 May 2003 22:42:09 -0000 1.26 @@ -41,8 +41,8 @@ AC_ARG_ENABLE(sdl, AC_HELP_STRING([--enable-sdl],[Configure with sdl support]), [config_sdl="$enableval"],[config_sdl="yes"]) -AC_ARG_ENABLE(c++-demos, - AC_HELP_STRING([--enable-c++-demos],[Configure c++ demos support]), +AC_ARG_ENABLE(cxx-demos, + AC_HELP_STRING([--enable-cxx-demos],[Configure c++ demos support]), [config_cxx_demos="$enableval"],[config_cxx_demos="yes"]) AC_ARG_ENABLE(python-runtime, AC_HELP_STRING([--enable-python-runtime],[Configure python runtime support]), From tobias at fresco.org Wed May 14 22:42:42 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:24 2005 Subject: [Fresco-changes] Fresco/Babylon configure.ac,1.23,1.24 Message-ID: Update of /cvs/fresco/Fresco/Babylon In directory purcel:/tmp/cvs-serv20833/Babylon Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/Babylon/configure.ac,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- configure.ac 6 Apr 2003 16:15:44 -0000 1.23 +++ configure.ac 14 May 2003 22:42:09 -0000 1.24 @@ -35,9 +35,14 @@ AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADER(include/Babylon/acconfig.hh:config/acconfig.hh.in) -AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST AC_PROG_MAKE_SET +FRESCO_PROG_CC_CXX +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING +FRESCO_FLAG_SO + AC_LANG(C++) dnl ------------------------------------------------------------------ @@ -72,8 +77,6 @@ AC_HELP_STRING([--enable-unicode-blocks],[complete or latin unicode support]), [AC_SUBST(UNICODE_BLOCKS,"$enableval")], [AC_SUBST(UNICODE_BLOCKS,complete)]) - -FRESCO_FLAG_SO dnl ------------------------------------------------------------------ dnl Output substitution From tobias at fresco.org Wed May 14 22:42:42 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:24 2005 Subject: [Fresco-changes] Fresco/Berlin configure.ac,1.63,1.64 Message-ID: Update of /cvs/fresco/Fresco/Berlin In directory purcel:/tmp/cvs-serv20833/Berlin Modified Files: configure.ac Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: configure.ac =================================================================== RCS file: /cvs/fresco/Fresco/Berlin/configure.ac,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- configure.ac 25 Apr 2003 18:41:13 -0000 1.63 +++ configure.ac 14 May 2003 22:42:10 -0000 1.64 @@ -33,16 +33,14 @@ AC_CONFIG_HEADER(include/Berlin/acconfig.hh:config/acconfig.hh.in) AC_CONFIG_AUX_DIR(config) -AC_CANONICAL_SYSTEM +AC_CANONICAL_HOST AC_PROG_MAKE_SET -AC_LANG(C++) - -dnl ------------------------------------------------------------------ -dnl General flags -dnl ------------------------------------------------------------------ - +FRESCO_PROG_CC_CXX +FRESCO_CHECK_OPTIMIZE +FRESCO_CHECK_DEBUGGING FRESCO_FLAG_SO +AC_LANG(C++) dnl ------------------------------------------------------------------ dnl Text rendering @@ -53,7 +51,7 @@ FRESCO_FREETYPE_CHECK(9.2.3,,[AC_MSG_ERROR([can't compile Server without freetype])]) AC_ARG_WITH(png-prefix, - [ --with-png-prefix=PFX Prefix where PNG library is installed (optional)], + AC_HELP_STRING([--with-png-prefix=PFX], [Prefix where PNG library is installed (optional)]), [png_prefix="$withval"; png_path="$PATH:$withval/bin"], [png_prefix=""; png_path="$PATH"]) From tobias at fresco.org Wed May 14 22:42:43 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:24 2005 Subject: [Fresco-changes] Fresco/Fresco-C++/config local.mk.in,1.13,1.14 Message-ID: Update of /cvs/fresco/Fresco/Fresco-C++/config In directory purcel:/tmp/cvs-serv20833/Fresco-C++/config Modified Files: local.mk.in Log Message: A couple of buildsystem fixes: * Reactivated some old code from Havard: --enable-optimization and --enable-debugging should work again (closes bug45) * --enable-c++-demos renamed to --enable-cxx-demos: Looks like autoconf does not like + in options (closes bug173) * Toplevel Makefile should check for "Makefile" in the subproject's dirs: --disable-sdl should now work, even if builddir == srcdir (closes bug209) * Remove -rdynamic flag: We need gcc > 3.0 now and I can't find any documentation on this flag anymore (closes bug79) * Various small cleanups like replacing macros that are getting obsolete) Index: local.mk.in =================================================================== RCS file: /cvs/fresco/Fresco/Fresco-C++/config/local.mk.in,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- local.mk.in 10 Dec 2002 05:46:14 -0000 1.13 +++ local.mk.in 14 May 2003 22:42:10 -0000 1.14 @@ -52,3 +52,4 @@ LIBS := @LIBS@ SO_CXXFLAGS := @SO_CXXFLAGS@ SO_LDFLAGS := @SO_LDFLAGS@ +CXXFLAGS := @CXXFLAGS@ From tobias at fresco.org Wed May 14 22:42:43 2003 From: tobias at fresco.org (Tobias Hunger) Date: Fri Feb 25 22:16:24 2005 Subject: [Fresco-changes] Fresco/Fresco-C++ configure.ac,1.34,1.35 Message-ID: Update of /cvs/fresco/Fresco/Fresco-C++ In directory purcel:/tmp/cvs-serv20833/Fresco-C++ Modified Files: configure.ac L