celestia/configure.ac

488 lines
15 KiB
Plaintext
Raw Normal View History

2001-04-30 00:12:27 -06:00
dnl
dnl Celestia autoconf file
dnl Process this file with autoconf to make a configure script
2001-04-30 00:12:27 -06:00
dnl
AC_PREREQ(2.57)
2019-09-09 15:58:19 -06:00
AC_INIT([celestia], [1.6.2], [celestia-developers@lists.sf.net])
AC_CONFIG_SRCDIR(acinclude.m4)
2018-02-24 05:37:47 -07:00
AC_CONFIG_MACRO_DIRS([macros])
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")
2018-02-24 05:37:47 -07:00
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
2002-11-11 04:12:58 -07:00
2006-01-01 17:46:09 -07:00
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")
2002-11-11 04:12:58 -07:00
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='#'
2003-04-14 14:15:33 -06:00
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH
2001-04-30 00:12:27 -06:00
dnl Check system type
AC_CANONICAL_HOST
2003-04-14 14:15:33 -06:00
dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM
dnl Perform program name transformation
AC_ARG_PROGRAM
2018-02-24 05:37:47 -07:00
AM_INIT_AUTOMAKE([-Wno-portability subdir-objects])
2003-04-14 14:15:33 -06:00
AM_CONFIG_HEADER(config.h)
2005-07-19 15:22:42 -06:00
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])
2005-07-19 15:22:42 -06:00
AM_GNU_GETTEXT([external])
dnl Checks for programs.
2001-04-30 00:12:27 -06:00
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
AC_PROG_INSTALL
2002-11-11 04:12:58 -07:00
AC_PROG_LIBTOOL
dnl
dnl Compilation options
dnl
CFLAGS="$CFLAGS -ffast-math -fexpensive-optimizations"
2011-01-24 11:11:25 -07:00
CXXFLAGS="$CXXFLAGS -ffast-math -fexpensive-optimizations"
2002-01-18 13:53:39 -07:00
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)
2002-01-18 13:53:39 -07:00
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)
2002-01-18 13:53:39 -07:00
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
2004-08-31 12:25:33 -06:00
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")
2001-04-30 00:12:27 -06:00
AC_ARG_WITH([gl-inc],
AC_HELP_STRING([--with-gl-inc=DIR],
[Specify OpenGL header file location]),
CXXFLAGS="$CXXFLAGS -I$withval")
2001-04-30 00:12:27 -06:00
AC_ARG_WITH([glut-libs],
AC_HELP_STRING([--with-glut-libs=DIR],
[Specify GLUT library location]),
LIBS="$LIBS -L$withval")
2001-04-30 00:12:27 -06:00
AC_ARG_WITH([glut-inc],
AC_HELP_STRING([--with-glut-inc=DIR],
[Specify GLUT header file location]),
CXXFLAGS="$CXXFLAGS -I$withval")
2001-04-30 00:12:27 -06:00
dnl
dnl SPICE lib
dnl
AC_ARG_WITH([cspice-dir],
AC_HELP_STRING([--with-cspice-dir=DIR], [Specify SPICE directory location]),
2018-02-24 05:37:47 -07:00
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" != "")
2002-11-11 04:12:58 -07:00
2003-04-14 14:15:33 -06:00
AC_MSG_CHECKING([whether to enable GLUT])
if (test "$ui_glut" != "no"); then
2003-04-14 14:15:33 -06:00
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
2002-11-11 04:12:58 -07:00
AC_MSG_CHECKING([whether to enable GTK])
if (test "$ui_gtk" != "no"); then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
2002-11-11 04:12:58 -07:00
fi
AC_MSG_CHECKING([whether to enable Gnome])
if (test "$ui_gnome" != "no"); then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
2003-04-14 14:15:33 -06:00
fi
AC_MSG_CHECKING([whether to enable KDE])
if (test "$ui_kde" != "no"); then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
2003-04-14 14:15:33 -06:00
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)
2003-04-14 14:15:33 -06:00
2004-02-20 00:17:16 -07:00
dnl Check for zlib -- libGL requires it.
AC_CHECK_LIB(z, deflate, ,
[AC_MSG_ERROR([zlib not found.])])
2004-02-20 00:17:16 -07:00
2003-04-14 14:15:33 -06:00
dnl Check for OpenGL headers first.
AC_CHECK_HEADERS(GL/gl.h, ,
[AC_MSG_ERROR([No gl.h found. See INSTALL file for help.])])
2003-04-14 14:15:33 -06:00
dnl Check for OpenGL. Taken partly from the plib sources.
AC_CHECK_LIB(GL, glNewList, GL_LIBS="-lGL")
AC_SUBST(GL_LIBS)
2003-04-14 14:15:33 -06:00
if (test "x$ac_cv_lib_GL_glNewList" = "xno"); then
2003-04-14 14:15:33 -06:00
dnl Check for MesaGL.
AC_CHECK_LIB(MesaGL, glNewList, ,
[AC_MSG_ERROR([GL library was not found])])
2003-04-14 14:15:33 -06:00
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)
2003-04-14 14:15:33 -06:00
if (test "x$ac_cv_lib_GLU_gluLookAt" = "xno"); then
2003-04-14 14:15:33 -06:00
dnl Check for MesaGLU.
AC_CHECK_LIB(MesaGLU, gluLookAt, ,
[AC_MSG_ERROR([GLU library was not found])])
2003-04-14 14:15:33 -06:00
fi
PKG_PROG_PKG_CONFIG
2003-04-14 14:15:33 -06:00
2005-12-12 11:58:32 -07:00
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.])])
2003-04-14 14:15:33 -06:00
dnl Check for GLUT.
AC_CHECK_LIB(glut, glutKeyboardUpFunc, ,
[AC_MSG_ERROR([GLUT library version >= 3.7 not found])])
2003-04-14 14:15:33 -06:00
fi
AM_CONDITIONAL(ENABLE_GLUT, test "$ui_glut" = "yes")
2003-04-14 14:15:33 -06:00
2004-02-28 01:49:00 -07:00
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)
2004-02-28 01:49:00 -07:00
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
2006-01-01 17:46:09 -07:00
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"
2006-01-01 17:46:09 -07:00
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")
2003-04-14 14:15:33 -06:00
2001-04-30 00:12:27 -06:00
2002-11-11 04:12:58 -07:00
dnl
dnl KDE
dnl
2005-08-26 14:52:20 -06:00
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)
2002-11-11 04:12:58 -07:00
KDE_PROG_LIBTOOL
AM_KDE_WITH_NLS
2002-11-11 04:12:58 -07:00
dnl KDE_USE_QT(3)
AC_PATH_KDE
check_theora="yes"
2002-11-11 04:12:58 -07:00
fi
AM_CONDITIONAL(ENABLE_KDE, test "$ui_kde" = "yes")
2002-11-11 04:12:58 -07:00
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
2002-11-11 04:12:58 -07:00
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")
2001-04-30 00:12:27 -06:00
dnl Check for JPEG library.
AC_CHECK_LIB(jpeg, jpeg_start_decompress, ,
[AC_MSG_ERROR([jpeg library not found])])
2001-04-30 00:12:27 -06:00
2003-04-14 14:15:33 -06:00
2001-04-30 16:56:25 -06:00
dnl Check for PNG library.
AC_CHECK_LIB(png, png_create_info_struct,,
[AC_MSG_ERROR([png library not found])])
2001-04-30 00:12:27 -06:00
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(byteswap.h)
AC_C_BIGENDIAN
2001-04-30 00:12:27 -06:00
dnl Establish the main data directory (defined in Makefiles)
PKGDATADIR='${datadir}'/$PACKAGE
2002-11-11 04:12:58 -07:00
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)
2002-01-18 13:53:39 -07:00
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",
2006-09-10 02:13:38 -06:00
enable_lua="auto")
if (test "$enable_lua" != "no"); then
2006-10-03 17:13:21 -06:00
LUA_VER=0
PKG_CHECK_MODULES(LUA, lua5.3 >= 5.3.0, LUA_VER=0x050300, [
PKG_CHECK_MODULES(LUA, lua >= 5.3.0, LUA_VER=0x050300, [
PKG_CHECK_MODULES(LUA, lua5.2 >= 5.2.0, LUA_VER=0x050200, [
PKG_CHECK_MODULES(LUA, lua >= 5.2.0, LUA_VER=0x050200, [
PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100, [
PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100, AC_MSG_RESULT([no])) ]
) ] ) ] ) ] ) ] )
2006-10-03 17:13:21 -06:00
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
2003-04-14 14:15:33 -06:00
fi
if (test "$enable_lua" = "yes"); then
LUA_CFLAGS="$LUA_CFLAGS $LUALIB_CFLAGS -DLUA_VER=$LUA_VER -DCELX"
fi
2003-04-14 14:15:33 -06:00
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 ])
2008-10-15 01:26:39 -06:00
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 ])
2008-10-15 01:26:39 -06:00
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 ])
2003-04-14 14:15:33 -06:00
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 ])
2004-03-14 19:29:29 -07:00
AC_CONFIG_FILES([ src/celestia/gtk/Makefile ])
AC_CONFIG_FILES([ src/celestia/gtk/data/Makefile ])
2005-07-19 15:22:42 -06:00
AC_CONFIG_FILES([ po/Makefile.in ])
AC_CONFIG_FILES([ po2/Makefile.in ])
AC_CONFIG_FILES([ locale/Makefile ])
2008-01-25 10:11:45 -07:00
AC_CONFIG_FILES([ scripts/Makefile ])
2005-07-19 15:22:42 -06:00
AC_OUTPUT()
2001-04-30 00:12:27 -06:00
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(***************************************************************)
2001-04-30 00:12:27 -06:00
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
2006-01-01 17:46:09 -07:00
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
2018-02-24 05:37:47 -07:00
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]);
2001-04-30 00:12:27 -06:00
AC_MSG_RESULT()