File: configure.in

package info (click to toggle)
celestia 1.6.1%2Bdfsg-3.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 104,696 kB
  • ctags: 17,840
  • sloc: cpp: 113,117; ansic: 17,996; sh: 12,886; perl: 5,838; objc: 3,942; makefile: 750; xml: 166
file content (491 lines) | stat: -rw-r--r-- 15,130 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
dnl
dnl Celestia autoconf file
dnl Process this file with autoconf to make a configure script
dnl

AC_PREREQ(2.57)
AC_INIT([celestia], [1.6.1], [celestia-developers@lists.sf.net])
AC_CONFIG_SRCDIR(acinclude.m4)

dnl The following section confirms that the user provided necessary option
dnl BEFORE anything is checked.

AC_ARG_WITH([glut],
            AC_HELP_STRING([--with-glut], [Use Glut for the UI]),
            ui_glut="yes"; ui_gtk="no"; ui_gnome="no"; ui_kde="no",
            ui_glut="no")
			
AC_ARG_WITH([gtk],
            AC_HELP_STRING([--with-gtk], [Use Gtk for an enhanced GUI]),
	        ui_gtk="yes"; ui_glut="no"; ui_gnome="no"; ui_kde="no",
            ui_gtk="no")

AC_ARG_WITH([gnome],
            AC_HELP_STRING([--with-gnome], [Use Gnome for an enhanced GUI]),
            ui_gnome="yes"; ui_gtk="yes"; ui_glut="no"; ui_kde="no",
            ui_gnome="no")

AC_ARG_WITH([kde],
            AC_HELP_STRING([--with-kde], [Use KDE for an enhanced GUI]),
            ui_kde="yes"; ui_glut="no"; ui_gtk="no"; ui_gnome="no",
            ui_kde="no")

dnl Following line left in: great for debugging.
dnl AC_MSG_ERROR([$ui_glut $ui_gtk $ui_gnome $ui_kde])

dnl Check that an interface was provided
if (test "$ui_glut" != "yes" -a "$ui_gtk" != "yes" -a "$ui_gnome" != "yes" -a "$ui_kde" != "yes"); then
	AC_MSG_ERROR([You must select an interface to build.
                  Possible options are:
                    --with-glut      GLUT front-end
                    --with-gtk       Enhanced GTK GUI
                    --with-gnome     GTK GUI with Gnome features
                    --with-kde       Enhanced KDE GUI]);
fi

AC_ARG_ENABLE([cairo],
              AC_HELP_STRING([--enable-cairo],
                             [use cairo for GTK splash screen]),
              enable_cairo="$enableval", enable_cairo="auto")

AC_ARG_ENABLE([theora],
              AC_HELP_STRING([--enable-theora],
                             [create Ogg/Theora video]),
              enable_theora="$enableval", enable_theora="auto")


dnl For KDE interface
AC_CONFIG_AUX_DIR(admin)

dnl "admin/acinclude.m4.in" generates "acinclude.m4", which has a broken
dnl conditional define for Qt embedded. This does not apply to Celestia
dnl anyway.
include_x11_FALSE='#'

dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH

dnl Check system type
AC_CANONICAL_HOST
dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM
dnl Perform program name transformation
AC_ARG_PROGRAM

AM_INIT_AUTOMAKE([-Wno-portability])
AM_CONFIG_HEADER(config.h)

AM_PO_SUBDIRS
dnl Specifying the AM_GNU_GETTEXT_VERSION macro causes autopoint to run,
dnl replacing many files from the KDE project in the admin/ directory. We
dnl will leave it out for now.
dnl AM_GNU_GETTEXT_VERSION([0.15])
AM_GNU_GETTEXT([external])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_INSTALL
AC_PROG_LIBTOOL

dnl
dnl Compilation options
dnl

CFLAGS="$CFLAGS -ffast-math -fexpensive-optimizations"
CXXFLAGS="$CXXFLAGS -ffast-math -fexpensive-optimizations"

