# Process this file with autoconf to produce a configure script. # $Id: configure.in,v 1.2 2003/08/17 23:45:17 arc Exp $ m4_define(writ_major, 0) m4_define(writ_minor, 0) m4_define(writ_micro, 0) m4_define(writ_version, m4_if(writ_micro, 0, writ_major.writ_minor, writ_major.writ_minor.writ_micro)) AC_INIT([writ], writ_version, [writ@xiph.org]) AC_PREREQ(2.52) # AC_CONFIG_SRCDIR([src/config.c]) # AM_CONFIG_HEADER(config.h) ## config.h guard # AH_TOP([#ifndef __CONFIG_H__ # define __CONFIG_H__ 1]) # AH_BOTTOM([#endif]) AC_DEFINE([writ_MAJOR], writ_major, [Writ library major version]) AC_DEFINE([writ_MINOR], writ_minor, [Writ library minor version]) AC_DEFINE([writ_MICRO], writ_micro, [Writ library patch version]) VERSION=writ_version AM_INIT_AUTOMAKE([writ], writ_version) AM_MAINTAINER_MODE AC_PROG_CC AC_PROG_LIBTOOL dnl Set some options based on environment dnl openbsd headers break when _XOPEN_SOURCE is defined but without it seems dnl to be fine case "$ac_cv_host" in *openbsd*) ;; *) AC_DEFINE(_XOPEN_SOURCE, 500, [Define if you have POSIX and XPG specifications]) ;; esac 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 XIPH_CFLAGS="-Wall -ffast-math -fsigned-char" AC_DEFINE(_GNU_SOURCE, ,[Define if you have POSIX and GNU specifications]) DEBUG="-g" PROFILE="-pg -g" fi dnl Checks for programs. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([inttypes.h]) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST dnl Check for types AC_CHECK_TYPE([uint32_t], [AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])], [AC_CHECK_SIZEOF(short) AC_CHECK_SIZEOF(int) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long)]) AH_VERBATIM([X_HAVE_C99_INTTYPES], [#ifndef HAVE_C99_INTTYPES # if SIZEOF_SHORT == 4 typedef unsigned short uint32_t; # elif SIZEOF_INT == 4 typedef unsigned int uint32_t; # elif SIZEOF_LONG == 4 typedef unsigned long uint32_t; # endif # if SIZEOF_INT == 8 typedef unsigned int uint64_t; # elif SIZEOF_LONG == 8 typedef unsigned long uint64_t; # elif SIZEOF_LONG_LONG == 8 typedef unsigned long long uint64_t; # endif #endif]) dnl Extra dependencies XIPH_PATH_OGG XIPH_CFLAGS="$XIPH_CFLAGS $OGG_CFLAGS" dnl Make substitutions AC_SUBST(LIBTOOL_DEPS) AC_SUBST(OPT) AC_SUBST(LIBS) AC_SUBST(DEBUG) AC_SUBST(CFLAGS) AC_SUBST(PROFILE) AC_SUBST(XIPH_CFLAGS) AC_OUTPUT([Makefile include/Makefile include/writ/Makefile src/Makefile])