ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/branches/dev-api-4/xvidcore/build/generic/configure.in
Revision: 981
Committed: Wed Apr 9 21:30:31 2003 UTC (21 years, 6 months ago) by edgomez
File size: 13352 byte(s)
Error occurred while calculating annotation data.
Log Message:
2003-04-09 GMT	Edouard Gomez <ed.gomez@free.fr>	patch-13

    Summary:
      Added GNU profiling option to the configure script.
    Revision:
      xvidcore--devapi4--1.0--patch-13

    In  order to allow  easy profiling  using GNU  tools (gprof,  gcov), I
    added  the  --enable-gnuprofile  to  the configure.in  template.  This
    modifies the SPECIFIC_LDFLAGS and SPECIFIC_CFLAGS for library building
    so they include all needed options for profiling and test coverage.

    /!\  When  compiling your  own  program,  don't  forget to  use  these
         options:
           -pg -fprofile-arcs -ftest-coverage

         When linking your program, you  MUST use the -pg option too, else
         your binary will not use/create profiling informations.

    modified files:
     build/generic/configure.in


2003-04-09 GMT	Edouard Gomez <ed.gomez@free.fr>	patch-12

    Summary:
      Build fix from release-0_9_1-fixes@cvs.xvid.org
    Revision:
      xvidcore--devapi4--1.0--patch-12

    MacOSX build process was wrong on the linking stage as it was ignoring
    the equivalent of the linux soname thingy.

    modified files:
     build/generic/configure.in

File Contents