AC_MSG_CHECKING([whether to include debugging code])
AC_ARG_ENABLE([debug],
              AC_HELP_STRING([--enable-debug],
                             [Produce an executable with debugging symbols]), ,
              enable_debug="no")
if (test "$enable_debug" = "yes"); then
	CFLAGS="$CFLAGS -g -Wall";
	CXXFLAGS="$CXXFLAGS -g -Wall"
	AC_DEFINE(DEBUG, 1, [Are we debugging ?])
fi
AC_MSG_RESULT($enable_debug)

AC_MSG_CHECKING([whether to be pedantic])
AC_ARG_ENABLE([pedantic],
              AC_HELP_STRING([--enable-pedantic],
                             [Enable -pedantic when compiling]), ,
              enable_pedantic="no")
if (test "$enable_pedantic" = "yes"); then
	CFLAGS="$CFLAGS -ansi -pedantic";
	CXXFLAGS="$CXXFLAGS -pedantic"
fi
AC_MSG_RESULT($enable_pedantic)

AC_MSG_CHECKING([whether to do profiling])
AC_ARG_ENABLE([profile],
              AC_HELP_STRING([--enable-profile],
                             [Produce a profiled executable[default=no]]), ,
              enable_profile="no")
if (test "$enable_profile" = "yes"); then
	CFLAGS="$CFLAGS -pg";
	CXXFLAGS="$CXXFLAGS -pg"
else
	if (test "$enable_debug" != "yes"); then
		dnl  must be set here instead of above because -pg and
		dnl -fomit-frame-pointer are incompatible
		CFLAGS="$CFLAGS -fomit-frame-pointer";
		CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
	fi
fi
AC_MSG_RESULT($enable_profile)


dnl
dnl GL and GLUT libs
dnl

AC_ARG_WITH([gl-libs],
            AC_HELP_STRING([--with-gl-libs=DIR],
                           [Specify OpenGL library location]),
            LIBS="$LIBS -L$withval")

AC_ARG_WITH([gl-inc],
            AC_HELP_STRING([--with-gl-inc=DIR],
                           [Specify OpenGL header file location]),
            CXXFLAGS="$CXXFLAGS -I$withval")

AC_ARG_WITH([glut-libs],
            AC_HELP_STRING([--with-glut-libs=DIR],
                           [Specify GLUT library location]),
            LIBS="$LIBS -L$withval")

AC_ARG_WITH([glut-inc],
            AC_HELP_STRING([--with-glut-inc=DIR],
                           [Specify GLUT header file location]),
            CXXFLAGS="$CXXFLAGS -I$withval")


dnl
dnl SPICE lib
dnl

AC_ARG_WITH([cspice-dir],
            AC_HELP_STRING([--with-cspice-dir=DIR], [Specify SPICE directory location]),
            SPICE_CFLAGS="-I$withval/include -DUSE_SPICE"; 
            SPICE_LIBS="$withval/lib/cspice.a")

AC_SUBST(SPICE_CFLAGS)
AC_SUBST(SPICE_LIBS)
AM_CONDITIONAL(ENABLE_SPICE, test "$SPICE_LIBS" != "")

AC_MSG_CHECKING([whether to enable GLUT])
if (test "$ui_glut" != "no"); then
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING([whether to enable GTK])
if (test "$ui_gtk" != "no"); then
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING([whether to enable Gnome])
if (test "$ui_gnome" != "no"); then
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi

AC_MSG_CHECKING([whether to enable KDE])
if (test "$ui_kde" != "no"); then
	AC_MSG_RESULT(yes)
else
	AC_MSG_RESULT(no)
fi


AC_CHECK_COMPILERS

