Imported Upstream version 1.3.0
[platform/upstream/libogg.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2
3 AC_INIT(src/framing.c)
4
5 AM_INIT_AUTOMAKE(libogg,1.3.0)
6 AM_MAINTAINER_MODE
7
8 dnl Library versioning
9
10 LIB_CURRENT=8
11 LIB_REVISION=0
12 LIB_AGE=8
13 AC_SUBST(LIB_CURRENT)
14 AC_SUBST(LIB_REVISION)
15 AC_SUBST(LIB_AGE)
16
17 AC_PROG_CC
18 AM_PROG_LIBTOOL
19 AM_PROG_CC_C_O
20
21 dnl config.h
22 AM_CONFIG_HEADER(config.h)
23
24 dnl Set some options based on environment
25
26 cflags_save="$CFLAGS"
27 if test -z "$GCC"; then
28         case $host in 
29         *-*-irix*)
30                 DEBUG="-g -signed" 
31                 CFLAGS="-O2 -w -signed"
32                 PROFILE="-p -g3 -O2 -signed"
33                 ;;
34         sparc-sun-solaris*)
35                 DEBUG="-v -g"
36                 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
37                 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
38                 ;;
39         *)
40                 DEBUG="-g"
41                 CFLAGS="-O"
42                 PROFILE="-g -p" 
43                 ;;
44         esac
45 else
46         case $host in 
47         *-*-linux*)
48                 DEBUG="-g -Wall -fsigned-char"
49                 CFLAGS="-O20 -Wall -ffast-math -fsigned-char"
50                 PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
51                 ;;
52         sparc-sun-*)
53                 DEBUG="-g -Wall -fsigned-char"
54                 CFLAGS="-O20 -ffast-math -fsigned-char"
55                 PROFILE="-pg -g -O20 -fsigned-char" 
56                 ;;
57         *-*-darwin*)
58                 DEBUG="-fno-common -g -Wall -fsigned-char"
59                 CFLAGS="-fno-common -O4 -Wall -fsigned-char -ffast-math"
60                 PROFILE="-fno-common -O4 -Wall -pg -g -fsigned-char -ffast-math"
61                 ;;
62         *)
63                 DEBUG="-g -Wall -fsigned-char"
64                 CFLAGS="-O20 -fsigned-char"
65                 PROFILE="-O20 -g -pg -fsigned-char" 
66                 ;;
67         esac
68 fi
69 CFLAGS="$CFLAGS $cflags_save"
70 DEBUG="$DEBUG $cflags_save"
71 PROFILE="$PROFILE $cflags_save"
72
73 dnl Checks for programs.
74
75 dnl Checks for libraries.
76
77 dnl Checks for header files.
78 AC_HEADER_STDC
79 INCLUDE_INTTYPES_H=0
80 INCLUDE_STDINT_H=0
81 INCLUDE_SYS_TYPES_H=0
82 AC_CHECK_HEADER(inttypes.h,INCLUDE_INTTYPES_H=1)
83 AC_CHECK_HEADER(stdint.h,INCLUDE_STDINT_H=1)
84 AC_CHECK_HEADER(sys/types.h,INCLUDE_SYS_TYPES_H=1)
85
86 dnl Checks for typedefs, structures, and compiler characteristics.
87 AC_C_CONST
88
89 dnl Check for types
90
91 AC_CHECK_SIZEOF(int16_t)
92 AC_CHECK_SIZEOF(uint16_t)
93 AC_CHECK_SIZEOF(u_int16_t)
94 AC_CHECK_SIZEOF(int32_t)
95 AC_CHECK_SIZEOF(uint32_t)
96 AC_CHECK_SIZEOF(u_int32_t)
97 AC_CHECK_SIZEOF(int64_t)
98 AC_CHECK_SIZEOF(short)
99 AC_CHECK_SIZEOF(int)
100 AC_CHECK_SIZEOF(long)
101 AC_CHECK_SIZEOF(long long)
102
103 case 2 in
104      $ac_cv_sizeof_short) SIZE16="short";;
105      $ac_cv_sizeof_int) SIZE16="int";;
106      $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
107 esac
108
109 case 2 in
110      $ac_cv_sizeof_short) USIZE16="unsigned short";;
111      $ac_cv_sizeof_int) USIZE16="unsigned int";;
112      $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";;
113      $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
114 esac
115
116 case 4 in
117      $ac_cv_sizeof_short) SIZE32="short";;
118      $ac_cv_sizeof_int) SIZE32="int";;
119      $ac_cv_sizeof_long) SIZE32="long";;
120      $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
121 esac
122
123 case 4 in
124      $ac_cv_sizeof_short) USIZE32="unsigned short";;
125      $ac_cv_sizeof_int) USIZE32="unsigned int";;
126      $ac_cv_sizeof_long) USIZE32="unsigned long";;
127      $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";;
128      $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
129 esac
130
131 case 8 in
132      $ac_cv_sizeof_int) SIZE64="int";;
133      $ac_cv_sizeof_long) SIZE64="long";;
134      $ac_cv_sizeof_long_long) SIZE64="long long";;
135      $ac_cv_sizeof_int64_t) SIZE64="int64_t";;
136 esac
137
138 if test -z "$SIZE16"; then
139         AC_MSG_ERROR(No 16 bit type found on this platform!)
140 fi
141 if test -z "$USIZE16"; then
142         AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
143 fi
144 if test -z "$SIZE32"; then
145         AC_MSG_ERROR(No 32 bit type found on this platform!)
146 fi
147 if test -z "$USIZE32"; then
148         AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
149 fi
150 if test -z "$SIZE64"; then
151         AC_MSG_WARN(No 64 bit type found on this platform!)
152 fi
153
154 dnl Checks for library functions.
155 AC_FUNC_MEMCMP
156
157 dnl Make substitutions
158
159 AC_SUBST(LIBTOOL_DEPS)
160 AC_SUBST(INCLUDE_INTTYPES_H)
161 AC_SUBST(INCLUDE_STDINT_H)
162 AC_SUBST(INCLUDE_SYS_TYPES_H)
163 AC_SUBST(SIZE16)
164 AC_SUBST(USIZE16)
165 AC_SUBST(SIZE32)
166 AC_SUBST(USIZE32)
167 AC_SUBST(SIZE64)
168 AC_SUBST(OPT)
169 AC_SUBST(LIBS)
170 AC_SUBST(DEBUG)
171 AC_SUBST(CFLAGS)
172 AC_SUBST(PROFILE)
173
174 AC_OUTPUT([
175 Makefile
176 src/Makefile
177 doc/Makefile doc/libogg/Makefile
178 include/Makefile include/ogg/Makefile include/ogg/config_types.h
179 libogg.spec
180 ogg.pc
181 ogg-uninstalled.pc
182 ])