configure.ac 4.45 KB
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1
dnl Process this file with autoconf to produce a configure script.
calc's avatar
calc committed
2

3
AC_INIT([libogg],[1.3.3],[ogg-dev@xiph.org])
Jack Moffitt's avatar
Jack Moffitt committed
4

5 6 7 8
AC_CONFIG_SRCDIR(src/framing.c)

AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE([enable])
Jack Moffitt's avatar
Jack Moffitt committed
9

Jack Moffitt's avatar
Jack Moffitt committed
10 11
dnl Library versioning

12
LIB_CURRENT=8
13
LIB_REVISION=3
14
LIB_AGE=8
Jack Moffitt's avatar
Jack Moffitt committed
15 16 17 18
AC_SUBST(LIB_CURRENT)
AC_SUBST(LIB_REVISION)
AC_SUBST(LIB_AGE)

Jack Moffitt's avatar
Jack Moffitt committed
19 20
AC_PROG_CC
AM_PROG_LIBTOOL
21
AM_PROG_CC_C_O
Jack Moffitt's avatar
Jack Moffitt committed
22 23 24

dnl Set some options based on environment

25
cflags_save="$CFLAGS"
Jack Moffitt's avatar
Jack Moffitt committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
if test -z "$GCC"; then
        case $host in 
        *-*-irix*)
                DEBUG="-g -signed" 
                CFLAGS="-O2 -w -signed"
                PROFILE="-p -g3 -O2 -signed"
		;;
        sparc-sun-solaris*)
                DEBUG="-v -g"
                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
                PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
		;;
        *)
                DEBUG="-g"
                CFLAGS="-O"
                PROFILE="-g -p" 
		;;
        esac
else
        case $host in 
        *-*-linux*)
                DEBUG="-g -Wall -fsigned-char"
48
                CFLAGS="-O20 -Wall -ffast-math -fsigned-char"
Jack Moffitt's avatar
Jack Moffitt committed
49 50 51
                PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
		;;
        sparc-sun-*)
52 53 54
                DEBUG="-g -Wall -fsigned-char"
                CFLAGS="-O20 -ffast-math -fsigned-char"
                PROFILE="-pg -g -O20 -fsigned-char" 
Jack Moffitt's avatar
Jack Moffitt committed
55
		;;
Monty's avatar
 
Monty committed
56 57 58 59 60
	*-*-darwin*)
		DEBUG="-fno-common -g -Wall -fsigned-char"
		CFLAGS="-fno-common -O4 -Wall -fsigned-char -ffast-math"
		PROFILE="-fno-common -O4 -Wall -pg -g -fsigned-char -ffast-math"
		;;
Jack Moffitt's avatar
Jack Moffitt committed
61 62 63 64 65 66 67
        *)
                DEBUG="-g -Wall -fsigned-char"
                CFLAGS="-O20 -fsigned-char"
                PROFILE="-O20 -g -pg -fsigned-char" 
		;;
        esac
fi
68
CFLAGS="$CFLAGS $cflags_save"
69 70
DEBUG="$DEBUG $cflags_save"
PROFILE="$PROFILE $cflags_save"
Jack Moffitt's avatar
Jack Moffitt committed
71 72 73 74 75 76 77

dnl Checks for programs.

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
78 79 80 81 82 83
INCLUDE_INTTYPES_H=0
INCLUDE_STDINT_H=0
INCLUDE_SYS_TYPES_H=0
AC_CHECK_HEADER(inttypes.h,INCLUDE_INTTYPES_H=1)
AC_CHECK_HEADER(stdint.h,INCLUDE_STDINT_H=1)
AC_CHECK_HEADER(sys/types.h,INCLUDE_SYS_TYPES_H=1)
Jack Moffitt's avatar
Jack Moffitt committed
84 85 86 87 88 89

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Check for types

90 91 92 93 94 95 96 97 98 99 100 101 102
AC_CHECK_SIZEOF(int16_t)
AC_CHECK_SIZEOF(uint16_t)
AC_CHECK_SIZEOF(u_int16_t)
AC_CHECK_SIZEOF(int32_t)
AC_CHECK_SIZEOF(uint32_t)
AC_CHECK_SIZEOF(u_int32_t)
AC_CHECK_SIZEOF(int64_t)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)