dnl (Copied from Pidgin's configure.ac)
dnl FreeBSD doesn't have libdl, dlopen is provided by libc
AC_CHECK_FUNC(dlopen, DL_LIBS="", [AC_CHECK_LIB(dl, dlopen, DL_LIBS="-ldl")])
AC_SUBST(DL_LIBS)

dnl Check for zlib -- libGL requires it.
AC_CHECK_LIB(z, deflate, ,
             [AC_MSG_ERROR([zlib not found.])])

dnl Check for OpenGL headers first.
AC_CHECK_HEADERS(GL/gl.h, ,
                 [AC_MSG_ERROR([No gl.h found. See INSTALL file for help.])])

dnl Check for OpenGL. Taken partly from the plib sources.
AC_CHECK_LIB(GL, glNewList, GL_LIBS="-lGL")
AC_SUBST(GL_LIBS)

if (test "x$ac_cv_lib_GL_glNewList" = "xno"); then
	dnl Check for MesaGL.
	AC_CHECK_LIB(MesaGL, glNewList, ,
	             [AC_MSG_ERROR([GL library was not found])])
fi

dnl Check for GLU headers.
AC_CHECK_HEADERS(GL/glu.h, ,
                 [AC_MSG_ERROR([No glu.h found. See INSTALL file for help.])])
AC_CHECK_LIB(GLU, gluLookAt)

if (test "x$ac_cv_lib_GLU_gluLookAt" = "xno"); then
	dnl Check for MesaGLU.
	AC_CHECK_LIB(MesaGLU, gluLookAt, ,
	             [AC_MSG_ERROR([GLU library was not found])])
fi

PKG_PROG_PKG_CONFIG

if (test "$ui_glut" = "yes"); then
	dnl Check for GLUT headers first.
	AC_CHECK_HEADERS(GL/glut.h, ,
	                 [AC_MSG_ERROR([No glut.h found. See INSTALL file for help.])])

	dnl Check for GLUT.
	AC_CHECK_LIB(glut, glutKeyboardUpFunc, ,
	             [AC_MSG_ERROR([GLUT library version >= 3.7 not found])])
fi
AM_CONDITIONAL(ENABLE_GLUT, test "$ui_glut" = "yes")

dnl Default GConf to FALSE
dnl (this is a silly trick to make configure behave)
AM_CONDITIONAL(GCONF_SCHEMAS_INSTALL, test "x" = "y")

if (test "$ui_gtk" != "no"); then
	dnl GNOME is an extension to the GTK options
	if (test "$ui_gnome" = "yes"); then
		PKG_CHECK_MODULES(GTK, libgnomeui-2.0 gtk+-2.0 >= 2.6 gtkglext-1.0)
		AM_GCONF_SOURCE_2
		AC_DEFINE(GNOME, 1, [Use Gnome Flag])
	else
		dnl Otherwise, vanilla GTK
		PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6 gtkglext-1.0)
	fi

	dnl Check for cairo. Default to trying yes. Want this structure to not
	dnl fail when not found if not explicitly enabled.
	if (test "x$enable_cairo" != "xno"); then
		PKG_CHECK_MODULES(CAIRO, cairo, enable_cairo="yes",
		                  if (test "x$enable_cairo" = "xauto"); then
		                      enable_cairo="no"
		                  else
		                      AC_ERROR([Cairo not found (explicitly enabled)!])
		                  fi)
	fi

        check_theora="yes"

	if (test "x$enable_cairo" = "xyes"); then
		AC_DEFINE(CAIRO, 1, [Use Cairo for Splash])
	fi
fi

dnl If all the GTK tests succeeded, safe to enable GTK
AM_CONDITIONAL(ENABLE_GTK, test "$ui_gtk" = "yes")
AM_CONDITIONAL(ENABLE_GNOME, test "$ui_gnome" = "yes")


dnl
dnl KDE
dnl

dnl Make certain ARTS is not conditionally defined, like GConf for Gnome
AM_CONDITIONAL(include_ARTS, test "x" = "y")

if (test "$ui_kde" != "no"); then
	dnl KDE_SET_PREFIX
	AC_ENABLE_SHARED(yes)
	AC_ENABLE_STATIC(no)

	KDE_PROG_LIBTOOL
	AM_KDE_WITH_NLS

	dnl KDE_USE_QT(3)
	AC_PATH_KDE

        check_theora="yes"
fi
AM_CONDITIONAL(ENABLE_KDE, test "$ui_kde" = "yes")

