This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
/
configure.in
158 lines (137 loc) · 3.7 KB
/
configure.in
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
# Process this file with autoconf to produce a configure script.
AC_INIT(src/fsv.c)
AM_CONFIG_HEADER(config.h)
PACKAGE=fsv
VERSION=0.9
RELEASE=1
AC_USE_SYSTEM_EXTENSIONS
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AC_SUBST(RELEASE)
AC_DEFINE(_GNU_SOURCE)
AC_DEFINE(GTK_DISABLE_COMPAT_H)
# Programs
AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB
AC_ISC_POSIX
# Header files
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_TIME
AC_CHECK_HEADERS(strings.h sys/time.h unistd.h)
# Typedefs, structures
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_TYPE(comparison_fn_t, , AC_DEFINE_UNQUOTED(comparison_fn_t, int (*)( const void *, const void * )))
AC_STRUCT_ST_BLOCKS
AC_STRUCT_TM
# Library functions
AC_FUNC_ALLOCA
AC_FUNC_FNMATCH
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(getcwd gettimeofday mktime strcspn strdup strspn strtod strtoul)
AC_REPLACE_FUNCS(scandir)
AC_CHECK_LIB([m], [hypot])
# Debugging
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging])
if test "$enable_debug" = "yes" ; then
AC_MSG_WARN([debugging enabled, CFLAGS=\"$CFLAGS\"])
AM_CONDITIONAL(DEBUG, true)
AC_DEFINE(DEBUG)
AC_DEFINE(G_ENABLE_DEBUG)
else
AM_CONDITIONAL(DEBUG, false)
AC_DEFINE(G_DISABLE_ASSERT)
AC_DEFINE(G_DISABLE_CHECKS)
AC_DEFINE(GTK_NO_CHECK_CASTS)
fi
# Internationalization
ALL_LINGUAS=""
AM_GNU_GETTEXT
# Locale directory
AC_ARG_WITH(locale-dir, [ --with-locale-dir=DIR install locale files in DIR [DATADIR/locale]])
if test "$USE_NLS" = "yes" ; then
if test -n "$with_locale_dir" ; then
localedir=$with_locale_dir
else
localedir=${datadir}/locale
fi
else
localedir="none"
fi
AC_SUBST(localedir)
# Documentation directory
AC_ARG_WITH(doc-dir, [ --with-doc-dir=DIR install documentation files in DIR [DATADIR/fsv]])
if test -n "$with_doc_dir" ; then
docdir=$with_doc_dir
else
docdir=${datadir}/fsv
fi
AC_SUBST(docdir)
# GTK+ libraries
PKG_CHECK_MODULES([GTK], [gtk+-2.0])
PKG_CHECK_MODULES([GLIB], [glib-2.0])
#### OpenGL/Mesa3D 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' (default)])
AC_ARG_WITH(lib-MesaGL, [ --with-lib-MesaGL use '-lMesaGL'])
if test -n "$with_GL_prefix" ; then
GL_CFLAGS=-I$with_GL_prefix/include
GL_LDOPTS=-L$with_GL_prefix/lib
else
GL_CFLAGS=""
GL_LDOPTS=""
fi
AC_CHECK_LIB(MesaGL, glBegin, have_MesaGL=yes, , $GTK_LIBS $GL_LDOPTS)
AC_CHECK_HEADER(GL/glu.h, have_GLU="yes", have_GLU="no")
AC_CHECK_LIB(GL, glBegin, have_GL=yes, , $GTK_LIBS $GL_LDOPTS)
if test "$have_GLU" = "no" ; then
AC_MSG_ERROR([Missing OpenGL utility library])
fi
if test "$with_lib_GL" = "yes" ; then
# Want to use '-lGL'
if test "$have_GL" = "yes" ; then
GL_LIBS="$GL_LDOPTS -lGL -lGLU"
else
AC_MSG_ERROR([Missing GL library])
fi
elif test "$with_lib_MesaGL" = "yes" ; then
# Want to use '-lMesaGL'
if test "$have_MesaGL" = "yes" ; then
GL_LIBS="$GL_LDOPTS -lMesaGL -lMesaGLU"
else
AC_MSG_ERROR([Missing Mesa3D library])
fi
else
# Use whatever is available, preferably '-lGL'
if test "$have_GL" = "yes" ; then
GL_LIBS="$GL_LDOPTS -lGL -lGLU"
elif test "$have_MesaGL" = "yes" ; then
GL_LIBS="$GL_LDOPTS -lMesaGL -lMesaGLU"
else
AC_MSG_ERROR([You need GL or MesaGL libraries])
fi
fi
AC_SUBST(GL_CFLAGS)
AC_SUBST(GL_LIBS)
#### end of OpenGL/Mesa3D configuration ####
#### GtkGLArea library ####
PKG_CHECK_MODULES([GTKGL], [gtkgl-2.0])
# Check for 'file' command
AC_PATH_PROG(FILE_CMD, file)
if test -n "$FILE_CMD" ; then
AC_DEFINE(HAVE_FILE_COMMAND)
AC_DEFINE_UNQUOTED(FILE_COMMAND, "$FILE_CMD %s")
fi
# That's a wrap!
AC_OUTPUT(fsv.spec
Makefile
debug/Makefile
doc/Makefile
intl/Makefile
lib/Makefile
po/Makefile.in
src/Makefile)