case 2 in
103
     $ac_cv_sizeof_int16_t) SIZE16="int16_t";;
104 105 106
     $ac_cv_sizeof_short) SIZE16="short";;
     $ac_cv_sizeof_int) SIZE16="int";;
esac
Jack Moffitt's avatar
Jack Moffitt committed
107

108
case 2 in
109
     $ac_cv_sizeof_uint16_t) USIZE16="uint16_t";;
110 111 112 113
     $ac_cv_sizeof_short) USIZE16="unsigned short";;
     $ac_cv_sizeof_int) USIZE16="unsigned int";;
     $ac_cv_sizeof_u_int16_t) USIZE16="u_int16_t";;
esac
Jack Moffitt's avatar
Jack Moffitt committed
114

115
case 4 in
116
     $ac_cv_sizeof_int32_t) SIZE32="int32_t";;
117 118 119 120
     $ac_cv_sizeof_short) SIZE32="short";;
     $ac_cv_sizeof_int) SIZE32="int";;
     $ac_cv_sizeof_long) SIZE32="long";;
esac
Jack Moffitt's avatar
Jack Moffitt committed
121

122
case 4 in
123
     $ac_cv_sizeof_uint32_t) USIZE32="uint32_t";;
124 125 126 127 128
     $ac_cv_sizeof_short) USIZE32="unsigned short";;
     $ac_cv_sizeof_int) USIZE32="unsigned int";;
     $ac_cv_sizeof_long) USIZE32="unsigned long";;
     $ac_cv_sizeof_u_int32_t) USIZE32="u_int32_t";;
esac
Monty's avatar
 
Monty committed
129

Jack Moffitt's avatar
Jack Moffitt committed
130
case 8 in
131
     $ac_cv_sizeof_int64_t) SIZE64="int64_t";;
132 133 134
     $ac_cv_sizeof_int) SIZE64="int";;
     $ac_cv_sizeof_long) SIZE64="long";;
     $ac_cv_sizeof_long_long) SIZE64="long long";;
Jack Moffitt's avatar
Jack Moffitt committed
135 136 137 138 139
esac

if test -z "$SIZE16"; then
        AC_MSG_ERROR(No 16 bit type found on this platform!)
fi
Monty's avatar
 
Monty committed
140 141 142
if test -z "$USIZE16"; then
        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
fi
Jack Moffitt's avatar
Jack Moffitt committed
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
if test -z "$SIZE32"; then
        AC_MSG_ERROR(No 32 bit type found on this platform!)
fi
if test -z "$USIZE32"; then
        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
fi
if test -z "$SIZE64"; then
        AC_MSG_WARN(No 64 bit type found on this platform!)
fi

dnl Checks for library functions.
AC_FUNC_MEMCMP

dnl Make substitutions

AC_SUBST(LIBTOOL_DEPS)
159 160 161
AC_SUBST(INCLUDE_INTTYPES_H)
AC_SUBST(INCLUDE_STDINT_H)
AC_SUBST(INCLUDE_SYS_TYPES_H)
Jack Moffitt's avatar
Jack Moffitt committed
162
AC_SUBST(SIZE16)
Monty's avatar
 
Monty committed
163
AC_SUBST(USIZE16)
Jack Moffitt's avatar
Jack Moffitt committed
164 165 166 167 168 169 170 171 172
AC_SUBST(SIZE32)
AC_SUBST(USIZE32)
AC_SUBST(SIZE64)
AC_SUBST(OPT)
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(CFLAGS)
AC_SUBST(PROFILE)

173 174

AC_CONFIG_FILES([
175 176
Makefile
src/Makefile
177
doc/Makefile doc/libogg/Makefile
178
include/Makefile include/ogg/Makefile include/ogg/config_types.h
179
libogg.spec
180 181 182
ogg.pc
ogg-uninstalled.pc
])
183 184 185
AC_CONFIG_HEADERS([config.h])

AC_OUTPUT