File: configure.in

package info (click to toggle)
smpeg 0.4.5%2Bcvs20030824-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,332 kB
  • sloc: cpp: 14,969; sh: 10,315; ansic: 2,316; asm: 544; makefile: 125
file content (314 lines) | stat: -rw-r--r-- 8,120 bytes parent folder | download
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314

dnl Process this file with autoconf to produce a configure script.
AC_INIT(README)

dnl Set various version strings - taken gratefully from the GTk sources
#
# Making releases:
#   MICRO_VERSION += 1;
#   INTERFACE_AGE += 1;
#   BINARY_AGE += 1;
# if any functions have been added, set INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set BINARY_AGE and INTERFACE_AGE to 0.
#
MAJOR_VERSION=0
MINOR_VERSION=4
MICRO_VERSION=5
INTERFACE_AGE=4
BINARY_AGE=5
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION

AC_SUBST(MAJOR_VERSION)
AC_SUBST(MINOR_VERSION)
AC_SUBST(MICRO_VERSION)
AC_SUBST(INTERFACE_AGE)
AC_SUBST(BINARY_AGE)
AC_SUBST(VERSION)

ASFLAGS=""
CCASFLAGS=""
AC_SUBST(ASFLAGS)
AC_SUBST(CCASFLAGS)

# libtool versioning
LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION
LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE`
LT_REVISION=$INTERFACE_AGE
LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE`

AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)

dnl Detect the canonical host and target build environment
AC_CANONICAL_HOST
AC_CANONICAL_TARGET

dnl Setup for automake
AM_INIT_AUTOMAKE(smpeg, $VERSION)

dnl Check for tools

AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_CXX
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_PROG_INSTALL
AM_PROG_AS

dnl Ugh.
AS="$CC"
CCAS="$CC"
AC_SUBST(AS)
AC_SUBST(CCAS)

dnl Work around the lack of certain typedefs.
AC_TYPE_SOCKLEN_T

dnl The alpha architecture needs special flags for binary portability
case "$target" in
    alpha*-*-linux*)
	if test x$ac_cv_prog_gcc = xyes; then
            CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"
        fi
        ;;
    sparc*-*-solaris*)
        LIBS="$LIBS -lsocket -lnsl"	
        ;;
    *-*-qnx*)
        LIBS="$LIBS -lsocket"
        ;;
    *-*-beos*)
        ac_default_prefix=/boot/develop/tools/gnupro
        ;;
    *-*-cygwin* | *-*-mingw32*)
        if test "$build" != "$target"; then # cross-compiling
            ac_default_prefix=/usr/local/cross-tools/i386-mingw32msvc
        fi
        ;;
esac

# Set runtime shared library paths as needed 

case "$target" in
# We don't want or need rpath in Debian
#    *-*-linux*)
#	SMPEG_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
#	;;
    *-*-freebsd*)
	SMPEG_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib"
	;;
    *-*-solaris*)
	SMPEG_RLD_FLAGS="-R\${exec_prefix}/lib"
	;;
esac

AC_SUBST(SMPEG_RLD_FLAGS)

dnl Add compiler-specific optimization flags

AC_ARG_ENABLE(debug,
[  --enable-debug          Disable aggressive optimizations [default=yes]],
              , enable_debug=yes)
if test x$enable_debug != xyes; then
    if test x$ac_cv_prog_gcc = xyes; then
        CFLAGS="$CFLAGS -fexpensive-optimizations -fomit-frame-pointer"
    fi
    case "$target" in
        i486-*-*)  # Yeah right. :)
            if test x$ac_cv_prog_gcc = xyes; then
                CFLAGS="$CFLAGS -march=486"
            fi
            ;;
        i?86-*-*)
            if test x$ac_cv_prog_gcc = xyes; then
                CFLAGS="$CFLAGS -march=pentium -mcpu=pentiumpro"
            fi
            ;;
    esac
fi

dnl Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
            :,
	    AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"

dnl See if we need to pass -lm for the math library
AC_CHECK_LIB(m, sqrt, LIBS="$LIBS -lm")

dnl Check for MMX support
AC_ARG_ENABLE(mmx,
[  --enable-mmx            enable MMX IDCT decoding routines [default=no]],
              , enable_mmx=no)
if test x$enable_mmx = xyes; then
    AC_MSG_CHECKING(for MMX optimizations)
    use_mmx=no
    case "$target" in
        i?86*)
            use_mmx=yes
            ;;
    esac
    AC_MSG_RESULT($use_mmx)

    if test x$use_mmx = xyes; then
        CFLAGS="$CFLAGS -DUSE_MMX"
        ASFLAGS="$ASFLAGS -DUSE_MMX"
        CCASFLAGS="$CCASFLAGS -DUSE_MMX"
    fi
fi

dnl Check for ATI vha support
AC_ARG_ENABLE(ati,
[  --enable-ati            enable ATI Rage128 hardware acceleration [default=no]],
              , enable_ati=no)
