cd32_fmv: align with WinUAE
[rofl0r-PUAE.git] / configure.ac
blobf264c852600de7063eab2de6c3ea10317abb1787
1 AC_PREREQ(2.55)
2 AC_INIT(PUAE, 2.8.1, rofl0r@github, puae)
4 AC_CONFIG_MACRO_DIR([m4])
5 AC_CONFIG_HEADER([src/sysconfig.h])
7 AC_PROG_CC
8 AC_LANG(C)
10 AC_CANONICAL_TARGET
11 AC_AIX
12 AC_ISC_POSIX
14 dnl commit version
15 dnl
16 commit=`tail -1 .git/packed-refs | awk '{print $1}'`
17 if test -z "$commit"; then
18         commit="not git"
20 AC_DEFINE_UNQUOTED(PACKAGE_COMMIT, "$commit", [cloned git commit version])
21 AC_SUBST(PACKAGE_COMMIT, $commit)
23 AC_ARG_WITH(sound,
24         AS_HELP_STRING([--with-sound=alsa,none,sdl], [which sound backend to use [sdl]]),
25         [sound=$withval],
26         [sound=sdl])
28 AC_ARG_WITH(gfx,
29         AS_HELP_STRING([--with-gfx=x11,sdl], [which gfx backend to use [sdl]]),
30         [gfx=$withval],
31         [gfx=sdl])
33 AC_ARG_WITH(gui,
34         AS_HELP_STRING([--with-gui=gtk,none,sdl], [which gui frontend to use [sdl]]),
35         [gui=$withval],
36         [gui=sdl])
38 AC_ARG_WITH(threads,
39         AS_HELP_STRING([--with-threads=posix,none,sdl], [which threads implementation use [sdl]]),
40         [threads=$withval],
41         [threads=sdl])
43 AC_ARG_WITH(os,
44         AS_HELP_STRING([--with-os=linux,macosx,generic], [which OS to compile for [linux]]),
45         [os=$withval],
46         [os=linux])
48 AC_ARG_WITH(joystick,
49         AS_HELP_STRING([--with-joystick=none,linuxold,sdl], [which joystick implementation to use [sdl]]),
50         [joystick=$withval],
51         [joystick=sdl])
53 AC_ARG_WITH(machine,
54         AS_HELP_STRING([--with-machine=generic,amd64-gcc,x86-gcc,ppc-gcc], [which machine specific optimizations to use [generic]]),
55         [machine=$withval],
56         [machine=generic])
58 AC_ARG_WITH(float,
59         AS_HELP_STRING([--with-float=ieee,unknown], [whether target machine uses IEEE 754 compatible floats [ieee]]),
60         [float=$withval],
61         [float=ieee])
63 AC_ARG_ENABLE(jit,
64         AS_HELP_STRING([--enable-jit], [Enable JIT compiler (currently x86 only)]),
65         [WANT_JIT=$enableval],[])
67 AC_ARG_ENABLE(net,
68         AS_HELP_STRING([--enable-net], [Enable network functionality (requires pcap)]),
69         [WANT_NET=$enableval],[])
71 dnl  Checks for header files.
72 dnl
73 AC_HEADER_DIRENT
74 AC_HEADER_STDC
75 AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h utime.h])
76 AC_CHECK_HEADERS([values.h ncurses.h curses.h sys/termios.h])
77 AC_CHECK_HEADERS([sys/stat.h sys/ipc.h sys/shm.h sys/mman.h])
78 AC_CHECK_HEADERS([sys/statfs.h sys/statvfs.h])
79 AC_CHECK_HEADERS([sys/filio.h])
81 AC_CHECK_HEADERS([libraries/cybergraphics.h cybergraphx/cybergraphics.h])
83 AC_CHECK_HEADERS([devices/ahi.h])
84 AC_CHECK_HEADERS([sys/soundcard.h machine/soundcard.h sun/audioio.h sys/audioio.h])
86 AC_CHECK_HEADERS([machine/joystick.h])
87 AC_CHECK_HEADER([amigainput/amigainput.h], HAVE_AMIGAINPUT=yes, HAVE_AMIGAINPUT=no)
89 AC_CHECK_HEADERS([byteswap.h])
91 dnl
92 dnl  Checks for typedefs, structures, and compiler characteristics.
93 dnl
94 AC_HEADER_STDBOOL
95 AC_C_CONST
96 AC_C_INLINE
97 AC_TYPE_MODE_T
98 AC_TYPE_OFF_T
99 AC_TYPE_SIZE_T
100 AC_STRUCT_ST_BLOCKS
101 AC_HEADER_TIME
102 AC_STRUCT_TM
103 AC_C_VOLATILE
104 AC_C_BIGENDIAN
106 AC_CHECK_SIZEOF(char, 1)
107 AC_CHECK_SIZEOF(short, 2)
108 AC_CHECK_SIZEOF(int, 4)
109 AC_CHECK_SIZEOF(long, 4)
110 AC_CHECK_SIZEOF(long long, 8)
111 AC_CHECK_SIZEOF(void *)
113 if test "${ac_cv_c_have_long_double}" = "yes" ; then
114         AC_CHECK_SIZEOF(long double, 12)
117 dnl  Checks for library functions.
119 AC_FUNC_MEMCMP
120 AC_TYPE_SIGNAL
121 AC_FUNC_UTIME_NULL
122 AC_CHECK_FUNCS(gettimeofday sigaction)
123 AC_CHECK_FUNCS(select strerror isnan isinf setitimer alarm sync)
124 AC_CHECK_FUNCS(readdir_r)
125 AC_CHECK_FUNCS(strdup strstr strcasecmp stricmp strcmpi)
126 AC_CHECK_FUNCS(nanosleep usleep sleep)
127 AC_CHECK_FUNCS(vprintf vsprintf vfprintf)
129 AC_CHECK_FUNCS(localtime_r timegm gmtime_r)
130 AC_SYS_LARGEFILE
132 AC_MSG_CHECKING(for bswap_16)
133 AC_TRY_LINK([
134   #if HAVE_BYTESWAP_H
135   # include <byteswap.h>
136   #endif
138   bswap_16 (0x12);
140   AC_DEFINE(HAVE_BSWAP_16, 1, [Define to 1 if you have the 'bswap_16' function.])
141   AC_MSG_RESULT(yes)
143   AC_MSG_RESULT(no)
145 AC_MSG_CHECKING(for bswap_32)
146 AC_TRY_LINK([
147   #if HAVE_BYTESWAP_H
148   # include <byteswap.h>
149   #endif
151   bswap_32 (0x1234);
153   AC_DEFINE(HAVE_BSWAP_32, 1, [Define to 1 if you have the 'bswap_32' function.])
154   AC_MSG_RESULT(yes)
156   AC_MSG_RESULT(no)
160 dnl  Checks for fsusage
162 AC_CHECK_HEADERS(sys/param.h sys/vfs.h sys/fs_types.h)
163 AC_CHECK_HEADERS(sys/mount.h, [], [],
164 [#ifdef HAVE_SYS_PARAM_H
165 # include <sys/param.h>
166 #endif
168 jm_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
169 if test $gl_cv_fs_space = yes; then
170   AC_LIBOBJ(fsusage)
171   gl_PREREQ_FSUSAGE_EXTRA
174 AC_CACHE_SAVE
176 AC_CHECK_LIB(z, inflateEnd, [zlib_cv_libz=yes], [zlib_cv_libz=no])
177 AC_CHECK_HEADER(zlib.h, [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
178 if test "$zlib_cv_libz" = "yes" -a "$zlib_cv_zlib_h" = "yes"
179 then
180     UAE_LIBS="-lz $UAE_LIBS"
181 else
182     AC_MSG_ERROR(Check for libz failed)
186 dnl  Check for dlopen
188 AC_CHECK_LIB(dl, dlopen, [
189     UAE_LIBS="-ldl $UAE_LIBS"
190     AC_DEFINE(HAVE_DLOPEN, 1, "Define to 1 if you have 'dlopen' function)
191   ],
194 net_enabled=0
195 if test x$WANT_NET = xyes ; then
196  AC_CHECK_LIB(pcap, pcap_open_live, [HAVE_LIB_PCAP=yes], [HAVE_LIB_PCAP=no])
197  AC_CHECK_HEADERS([pcap.h], HAVE_PCAP=yes, HAVE_PCAP=no)
198  if test x$HAVE_PCAP = xno || test x$HAVE_LIB_PCAP = xno ; then
199   AC_MSG_ERROR(pcap library not found!)
200  fi
201  net_enabled=1
204 jit_enabled=0
205 if test x$WANT_JIT = xyes ; then
206  AC_CHECK_HEADERS([execinfo.h])
207  jit_enabled=1
210 AC_CONFIG_FILES([config.mak])
211 AC_SUBST(gfx)
212 AC_SUBST(gui)
213 AC_SUBST(threads)
214 AC_SUBST(machine)
215 AC_SUBST(os)
216 AC_SUBST(sound)
217 AC_SUBST(joystick)
218 AC_SUBST(float)
219 AC_SUBST(net_enabled)
220 AC_SUBST(jit_enabled)
222 AC_SUBST(CC)
223 AC_SUBST(HOSTCC)
224 AC_SUBST(CFLAGS)
225 AC_SUBST(CPPFLAGS)
226 AC_SUBST(LDFLAGS)
227 AC_SUBST(LIBS)
229 AC_OUTPUT