1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/cpu.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gngb,20040115)
dnl Setup for automake
AC_LANG_C
MY_CFLAGS="$CFLAGS"
OUTPUT="Makefile src/Makefile"
dnl Checks for programs.
AC_PROG_CC
AC_C_BIGENDIAN
dnl Checks for libraries.
AC_CHECK_LIB(pthread, pthread_create,,AC_MSG_ERROR(SDL library needs pthread Library))
AC_CHECK_PROG(SDL_CONFIG, sdl-config, yes,no)
if test "$SDL_CONFIG" = yes ; then
CFLAGS="$CFLAGS -DSDL_YUV `sdl-config --cflags`";
LIBS="$LIBS `sdl-config --libs`";
AC_CHECK_LIB(SDL, SDL_Init,,AC_MSG_ERROR(can't find SDL on your system))
else
AC_MSG_ERROR(can't find sdl-config on your system);
fi
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h unistd.h )
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
dnl Checks for library functions.
AC_SUBST(LIBOBJS)
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday sleep mkdir socket strtol)
dnl AC_CHECK_FUNCS(getopt_long ,[GETOPT_LONG=yes , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"]])
AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
#Compress Roms
AC_ARG_ENABLE(compress_roms,[ --disable-compress-roms disable compress roms support], [enablecompress_roms=$enableval], [enablecompress_roms=yes])
AC_SUBST(UNZIP_SRC)
if test "$enablecompress_roms" = yes; then
AC_CHECK_HEADER(bzlib.h,AC_CHECK_LIB(bz2, BZ2_bzopen,,))
AC_CHECK_HEADER(zlib.h,AC_CHECK_LIB(z, gzopen,,))
UNZIP_SRC="unzip.c unzip.h"
LIBOBJS="$LIBOBJS unzip.o"
else
UNZIP_SRC=""
fi
#Opengl Mode
AC_ARG_ENABLE(gl,[ --enable-gl enable opengl support], [enablegl=$enableval], [enablegl=yes])
if test "$enablegl" = yes ; then
AC_CHECK_HEADER(GL/gl.h,,enablegl=no)
AC_CHECK_LIB(GL, glBegin,
[LIBS="$LIBS -lGL";
CFLAGS="$CFLAGS -DSDL_GL ";]
,enablegl=no)
fi
AM_CONDITIONAL(NATIVE_GETOPT_LONG, test "$GETOPT_LONG" = yes)
dnl Force Big Endian
AC_ARG_ENABLE(big_endian,[ --enable-big-endian Force Big Endian], [enablebig_endian=$enableval], [enablebig_endian=no])
if test "$enablebig_endian" = yes ; then
CFLAGS="$CFLAGS -DWORDS_BIGENDIAN ";
fi
dnl Arch
case `uname -m` in
*686) arch_info=i686 ;;
*i586) arch_info=i586 ;;
*i486) arch_info=i486 ;;
*i386) arch_info=i386 ;;
*sun4u) arch_info=sun4u ;;
*) arch_info=no ;;
esac
AC_MSG_RESULT(Architeture: $arch_info)
dnl System
sys_info=`uname -s`
AC_MSG_RESULT(System: $sys_info)
case $arch_info in
i686|i586|i486|i386) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \
-ffast-math -malign-functions=2 -malign-jumps=2 \
-malign-loops=2 -fomit-frame-pointer -Wall -g" ;;
sun4u) OPT="-O3 -Wno-unused -funroll-loops -fstrength-reduce \
-ffast-math -malign-functions=4 -malign-jumps=4 \
-malign-loops=4 -fomit-frame-pointer -Wall -g " ;;
no) OPT="-O3 -Wall -g" ;;
esac
case $sys_info in
SunOS) LDOPT="-lnsl -lsocket -lresolv" ;;
esac
CFLAGS="$CFLAGS $OPT"
LIBS="$LIBS $LDOPT"
AC_OUTPUT(Makefile src/Makefile )
|