File: configure.in

package info (click to toggle)
g3dviewer 0.2.99.5~svn130-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 1,896 kB
  • ctags: 293
  • sloc: sh: 10,341; ansic: 2,446; makefile: 132; xml: 75
file content (130 lines) | stat: -rw-r--r-- 3,039 bytes parent folder | download | duplicates (5)
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
AC_INIT(configure.in)
AC_CONFIG_MACRO_DIR([m4])

VERSION=0.2.99.5
PACKAGE=g3dviewer

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AC_SUBST(VERSION)

LT_INIT
AC_PROG_LIBTOOL

AC_PROG_CC
AM_PROG_CC_C_O

AC_DISABLE_STATIC
AC_IS_WIN32

ALL_LINGUAS="de"
AM_GLIB_GNU_GETTEXT

GETTEXT_PACKAGE=$PACKAGE
AC_SUBST(GETTEXT_PACKAGE)

# glib 2.0
AM_PATH_GLIB_2_0(2.6.0,,AC_MSG_ERROR([GLib >= 2.6.0 is required]))

# gtk+ 2.0
AM_PATH_GTK_2_0(2.4.0,,AC_MSG_ERROR([GTK+ >= 2.4.0 is required]))

# libglade 2.0
PKG_CHECK_MODULES(LIBGLADE, libglade-2.0 >= 2.4.0,,
	AC_MSG_ERROR([libglade >= 2.4.0 is required]))

# gtkglext
AM_PATH_GTKGLEXT_1_0(1.0.0,,AC_MSG_ERROR([GtkGlExt >= 1.0.0 is required]))

# libg3d
PKG_CHECK_MODULES(LIBG3D, libg3d >= 0.0.8,,
	AC_MSG_ERROR([libg3d >= 0.0.8 is required]))

if test "$os_win32" != "yes" ; then
# Check OpenGL stuff
AC_PATH_XTRA

ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"

ac_save_LIBS="$LIBS"
LIBS="$LIBS $X_LIBS"

AC_CHECK_HEADERS(GL/gl.h GL/glu.h,,
	AC_MSG_ERROR([some OpenGL headers missing]),
	[#include <GL/gl.h>])

AC_CHECK_LIB(GL, glBegin, have_gl=yes, have_gl=no)
AC_CHECK_LIB(GLU, gluPerspective, have_glu=yes, have_glu=no, -lGL $GTK_LIBS)
if test $have_gl = no || test $have_glu = no; then
	AC_MSG_ERROR([libgl or libglu missing])
else
	GL_LIBS="-lGL -lGLU $GTK_LIBS"
	AC_SUBST(GL_LIBS)
fi

fi # !os_win32

# OSMesa stuff
AC_CHECK_HEADERS(GL/osmesa.h, have_osmesa_h=yes)
AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa=yes)
AM_CONDITIONAL(HAVE_OSMESA,
	[test "$have_osmesa_h" = "yes" -a "$have_osmesa" = "yes" ])
OSMESA_LIBS=-lOSMesa
AC_SUBST(OSMESA_CFLAGS)
AC_SUBST(OSMESA_LIBS)

# Check some UNIX headers
AC_CHECK_HEADERS(dirent.h sys/stat.h unistd.h,,
	AC_MSG_ERROR([missing header file]),
	[#include <sys/types.h>])

# Look for snprintf (optional)
AC_CHECK_FUNC(snprintf,[AC_DEFINE(HAVE_SNPRINTF,1,[snprintf])],,stdio.h)

# Look for fstat (required)
AC_CHECK_FUNC(fstat, have_fstat=yes, have_fstat=no, [unistd.h sys/types.h])
if test $have_fstat = no; then
	AC_MSG_ERROR([fstat function not found])
fi

# Debug level (verbosity & optimization)
AC_MSG_CHECKING([for debug level])
AC_ARG_ENABLE(debug, 
  [[  --enable-debug[=LVL]    enable debug level LVL or 1 (default is 0)]],
  [if test "$enableval" = "yes" ; then DEBUG=1; else DEBUG=$enableval; fi],
  DEBUG=0)
AC_MSG_RESULT($DEBUG)
AC_SUBST(DEBUG)

AC_ARG_ENABLE(profile,
	[[  --enable-profile        enable gprof profiling]],
	[if test "x$enableval" = "xyes" ; then profile="-pg"
		else profile=""; fi],
	profile="")

if test "$DEBUG" = "0"; then
	DBG_CFLAGS="-O2 $profile"
else
	DBG_CFLAGS="-g $profile -DGLIB_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED"
fi
AC_SUBST(DBG_CFLAGS)

# Data & plugin directories
AC_DEFINE_DIR(DATA_DIR,   datadir/$PACKAGE, [Data directory])

# Create the files
AC_OUTPUT(Makefile
	m4/Makefile
	man/Makefile
	src/Makefile
	thumbnailer/Makefile
	pixmaps/Makefile
	glade/Makefile
	examples/Makefile
	po/Makefile.in
	g3dviewer.desktop
)