Recognizes if input is ogg or not.
[xiph.git] / writ / configure.in
blobc971ee21973c4bba89b7b390986f91ad5c953a71
1 # Process this file with autoconf to produce a configure script.
2 # $Id: configure.in,v 1.2 2003/08/17 23:45:17 arc Exp $
4 m4_define(writ_major, 0)
5 m4_define(writ_minor, 0)
6 m4_define(writ_micro, 0)
7 m4_define(writ_version,
8   m4_if(writ_micro, 0, writ_major.writ_minor,
9    writ_major.writ_minor.writ_micro))
11 AC_INIT([writ], writ_version, [writ@xiph.org])
12 AC_PREREQ(2.52)
13 # AC_CONFIG_SRCDIR([src/config.c])
14 # AM_CONFIG_HEADER(config.h)
15 ## config.h guard
16 # AH_TOP([#ifndef __CONFIG_H__
17 # define __CONFIG_H__ 1])
18 # AH_BOTTOM([#endif])
20 AC_DEFINE([writ_MAJOR], writ_major, [Writ library major version])
21 AC_DEFINE([writ_MINOR], writ_minor, [Writ library minor version])
22 AC_DEFINE([writ_MICRO], writ_micro, [Writ library patch version])
24 VERSION=writ_version
26 AM_INIT_AUTOMAKE([writ], writ_version)
27 AM_MAINTAINER_MODE
29 AC_PROG_CC
30 AC_PROG_LIBTOOL
32 dnl Set some options based on environment
34 dnl openbsd headers break when _XOPEN_SOURCE is defined but without it seems
35 dnl to be fine
36 case "$ac_cv_host" in
37    *openbsd*)
38    ;;
39    *) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
40    ;;
41 esac
42 if test -z "$GCC"; then
43         case $host in 
44         *-*-irix*)
45                 DEBUG="-g -signed" 
46                 CFLAGS="-O2 -w -signed"
47                 PROFILE="-p -g3 -O2 -signed"
48                 ;;
49         sparc-sun-solaris*)
50                 DEBUG="-v -g"
51                 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
52                 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
53                 ;;
54         *)
55                 DEBUG="-g"
56                 CFLAGS="-O"
57                 PROFILE="-g -p" 
58                 ;;
59         esac
60 else
61         XIPH_CFLAGS="-Wall -ffast-math -fsigned-char"
62         AC_DEFINE(_GNU_SOURCE, ,[Define if you have POSIX and GNU specifications])
63         DEBUG="-g"
64         PROFILE="-pg -g"
67 dnl Checks for programs.
69 dnl Checks for header files.
70 AC_HEADER_STDC
71 AC_CHECK_HEADERS([inttypes.h])
73 dnl Checks for typedefs, structures, and compiler characteristics.
74 AC_C_CONST
76 dnl Check for types
77 AC_CHECK_TYPE([uint32_t],
78   [AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
79   [AC_CHECK_SIZEOF(short)
80    AC_CHECK_SIZEOF(int)
81    AC_CHECK_SIZEOF(long)
82    AC_CHECK_SIZEOF(long long)])
83 AH_VERBATIM([X_HAVE_C99_INTTYPES],
84   [#ifndef HAVE_C99_INTTYPES
85 #  if SIZEOF_SHORT == 4
86 typedef unsigned short uint32_t;
87 #  elif SIZEOF_INT == 4
88 typedef unsigned int uint32_t;
89 #  elif SIZEOF_LONG == 4
90 typedef unsigned long uint32_t;
91 #  endif
92 #  if SIZEOF_INT == 8
93 typedef unsigned int uint64_t;
94 #  elif SIZEOF_LONG == 8
95 typedef unsigned long uint64_t;
96 #  elif SIZEOF_LONG_LONG == 8
97 typedef unsigned long long uint64_t;
98 #  endif
99 #endif])
101 dnl Extra dependencies
103 XIPH_PATH_OGG
104 XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS"
106 dnl Make substitutions
108 AC_SUBST(LIBTOOL_DEPS)
109 AC_SUBST(OPT)
110 AC_SUBST(LIBS)
111 AC_SUBST(DEBUG)
112 AC_SUBST(CFLAGS)
113 AC_SUBST(PROFILE)
114 AC_SUBST(XIPH_CFLAGS)
116 AC_OUTPUT([Makefile include/Makefile include/writ/Makefile src/Makefile])