dnl Process this file with autoconf to produce a configure script. AC_INIT(README) dnl Set various version strings - taken gratefully from the GTk sources # # Making releases: # MICRO_VERSION += 1; # INTERFACE_AGE += 1; # BINARY_AGE += 1; # if any functions have been added, set INTERFACE_AGE to 0. # if backwards compatibility has been broken, # set BINARY_AGE and INTERFACE_AGE to 0. # MAJOR_VERSION=0 MINOR_VERSION=9 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION AC_SUBST(MAJOR_VERSION) AC_SUBST(MINOR_VERSION) AC_SUBST(MICRO_VERSION) AC_SUBST(INTERFACE_AGE) AC_SUBST(BINARY_AGE) AC_SUBST(VERSION) # libtool versioning LT_RELEASE=$MAJOR_VERSION.$MINOR_VERSION LT_CURRENT=`expr $MICRO_VERSION - $INTERFACE_AGE` LT_REVISION=$INTERFACE_AGE LT_AGE=`expr $BINARY_AGE - $INTERFACE_AGE` dnl Detect the canonical host and target build environment AC_CANONICAL_HOST AC_CANONICAL_TARGET AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) dnl Setup for automake AM_INIT_AUTOMAKE(libfame, $VERSION) dnl Check for tools AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL AC_PROG_MAKE_SET AC_PROG_CC AC_C_INLINE AC_C_CONST AC_PROG_INSTALL dnl The alpha architecture needs special flags for binary portability case "$target" in alpha*-*-linux*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall" fi ;; i386-*-*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -march=i386" fi ;; i486-*-*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -march=i486 -DHAS_BSWAP" fi ;; i?86-*-*) if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -march=i586 -DHAS_BSWAP" fi ;; esac dnl Set runtime shared library paths as needed case "$target" in *-*-linux*) FAME_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib" ;; *-*-freebsd*) FAME_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib" ;; *-*-solaris*) FAME_RLD_FLAGS="-R\${exec_prefix}/lib" ;; esac AC_SUBST(FAME_RLD_FLAGS) dnl See if we need to pass -lm for the math library AC_CHECK_LIB(m, sqrt, LIBS="$LIBS -lm") dnl Optimize if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -Wall -fexpensive-optimizations -funroll-loops -ffast-math" dnl -fstrict-aliasing doesn't seem to be supported by gcc < 2.95 gcc_major_version=`$CC --version | \ sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` gcc_minor_version=`$CC --version | \ sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` gcc_micro_version=`$CC --version | \ sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` dnl ok, I must admit I don't know how to do or/and ;) if test $gcc_major_version -eq 2; then if test $gcc_minor_version -gt 94; then CFLAGS="$CFLAGS -fstrict-aliasing" fi fi if test $gcc_major_version -gt 2; then CFLAGS="$CFLAGS -fstrict-aliasing" fi fi dnl Check for debugging support AC_ARG_ENABLE(debug, [ --enable-debug Include debugging support [default=no]], , enable_debug=no) if test x$enable_debug = xyes; then dnl See if electric fence is installed AC_CHECK_LIB(efence, malloc, LIBS="$LIBS -lefence") fi dnl Check for profiling support AC_ARG_ENABLE(profile, [ --enable-profile Include profiling support [default=no]], , enable_profile=no) if test x$enable_profile = xyes; then if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -pg" LIBS="$LIBS -pg" fi fi if test x$enable_profile != xyes -a x$enable_debug != xyes; then if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -fomit-frame-pointer" fi fi dnl Check for MMX support AC_ARG_ENABLE(mmx, [ --enable-mmx Enable MMX support [default=yes]], , enable_mmx=yes) if test x$enable_mmx = xyes; then if test x$ac_cv_prog_gcc = xyes; then enable_mmx=yes AC_MSG_CHECKING(for MMX support) AC_TRY_RUN([ main() { unsigned int flags = 0; #if defined(i386) && defined(__GNUC__) asm volatile ("push %%eax\n" "push %%ebx\n" "push %%ecx\n" "pushfl\n" "popl %%ecx\n" "movl %%ecx, %%edx\n" "xorl \$0x200000,%%edx\n" "pushl %%edx\n" "popfl\n" "pushfl\n" "popl %%edx\n" "xorl %%ecx, %%edx\n" "je 1f\n" "pushl %%ecx\n" "popfl\n" "movl \$1,%%eax\n" "cpuid\n" "1:\n" "pop %%ecx\n" "pop %%ebx\n" "pop %%eax\n" : "=d" (flags)); if(flags & (1 << 23)) { asm ("pxor %mm0, %mm0\n"); exit(0); } #endif exit(1); } ],[ have_mmx=yes ],[ have_mmx=no ],[ have_mmx=yes ]) if test x$have_mmx != xcross; then AC_MSG_RESULT($have_mmx) enable_mmx=$have_mmx else AC_MSG_RESULT(cross-compiling, assumed ok) enable_mmx=yes fi if test x$enable_mmx = xyes; then CFLAGS="$CFLAGS -DHAS_MMX" fi fi fi dnl Check for SSE support AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support [default=no]], , enable_sse=no) if test x$enable_sse = xyes; then if test x$ac_cv_prog_gcc = xyes; then CFLAGS="$CFLAGS -DHAS_SSE" fi fi dnl Finally create all the generated files AC_OUTPUT([ libfame-config libfame.spec libfame.m4 Makefile src/Makefile src/fame_version.h doc/Makefile ])