Building Celestia on Xubuntu Intrepid
Posted: 02.11.2008, 21:06
Hello!
I have built the latest SVN of Celestia under Intrepid, but it required some changes - mostly I think because GCC is a newer version.
I had to #include <libintl.h> in quite a few places, and also <cstring>. In one place I had to change Std::time to just "time", but I think this may just be for GCC, so I put it in a #ifdef for _WIN32.
For anyone else trying to build this, here are the libs needed:
build-essential libtheora-dev liblua5.1-0-dev libgl1-mesa-dev libglut3-dev libgnomeui-dev libgtkglext1-dev libjpeg62-dev
zlib1g-dev
After installing zlib, configure kept complaining about it not being installed, but config.log revealed that it was libxmu-dev that was missing. The error I was getting was:
configure: error: zlib not found.
So I installed: libxmu-dev
I then ran: ./configure --with-gnome --with-lua --enable-theora
The source changes I made to get it to compile are against SVN r4534. Since there is no clue as to what extensions I can upload here, I will paste the unified diff that SVN generated below. Perhaps these can be reviewed and merged? I can't test it on anything but GCC 4.3.2.
----8<---- snip ----8<----
Index: src/celestia/eclipsefinder.cpp
===================================================================
--- src/celestia/eclipsefinder.cpp (revision 4534)
+++ src/celestia/eclipsefinder.cpp (working copy)
@@ -10,7 +10,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
-#include <string>
+#include <cstring>
#include <sstream>
#include <algorithm>
#include <set>
Index: src/celestia/celestiacore.cpp
===================================================================
--- src/celestia/celestiacore.cpp (revision 4534)
+++ src/celestia/celestiacore.cpp (working copy)
@@ -13,6 +13,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <cstdio>
#include <iostream>
#include <fstream>
Index: src/celestia/url.cpp
===================================================================
--- src/celestia/url.cpp (revision 4534)
+++ src/celestia/url.cpp (working copy)
@@ -15,7 +15,8 @@
* *
***************************************************************************/
-#include <string>
+#include <libintl.h>
+#include <cstring>
#include <cstdio>
#include <cassert>
#include <sstream>
Index: src/celestia/oggtheoracapture.cpp
===================================================================
--- src/celestia/oggtheoracapture.cpp (revision 4534)
+++ src/celestia/oggtheoracapture.cpp (working copy)
@@ -59,13 +59,14 @@
# define _REENTRANT
#endif
+#include <libintl.h>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <celutil/debug.h>
#include <celutil/util.h>
#include "../celengine/gl.h"
-#include <string>
+#include <cstring>
#include "theora/theora.h"
using namespace std;
@@ -159,7 +160,12 @@
return false;
}
/* Set up Ogg output stream */
- std::srand(std::time(NULL));
+ #ifdef _WIN32
+ std::srand(std::time(NULL));
+ #else
+ std::srand(time(NULL));
+ #endif
+
ogg_stream_init(&to,std::rand());
frame_x = w;
Index: src/celestia/celx_object.cpp
===================================================================
--- src/celestia/celx_object.cpp (revision 4534)
+++ src/celestia/celx_object.cpp (working copy)
@@ -9,6 +9,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include "celx.h"
#include "celx_internal.h"
#include "celx_object.h"
Index: src/celengine/location.cpp
===================================================================
--- src/celengine/location.cpp (revision 4534)
+++ src/celengine/location.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <map>
#include <celengine/location.h>
#include <celengine/body.h>
Index: src/celengine/body.cpp
===================================================================
--- src/celengine/body.cpp (revision 4534)
+++ src/celengine/body.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <cstdlib>
#include <cassert>
#include <algorithm>
Index: src/celengine/texture.cpp
===================================================================
--- src/celengine/texture.cpp (revision 4534)
+++ src/celengine/texture.cpp (working copy)
@@ -21,6 +21,7 @@
#endif
#endif
+#include <libintl.h>
#include <cmath>
#include <algorithm>
#include <iostream>
Index: src/celengine/opencluster.cpp
===================================================================
--- src/celengine/opencluster.cpp (revision 4534)
+++ src/celengine/opencluster.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <algorithm>
#include <stdio.h>
#include "celestia.h"
Index: src/celengine/nebula.cpp
===================================================================
--- src/celengine/nebula.cpp (revision 4534)
+++ src/celengine/nebula.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <algorithm>
#include <stdio.h>
#include "celestia.h"
Index: src/celengine/stardb.cpp
===================================================================
--- src/celengine/stardb.cpp (revision 4534)
+++ src/celengine/stardb.cpp (working copy)
@@ -7,6 +7,8 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
+#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
Index: src/celengine/globular.cpp
===================================================================
--- src/celengine/globular.cpp (revision 4534)
+++ src/celengine/globular.cpp (working copy)
@@ -11,6 +11,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <fstream>
#include <algorithm>
#include <cstdio>
Index: src/celengine/asterism.cpp
===================================================================
--- src/celengine/asterism.cpp (revision 4534)
+++ src/celengine/asterism.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <algorithm>
#ifndef _WIN32
Index: src/celengine/solarsys.cpp
===================================================================
--- src/celengine/solarsys.cpp (revision 4534)
+++ src/celengine/solarsys.cpp (working copy)
@@ -9,6 +9,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <cassert>
// #include <limits>
#include <cstdio>
Index: src/celengine/image.cpp
===================================================================
--- src/celengine/image.cpp (revision 4534)
+++ src/celengine/image.cpp (working copy)
@@ -8,6 +8,7 @@
// of the License, or (at your option) any later version.
#include <fstream>
+#include <libintl.h>
#ifndef TARGET_OS_MAC
#define JPEG_SUPPORT
Index: src/celengine/galaxy.cpp
===================================================================
--- src/celengine/galaxy.cpp (revision 4534)
+++ src/celengine/galaxy.cpp (working copy)
@@ -7,6 +7,8 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
+#include <libintl.h>
#include <fstream>
#include <algorithm>
#include <cstdio>
Index: src/celengine/fragmentprog.cpp
===================================================================
--- src/celengine/fragmentprog.cpp (revision 4534)
+++ src/celengine/fragmentprog.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <iostream>
#include <fstream>
#include <string>
Index: src/celengine/vertexprog.cpp
===================================================================
--- src/celengine/vertexprog.cpp (revision 4534)
+++ src/celengine/vertexprog.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <iostream>
#include <fstream>
#include <string>
Index: src/celengine/overlay.cpp
===================================================================
--- src/celengine/overlay.cpp (revision 4534)
+++ src/celengine/overlay.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include <cstdarg>
#include <cstdio>
#include <celutil/utf8.h>
Index: src/celengine/dsodb.cpp
===================================================================
--- src/celengine/dsodb.cpp (revision 4534)
+++ src/celengine/dsodb.cpp (working copy)
@@ -10,6 +10,7 @@
//
//
+#include <libintl.h>
#include <cmath>
#include <cstdlib>
#include <cstdio>
Index: src/celengine/console.cpp
===================================================================
--- src/celengine/console.cpp (revision 4534)
+++ src/celengine/console.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include <cstdarg>
#include <cstdio>
#include <cassert>
Index: src/celengine/meshmanager.cpp
===================================================================
--- src/celengine/meshmanager.cpp (revision 4534)
+++ src/celengine/meshmanager.cpp (working copy)
@@ -10,6 +10,7 @@
// Experimental particle system support
#define PARTICLE_SYSTEM 0
+#include <libintl.h>
#include <iostream>
#include <fstream>
#include <cassert>
Index: src/celengine/astro.cpp
===================================================================
--- src/celengine/astro.cpp (revision 4534)
+++ src/celengine/astro.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include <cmath>
#include <iomanip>
#include <cstdio>
Index: src/celutil/utf8.cpp
===================================================================
--- src/celutil/utf8.cpp (revision 4534)
+++ src/celutil/utf8.cpp (working copy)
@@ -9,6 +9,7 @@
#include "utf8.h"
#include <cctype>
+#include <cstring>
#include "util.h"
unsigned int WGL4_Normalization_00[256] = {
Index: src/celutil/formatnum.cpp
===================================================================
--- src/celutil/formatnum.cpp (revision 4534)
+++ src/celutil/formatnum.cpp (working copy)
@@ -9,7 +9,9 @@
#include <cmath>
#include <cstdio>
-#include <string>
+#include <climits>
+#include <cstring>
+
#include "formatnum.h"
// HACK: MS Visual C++ has _snprintf declared in stdio.h but not snprintf
Index: src/celutil/util.cpp
===================================================================
--- src/celutil/util.cpp (revision 4534)
+++ src/celutil/util.cpp (working copy)
@@ -9,6 +9,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include "util.h"
#include <sys/types.h>
#include <sys/stat.h>
I have built the latest SVN of Celestia under Intrepid, but it required some changes - mostly I think because GCC is a newer version.
I had to #include <libintl.h> in quite a few places, and also <cstring>. In one place I had to change Std::time to just "time", but I think this may just be for GCC, so I put it in a #ifdef for _WIN32.
For anyone else trying to build this, here are the libs needed:
build-essential libtheora-dev liblua5.1-0-dev libgl1-mesa-dev libglut3-dev libgnomeui-dev libgtkglext1-dev libjpeg62-dev
zlib1g-dev
After installing zlib, configure kept complaining about it not being installed, but config.log revealed that it was libxmu-dev that was missing. The error I was getting was:
configure: error: zlib not found.
So I installed: libxmu-dev
I then ran: ./configure --with-gnome --with-lua --enable-theora
The source changes I made to get it to compile are against SVN r4534. Since there is no clue as to what extensions I can upload here, I will paste the unified diff that SVN generated below. Perhaps these can be reviewed and merged? I can't test it on anything but GCC 4.3.2.
----8<---- snip ----8<----
Index: src/celestia/eclipsefinder.cpp
===================================================================
--- src/celestia/eclipsefinder.cpp (revision 4534)
+++ src/celestia/eclipsefinder.cpp (working copy)
@@ -10,7 +10,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
-#include <string>
+#include <cstring>
#include <sstream>
#include <algorithm>
#include <set>
Index: src/celestia/celestiacore.cpp
===================================================================
--- src/celestia/celestiacore.cpp (revision 4534)
+++ src/celestia/celestiacore.cpp (working copy)
@@ -13,6 +13,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <cstdio>
#include <iostream>
#include <fstream>
Index: src/celestia/url.cpp
===================================================================
--- src/celestia/url.cpp (revision 4534)
+++ src/celestia/url.cpp (working copy)
@@ -15,7 +15,8 @@
* *
***************************************************************************/
-#include <string>
+#include <libintl.h>
+#include <cstring>
#include <cstdio>
#include <cassert>
#include <sstream>
Index: src/celestia/oggtheoracapture.cpp
===================================================================
--- src/celestia/oggtheoracapture.cpp (revision 4534)
+++ src/celestia/oggtheoracapture.cpp (working copy)
@@ -59,13 +59,14 @@
# define _REENTRANT
#endif
+#include <libintl.h>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <celutil/debug.h>
#include <celutil/util.h>
#include "../celengine/gl.h"
-#include <string>
+#include <cstring>
#include "theora/theora.h"
using namespace std;
@@ -159,7 +160,12 @@
return false;
}
/* Set up Ogg output stream */
- std::srand(std::time(NULL));
+ #ifdef _WIN32
+ std::srand(std::time(NULL));
+ #else
+ std::srand(time(NULL));
+ #endif
+
ogg_stream_init(&to,std::rand());
frame_x = w;
Index: src/celestia/celx_object.cpp
===================================================================
--- src/celestia/celx_object.cpp (revision 4534)
+++ src/celestia/celx_object.cpp (working copy)
@@ -9,6 +9,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include "celx.h"
#include "celx_internal.h"
#include "celx_object.h"
Index: src/celengine/location.cpp
===================================================================
--- src/celengine/location.cpp (revision 4534)
+++ src/celengine/location.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <map>
#include <celengine/location.h>
#include <celengine/body.h>
Index: src/celengine/body.cpp
===================================================================
--- src/celengine/body.cpp (revision 4534)
+++ src/celengine/body.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <cstdlib>
#include <cassert>
#include <algorithm>
Index: src/celengine/texture.cpp
===================================================================
--- src/celengine/texture.cpp (revision 4534)
+++ src/celengine/texture.cpp (working copy)
@@ -21,6 +21,7 @@
#endif
#endif
+#include <libintl.h>
#include <cmath>
#include <algorithm>
#include <iostream>
Index: src/celengine/opencluster.cpp
===================================================================
--- src/celengine/opencluster.cpp (revision 4534)
+++ src/celengine/opencluster.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <algorithm>
#include <stdio.h>
#include "celestia.h"
Index: src/celengine/nebula.cpp
===================================================================
--- src/celengine/nebula.cpp (revision 4534)
+++ src/celengine/nebula.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <algorithm>
#include <stdio.h>
#include "celestia.h"
Index: src/celengine/stardb.cpp
===================================================================
--- src/celengine/stardb.cpp (revision 4534)
+++ src/celengine/stardb.cpp (working copy)
@@ -7,6 +7,8 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
+#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
Index: src/celengine/globular.cpp
===================================================================
--- src/celengine/globular.cpp (revision 4534)
+++ src/celengine/globular.cpp (working copy)
@@ -11,6 +11,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <fstream>
#include <algorithm>
#include <cstdio>
Index: src/celengine/asterism.cpp
===================================================================
--- src/celengine/asterism.cpp (revision 4534)
+++ src/celengine/asterism.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <algorithm>
#ifndef _WIN32
Index: src/celengine/solarsys.cpp
===================================================================
--- src/celengine/solarsys.cpp (revision 4534)
+++ src/celengine/solarsys.cpp (working copy)
@@ -9,6 +9,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <cassert>
// #include <limits>
#include <cstdio>
Index: src/celengine/image.cpp
===================================================================
--- src/celengine/image.cpp (revision 4534)
+++ src/celengine/image.cpp (working copy)
@@ -8,6 +8,7 @@
// of the License, or (at your option) any later version.
#include <fstream>
+#include <libintl.h>
#ifndef TARGET_OS_MAC
#define JPEG_SUPPORT
Index: src/celengine/galaxy.cpp
===================================================================
--- src/celengine/galaxy.cpp (revision 4534)
+++ src/celengine/galaxy.cpp (working copy)
@@ -7,6 +7,8 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
+#include <libintl.h>
#include <fstream>
#include <algorithm>
#include <cstdio>
Index: src/celengine/fragmentprog.cpp
===================================================================
--- src/celengine/fragmentprog.cpp (revision 4534)
+++ src/celengine/fragmentprog.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <iostream>
#include <fstream>
#include <string>
Index: src/celengine/vertexprog.cpp
===================================================================
--- src/celengine/vertexprog.cpp (revision 4534)
+++ src/celengine/vertexprog.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include <iostream>
#include <fstream>
#include <string>
Index: src/celengine/overlay.cpp
===================================================================
--- src/celengine/overlay.cpp (revision 4534)
+++ src/celengine/overlay.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include <cstdarg>
#include <cstdio>
#include <celutil/utf8.h>
Index: src/celengine/dsodb.cpp
===================================================================
--- src/celengine/dsodb.cpp (revision 4534)
+++ src/celengine/dsodb.cpp (working copy)
@@ -10,6 +10,7 @@
//
//
+#include <libintl.h>
#include <cmath>
#include <cstdlib>
#include <cstdio>
Index: src/celengine/console.cpp
===================================================================
--- src/celengine/console.cpp (revision 4534)
+++ src/celengine/console.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include <cstdarg>
#include <cstdio>
#include <cassert>
Index: src/celengine/meshmanager.cpp
===================================================================
--- src/celengine/meshmanager.cpp (revision 4534)
+++ src/celengine/meshmanager.cpp (working copy)
@@ -10,6 +10,7 @@
// Experimental particle system support
#define PARTICLE_SYSTEM 0
+#include <libintl.h>
#include <iostream>
#include <fstream>
#include <cassert>
Index: src/celengine/astro.cpp
===================================================================
--- src/celengine/astro.cpp (revision 4534)
+++ src/celengine/astro.cpp (working copy)
@@ -7,6 +7,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <cstring>
#include <cmath>
#include <iomanip>
#include <cstdio>
Index: src/celutil/utf8.cpp
===================================================================
--- src/celutil/utf8.cpp (revision 4534)
+++ src/celutil/utf8.cpp (working copy)
@@ -9,6 +9,7 @@
#include "utf8.h"
#include <cctype>
+#include <cstring>
#include "util.h"
unsigned int WGL4_Normalization_00[256] = {
Index: src/celutil/formatnum.cpp
===================================================================
--- src/celutil/formatnum.cpp (revision 4534)
+++ src/celutil/formatnum.cpp (working copy)
@@ -9,7 +9,9 @@
#include <cmath>
#include <cstdio>
-#include <string>
+#include <climits>
+#include <cstring>
+
#include "formatnum.h"
// HACK: MS Visual C++ has _snprintf declared in stdio.h but not snprintf
Index: src/celutil/util.cpp
===================================================================
--- src/celutil/util.cpp (revision 4534)
+++ src/celutil/util.cpp (working copy)
@@ -9,6 +9,7 @@
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
+#include <libintl.h>
#include "util.h"
#include <sys/types.h>
#include <sys/stat.h>