if (test "$check_theora" = "yes"); then
	dnl Check for theora. Default to trying yes. Want this structure to not
	dnl fail when not found if not explicitly enabled.
	if (test "x$enable_theora" != "xno"); then
		PKG_CHECK_MODULES(THEORA, theora, enable_theora="yes",
		                  if (test "x$enable_theora" = "xauto"); then
		                      enable_theora="no"
		                  else
		                      AC_ERROR([Theora not found (explicitly enabled)!])
		                  fi)
	fi

	if (test "x$enable_theora" = "xyes"); then
		AC_DEFINE(THEORA, 1, [Use OGG Theora for video])
	fi
fi
AM_CONDITIONAL(ENABLE_THEORA, test "$enable_theora" = "yes")

dnl Check for JPEG library.
AC_CHECK_LIB(jpeg, jpeg_start_decompress, ,
             [AC_MSG_ERROR([jpeg library not found])])


dnl Check for PNG library.
AC_CHECK_LIB(png, png_create_info_struct,,
             [AC_MSG_ERROR([png library not found])])


dnl Checks for header files.

AC_HEADER_STDC
AC_CHECK_HEADERS(byteswap.h)
AC_C_BIGENDIAN

dnl Establish the main data directory (defined in Makefiles)
PKGDATADIR='${datadir}'/$PACKAGE
AC_SUBST(PKGDATADIR)

enable_hipparcos="no"
AC_ARG_ENABLE([hipparcos-dir],
              AC_HELP_STRING([--enable-hipparcos-dir=DIR],
                             [Specify location of HIPPARCOS/TYCHO stardata]),
              HIPDIR="$enableval",HIPDIR="$PKGDATADIR")
AC_SUBST(HIPDIR)
AC_MSG_CHECKING([whether we can create a new star database])
if (test -f "$HIPDIR/hip_main.dat"); then
	enable_hipparcos="yes"
fi
AC_MSG_RESULT($enable_hipparcos)
AM_CONDITIONAL(ENABLE_HIPPARCOS, test "x$enable_hipparcos" = "xyes")


AC_ARG_WITH([lua],
            AC_HELP_STRING([--with-lua],
                           [Use Lua for Celestia Extension Language support]),
            enable_lua="$withval",
            enable_lua="auto")

if (test "$enable_lua" != "no"); then
	LUA_VER=0
	PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100, 
		[ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100, 
		  [ PKG_CHECK_MODULES(LUA, lua50 >= 5.0.0 lua50 < 5.1.0, LUA_VER=0x050000,
		    [ PKG_CHECK_MODULES(LUA, lua >= 5.0.0 lua < 5.1.0, LUA_VER=0x050000, AC_MSG_RESULT([no])) ] 
		    ) ] 
		) ]
	)
	if (test "$LUA_VER" = "0x050000"); then
		PKG_CHECK_MODULES(LUALIB, lualib50 >= 5.0.0 lualib50 < 5.1.0, ,
			[ PKG_CHECK_MODULES(LUALIB, lualib >= 5.0.0 lualib < 5.1.0, , AC_MSG_RESULT([no])) ]
			)
	fi
	if (test "$LUA_VER" = "0"); then
		if (test "x$enable_lua" != "xauto"); then
			AC_ERROR([Lua not found (explicitly enabled)!])
		else
			enable_lua="no"
		fi
	else
		enable_lua="yes"
	fi
fi

if (test "$enable_lua" = "yes"); then
	LUA_CFLAGS="$LUA_CFLAGS $LUALIB_CFLAGS -DLUA_VER=$LUA_VER -DCELX"
fi

AM_CONDITIONAL(ENABLE_CELX, test "$enable_lua" != "no")


AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ src/celutil/Makefile ])
AC_CONFIG_FILES([ src/celmath/Makefile ])
AC_CONFIG_FILES([ src/cel3ds/Makefile ])
AC_CONFIG_FILES([ src/celtxf/Makefile ])
AC_CONFIG_FILES([ src/celengine/Makefile ])
AC_CONFIG_FILES([ src/celestia/Makefile ])
AC_CONFIG_FILES([ data/Makefile ])
AC_CONFIG_FILES([ extras/Makefile ])
AC_CONFIG_FILES([ extras-standard/Makefile ])
AC_CONFIG_FILES([ extras-standard/cassini/Makefile ])
AC_CONFIG_FILES([ extras-standard/cassini/models/Makefile ])
AC_CONFIG_FILES([ extras-standard/cassini/data/Makefile ])
AC_CONFIG_FILES([ extras-standard/mir/Makefile ])
AC_CONFIG_FILES([ extras-standard/mir/models/Makefile ])
AC_CONFIG_FILES([ extras-standard/galileo/Makefile ])
AC_CONFIG_FILES([ extras-standard/galileo/models/Makefile ])
AC_CONFIG_FILES([ extras-standard/galileo/data/Makefile ])
AC_CONFIG_FILES([ extras-standard/hubble/Makefile ])
AC_CONFIG_FILES([ extras-standard/hubble/models/Makefile ])
AC_CONFIG_FILES([ extras-standard/iss/Makefile ])
AC_CONFIG_FILES([ extras-standard/iss/models/Makefile ])
AC_CONFIG_FILES([ extras-standard/iss/textures/Makefile ])
AC_CONFIG_FILES([ extras-standard/iss/textures/medres/Makefile ])
AC_CONFIG_FILES([ textures/Makefile ])
AC_CONFIG_FILES([ textures/lores/Makefile ])
AC_CONFIG_FILES([ textures/medres/Makefile ])
AC_CONFIG_FILES([ textures/hires/Makefile ])
AC_CONFIG_FILES([ models/Makefile ])
AC_CONFIG_FILES([ shaders/Makefile ])
AC_CONFIG_FILES([ fonts/Makefile ])
AC_CONFIG_FILES([ src/celestia/res/Makefile ])
AC_CONFIG_FILES([ src/celestia/kde/Makefile ])
AC_CONFIG_FILES([ src/celestia/kde/data/Makefile ])
AC_CONFIG_FILES([ src/celestia/kde/doc/Makefile ])
AC_CONFIG_FILES([ src/celestia/kde/doc/celestia/Makefile ])
AC_CONFIG_FILES([ src/celestia/gtk/Makefile ])
AC_CONFIG_FILES([ src/celestia/gtk/data/Makefile ])
AC_CONFIG_FILES([ po/Makefile.in ])
AC_CONFIG_FILES([ po2/Makefile.in ])
AC_CONFIG_FILES([ locale/Makefile ])
AC_CONFIG_FILES([ scripts/Makefile ])
AC_OUTPUT()

AC_MSG_RESULT()
AC_MSG_RESULT()
AC_MSG_RESULT(***************************************************************)
AC_MSG_RESULT(** Celestia configuration complete. Now do a 'make' followed **)
AC_MSG_RESULT(** by 'make install'                                         **)
AC_MSG_RESULT(***************************************************************)
AC_MSG_RESULT()

if (test "$ui_glut" = "yes"); then
	AC_MSG_RESULT([Front-End: GLUT]);
fi

if (test "$ui_gtk" = "yes" -a "$ui_gnome" = "no"); then
	AC_MSG_RESULT([Front-End: GTK]);
fi

if (test "$ui_gnome" = "yes"); then
	AC_MSG_RESULT([Front-End: Gnome]);
fi

if (test "$ui_kde" = "yes"); then
	AC_MSG_RESULT([Front-End: KDE]);
fi

if (test "$ui_gtk" = "yes" -o "$ui_gnome" = "yes"); then
	AC_MSG_RESULT([Use Cairo: $enable_cairo]);
fi

AC_MSG_RESULT([Use Lua: $enable_lua]);

if (test "$LUA_VER" = "0x050000"); then
	AC_MSG_RESULT([    Warning: Lua 5.1 is not available on your system, Lua 5.0 will be used
    instead but it may not be fully compatible with existing CELX scripts. 
    It is recommanded that you install Lua 5.0 and rerun configure.]);
fi

AC_MSG_RESULT([Use Theora: $enable_theora]);

AC_MSG_RESULT()