summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 791690126d5c3a3d21dde2ca0682f90b7bbafe6c (plain)
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
# configure.ac for the gpligc/ogie project

AC_INIT([gpligc], [1.10.1])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
AC_CONFIG_HEADERS([config.h])

AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL

# Checks for header files.
AC_CHECK_HEADERS([stdlib.h string.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE

# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_STRTOD
AC_CHECK_FUNCS([floor gettimeofday pow sqrt strcasecmp strchr strtol])

# check host
AC_CANONICAL_HOST

# some checks dont work on my mingw32 compile platform
AS_IF(
  [test "x$host_os" != xmingw32],
  AC_CHECK_LIB([glut], [glutInit], [], [AC_MSG_ERROR([glut library not found]) ])
  AC_CHECK_LIB([GLU], [gluErrorString], [], [AC_MSG_ERROR([GLU library not found]) ])
  AC_CHECK_LIB([jpeg], [jpeg_std_error], [], [AC_MSG_ERROR([jpeg library not found])] )
  ,
  echo "Platform is $host_os  setting LIBS=-lglut -lglu32 -lopengl32 -ljpeg"
  LIBS="-lglut -lglu32 -lopengl32 -ljpeg"
)
# -static-libgcc -static-libstdc++  works, but produces larger archive files


# on pc12 this is needed as of ? now?
AC_CHECK_LIB([GL], [glBegin])
#[glXCreatePbuffer])
AC_CHECK_LIB([X11], [XOpenDisplay])

AC_CHECK_FUNC([glXCreatePbuffer], [AC_DEFINE([HAVE_GLXPBUFFER], [1],
                               [Define if glXCreatePbuffer exists.])])

# use of osmesa is default, but optional
AC_ARG_ENABLE([osmesa],
            [AS_HELP_STRING([--enable-osmesa],  [support for osmesa @<:@default=check@:>@])],
            [],  [enable_osmesa=check])
LIBOSMESA=
  AS_IF(
    [test "x$enable_osmesa" != xno],
    [AC_CHECK_LIB([OSMesa], [OSMesaCreateContextExt], [], [if test "x$enable_osmesa" != xcheck; then
      AC_MSG_FAILURE([--enable-osmesa was given, but test for osmesa failed])
      fi])
    ]
  )


# use of gpsd is default, but optional
AC_ARG_WITH([gpsd],
            [AS_HELP_STRING([--with-gpsd],  [support for gpsd @<:@default=check@:>@])],
            [],  [with_gpsd=check])
LIBGPS=
  AS_IF(
    [test "x$with_gpsd" != xno],
    [AC_CHECK_LIB([gps], [read], [], [if test "x$with_gpsd" != xcheck; then
      AC_MSG_FAILURE([--with-gpsd was given, but test for gpsd failed])
      fi])
    ]
  )

AC_CONFIG_FILES([
 Makefile
 src/Makefile
 perl/Makefile
 images/Makefile
])
AC_OUTPUT