File: configure.in

package info (click to toggle)
lightspeed 1.2-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,052 kB
  • ctags: 1,193
  • sloc: ansic: 11,604; sh: 327; makefile: 205; sed: 93
file content (164 lines) | stat: -rw-r--r-- 4,504 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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(lightspeed.c)

AM_CONFIG_HEADER(config.h)

LIGHTSPEED_VERSION_MAJOR=1
LIGHTSPEED_VERSION_MINOR=2

AC_DEFINE_UNQUOTED(LIGHTSPEED_VERSION_MAJOR, $LIGHTSPEED_VERSION_MAJOR)
AC_DEFINE_UNQUOTED(LIGHTSPEED_VERSION_MINOR, $LIGHTSPEED_VERSION_MINOR)

LIGHTSPEED_VERSION=$LIGHTSPEED_VERSION_MAJOR.$LIGHTSPEED_VERSION_MINOR
AM_INIT_AUTOMAKE(lightspeed, $LIGHTSPEED_VERSION)

dnl Checks for programs.
AM_SANITY_CHECK
AC_PROG_INSTALL
AC_PROG_CC
AC_PROG_CPP


dnl Checks for GTK+ libraries.
AM_PATH_GTK(1.0.1, , AC_MSG_ERROR([Cannot find proper GTK+ version]))


dnl Checks for GL/MesaGL libraries.
AC_ARG_WITH(GL-prefix,  [  --with-GL-prefix=PFX    Prefix where GL/MesaGL is installed (optional)])
AC_ARG_WITH(lib-GL,     [  --with-lib-GL           use '-lGL'])
AC_ARG_WITH(lib-MesaGL, [  --with-lib-MesaGL       use '-lMesaGL'])

if test "x$with_GL_prefix" = "x" ; then
  GL_CFLAGS=""
  GL_LDOPTS=""
else
  GL_CFLAGS="-I$with_GL_prefix/include"
  GL_LDOPTS="-L$with_GL_prefix/lib"
fi

AC_CHECK_LIB(MesaGL, glBegin, have_MesaGL=yes, , $GTK_LIBS $GL_LDOPTS)
AC_CHECK_LIB(GL,     glBegin, have_GL=yes,     , $GTK_LIBS $GL_LDOPTS)

if test "$with_lib_GL" = yes; then

  if test "$have_GL" = yes; then
    GL_LIBS="$GL_LDOPTS -lGL"
  else
    AC_MSG_ERROR([Missing GL library])
  fi

elif test "$with_lib_MesaGL" = yes; then

  if test "$have_MesaGL" = yes; then
    GL_LIBS="$GL_LDOPTS -lMesaGL"
  else
    AC_MSG_ERROR([Missing MesaGL library])
  fi

else

  if test "$have_GL" = yes; then
    GL_LIBS="$GL_LDOPTS -lGL"
  elif test "$have_MesaGL" = yes; then
    GL_LIBS="$GL_LDOPTS -lMesaGL"
  else
    AC_MSG_ERROR([You need GL or MesaGL libraries])
  fi

fi


dnl Checks for gtkgl widget.
AC_ARG_WITH(gtkgl-prefix, [  --with-gtkgl-prefix=PFX Prefix where GtkGLArea is installed (optional)])

GTKGL_CFLAGS=""
GTKGL_LDOPTS="" 
if test -n "${with_gtkgl_prefix}"; then
  GTKGL_CFLAGS="-I${with_gtkgl_prefix}/include"
  GTKGL_LDOPTS="-L${with_gtkgl_prefix}/lib"
fi

AC_CHECK_LIB(gtkgl, gtk_gl_area_new, gtkgl_ok=yes, ,
  ${GTKGL_LDOPTS} ${GTK_LIBS} ${GL_LIBS})

if test "$gtkgl_ok" = yes; then
  GTKGL_LIBS="${GTKGL_LDOPTS} -lgtkgl"
else
  AC_MSG_ERROR([Cannot find gtkglarea])
fi


dnl Test for libpng
  if test -z "$LIBPNG_LIB"; then
    AC_CHECK_LIB(png, png_read_info,
      AC_CHECK_HEADER(png.h,
	png_ok=yes,
	png_ok=no),
      AC_MSG_WARN(*** PNG exporter cannot be built (PNG library not found) ***),
      -lz -lm)
    if test "$png_ok" = yes; then
      AC_MSG_CHECKING([for png_structp in png.h])
      AC_TRY_COMPILE([#include <png.h>],
        [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
        png_ok=yes,
        png_ok=no)
      AC_MSG_RESULT($png_ok)
      if test "$png_ok" = yes; then
        PNG='png'; LIBPNG_LIB='-lpng -lz'
      else
        AC_MSG_WARN(*** PNG exporter cannot be built (PNG library is too old) ***)
      fi
    else
      AC_MSG_WARN(*** PNG exporter cannot be built (PNG header file not found) ***)
    fi
  fi

dnl Test for libtiff
  if test -z "$LIBTIFF_LIB"; then
    AC_CHECK_LIB(tiff, TIFFReadScanline,
      AC_CHECK_HEADER(tiffio.h,
	TIFF='tiff'; LIBTIFF_LIB='-ltiff',
	AC_MSG_WARN(*** TIFF exporter cannot be built (TIFF header files not found) ***)),
      AC_CHECK_LIB(tiff, TIFFWriteScanline,
	AC_CHECK_HEADER(tiffio.h,
          TIFF='tiff'; LIBTIFF_LIB='-ltiff -ljpeg -lz',
	  AC_MSG_WARN(*** TIFF exporter cannot be built (TIFF header files not found) ***)),
	AC_CHECK_LIB(tiff34, TIFFFlushData,
	  AC_CHECK_HEADER(tiffio.h,
            TIFF='tiff'; LIBTIFF_LIB='-ltiff34 -ljpeg -lz',
	    AC_MSG_WARN(*** TIFF exporter cannot be built (TIFF header files not found) ***)),
        AC_MSG_WARN(*** TIFF exporter cannot be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
  fi

if test "$PNG" = png; then
  AC_DEFINE(HAVE_LIBPNG)
fi
if test "$TIFF" = tiff; then
  AC_DEFINE(HAVE_LIBTIFF)
fi

IMG_LIBS="$LIBPNG_LIB $LIBTIFF_LIB"


dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(getopt.h malloc.h sys/time.h)

dnl Check for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

dnl Check for library functions
AC_CHECK_FUNCS(getopt_long gettimeofday strcspn strdup strtod)


dnl That's a wrap!
CFLAGS="$CFLAGS $GTK_CFLAGS $GL_CFLAGS $GTKGL_CFLAGS"
LIBS="$GTKGL_LIBS $GTK_LIBS $GL_LIBS $IMG_LIBS"

ALL_LINGUAS=es

AM_GNU_GETTEXT

AC_OUTPUT(Makefile intl/Makefile po/Makefile.in)