if test x$enable_ati = xyes; then
    use_ati=yes
    AC_CHECK_LIB(r128hap, ATIHAP_StartCCE, LIBS="$LIBS -lr128hap", use_ati=no)
    AC_CHECK_LIB(r128vha, VHA_Init, LIBS="$LIBS -lr128vha", use_ati=no)
    AC_CHECK_LIB(r128ov, CreateOVSurface, LIBS="$LIBS -lr128ov", use_ati=no)
    AC_MSG_CHECKING(for ATI Rage128 hardware acceleration)
    AC_MSG_RESULT($use_ati)

    if test x$use_ati = xyes; then
        CFLAGS="$CFLAGS -DUSE_ATI"
    fi
fi

dnl Check for system timestamp sync
AC_ARG_ENABLE(timestamp-sync,
[  --enable-timestamp-sync  enable system timestamp sync [default=yes]],
              , enable_timestamp_sync=no)
if test x$enable_timestamp_sync = xyes; then
	CFLAGS="$CFLAGS -DUSE_TIMESTAMP_SYNC"
fi

dnl Enable the use of the system thread
AC_ARG_ENABLE(threaded-system,
[  --enable-threaded-system enable system thread         [default=no]],
              , enable_threaded_system=no)
if test x$enable_threaded_system = xyes; then
	CFLAGS="$CFLAGS -DUSE_SYSTEM_THREAD"
fi

dnl Enable threaded audio
AC_ARG_ENABLE(threaded-audio,
[  --enable-threaded-audio  enable threaded audio        [default=yes]],
              , enable_threaded_audio=yes)
if test x$enable_threaded_audio = xyes; then
	CFLAGS="$CFLAGS -DTHREADED_AUDIO"
fi

dnl See if we can build the GTk player
AC_ARG_ENABLE(gtk_player,
[  --enable-gtk-player     build a GTk sample SMPEG player [default=yes]],
              , enable_gtk_player=yes)
have_gtk=no
if test x$enable_gtk_player = xyes; then
    AM_PATH_GTK_2_0(2.0.0, have_gtk=yes)
    if test x$have_gtk = xyes; then
        CFLAGS="$CFLAGS $GTK_CFLAGS"
    fi
    AC_SUBST(GTK_LIBS)
    PKG_CHECK_MODULES([X11], [x11])
fi
AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)

dnl See if we can build the Mesa player
AC_ARG_ENABLE(opengl_player,
[  --enable-opengl-player  build an OpenGL sample SMPEG player [default=yes]],
              , enable_opengl_player=yes)
have_glu=no
if test x$enable_opengl_player = xyes; then
    case "$target" in
        *-*-cygwin* | *-*-mingw32*)
            SYS_GL_LIBS="-lopengl32 -lglu32"
            ;;
        *-*-beos*)
            SYS_GL_LIBS="-lGL"
            ;;
        *-*-darwin*)
            SYS_GL_LIBS=""
            ;;
        *)
            AC_PATH_X
            AC_PATH_XTRA
            if test x$have_x = xyes; then
                CFLAGS="$CFLAGS $X_CFLAGS"
                SYS_GL_LIBS="$X_LIBS -lGL -lGLU"
            else
                SYS_GL_LIBS="-lGL -lGLU"
            fi
            ;;
    esac
    AC_MSG_CHECKING(for OpenGL support)
    have_opengl=no
    AC_TRY_COMPILE([
     #include <GL/gl.h>
     #include <GL/glu.h>
    ],[
    ],[
    have_opengl=yes
    ])
    AC_MSG_RESULT($have_opengl)
    if test x$have_opengl = xyes; then
        GL_LIBS="$SYS_GL_LIBS"
    else
        echo "*** The OpenGL movie player will not be built (missing GL or GLU)"
    fi
fi
AC_SUBST(GL_LIBS)
AM_CONDITIONAL(HAVE_OPENGL, test x$have_opengl = xyes)

dnl Disable assertions in release builds
AC_ARG_ENABLE(assertions,
[  --enable-assertions     Enable consistency checks in decoding [default=no]],
              , enable_assertions=no)
if test x$enable_assertions != xyes; then
    CFLAGS="$CFLAGS -DNDEBUG"
fi

dnl Add the source include directories
CFLAGS="$CFLAGS -I.. -DNOCONTROLS"
CFLAGS="$CFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/audio -I\$(top_srcdir)/video"
CXXFLAGS="$CFLAGS"


dnl C++ flags are the same as the C flags
CXXFLAGS="$CFLAGS"
if test x$GCC = xyes; then
    # Check to see if options -fno-rtti -fno-exceptions are supported
    AC_MSG_CHECKING(if $CXX supports -fno-rtti -fno-exceptions)
    use_fnoexceptions=no
    save_CFLAGS="$CFLAGS"
    save_CC="$CC"
    CFLAGS="-fno-rtti -fno-exceptions"
    CC="$CXX"
    AC_TRY_COMPILE([
    ],[
    ],[
    use_fnoexceptions=yes
    ])
    AC_MSG_RESULT($use_fnoexceptions)
    if test x$use_fnoexceptions = xyes; then
        CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-rtti"
    fi
    CC="$save_CC"
    CFLAGS="$save_CFLAGS"
fi


# Finally create all the generated files
AC_OUTPUT([
Makefile
audio/Makefile
video/Makefile
smpeg-config
smpeg.spec
])