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])
13 # AC_CONFIG_SRCDIR([src/config.c])
14 # AM_CONFIG_HEADER(config.h)
16 # AH_TOP([#ifndef __CONFIG_H__
17 # define __CONFIG_H__ 1])
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])
26 AM_INIT_AUTOMAKE([writ], writ_version)
32 dnl Set some options based on environment
34 dnl openbsd headers break when _XOPEN_SOURCE is defined but without it seems
39 *) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications])
42 if test -z "$GCC"; then
46 CFLAGS="-O2 -w -signed"
47 PROFILE="-p -g3 -O2 -signed"
51 CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
52 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
61 XIPH_CFLAGS="-Wall -ffast-math -fsigned-char"
62 AC_DEFINE(_GNU_SOURCE, ,[Define if you have POSIX and GNU specifications])
67 dnl Checks for programs.
69 dnl Checks for header files.
71 AC_CHECK_HEADERS([inttypes.h])
73 dnl Checks for typedefs, structures, and compiler characteristics.
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)
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;
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;
101 dnl Extra dependencies
104 XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS"
106 dnl Make substitutions
108 AC_SUBST(LIBTOOL_DEPS)
114 AC_SUBST(XIPH_CFLAGS)
116 AC_OUTPUT([Makefile include/Makefile include/writ/Makefile src/Makefile])