# Content
1 dnl ==========================================================================
2 dnl
3 dnl Autoconf script for XviD
4 dnl
5 dnl Copyright(C) 2003 Edouard Gomez <ed.gomez@free.fr>
6 dnl
7 dnl ==========================================================================
8
9 AC_INIT([XviD], [1.0.0 cvs-snapshot], [xvid-devel@xvid.org])
10 AC_CONFIG_SRCDIR(configure.in)
11
12 dnl Do not forget to increase that when needed.
13 API_MAJOR="3"
14 API_MINOR="0"
15
16 dnl NASM version requirement
17 minimum_nasm_patch_version=34
18 nasm_prog="nasm"
19
20 dnl Default CFLAGS -- Big impact on overall speed
21 our_cflags_defaults="-Wall"
22 our_cflags_defaults="$our_cflags_defaults -O2"
23 our_cflags_defaults="$our_cflags_defaults -fomit-frame-pointer"
24 our_cflags_defaults="$our_cflags_defaults -ffast-math"
25 our_cflags_defaults="$our_cflags_defaults -funroll-loops"
26 our_cflags_defaults="$our_cflags_defaults -fschedule-insns"
27 our_cflags_defaults="$our_cflags_defaults -fschedule-insns2"
28
29 dnl ==========================================================================
30 dnl Features - configure options
31 dnl ==========================================================================
32
33 FEATURES=""
34 DIVX4COMPAT_SOURCES=""
35 DIVX4_ENCORE=""
36 DIVX4_DECORE=""
37
38 dnl BIGLUT aka old VLC code
39 AC_ARG_ENABLE(oldvlc,
40 AC_HELP_STRING([--enable-oldvlc],
41 [Enable old VLC code (Needs much more memory ~10MB)]),
42 [if test "$enable_oldvlc" = "yes" ; then
43 FEATURES="$FEATURES -DBIGLUT"
44 fi])
45
46 dnl Internal Debug
47 AC_ARG_ENABLE(idebug,
48 AC_HELP_STRING([--enable-idebug],
49 [Enable internal debug function]),
50 [if test "$enable_idebug" = "yes" ; then
51 FEATURES="$FEATURES -D_DEBUG"
52 fi])
53
54 dnl Internal Profile
55 AC_ARG_ENABLE(iprofile,
56 AC_HELP_STRING([--enable-iprofile],
57 [Enable internal profiling]),
58 [if test "$enable_iprofile" = "yes" ; then
59 FEATURES="$FEATURES -D_PROFILING_"
60 fi])
61
62 dnl GNU Profiling options
63 AC_ARG_ENABLE(gnuprofile,
64 AC_HELP_STRING([--enable-gnuprofile],
65 [Enable profiling informations for gprof]),
66 [if test "$enable_gnuprofile" = "yes" ; then
67 GNU_PROF_CFLAGS="-pg -fprofile-arcs -ftest-coverage"
68 GNU_PROF_LDFLAGS="-pg"
69 fi])
70
71 dnl Assembly code
72 AC_ARG_ENABLE(assembly,
73 AC_HELP_STRING([--disable-assembly],
74 [Disable assembly code]),
75 [if test "$enable_assembly" = "no" ; then
76 assembly="no"
77 else
78 if test "$enable_assembly" = "yes" ; then
79 assembly="yes"
80 fi
81 fi],
82 [assembly="yes"])
83
84 dnl Internal Debug
85 AC_ARG_ENABLE(divx4compat,
86 AC_HELP_STRING([--enable-divx4compat],
87 [Enable DivX4 compatibility API]),
88 [if test "$enable_divx4compat" = "yes" ; then
89 DIVX4COMPAT_SOURCES="SRC_DIVX4COMPAT"
90 DIVX4_ENCORE="encore;"
91 DIVX4_DECORE="decore;"
92 fi])
93
94 dnl ==========================================================================
95 dnl Default install prefix and checks build type
96 dnl ==========================================================================
97
98 AC_PREFIX_DEFAULT("/usr/local")
99 AC_CANONICAL_BUILD
100 AC_CANONICAL_HOST
101 AC_CANONICAL_TARGET
102
103 dnl ==========================================================================
104 dnl Check for the C compiler (could be passed on command line)
105 dnl ==========================================================================
106
107 dnl
108 dnl First we test if CFLAGS have been passed on command line
109 dnl I do that because autoconf defaults (-g -O2) suck and they would kill
110 dnl performance. To prevent that we define a good defult CFLAGS at the end
111 dnl of the script if and only if CFLAGS has not been passed on the command
112 dnl line
113 dnl
114 AC_MSG_CHECKING(whether to use default CFLAGS)
115 if test x"$CFLAGS" = x"" ; then
116 force_default_cc_options="yes"
117 AC_MSG_RESULT([yes])
118 else
119 force_default_cc_options="no"
120 AC_MSG_RESULT([no])
121 fi
122
123 dnl Now we can safely check for the C compiler
124 AC_PROG_CC
125
126 dnl ==========================================================================
127 dnl Check for the install program
128 dnl ==========================================================================
129
130 AC_PROG_INSTALL
131
132 dnl ==========================================================================
133 dnl Check for the ranlib program to generate static library index
134 dnl ==========================================================================
135
136 AC_PROG_RANLIB
137
138 dnl ==========================================================================
139 dnl
140 dnl This part looks for:
141 dnl
142 dnl ARCHITECTURE : The platform architecture
143 dnl - IA32 for mmx, mmx-ext, mmx2, sse assembly
144 dnl - IA64
145 dnl - PPC for PowerPC assembly routines
146 dnl - GENERIC for plain C sources only
147 dnl
148 dnl BUS: Address bus size (in bits)
149 dnl - 32
150 dnl - 64
151 dnl
152 dnl ENDIANNESS: I think you can guess what this thing means :-)
153 dnl - LITTLE_ENDIAN
154 dnl - BIG_ENDIAN
155 dnl
156 dnl ==========================================================================
157
158 dnl
159 dnl Looking what sources have to be compiled according to the CPU type
160 dnl
161
162 ARCHITECTURE=""
163
164 AC_MSG_CHECKING([for whether to use assembly code])
165 if test x"$assembly" = x"yes" ; then
166 AC_MSG_RESULT([yes])
167 AC_MSG_CHECKING([for architecture type])
168 case "$target_cpu" in
169 i[[3456]]86)
170 AC_MSG_RESULT(ia32)
171 ARCHITECTURE="IA32"
172 ;;
173 powerpc)
174 AC_MSG_RESULT(PowerPC)
175 dnl ATM the ppc port is out of date
176 dnl ARCHITECTURE="PPC"
177 ARCHITECTURE="GENERIC"
178 ;;
179 ia64)
180 AC_MSG_RESULT(ia64)
181 ARCHITECTURE="IA64"
182 ;;
183 *)
184 AC_MSG_RESULT($target_cpu)
185 ARCHITECTURE="GENERIC"
186 ;;
187 esac
188 else
189 AC_MSG_RESULT([no])
190 ARCHITECTURE="GENERIC"
191 fi
192
193 dnl
194 dnl Testing address bus length
195 dnl
196 BUS=""
197
198 AC_CHECK_SIZEOF([int *])
199 case "$ac_cv_sizeof_int_p" in
200 4)
201 BUS="32BIT"
202 ;;
203 8)
204 BUS="64BIT"
205 ;;
206 *)
207 AC_MSG_ERROR([XviD supports only 32/64 bit architectures])
208 ;;
209 esac
210
211 dnl
212 dnl Testing endianness
213 dnl
214 ENDIANNESS=""
215
216 AC_C_BIGENDIAN(ENDIANNESS="BIG_ENDIAN", ENDIANNESS="LITTLE_ENDIAN")
217
218 dnl ==========================================================================
219 dnl
220 dnl Check for OS specific variables
221 dnl - SHARED_EXTENSION, STATIC_EXTENSION, OBJECT_EXTENSION
222 dnl
223 dnl ==========================================================================
224
225 AC_MSG_CHECKING(for build extensions)
226 SHARED_EXTENSION=""
227 STATIC_EXTENSION=""
228 OBJECT_EXTENSION=""
229 case "$target_os" in
230 *bsd*|linux*|beos|irix*|solaris*)
231 AC_MSG_RESULT([.so .a .o])
232 STATIC_EXTENSION="a"
233 SHARED_EXTENSION="so"
234 OBJECT_EXTENSION="o"
235 ;;
236 [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]|mingw32|mks)
237 AC_MSG_RESULT([.dll .a .obj])
238 STATIC_EXTENSION="a"
239 SHARED_EXTENSION="dll"
240 OBJECT_EXTENSION="obj"
241 ;;
242 darwin*|raphsody*)
243 AC_MSG_RESULT([.dynlib .a .o])
244 STATIC_EXTENSION="a"
245 SHARED_EXTENSION="dylib"
246 OBJECT_EXTENSION="o"
247 ;;
248 *)
249 AC_MSG_RESULT([Unknown OS - Using .so .a .o])
250 STATIC_EXTENSION="a"
251 SHARED_EXTENSION="so"
252 OBJECT_EXTENSION="o"
253 ;;
254 esac
255
256 dnl ==========================================================================
257 dnl
258 dnl Determines best options for CC and LD
259 dnl - STATIC_LIB, SHARED_LIB, SPECIFIC_CFLAGS, SPECIFIC_LDLAGS
260 dnl
261 dnl ==========================================================================
262
263 AC_MSG_CHECKING(for platform specific LDFLAGS/CFLAGS)
264 SPECIFIC_LDFLAGS=""
265 SPECIFIC_CFLAGS=""
266 case "$target_os" in
267 *bsd*|linux*|irix*|solaris*)
268 AC_MSG_RESULT([ok])
269 STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
270 SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION).\$(API_MAJOR).\$(API_MINOR)"
271 SPECIFIC_LDFLAGS="-Wl,-soname,libxvidcore.\$(SHARED_EXTENSION) -shared -lc -lm"
272 SPECIFIC_CFLAGS="-fPIC"
273 ;;
274 [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]|mingw32|mks)
275 AC_MSG_RESULT([ok])
276 STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
277 SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)"
278 SPECIFIC_LDFLAGS="-mno-cygwin -shared -Wl,--dll,--out-implib,\$@.a libxvidcore.def"
279 SPECIFIC_CFLAGS="-mno-cygwin"
280 ;;
281 darwin*|raphsody*)
282 AC_MSG_RESULT([ok])
283 STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
284 SHARED_LIB="libxvidcore.\$(API_MAJOR).\$(SHARED_EXTENSION)"
285 SPECIFIC_LDFLAGS="-dynamiclib -flat_namespace -compatibility_version \$(API_MAJOR) -current_version \$(API_MINOR) -install_name \$(libdir)/\$(SHARED_LIB)"
286 SPECIFIC_CFLAGS="-fPIC -fno-common -no-cpp-precomp"
287 ;;
288 beos)
289 AC_MSG_RESULT([ok])
290 STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
291 SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)"
292 SPECIFIC_LDFLAGS="-nostart"
293 SPECIFIC_CFLAGS="-fPIC"
294 ;;
295 *)
296 AC_MSG_RESULT([Unknown Platform (Using default -shared -lc -lm)])
297 STATIC_LIB="libxvidcore.\$(STATIC_EXTENSION)"
298 SHARED_LIB="libxvidcore.\$(SHARED_EXTENSION)"
299 SPECIFIC_LDFLAGS=""
300 SPECIFIC_CFLAGS=""
301 ;;
302 esac
303
304 dnl ==========================================================================
305 dnl
306 dnl Assembler stuff
307 dnl - AS, AFLAGS, ASSEMBLY_EXTENSION, SOURCES
308 dnl
309 dnl ==========================================================================
310
311 AS=""
312 AFLAGS=""
313 ASSEMBLY_EXTENSION=""
314 GENERIC_SOURCES="SRC_GENERIC"
315 ASSEMBLY_SOURCES=""
316
317 dnl
318 dnl IA32
319 dnl
320
321 if test "$ARCHITECTURE" = "IA32" ; then
322
323 dnl
324 dnl Checking nasm existence
325 dnl
326 AC_CHECK_PROG([ac_nasm], [$nasm_prog], [yes], [no], , [yes])
327 if test "$ac_nasm" = "yes" ; then
328
329 dnl
330 dnl Checking nasm patch version
331 dnl
332 AC_MSG_CHECKING([for nasm patch version])
333 nasm_patch=`nasm -r | cut -d '.' -f 3 | cut -d ' ' -f 1`
334 AC_MSG_RESULT([$nasm_patch])
335
336 if test "$nasm_patch" -lt "$minimum_nasm_patch_version" ; then
337 AC_MSG_WARN([nasm patch version too old - Compiling generic sources only])
338 ARCHITECTURE="GENERIC"
339 else
340
341 dnl
342 dnl Checking nasm format - win32 or elf
343 dnl
344 AC_MSG_CHECKING([for nasm object format])
345 case "$target_os" in
346 *bsd*|linux*|beos|irix*|solaris*)
347 AC_MSG_RESULT([elf])
348 NASM_FORMAT="elf"
349 PREFIX=""
350 ;;
351 [[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]|mingw32|mks)
352 AC_MSG_RESULT([win32])
353 NASM_FORMAT="win32"
354 PREFIX="-DPREFIX"
355 ;;
356 esac
357
358 AS=nasm
359 AFLAGS="-I\$(<D) -f $NASM_FORMAT $PREFIX"
360 ASSEMBLY_EXTENSION="asm"
361 ASSEMBLY_SOURCES="SRC_IA32"
362 fi
363
364 else
365 AC_MSG_WARN([nasm not found - Compiling generic sources only])
366 ARCHITECTURE="GENERIC"
367 fi
368
369 fi
370
371 dnl
372 dnl PPC
373 dnl
374
375 if test "$ARCHITECTURE" = "PPC" ; then
376 AS="\$(CC)"
377 AFLAGS="-c"
378 ASSEMBLY_EXTENSION="s"
379 ASSEMBLY_SOURCES="SRC_PPC"
380 AC_MSG_CHECKING([for Altivec support])
381 cat > conftest.S << EOF
382 .text
383 vxor 0,0,0
384 EOF
385 if $CC -c conftest.S 2>/dev/null 1>/dev/null ; then
386 AC_MSG_RESULT(yes)
387 SPECIFIC_CFLAGS="$SPECIFIC_CFLAGS -DARCH_IS_PPC_ALTIVEC"
388 ASSEMBLY_SOURCES="SRC_ALTIVEC"
389 else
390 AC_MSG_RESULT(no)
391 fi
392 rm -f conftest.*
393 fi
394
395 dnl
396 dnl IA64
397 dnl
398
399 if test "$ARCHITECTURE" = "IA64" ; then
400 AS="\$(CC)"
401 AFLAGS="-c"
402 ASSEMBLY_EXTENSION="s"
403 ASSEMBLY_SOURCES="SRC_IA64"
404
405 case `basename $CC` in
406 *ecc*)
407 DCT_IA64_SOURCES="idct_ia64_ecc.s"
408
409 dnl If the compiler is ecc, then i don't know its options
410 dnl fallback to "no options"
411 if test "$force_default_cc_options" = "yes" ; then
412 our_cflags_defaults=""
413 fi
414 ;;
415 *)
416 DCT_IA64_SOURCES="idct_ia64_gcc.s"
417 ;;
418 esac
419
420 fi
421
422 dnl ==========================================================================
423 dnl
424 dnl Check for header files
425 dnl
426 dnl ==========================================================================
427
428 AC_CHECK_HEADERS(
429 stdio.h \
430 signal.h \
431 , , AC_MSG_ERROR(Missing header file))
432
433 dnl ==========================================================================
434 dnl
435 dnl Now we can set CFLAGS if needed
436 dnl
437 dnl ==========================================================================
438
439 if test "$force_default_cc_options" = "yes" ; then
440 CFLAGS="$our_cflags_defaults"
441 fi
442
443 dnl ==========================================================================
444 dnl
445 dnl Profiling stuff goes here
446 dnl - adds options to SPECIFIC_CFLAGS, SPECIFIC_LDLAGS
447 dnl - removes incompatible options from CFLAGS
448 dnl
449 dnl ==========================================================================
450
451 SPECIFIC_LDFLAGS="$SPECIFIC_LDFLAGS $GNU_PROF_LDFLAGS"
452 SPECIFIC_CFLAGS="$SPECIFIC_CFLAG $GNU_PROF_CFLAGS"
453
454 if test "$enable_gnuprofile" = "yes" ; then
455 CFLAGS=`echo $CFLAGS | sed s/'-fomit-frame-pointer'/''/`
456 fi
457
458 dnl ==========================================================================
459 dnl
460 dnl Substitions
461 dnl
462 dnl ==========================================================================
463
464 AC_SUBST(FEATURES)
465 AC_SUBST(ARCHITECTURE)
466 AC_SUBST(BUS)
467 AC_SUBST(ENDIANNESS)
468 AC_SUBST(SHARED_EXTENSION)
469 AC_SUBST(STATIC_EXTENSION)
470 AC_SUBST(OBJECT_EXTENSION)
471 AC_SUBST(NASM_FORMAT)
472 AC_SUBST(AS)
473 AC_SUBST(AFLAGS)
474 AC_SUBST(ASSEMBLY_EXTENSION)
475 AC_SUBST(GENERIC_SOURCES)
476 AC_SUBST(ASSEMBLY_SOURCES)
477 AC_SUBST(CC)
478 AC_SUBST(CFLAGS)
479 AC_SUBST(SPECIFIC_LDFLAGS)
480 AC_SUBST(SPECIFIC_CFLAGS)
481 AC_SUBST(DIVX4COMPAT_SOURCES)
482 AC_SUBST(DCT_IA64_SOURCES)
483 AC_SUBST(DIVX4_ENCORE)
484 AC_SUBST(DIVX4_DECORE)
485 AC_SUBST(RANLIB)
486 AC_SUBST(API_MAJOR)
487 AC_SUBST(API_MINOR)
488 AC_SUBST(STATIC_LIB)
489 AC_SUBST(SHARED_LIB)
490
491 dnl ==========================================================================
492 dnl
493 dnl Output files
494 dnl
495 dnl ==========================================================================
496
497 AC_CONFIG_FILES(platform.inc)
498 AC_CONFIG_FILES(libxvidcore.def)
499
500 AC_OUTPUT