File: configure.in

package info (click to toggle)
gngb 20060309-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,248 kB
  • ctags: 1,642
  • sloc: ansic: 11,009; sh: 2,915; makefile: 8
file content (131 lines) | stat: -rw-r--r-- 3,438 bytes parent folder | download
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
128
129
130
131
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,20060309)

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.
dnl 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"]])
dnl AC_CHECK_FUNCS(getopt_long , , [LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
AC_CHECK_FUNCS(getopt_long , , [ AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) ])

#Compress Roms
dnl AC_ARG_ENABLE(compress_roms,[  --disable-compress-roms      disable compress roms support], [enablecompress_roms=$enableval], [enablecompress_roms=yes])

dnl if test "$enablecompress_roms" = yes; then
AC_CHECK_HEADER(bzlib.h,AC_CHECK_LIB(bz2, BZ2_bzopen,,AC_MSG_ERROR(can't find bzlil on your system)))
AC_CHECK_HEADER(zlib.h,AC_CHECK_LIB(z, gzopen,,AC_MSG_ERROR(can't find zlib on your system)))

dnl UNZIP_SRC="unzip.c unzip.h"
dnl LIBOBJS="$LIBOBJS unzip.o"
dnl AC_LIBOBJ([unzip])
dnl else 
dnl UNZIP_SRC=""
dnl fi	
dnl AC_SUBST(UNZIP_SRC)



#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
*x86_64) arch_info=x86_64 ;;
*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
x86_64|i686|i586|i486|i386) OPT="-O3  -Wno-unused -funroll-loops -fstrength-reduce \
                          -ffast-math -falign-functions=2 -falign-jumps=2 \
                          -falign-loops=2 -fomit-frame-pointer -Wall " ;;
sun4u)               OPT="-O3  -Wno-unused -funroll-loops -fstrength-reduce \
                          -ffast-math -falign-functions=4 -falign-jumps=4 \
                          -falign-loops=4 -fomit-frame-pointer -Wall " ;;
no)                  OPT="-O3 -Wall " ;;
esac

case $sys_info in
SunOS) LDOPT="-lnsl -lsocket -lresolv" ;;
esac

CFLAGS="$CFLAGS $OPT"
LIBS="$LIBS $LDOPT"

AC_OUTPUT(Makefile src/Makefile )