dinput8: Better DirectInput8Create warning.
[wine] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 dnl Original author: Michael Patra
3 dnl See ChangeLog file for detailed change history.
4
5 m4_define(WINE_VERSION,regexp(m4_include(VERSION),[version \([-.0-9A-Za-z]+\)],[\1]))
6
7 AC_PREREQ(2.53b)
8 AC_INIT([Wine],WINE_VERSION,[wine-devel@winehq.org])
9 AC_CONFIG_SRCDIR(server/atom.c)
10 AC_CONFIG_HEADERS(include/config.h)
11 AC_CONFIG_AUX_DIR(tools)
12
13 dnl **** Command-line arguments ****
14
15 AC_ARG_ENABLE(win16, AC_HELP_STRING([--disable-win16],[do not include Win16 support]))
16 AC_ARG_ENABLE(win64, AC_HELP_STRING([--enable-win64], [build a Win64 emulator on AMD64 (won't run Win32 binaries)]))
17
18 AC_ARG_WITH(opengl,    AC_HELP_STRING([--without-opengl],[do not use OpenGL]))
19 AC_ARG_WITH(curses,    AC_HELP_STRING([--without-curses],[do not use curses]))
20 AC_ARG_WITH(wine-tools,AC_HELP_STRING([--with-wine-tools=<dir>],[use Wine tools from directory <dir>]))
21
22 AC_CANONICAL_HOST
23 case $host in
24   x86_64*linux*)
25     if test "x$enable_win64" != "xyes"
26     then
27       test -n "$CC" || CC="gcc -m32"
28       test -n "$LD" || LD="ld -m elf_i386"
29       test -n "$AS" || AS="as --32"
30       host_cpu="i386"
31     fi
32     ;;
33 esac
34
35 dnl enable_win16 defaults to yes on x86, to no on other CPUs
36 case $host_cpu in
37   *i[[3456789]]86*)
38     if test "x$enable_win16" != "xno" 
39     then
40       enable_win16="yes"
41     fi
42     ;;
43 esac
44    
45 AC_SUBST(WIN16_FILES,"\$(WIN16_FILES)")
46 AC_SUBST(WIN16_INSTALL,"\$(WIN16_INSTALL)")
47 if test "x$enable_win16" != "xyes"
48 then
49   WIN16_FILES=""
50   WIN16_INSTALL=""
51 fi
52
53 dnl **** Check for some programs ****
54
55 AC_PROG_MAKE_SET
56 AC_PROG_CC
57 AC_PROG_CXX
58 dnl We can't use AC_PROG_CPP for winegcc, it uses by default $(CC) -E
59 AC_CHECK_TOOL(CPPBIN,cpp,cpp)
60
61 AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir,
62   [if test -z "$with_wine_tools"; then
63      if test "$cross_compiling" = "yes"; then
64        AC_MSG_ERROR([you must use the --with-wine-tools option when cross-compiling.])
65      else
66        wine_cv_toolsdir="\$(TOPOBJDIR)"
67      fi
68    elif test -d "$with_wine_tools/tools/winebuild"; then
69      case $with_wine_tools in
70        /*) wine_cv_toolsdir="$with_wine_tools" ;;
71        *)  wine_cv_toolsdir="\$(TOPOBJDIR)/$with_wine_tools" ;;
72      esac
73    else
74      AC_MSG_ERROR([could not find Wine tools in $with_wine_tools.])
75    fi])
76 AC_SUBST(TOOLSDIR,$wine_cv_toolsdir)
77
78 AC_PATH_XTRA
79 AC_PROG_LEX
80
81 dnl **** Just additional warning checks, since AC_PROG just sets 'lex' even
82 dnl **** without one present.
83 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
84 if test "$XLEX" = "none"
85 then
86   AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
87 fi
88
89 dnl Check for bison
90 AC_CHECK_PROGS(BISON,bison,none)
91 if test "$BISON" = "none"
92 then
93   AC_MSG_ERROR([no suitable bison found. Please install the 'bison' package.])
94 fi
95
96 AC_CHECK_TOOLS(AS,[gas as],as)
97 AC_CHECK_TOOL(LD,ld,ld)
98 AC_CHECK_TOOL(AR,ar,ar)
99 AC_PROG_RANLIB
100 AC_CHECK_TOOL(STRIP,strip,strip)
101 AC_CHECK_TOOL(WINDRES,windres,false)
102 AC_PROG_LN_S
103 WINE_PROG_LN
104 AC_PROG_EGREP
105 AC_PATH_PROG(LDCONFIG, ldconfig, true, [/sbin /usr/sbin $PATH])
106 AC_PROG_INSTALL
107 dnl Prepend src dir to install path dir if it's a relative path
108 case "$INSTALL" in
109   [[\\/$]]* | ?:[[\\/]]* ) ;;
110   *)  INSTALL="\\\$(TOPSRCDIR)/$INSTALL" ;;
111 esac
112
113 dnl Check for lint
114 AC_CHECK_PROGS(LINT, lclint lint)
115 if test "$LINT" = "lint"
116 then
117   LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
118   dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
119 fi
120 AC_SUBST(LINT)
121 AC_SUBST(LINTFLAGS)
122
123 dnl Check for various programs
124 AC_CHECK_PROGS(FONTFORGE, fontforge, false)
125 AC_CHECK_PROGS(PKG_CONFIG, pkg-config, false)
126
127 case $host_cpu in
128   *i[[3456789]]86*)
129     AC_PATH_PROG(PRELINK, prelink, false, [/sbin /usr/sbin $PATH])
130     ;;
131 esac
132
133 dnl **** Check for some libraries ****
134
135 dnl Check for -li386 for NetBSD and OpenBSD
136 AC_CHECK_LIB(i386,i386_set_ldt)
137 dnl Check for -lossaudio for NetBSD
138 AC_CHECK_LIB(ossaudio,_oss_ioctl)
139 dnl Check for -lnsl for Solaris
140 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
141 dnl Check for -lsocket for Solaris
142 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
143 dnl Check for -lresolv for Solaris
144 AC_CHECK_FUNCS(inet_aton,,AC_CHECK_LIB(resolv,inet_aton))
145 dnl Check for -lxpg4 for FreeBSD
146 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
147 dnl Check for -lpoll for Mac OS X/Darwin
148 AC_CHECK_LIB(poll,poll)
149 dnl Check for -lresolv for Mac OS X/Darwin
150 AC_CHECK_LIB(resolv,res_9_init)
151 dnl Check for -lpthread
152 AC_CHECK_LIB(pthread,pthread_create,AC_SUBST(LIBPTHREAD,"-lpthread"))
153
154 AC_SUBST(XLIB,"")
155 AC_SUBST(XFILES,"")
156 AC_SUBST(OPENGLFILES,"")
157 AC_SUBST(GLU32FILES,"")
158 AC_SUBST(OPENGL_LIBS,"")
159
160 dnl **** Check for header files ****
161
162 AC_CHECK_HEADERS(\
163         AudioUnit/AudioUnit.h \
164         CoreAudio/CoreAudio.h \
165         IOKit/IOKitLib.h \
166         alsa/asoundlib.h \
167         arpa/inet.h \
168         arpa/nameser.h \
169         asm/types.h \
170         capi20.h \
171         cups/cups.h \
172         curses.h \
173         direct.h \
174         dlfcn.h \
175         elf.h \
176         float.h \
177         fontconfig/fontconfig.h \
178         getopt.h \
179         gif_lib.h \
180         ieeefp.h \
181         io.h \
182         jack/jack.h \
183         jpeglib.h \
184         lber.h \
185         lcms.h \
186         lcms/lcms.h \
187         ldap.h \
188         libaudioio.h \
189         link.h \
190         linux/cdrom.h \
191         linux/compiler.h \
192         linux/hdreg.h \
193         linux/input.h \
194         linux/ioctl.h \
195         linux/joystick.h \
196         linux/major.h \
197         linux/param.h \
198         linux/serial.h \
199         linux/ucdrom.h \
200         mach/machine.h \
201         machine/cpu.h \
202         machine/limits.h \
203         machine/soundcard.h \
204         mntent.h \
205         ncurses.h \
206         netdb.h \
207         netinet/in.h \
208         netinet/in_systm.h \
209         netinet/tcp.h \
210         netinet/tcp_fsm.h \
211         openssl/err.h \
212         openssl/ssl.h \
213         poll.h \
214         process.h \
215         pthread.h \
216         pwd.h \
217         regex.h \
218         sched.h \
219         scsi/scsi.h \
220         scsi/scsi_ioctl.h \
221         scsi/sg.h \
222         soundcard.h \
223         stdint.h \
224         strings.h \
225         sys/asoundlib.h \
226         sys/cdio.h \
227         sys/elf32.h \
228         sys/epoll.h \
229         sys/errno.h \
230         sys/exec_elf.h \
231         sys/filio.h \
232         sys/ioctl.h \
233         sys/ipc.h \
234         sys/limits.h \
235         sys/link.h \
236         sys/lwp.h \
237         sys/mman.h \
238         sys/modem.h \
239         sys/msg.h \
240         sys/mtio.h \
241         sys/param.h \
242         sys/poll.h \
243         sys/prctl.h \
244         sys/ptrace.h \
245         sys/reg.h \
246         sys/resource.h \
247         sys/scsiio.h \
248         sys/shm.h \
249         sys/signal.h \
250         sys/socket.h \
251         sys/sockio.h \
252         sys/soundcard.h \
253         sys/statvfs.h \
254         sys/strtio.h \
255         sys/syscall.h \
256         sys/sysctl.h \
257         sys/time.h \
258         sys/times.h \
259         sys/uio.h \
260         sys/un.h \
261         sys/vm86.h \
262         sys/wait.h \
263         syscall.h \
264         termios.h \
265         unicode/ubidi.h \
266         unistd.h \
267         utime.h \
268         valgrind/memcheck.h
269 )
270 AC_HEADER_STAT()
271
272 dnl **** Checks for headers that depend on other ones ****
273
274 AC_CHECK_HEADERS([sys/mount.h sys/statfs.h sys/user.h sys/vfs.h],,,
275     [#include <sys/types.h>
276      #if HAVE_SYS_PARAM_H
277      # include <sys/param.h>
278      #endif])
279
280 AC_CHECK_HEADERS([net/if.h net/if_arp.h net/if_dl.h net/if_types.h net/route.h netipx/ipx.h],,,
281     [#include <sys/types.h>
282      #if HAVE_SYS_SOCKET_H
283      # include <sys/socket.h>
284      #endif])
285
286 AC_CHECK_HEADERS([resolv.h],,,
287     [#include <sys/types.h>
288      #if HAVE_SYS_SOCKET_H
289      # include <sys/socket.h>
290      #endif
291      #if HAVE_NETINET_IN_H
292      # include <netinet/in.h>
293      #endif
294      #if HAVE_ARPA_NAMESER_H
295      # include <arpa/nameser.h>
296      #endif])
297
298 AC_CHECK_HEADERS(ucontext.h,,,[#include <signal.h>])
299
300 AC_CHECK_HEADERS([linux/ipx.h linux/videodev.h],,,
301 [#ifdef HAVE_SYS_TIME_H
302 #include <sys/time.h>
303 #endif
304 #include <sys/types.h>
305 #ifdef HAVE_ASM_TYPES_H
306 #include <asm/types.h>
307 #endif])
308
309 dnl Check for broken kernel header that doesn't define __user
310 AC_CHECK_HEADERS([linux/capi.h],,,[#define __user])
311
312 dnl **** Check for X11 ****
313
314 if test "$have_x" = "yes"
315 then
316     XLIB="-lXext -lX11"
317     ac_save_CPPFLAGS="$CPPFLAGS"
318     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
319
320     dnl *** All of the following tests require X11/Xlib.h
321     AC_CHECK_HEADERS([X11/Xlib.h \
322                       X11/XKBlib.h \
323                       X11/Xutil.h \
324                       X11/extensions/shape.h \
325                       X11/extensions/XInput.h \
326                       X11/extensions/XShm.h \
327                       X11/extensions/Xrandr.h \
328                       X11/extensions/Xrender.h \
329                       X11/extensions/xf86dga.h \
330                       X11/extensions/xf86vmode.h],,,
331 [#ifdef HAVE_X11_XLIB_H
332 # include <X11/Xlib.h>
333 #endif
334 #ifdef HAVE_X11_XUTIL_H
335 # include <X11/Xutil.h>
336 #endif])
337
338         dnl *** Check for X keyboard extension
339         if test "$ac_cv_header_X11_XKBlib_h" = "yes"
340         then
341               AC_CHECK_LIB(X11, XkbQueryExtension,
342               AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
343               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
344         fi
345
346         dnl *** Check for X Shm extension
347         if test "$ac_cv_header_X11_extensions_XShm_h" = "yes"
348         then
349               AC_CHECK_LIB(Xext, XShmQueryExtension,
350               AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
351               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
352         fi
353
354         dnl *** Check for X shape extension
355         if test "$ac_cv_header_X11_extensions_shape_h" = "yes"
356         then
357               AC_CHECK_LIB(Xext,XShapeQueryExtension,
358               AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
359               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
360         fi
361
362         dnl *** Check for XFree86 DGA / DGA 2.0 extension
363         if test "$ac_cv_header_X11_extensions_xf86dga_h" = "yes"
364         then
365               AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
366                 [ AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
367                             [Define if you have the Xxf86dga library version 2])
368                   X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
369                 ],,
370                 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
371         fi
372
373         dnl *** Check for XFree86 VMODE extension
374         if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes"
375         then
376                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
377                   [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
378                      X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
379                   ],,
380                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
381         fi
382
383         dnl *** Check for X RandR extension
384         if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes"
385         then
386                 AC_TRY_COMPILE([#include <X11/Xlib.h>
387 #include <X11/extensions/Xrandr.h>],[static typeof(XRRSetScreenConfigAndRate) * func;],
388                   [AC_DEFINE(HAVE_LIBXRANDR, 1, [Define if you have the Xrandr library])])
389         fi
390
391         dnl *** Check for Transform functions in Xrender
392         if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
393         then
394               AC_CHECK_LIB(Xrender, XRenderSetPictureTransform,
395                 [AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
396                  [Define if Xrender has the XRenderSetPictureTransform function])],,
397                 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
398         fi
399     dnl *** End of X11/Xlib.h check
400
401     dnl Check for the presence of OpenGL
402     if test "x$with_opengl" != "xno"
403     then
404         AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h GL/glu.h,,,
405 [#ifdef HAVE_GL_GLX_H
406 # include <GL/glx.h>
407 #endif])
408         if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
409         then
410             dnl Check for some problems due to old Mesa versions
411             AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
412               AC_TRY_COMPILE(
413                 [#include <GL/gl.h>],
414                 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
415                 [wine_cv_opengl_version_OK="yes"],
416                 [wine_cv_opengl_version_OK="no"]
417               )
418             )
419
420             if test "$wine_cv_opengl_version_OK" = "yes"
421             then
422                 dnl Check for the presence of the library
423                 AC_CHECK_LIB(GL,glXCreateContext,
424                              OPENGL_LIBS="-lGL"
425                              ,,
426                              $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
427
428                 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
429                 then
430                         OPENGLFILES='$(OPENGLFILES)'
431                         AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
432                 else
433                     if test -f /usr/X11R6/lib/libGL.a
434                     then 
435                        AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
436 This prevents linking to OpenGL. Delete the file and restart configure.])
437                     fi
438                 fi
439
440                 dnl Check for GLU32 library.
441                 AC_CHECK_LIB(GLU,gluLookAt,
442                              [OPENGL_LIBS="$OPENGL_LIBS -lGLU"
443                              GLU32FILES='$(GLU32FILES)']
444                              ,,
445                              $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
446                 )
447              fi
448
449              dnl Check for glut32 library.
450              AC_CHECK_LIB(glut,glutMainLoop,
451                        [AC_SUBST(GLUT_LIBS,"-lglut -lXmu -lXi")
452                         AC_SUBST(GLUT32FILES,'$(GLUT32FILES)')],,
453                         $OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXmu -lXi -lX11 $X_EXTRA_LIBS)
454          fi
455     fi
456
457     dnl **** Check for NAS ****
458     AC_SUBST(NASLIBS,"")
459     AC_CHECK_HEADERS(audio/audiolib.h,
460          [AC_CHECK_HEADERS(audio/soundlib.h,,,[#include <audio/audiolib.h>])
461           AC_CHECK_LIB(audio,AuCreateFlow,
462                        [AC_DEFINE(HAVE_NAS,1,[Define if you have NAS including devel headers])
463                         NASLIBS="-laudio -lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS"],,
464                        [-lXt $X_LIBS -lXext -lX11 $X_EXTRA_LIBS])])
465
466     CPPFLAGS="$ac_save_CPPFLAGS"
467     XFILES='$(XFILES)'
468 else
469     XLIB=""
470     X_CFLAGS=""
471     X_LIBS=""
472 fi
473
474 dnl **** Check for libxml2 ****
475
476 AC_SUBST(XML2LIBS,"")
477 AC_SUBST(XML2INCL,"")
478 AC_SUBST(XSLTLIBS,"")
479 AC_SUBST(XSLTINCL,"")
480 if test "$PKG_CONFIG" != "false"
481 then
482     ac_save_CPPFLAGS="$CPPFLAGS"
483     ac_xml_libs="`$PKG_CONFIG --libs libxml-2.0 2>/dev/null`"
484     ac_xml_cflags="`$PKG_CONFIG --cflags libxml-2.0 2>/dev/null`"
485     CPPFLAGS="$CPPFLAGS $ac_xml_cflags"
486     AC_CHECK_HEADERS(libxml/parser.h,
487         [AC_CHECK_LIB(xml2, xmlParseMemory,
488             [AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library])
489              XML2LIBS="$ac_xml_libs"
490              XML2INCL="$ac_xml_cflags"],,$ac_xml_libs)
491          AC_CHECK_LIB(xml2, xmlReadMemory,
492             [AC_DEFINE(HAVE_XMLREADMEMORY,1,[Define if libxml2 has the xmlReadMemory function])],,$ac_xml_libs)
493         ])
494     CPPFLAGS="$ac_save_CPPFLAGS"
495     ac_xslt_libs="`$PKG_CONFIG --libs libxslt 2>/dev/null`"
496     ac_xslt_cflags="`$PKG_CONFIG --cflags libxslt 2>/dev/null`"
497     CPPFLAGS="$CPPFLAGS $ac_xslt_cflags"
498     AC_CHECK_HEADERS([libxslt/pattern.h libxslt/transform.h],
499         [AC_CHECK_LIB(xslt, xsltCompilePattern,
500             [AC_DEFINE(HAVE_LIBXSLT, 1, [Define if you have the libxslt library])
501              XSLTLIBS="$ac_xslt_libs"
502              XSLTINCL="$ac_xslt_cflags"],,$ac_xslt_libs)
503         ],,
504 [#ifdef HAVE_LIBXSLT_PATTERN_H
505 # include <libxslt/pattern.h>
506 #endif])
507     CPPFLAGS="$ac_save_CPPFLAGS"
508 fi
509
510 dnl **** Check for libhal ****
511 AC_SUBST(HALINCL,"")
512 if test "$PKG_CONFIG" != "false"
513 then
514     ac_save_CPPFLAGS="$CPPFLAGS"
515     ac_hal_libs="`$PKG_CONFIG --libs hal 2>/dev/null`"
516     ac_hal_cflags="`$PKG_CONFIG --cflags hal 2>/dev/null`"
517     CPPFLAGS="$CPPFLAGS $ac_hal_cflags"
518     AC_CHECK_HEADERS([dbus/dbus.h hal/libhal.h])
519     if test "$ac_cv_header_dbus_dbus_h" = "yes" -a "$ac_cv_header_hal_libhal_h" = "yes"
520     then
521         AC_CHECK_LIB(hal, libhal_ctx_new,
522           [AC_CHECK_LIB(dbus-1, dbus_connection_close,
523             [AC_DEFINE(HAVE_LIBHAL, 1, [Define if you have the hal library])
524              HALINCL="$ac_hal_cflags"],,$ac_hal_libs)])
525     fi
526     CPPFLAGS="$ac_save_CPPFLAGS"
527 fi
528
529 dnl **** Check which curses lib to use ***
530 CURSESLIBS=""
531 if test "x$with_curses" != "xno"
532 then
533     if test "$ac_cv_header_ncurses_h" = "yes"
534     then
535         AC_CHECK_LIB(ncurses,waddch,
536             [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
537              CURSESLIBS="-lncurses"])
538     elif test "$ac_cv_header_curses_h" = "yes"
539     then
540         AC_CHECK_LIB(curses,waddch,
541             [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
542              CURSESLIBS="-lcurses"])
543     fi
544     ac_save_LIBS="$LIBS"
545     LIBS="$LIBS $CURSESLIBS"
546     AC_CHECK_FUNCS(mousemask)
547     LIBS="$ac_save_LIBS"
548 fi
549 AC_SUBST(CURSESLIBS)
550
551 dnl **** Check for SANE ****
552 AC_CHECK_PROG(sane_devel,sane-config,sane-config,no)
553 AC_SUBST(SANELIBS,"")
554 AC_SUBST(SANEINCL,"")
555 if test "$sane_devel" != "no"
556 then
557     SANELIBS="`$sane_devel --libs`"
558     SANEINCL="`$sane_devel --cflags`"
559     ac_save_CPPFLAGS="$CPPFLAGS"
560     ac_save_LIBS="$LIBS"
561     CPPFLAGS="$CPPFLAGS $SANEINCL"
562     LIBS="$LIBS $SANELIBS"
563     AC_CHECK_HEADER(sane/sane.h,
564                     [AC_CHECK_LIB(sane,sane_open,
565                                   [AC_DEFINE(HAVE_SANE, 1, [Define if we have SANE development environment])],
566                                   [SANELIBS=""
567                                   SANEINCL=""])],
568                     [SANELIBS=""
569                     SANEINCL=""])
570     LIBS="$ac_save_LIBS"
571     CPPFLAGS="$ac_save_CPPFLAGS"
572 fi
573
574 dnl **** Check for libgphoto2 ****
575 AC_CHECK_PROG(gphoto2_devel,gphoto2-config,gphoto2-config,no)
576 AC_CHECK_PROG(gphoto2port_devel,gphoto2-port-config,gphoto2-port-config,no)
577 AC_SUBST(GPHOTO2LIBS,"")
578 AC_SUBST(GPHOTO2INCL,"")
579 if test "$gphoto2_devel" != "no" -a "$gphoto2port_devel" != "no"
580 then
581     GPHOTO2INCL="`$gphoto2_devel --cflags` `$gphoto2port_devel --cflags`"
582     GPHOTO2LIBS=""
583     for i in `$gphoto2_devel --libs` `$gphoto2port_devel --libs`
584     do
585       case "$i" in
586         -L/usr/lib|-L/usr/lib64) ;;
587         -L*|-l*) GPHOTO2LIBS="$GPHOTO2LIBS $i";;
588       esac
589     done
590     ac_save_CPPFLAGS="$CPPFLAGS"
591     ac_save_LIBS="$LIBS"
592     CPPFLAGS="$CPPFLAGS $GPHOTO2INCL"
593     LIBS="$LIBS $GPHOTO2LIBS"
594     AC_CHECK_HEADER(gphoto2-camera.h,
595                     [AC_CHECK_LIB(gphoto2,gp_camera_new,
596                                   [AC_DEFINE(HAVE_GPHOTO2, 1, [Define if we have libgphoto2 development environment])],
597                                   [GPHOTO2LIBS=""
598                                   GPHOTO2INCL=""])],
599                     [GPHOTO2LIBS=""
600                     GPHOTO2INCL=""])
601     LIBS="$ac_save_LIBS"
602     CPPFLAGS="$ac_save_CPPFLAGS"
603 fi
604
605 dnl **** Check for the ICU library ****
606 if test "$ac_cv_header_unicode_ubidi_h" = "yes"
607 then
608     saved_libs="$LIBS"
609     for i in ${ICU_LIB_DIR-/usr/lib}/libsicu ${ICU_LIB_DIR-/usr/lib}/libicu
610     do
611         TEST_ICUUC_LIB="${ICUUC_LIB-${i}uc.a}"
612         TEST_ICUDATA_LIB="${ICUDATA_LIB-${i}data.a}"
613         AC_MSG_CHECKING(whether can link with ICU libraries $TEST_ICUUC_LIB and $TEST_ICUDATA_LIB)
614         LIBS="$saved_libs $TEST_ICUUC_LIB $TEST_ICUDATA_LIB -lstdc++ -lgcc_s"
615         AC_TRY_LINK([#include <unicode/ubidi.h>],[ubidi_open()],
616                     [AC_DEFINE(HAVE_ICU,1,[Define to 1 if the ICU libraries are installed])
617                      AC_SUBST(ICULIBS,"$TEST_ICUUC_LIB $TEST_ICUDATA_LIB -lstdc++ -lgcc_s")
618                      AC_MSG_RESULT(yes)],
619                     [AC_MSG_RESULT(no)])
620     done
621     LIBS="$saved_libs"
622 fi
623
624 dnl **** Check for resolver library ***
625 AC_SUBST(RESOLVLIBS,"")
626 if test "$ac_cv_header_resolv_h" = "yes"
627 then
628     AC_CHECK_LIB(resolv, res_query,
629         [AC_DEFINE(HAVE_RESOLV, 1, [Define if you have the resolver library and header])
630          RESOLVLIBS="-lresolv"])
631 fi
632
633 dnl **** Check for LittleCMS ***
634 AC_SUBST(LCMSLIBS,"")
635 if test "$ac_cv_header_lcms_h" = "yes" -o "$ac_cv_header_lcms_lcms_h" = "yes"
636 then
637     AC_CHECK_LIB(lcms, cmsOpenProfileFromFile,
638         [AC_DEFINE(HAVE_LCMS, 1, [Define if you have the LittleCMS development environment])
639          LCMSLIBS="-llcms"])
640 fi
641
642 dnl **** Check for OpenLDAP ***
643 AC_SUBST(LDAPLIBS,"")
644 if test "$ac_cv_header_ldap_h" = "yes" -a "$ac_cv_header_lber_h" = "yes"
645 then
646     AC_CHECK_LIB(ldap_r, ldap_initialize,
647         [AC_CHECK_LIB(lber, ber_init,
648             [AC_DEFINE(HAVE_LDAP, 1, [Define if you have the OpenLDAP development environment])
649              LDAPLIBS="-lldap_r -llber"],,
650              [$LIBPTHREAD])],,
651              [$LIBPTHREAD])
652     WINE_CHECK_LIB_FUNCS(\
653         ldap_count_references \
654         ldap_first_reference \
655         ldap_next_reference \
656         ldap_parse_reference,
657         [$LDAPLIBS $LIBPTHREAD])
658 fi
659
660 dnl **** Check for FreeType 2 ****
661 AC_SUBST(FREETYPELIBS,"")
662 AC_SUBST(FREETYPEINCL,"")
663 AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
664 if test "$ft_devel" = "no"
665 then
666     AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
667     if test "$ft_devel2" = "freetype2-config"
668     then
669         ft_devel=$ft_devel2
670     fi
671 fi
672
673 if test "$ft_devel" = "no"
674 then
675     wine_cv_msg_freetype=yes
676 else
677     FREETYPELIBS=`$ft_devel --libs`
678     FREETYPEINCL=`$ft_devel --cflags`
679     AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$FREETYPELIBS)
680     if test "$ft_lib" = "no"
681     then
682         wine_cv_msg_freetype=yes
683         FREETYPELIBS=""
684         FREETYPEINCL=""
685     else
686         ac_save_CPPFLAGS="$CPPFLAGS"
687         CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
688         AC_CHECK_HEADERS(ft2build.h \
689                          freetype/freetype.h \
690                          freetype/ftglyph.h \
691                          freetype/tttables.h \
692                          freetype/ftnames.h \
693                          freetype/ftsnames.h \
694                          freetype/ttnameid.h \
695                          freetype/ftoutln.h \
696                          freetype/ftwinfnt.h \
697                          freetype/ftmodapi.h \
698                          freetype/internal/sfnt.h,,,
699                          [#if HAVE_FT2BUILD_H
700                           #include <ft2build.h>
701                           #endif])
702         AC_TRY_CPP([#include <ft2build.h>
703                     #include <freetype/fttrigon.h>],
704                     [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
705           [Define if you have the <freetype/fttrigon.h> header file.])
706                     wine_cv_fttrigon=yes],
707                     wine_cv_fttrigon=no)
708         AC_CHECK_TYPES(FT_TrueTypeEngineType,,,[#include <freetype/ftmodapi.h>])
709         ac_save_CFLAGS="$CFLAGS"
710         CFLAGS="$CFLAGS $FREETYPELIBS"
711         AC_CHECK_FUNCS(FT_Load_Sfnt_Table)
712         CFLAGS="$ac_save_CFLAGS"
713         CPPFLAGS="$ac_save_CPPFLAGS"
714         dnl Check that we have at least freetype/freetype.h
715         if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
716         then
717             AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
718             wine_cv_msg_freetype=no
719         else
720             FREETYPELIBS=""
721             FREETYPEINCL=""
722             wine_cv_msg_freetype=yes
723         fi
724     fi
725 fi
726
727 dnl Only build the fonts dir if we have both freetype and fontforge
728 if test "$FONTFORGE" != "false" -a -n "$FREETYPELIBS"
729 then
730   AC_SUBST(FONTSSUBDIRS,"fonts")
731 fi
732
733 dnl **** Check for parport (currently Linux only) ****
734 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
735  AC_TRY_COMPILE(
736    [#include <linux/ppdev.h>],
737    [ioctl (1,PPCLAIM,0)],
738    [ac_cv_c_ppdev="yes"],
739    [ac_cv_c_ppdev="no"])
740  )
741 if test "$ac_cv_c_ppdev" = "yes"
742 then
743     AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
744 fi
745
746 dnl **** Check for va_copy ****
747 AC_CACHE_CHECK([for va_copy], ac_cv_c_va_copy,
748  AC_TRY_LINK(
749    [#include <stdarg.h>],
750    [va_list ap1, ap2;
751     va_copy(ap1,ap2);
752    ],
753    [ac_cv_c_va_copy="yes"],
754    [ac_cv_c_va_copy="no"])
755  )
756 if test "$ac_cv_c_va_copy" = "yes"
757 then
758     AC_DEFINE(HAVE_VA_COPY, 1, [Define if we have va_copy])
759 fi
760 AC_CACHE_CHECK([for __va_copy], ac_cv_c___va_copy,
761  AC_TRY_LINK(
762    [#include <stdarg.h>],
763    [va_list ap1, ap2;
764     __va_copy(ap1,ap2);
765    ],
766    [ac_cv_c___va_copy="yes"],
767    [ac_cv_c___va_copy="no"])
768  )
769 if test "$ac_cv_c___va_copy" = "yes"
770 then
771     AC_DEFINE(HAVE___VA_COPY, 1, [Define if we have __va_copy])
772 fi
773
774 dnl **** Check for sigsetjmp ****
775 AC_CACHE_CHECK([for sigsetjmp], ac_cv_c_sigsetjmp,
776  AC_TRY_LINK(
777    [#include <setjmp.h>],
778    [sigjmp_buf buf;
779     sigsetjmp( buf, 1 );
780     siglongjmp( buf, 1 );],
781    [ac_cv_c_sigsetjmp="yes"],
782    [ac_cv_c_sigsetjmp="no"])
783  )
784 if test "$ac_cv_c_sigsetjmp" = "yes"
785 then
786     AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have the sigsetjmp (and siglongjmp) function])
787 fi
788
789 dnl **** Check for pthread_rwlock_t ****
790 AC_CHECK_TYPES([pthread_rwlock_t, pthread_rwlockattr_t],,,[#define _GNU_SOURCE
791 #include <pthread.h>])
792
793 dnl **** Check for pthread functions ****
794 WINE_CHECK_LIB_FUNCS(\
795         pthread_getattr_np \
796         pthread_get_stackaddr_np \
797         pthread_get_stacksize_np,
798         [$LIBPTHREAD])
799
800 dnl **** Check for aRts Sound Server ****
801 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
802 if test x$ARTSCCONFIG != x -a x$ARTSCCONFIG != x'"$ARTSCCONFIG"';
803 then
804     ARTSC_CFLAGS=""
805     for i in `$ARTSCCONFIG --cflags`
806     do
807       case "$i" in
808         -I*) ARTSC_CFLAGS="$ARTSC_CFLAGS $i";;
809       esac
810     done
811     ARTSC_LIBS=""
812     for i in `$ARTSCCONFIG --libs`
813     do
814       case "$i" in
815         -L/usr/lib|-L/usr/lib64) ;;
816         -L*|-l*) ARTSC_LIBS="$ARTSC_LIBS $i";;
817       esac
818     done
819     save_CFLAGS="$CFLAGS"
820     CFLAGS="$CFLAGS $ARTSC_CFLAGS"
821     AC_CHECK_LIB(artsc,arts_init,
822         [AC_TRY_COMPILE([#include <artsc.h>],[arts_stream_t stream;],
823             [AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
824             AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
825             AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])])],,
826             $ARTSC_LIBS)
827     CFLAGS="$save_CFLAGS"
828 fi
829
830 dnl **** Check for EsounD ****
831 AC_PATH_PROG(ESDCONFIG, esd-config)
832 if test x$ESDCONFIG != x -a x$ESDCONFIG != x'"$ESDCONFIG"';
833 then
834     ESD_CFLAGS=""
835     for i in `$ESDCONFIG --cflags`
836     do
837       case "$i" in
838         -I*) ESD_CFLAGS="$ESD_CFLAGS $i";;
839       esac
840     done
841     ESD_LIBS=`$ESDCONFIG --libs`
842     save_CFLAGS="$CFLAGS"
843     CFLAGS="$CFLAGS $ESD_CFLAGS"
844     AC_CHECK_LIB(esd,esd_open_sound,
845         [AC_SUBST(ESDLIBS, $ESD_LIBS)
846          AC_SUBST(ESDINCL, $ESD_CFLAGS)
847          AC_DEFINE(HAVE_ESD, 1, [Define if you have EsounD sound server])])
848     CFLAGS="$save_CFLAGS"
849 fi
850
851 dnl **** Check for ALSA 1.x ****
852 AC_SUBST(ALSALIBS,"")
853 if test "$ac_cv_header_sys_asoundlib_h" = "yes" -o "$ac_cv_header_alsa_asoundlib_h" = "yes"
854 then
855     AC_CHECK_LIB(asound,snd_pcm_hw_params_get_access,
856         [AC_TRY_COMPILE([#ifdef HAVE_ALSA_ASOUNDLIB_H
857 #include <alsa/asoundlib.h>
858 #elif defined(HAVE_SYS_ASOUNDLIB_H)
859 #include <sys/asoundlib.h>
860 #endif],
861                         [int ret = snd_pcm_hw_params_get_access(NULL, NULL)],
862                         [AC_DEFINE(HAVE_ALSA,1,[Define if you have ALSA 1.x including devel headers])
863                          ALSALIBS="-lasound"])])
864 fi
865
866 dnl **** Check for libaudioio (which can be used to get solaris audio support) ****
867
868 AC_SUBST(AUDIOIOLIBS,"")
869 if test "$ac_cv_header_libaudioio_h" = "yes"
870 then
871     AC_CHECK_LIB(audioio,AudioIOGetVersion,
872                   [AUDIOIOLIBS="-laudioio"
873                    AC_DEFINE(HAVE_LIBAUDIOIO, 1, [Define if you have libaudioIO])])
874 fi
875
876 dnl **** Check for capi4linux ****
877
878 if test "$ac_cv_header_capi20_h" = "yes" -a "$ac_cv_header_linux_capi_h" = "yes"
879 then
880     AC_CHECK_LIB(capi20,capi20_register,[AC_DEFINE(HAVE_CAPI4LINUX,1,[Define if you have capi4linux libs and headers])])
881 fi
882
883 dnl **** Check for gif header usability ****
884
885 if test "$ac_cv_header_gif_lib_h" = "yes"
886 then
887     AC_TRY_COMPILE([#include <gif_lib.h>],[static typeof(DGifOpen) * func;],
888         AC_DEFINE(HAVE_GIF, 1, [Define if you have usable GIF headers]))
889 fi
890
891 dnl **** Check for gcc specific options ****
892
893 AC_SUBST(EXTRACFLAGS,"")
894 if test "x${GCC}" = "xyes"
895 then
896   EXTRACFLAGS="-Wall -pipe"
897
898   dnl Check for strength-reduce bug
899   AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
900                   AC_TRY_RUN([
901 int     L[[4]] = {0,1,2,3};
902 int main(void) {
903   static int Array[[3]];
904   unsigned int B = 3;
905   int i;
906   for(i=0; i<B; i++) Array[[i]] = i - 3;
907   for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
908   L[[i]] = 4;
909
910   exit( Array[[1]] != -2 || L[[2]] != 3);
911 }],
912     ac_cv_c_gcc_strength_bug="no",
913     ac_cv_c_gcc_strength_bug="yes",
914     ac_cv_c_gcc_strength_bug="yes") )
915   if test "$ac_cv_c_gcc_strength_bug" = "yes"
916   then
917     EXTRACFLAGS="$EXTRACFLAGS -fno-strength-reduce"
918   fi
919
920   dnl Check for -fshort-wchar
921   AC_CACHE_CHECK([for gcc -fshort-wchar support], ac_cv_c_gcc_fshort_wchar,
922       [WINE_TRY_CFLAGS([-fshort-wchar],
923                       ac_cv_c_gcc_fshort_wchar="yes",ac_cv_c_gcc_fshort_wchar="no")])
924   if test "$ac_cv_c_gcc_fshort_wchar" = "yes"
925   then
926       AC_DEFINE(CC_FLAG_SHORT_WCHAR, "-fshort-wchar", [Specifies the compiler flag that forces a short wchar_t])
927   fi
928
929   dnl Check for -fno-strict-aliasing
930   AC_CACHE_CHECK([for gcc -fno-strict-aliasing support], ac_cv_c_gcc_no_strict_aliasing,
931       [WINE_TRY_CFLAGS([-fno-strict-aliasing],
932                       ac_cv_c_gcc_no_strict_aliasing="yes",ac_cv_c_gcc_no_strict_aliasing="no")])
933   if test "$ac_cv_c_gcc_no_strict_aliasing" = "yes"
934   then
935     EXTRACFLAGS="$EXTRACFLAGS -fno-strict-aliasing"
936   fi
937
938   dnl Check for -gstabs+ option
939   AC_CACHE_CHECK([for gcc -gstabs+ support], ac_cv_c_gcc_gstabs,
940       [WINE_TRY_CFLAGS([-gstabs+],ac_cv_c_gcc_gstabs="yes", ac_cv_c_gcc_gstabs="no")])
941   if test "$ac_cv_c_gcc_gstabs" = "yes"
942   then
943     EXTRACFLAGS="$EXTRACFLAGS -gstabs+"
944   fi
945
946   dnl Check for -Wdeclaration-after-statement option
947   AC_CACHE_CHECK([for gcc -Wdeclaration-after-statement support], ac_cv_c_gcc_decl_after_statement,
948       [WINE_TRY_CFLAGS([-Wdeclaration-after-statement],ac_cv_c_gcc_decl_after_statement="yes", ac_cv_c_gcc_decl_after_statement="no")])
949   if test "$ac_cv_c_gcc_decl_after_statement" = "yes"
950   then
951     EXTRACFLAGS="$EXTRACFLAGS -Wdeclaration-after-statement"
952   fi
953
954   dnl Check for noisy string.h
955   saved_CFLAGS="$CFLAGS"
956   CFLAGS="$CFLAGS -Wpointer-arith -Werror"
957   AC_CACHE_CHECK([for broken string.h that generates warnings], ac_cv_c_string_h_warnings,
958       AC_TRY_COMPILE([#include <string.h>],[],
959                      [ac_cv_c_string_h_warnings=no],[ac_cv_c_string_h_warnings=yes]))
960   CFLAGS="$saved_CFLAGS"
961   if test "$ac_cv_c_string_h_warnings" = "no"
962   then
963     EXTRACFLAGS="$EXTRACFLAGS -Wpointer-arith"
964   fi
965
966   AC_SUBST(BUILTINFLAG,"")
967   saved_CFLAGS="$CFLAGS"
968   CFLAGS="$CFLAGS -Werror"
969   AC_CACHE_CHECK([for builtin wchar inlines], ac_cv_c_builtin_wchar_ctype,
970       AC_TRY_COMPILE([],
971                      [int iswlower(unsigned short);],
972                      [ac_cv_c_builtin_wchar_ctype=no],[ac_cv_c_builtin_wchar_ctype=yes]))
973   CFLAGS="$saved_CFLAGS"
974   if test "$ac_cv_c_builtin_wchar_ctype" = "yes"
975   then
976     BUILTINFLAG="-fno-builtin"
977   fi
978 fi
979
980 dnl **** Check how to define a function in assembly code ****
981
982 AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,
983   WINE_TRY_ASM_LINK(
984       ["\t.globl _ac_test\n\t.def _ac_test; .scl 2; .type 32; .endef\n_ac_test:\t.long 0"],,,
985       ac_cv_asm_func_def=".def",
986     [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,@function\n_ac_test:\t.long 0"],,,
987       ac_cv_asm_func_def=".type @function",
988     [WINE_TRY_ASM_LINK(["\t.globl _ac_test\n\t.type _ac_test,2\n_ac_test:\t.long 0"],,,
989       ac_cv_asm_func_def=".type 2",
990       ac_cv_asm_func_def="unknown")])]))
991
992 AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function directive])
993 case "$ac_cv_asm_func_def" in
994   ".def")
995      AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"]) ;;
996   ".type @function")
997      AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",@function"]) ;;
998   ".type 2")
999      AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"]) ;;
1000   *)
1001      AC_DEFINE([__ASM_FUNC(name)], [""]) ;;
1002 esac
1003
1004 dnl **** Check for underscore on external symbols ****
1005
1006 AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_extern_prefix,
1007     WINE_TRY_ASM_LINK([".globl _ac_test\n_ac_test:\t.long 0"],
1008                       [extern int ac_test;],
1009                       [if (ac_test) return 1],
1010                       ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
1011
1012 AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
1013 if test "$ac_cv_c_extern_prefix" = "yes"
1014 then
1015   AC_DEFINE([__ASM_NAME(name)], ["_" name])
1016 else
1017   AC_DEFINE([__ASM_NAME(name)], [name])
1018 fi
1019
1020 dnl **** Check for working dll ****
1021
1022 AC_SUBST(DLLEXT,"")
1023 AC_SUBST(DLLFLAGS,"-D_REENTRANT")
1024 AC_SUBST(DLLIBS,"")
1025 AC_SUBST(LDSHARED,"")
1026 AC_SUBST(LDDLLFLAGS,"")
1027 AC_SUBST(LIBEXT,"so")
1028 AC_SUBST(IMPLIBEXT,"def")
1029
1030 case $host_os in
1031   cygwin*|mingw32*)
1032     AC_CHECK_TOOL(DLLTOOL,dlltool,false)
1033     AC_CHECK_TOOL(DLLWRAP,dllwrap,false)
1034     if test "$DLLWRAP" = "false"; then
1035       LIBEXT="a"
1036     else
1037       dnl FIXME - check whether dllwrap works correctly...
1038       LIBEXT="dll"
1039     fi
1040     IMPLIBEXT="a"
1041     dnl We can't build 16-bit NE dlls
1042     WIN16_FILES=""
1043     WIN16_INSTALL=""
1044     ;;
1045   *)
1046     if test "$ac_cv_header_dlfcn_h" = "yes"
1047     then
1048         AC_CHECK_FUNCS(dlopen,,
1049             [AC_CHECK_LIB(dl,dlopen,
1050                          [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
1051                           DLLIBS="-ldl"],
1052                          [LIBEXT="a"])])
1053         WINE_CHECK_LIB_FUNCS(dladdr,[$DLLIBS])
1054     else
1055         LIBEXT="a"
1056     fi
1057
1058     if test "$LIBEXT" = "so"
1059     then
1060       DLLFLAGS="$DLLFLAGS -fPIC"
1061       DLLEXT=".so"
1062       AC_CACHE_CHECK([whether we can build a GNU style ELF dll], ac_cv_c_dll_gnuelf,
1063           [WINE_TRY_SHLIB_FLAGS([-fPIC -shared -Wl,-Bsymbolic],
1064                                 ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")])
1065       if test "$ac_cv_c_dll_gnuelf" = "yes"
1066       then
1067         LDSHARED="\$(CC) -shared"
1068         LDDLLFLAGS="-shared -Wl,-Bsymbolic"
1069         AC_CACHE_CHECK([whether the linker accepts soname], ac_cv_c_sonames,
1070           [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-soname,confest.so.1],
1071                            ac_cv_c_sonames="yes",ac_cv_c_sonames="no")])
1072         if test "$ac_cv_c_sonames" = "yes"
1073         then
1074           LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
1075         else
1076           AC_CACHE_CHECK([check to see if -h soname is an alternate], ac_cv_c_h_sonames,
1077             [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-h,confest.so.1],
1078                              ac_cv_c_h_sonames="yes",ac_cv_c_h_sonames="no")])
1079           if test "$ac_cv_c_h_sonames" = "yes"
1080           then
1081             LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-h,%)"
1082           fi
1083         fi
1084
1085         AC_CACHE_CHECK([whether the linker accepts -z defs], ac_cv_c_dll_zdefs,
1086           [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-z,defs],
1087                            ac_cv_c_dll_zdefs="yes",ac_cv_c_dll_zdefs="no")])
1088         if test "$ac_cv_c_dll_zdefs" = "yes"
1089         then
1090           LDDLLFLAGS="$LDDLLFLAGS,-z,defs"
1091         fi
1092
1093         AC_CACHE_CHECK([whether the linker accepts -init and -fini], ac_cv_c_dll_init_fini,
1094           [WINE_TRY_CFLAGS([-fPIC -shared -Wl,-Bsymbolic,-init,__wine_spec_init,-fini,__wine_spec_fini],
1095                            ac_cv_c_dll_init_fini="yes",ac_cv_c_dll_init_fini="no")])
1096         if test "$ac_cv_c_dll_init_fini" = "yes"
1097         then
1098           LDDLLFLAGS="$LDDLLFLAGS,-init,__wine_spec_init,-fini,__wine_spec_fini"
1099         fi
1100
1101         AC_CACHE_CHECK([whether the linker accepts version scripts], ac_cv_c_ld_version_scripts,
1102           [echo '{ global: *; };' >conftest.map
1103            WINE_TRY_CFLAGS([-fPIC -shared -Wl,--version-script=conftest.map],
1104                            ac_cv_c_ld_version_scripts="yes",ac_cv_c_ld_version_scripts="no")
1105            rm -f conftest.map])
1106         if test "$ac_cv_c_ld_version_scripts" = "yes"
1107         then
1108           LDSHARED="$LDSHARED \$(VERSCRIPT:%=-Wl,--version-script=%)"
1109         fi
1110
1111         AC_CACHE_CHECK([whether the linker accepts --export-dynamic], ac_cv_c_export_dynamic,
1112           [WINE_TRY_CFLAGS([-fPIC -Wl,--export-dynamic],
1113                            ac_cv_c_export_dynamic="yes",ac_cv_c_export_dynamic="no")])
1114         if test "$ac_cv_c_export_dynamic" = "yes"
1115         then
1116           AC_SUBST(LDEXECFLAGS,["-Wl,--export-dynamic"])
1117         fi
1118
1119         AC_CACHE_CHECK([whether the linker accepts --rpath], ac_cv_ld_rpath,
1120           [WINE_TRY_CFLAGS([-fPIC -Wl,--rpath,\$ORIGIN/../lib],
1121                            ac_cv_ld_rpath="yes",ac_cv_ld_rpath="no")])
1122         if test "$ac_cv_ld_rpath" = "yes"
1123         then
1124           AC_SUBST(LDEXERPATH,["-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(bindir) \$(libdir)\`"])
1125           AC_SUBST(LDDLLRPATH,["-Wl,--rpath,\\\$\$ORIGIN/\`\$(RELPATH) \$(dlldir) \$(libdir)\`"])
1126         fi
1127
1128         case $host_cpu in
1129           *i[[3456789]]86* | x86_64)
1130             AC_CACHE_CHECK([whether we can relocate the executable to 0x7bf00000], ac_cv_ld_reloc_exec,
1131               [WINE_TRY_CFLAGS([-Wl,--section-start,.interp=0x7bf00400],
1132                                ac_cv_ld_reloc_exec="yes", ac_cv_ld_reloc_exec="no")])
1133             if test "$ac_cv_ld_reloc_exec" = "yes"
1134             then
1135               LDEXECFLAGS="$LDEXECFLAGS -Wl,--section-start,.interp=0x7bf00400"
1136             fi
1137             ;;
1138         esac
1139
1140       else
1141         AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll, ac_cv_c_dll_unixware,
1142             [WINE_TRY_SHLIB_FLAGS([-fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic],
1143                                   ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")])
1144         if test "$ac_cv_c_dll_unixware" = "yes"
1145         then
1146           LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
1147           LDDLLFLAGS="-Wl,-G,-B,symbolic"
1148
1149         else
1150           AC_CACHE_CHECK(whether we can build a Mach-O (Mac OS X/Darwin) dll, ac_cv_c_dll_macho,
1151             [WINE_TRY_SHLIB_FLAGS([-bundle], ac_cv_c_dll_macho="yes", ac_cv_c_dll_macho="no")])
1152           if test "$ac_cv_c_dll_macho" = "yes"
1153           then
1154             LIBEXT="dylib"
1155             LDDLLFLAGS="-bundle"
1156             LDSHARED="\$(CC) -dynamiclib -install_name @executable_path/\`\$(RELPATH) \$(bindir) \$(libdir)\`/\$(DYNAME) \$(SOVERSION:%=-compatibility_version %)"
1157             STRIP="$STRIP -u -r"
1158             dnl declare needed frameworks
1159             AC_SUBST(COREFOUNDATIONLIB,"-framework CoreFoundation")
1160             AC_SUBST(IOKITLIB,"-framework IOKit -framework CoreFoundation")
1161             AC_SUBST(LDEXECFLAGS,["-image_base 0x7bf00000 -Wl,-segaddr,WINE_DOS,0x00000000,-segaddr,WINE_SHARED_HEAP,0x7f000000"])
1162             if test "$ac_cv_header_CoreAudio_CoreAudio_h" = "yes" -a "$ac_cv_header_AudioUnit_AudioUnit_h" = "yes"
1163             then
1164                 dnl CoreServices needed by AudioUnit
1165                 AC_SUBST(COREAUDIO,"-framework CoreAudio -framework AudioUnit -framework CoreServices")
1166             fi
1167             case $host_cpu in
1168               *powerpc*)
1169                 CFLAGS="$CFLAGS -ffixed-r13"
1170                 LDDLLFLAGS="$LDDLLFLAGS -read_only_relocs warning"
1171                 ;;
1172             esac
1173
1174           else
1175             AC_CACHE_CHECK(whether we can build an HP-UX dll, ac_cv_c_dll_hpux,
1176               [WINE_TRY_SHLIB_FLAGS([-shared], ac_cv_c_dll_hpux="yes", ac_cv_c_dll_hpux="no")])
1177             if test "$ac_cv_c_dll_hpux" = "yes"
1178             then
1179               LIBEXT="sl"
1180               DLLEXT=".sl"
1181               LDDLLFLAGS="-shared -fPIC"
1182               LDSHARED="\$(CC) -shared"
1183             fi
1184           fi
1185         fi
1186       fi
1187     fi
1188
1189     dnl Check for cross compiler to build test programs
1190     AC_SUBST(CROSSTEST,"")
1191     if test "$cross_compiling" = "no"
1192     then
1193       AC_CHECK_PROGS(CROSSCC,i586-mingw32msvc-gcc i386-mingw32msvc-gcc i386-mingw32-gcc mingw-gcc,false)
1194       AC_CHECK_PROGS(DLLTOOL,i586-mingw32msvc-dlltool i386-mingw32msvc-dlltool i386-mingw32-dlltool mingw-dlltool,false)
1195       AC_CHECK_PROGS(CROSSWINDRES,i586-mingw32msvc-windres i386-mingw32msvc-windres i386-mingw32-windres mingw-windres,false)
1196       if test "$CROSSCC" != "false"; then CROSSTEST="\$(CROSSTEST)"; fi
1197     fi
1198     ;;
1199 esac
1200
1201 if test "$LIBEXT" = "a"; then
1202   AC_MSG_ERROR(
1203 [could not find a way to build shared libraries.
1204 It is currently not possible to build Wine without shared library
1205 (.so) support to allow transparent switch between .so and .dll files.
1206 If you are using Linux, you will need a newer binutils.]
1207 )
1208 fi
1209
1210 case $build_os in
1211   cygwin*|mingw32*)
1212     AC_SUBST(LDPATH,"PATH=\"\$(TOOLSDIR)/libs/wine:\$\$PATH\"") ;;
1213   darwin*|macosx*)
1214     AC_SUBST(LDPATH,"DYLD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$DYLD_LIBRARY_PATH\"") ;;
1215   *)
1216     AC_SUBST(LDPATH,"LD_LIBRARY_PATH=\"\$(TOOLSDIR)/libs/wine:\$\$LD_LIBRARY_PATH\"") ;;
1217 esac
1218
1219 dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet
1220 case $host_os in
1221   mingw32*)
1222     AC_SUBST(CRTLIBS,"-lmsvcrt")
1223     AC_SUBST(SOCKETLIBS,"-lws2_32")
1224     ;;
1225 esac
1226
1227 AC_SUBST(MAIN_BINARY,"wine-pthread")  dnl Default value
1228 case $host_cpu in
1229   *i[[3456789]]86*)
1230     case $host_os in
1231       linux* | k*bsd*-gnu)
1232         AC_SUBST(MAIN_BINARY,"wine-glibc")
1233         AC_SUBST(EXTRA_BINARIES,"wine-kthread wine-pthread wine-preloader") ;;
1234     esac
1235     ;;
1236 esac
1237
1238 dnl **** Get the soname for libraries that we load dynamically ****
1239
1240 if test "$LIBEXT" = "so" -o "$LIBEXT" = "dylib"
1241 then
1242   WINE_GET_SONAME(X11,XCreateWindow,[$X_LIBS $X_EXTRA_LIBS])
1243   WINE_GET_SONAME(Xext,XextCreateExtension,[$X_LIBS -lX11 $X_EXTRA_LIBS])
1244   WINE_GET_SONAME(Xi,XOpenDevice,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1245   WINE_GET_SONAME(Xrender,XRenderQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1246   WINE_GET_SONAME(Xrandr,XRRQueryExtension,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
1247   WINE_GET_SONAME(freetype,FT_Init_FreeType,[$X_LIBS])
1248   WINE_GET_SONAME(GL,glXQueryExtension,[$X_LIBS $X_EXTRA_LIBS])
1249   WINE_GET_SONAME(dbus-1,dbus_error_init)
1250   WINE_GET_SONAME(hal,libhal_ctx_new)
1251   WINE_GET_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1)
1252   WINE_GET_SONAME(cups,cupsGetDefault)
1253   WINE_GET_SONAME(jack,jack_client_new)
1254   WINE_GET_SONAME(fontconfig,FcInit)
1255   WINE_GET_SONAME(ssl,SSL_library_init)
1256   WINE_GET_SONAME(crypto,BIO_new_socket)
1257   WINE_GET_SONAME(ncurses,waddch)
1258   WINE_GET_SONAME(curses,waddch)
1259   WINE_GET_SONAME(jpeg,jpeg_start_decompress)
1260   WINE_GET_SONAME(ungif,DGifOpen)
1261   WINE_GET_SONAME(gif,DGifOpen)
1262   WINE_GET_SONAME(capi20,capi20_isinstalled)
1263 fi
1264
1265
1266 dnl **** Check for functions ****
1267
1268 AC_CHECK_FUNCS(\
1269         _lwp_create \
1270         _lwp_self \
1271         _pclose \
1272         _popen \
1273         _snprintf \
1274         _spawnvp \
1275         _stricmp \
1276         _strnicmp \
1277         _vsnprintf \
1278         asctime_r \
1279         chsize \
1280         clone \
1281         epoll_create \
1282         ffs \
1283         finite \
1284         fork \
1285         fpclass \
1286         fstatfs \
1287         fstatvfs \
1288         ftruncate \
1289         futimes \
1290         futimesat \
1291         getaddrinfo \
1292         getnameinfo \
1293         getnetbyname \
1294         getopt_long \
1295         getpagesize \
1296         getprotobyname \
1297         getprotobynumber \
1298         getpwuid \
1299         getservbyport \
1300         gettid \
1301         gettimeofday \
1302         getuid \
1303         inet_network \
1304         lstat \
1305         memmove \
1306         mmap \
1307         pclose \
1308         popen \
1309         prctl \
1310         pread \
1311         pwrite \
1312         readlink \
1313         rfork \
1314         sched_yield \
1315         select \
1316         sendmsg \
1317         setrlimit \
1318         settimeofday \
1319         sigaltstack \
1320         sigprocmask \
1321         snprintf \
1322         spawnvp \
1323         statfs \
1324         statvfs \
1325         strcasecmp \
1326         strerror \
1327         strncasecmp \
1328         tcgetattr \
1329         timegm \
1330         usleep \
1331         vsnprintf \
1332         wait4 \
1333         waitpid \
1334 )
1335
1336
1337 dnl **** Check for types ****
1338
1339 AC_C_CONST
1340 AC_C_INLINE
1341 AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long, fsblkcnt_t, fsfilcnt_t])
1342 AC_CHECK_TYPES([sigset_t],,,[#include <signal.h>])
1343 AC_CHECK_TYPES([request_sense],,,[#include <linux/cdrom.h>])
1344
1345 AC_CHECK_MEMBERS([struct ff_effect.direction],,,
1346 [#ifdef HAVE_LINUX_INPUT_H
1347 #include <linux/input.h>
1348 #endif])
1349
1350 AC_CACHE_CHECK([for sigaddset],wine_cv_have_sigaddset,
1351                AC_TRY_LINK([#include <signal.h>],[sigset_t set; sigaddset(&set,SIGTERM);],
1352                            wine_cv_have_sigaddset=yes,wine_cv_have_sigaddset=no))
1353 if test "$wine_cv_have_sigaddset" = "yes"
1354 then
1355   AC_DEFINE(HAVE_SIGADDSET, 1, [Define if sigaddset is supported])
1356 fi
1357
1358
1359 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1360         wine_cv_linux_gethostbyname_r_6,
1361         AC_TRY_LINK([
1362 #include <netdb.h>
1363         ], [
1364     char *name=NULL;
1365     struct hostent he;
1366     struct hostent *result;
1367     char *buf=NULL;
1368     int bufsize=0;
1369     int res,errnr;
1370     char *addr=NULL;
1371     int addrlen=0;
1372     int addrtype=0;
1373     res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1374     res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1375     ],
1376         wine_cv_linux_gethostbyname_r_6=yes,
1377         wine_cv_linux_gethostbyname_r_6=no
1378         )
1379    )
1380    if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1381    then
1382       AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1383                 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1384    fi
1385
1386 if test "$ac_cv_header_linux_joystick_h" = "yes"
1387 then
1388    AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1389         wine_cv_linux_joystick_22_api,
1390         AC_TRY_COMPILE([
1391         #include <sys/ioctl.h>
1392         #include <linux/joystick.h>
1393
1394         struct js_event blub;
1395         #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1396         #error "no 2.2 header"
1397         #endif
1398         ],/*empty*/,
1399         wine_cv_linux_joystick_22_api=yes,
1400         wine_cv_linux_joystick_22_api=no,
1401         wine_cv_linux_joystick_22_api=no
1402         )
1403    )
1404    if test "$wine_cv_linux_joystick_22_api" = "yes"
1405    then
1406       AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1407                 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1408    fi
1409 fi
1410
1411 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1412
1413 dnl Check for statfs members
1414 AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail, struct statfs.f_frsize, struct statfs.f_ffree, struct statfs.f_favail, struct statfs.f_namelen],,,
1415 [#include <sys/types.h>
1416 #ifdef HAVE_SYS_PARAM_H
1417 # include <sys/param.h>
1418 #endif
1419 #ifdef HAVE_SYS_MOUNT_H
1420 # include <sys/mount.h>
1421 #endif
1422 #ifdef HAVE_SYS_VFS_H
1423 # include <sys/vfs.h>
1424 #endif
1425 #ifdef HAVE_SYS_STATFS_H
1426 # include <sys/statfs.h>
1427 #endif])
1428
1429 AC_CHECK_MEMBERS([struct statvfs.f_blocks],,,
1430 [#ifdef HAVE_SYS_STATVFS_H
1431 #include <sys/statvfs.h>
1432 #endif])
1433
1434 dnl Check for socket structure members
1435 AC_CHECK_MEMBERS([struct msghdr.msg_accrights, struct sockaddr.sa_len, struct sockaddr_un.sun_len],,,
1436 [#include <sys/types.h>
1437 #ifdef HAVE_SYS_SOCKET_H
1438 # include <sys/socket.h>
1439 #endif
1440 #ifdef HAVE_SYS_UN_H
1441 # include <sys/un.h>
1442 #endif])
1443
1444 dnl Check for scsireq_t and sg_io_hdr_t members
1445 AC_CHECK_MEMBERS([scsireq_t.cmd, sg_io_hdr_t.interface_id],,,
1446 [#include <sys/types.h>
1447 #ifdef HAVE_SCSI_SG_H
1448 #include <scsi/sg.h>
1449 #endif])
1450
1451 dnl Check for siginfo_t members
1452 AC_CHECK_MEMBERS([siginfo_t.si_fd],,,[#include <signal.h>])
1453
1454 dnl Check for struct mtget members
1455 AC_CHECK_MEMBERS([struct mtget.mt_blksiz, struct mtget.mt_gstat, struct mtget.mt_blkno],,,
1456 [#include <sys/types.h>
1457 #ifdef HAVE_SYS_MTIO_H
1458 #include <sys/mtio.h>
1459 #endif])
1460
1461 dnl Check for struct option
1462 AC_CHECK_MEMBERS([struct option.name],,,
1463 [#ifdef HAVE_GETOPT_H
1464 #include <getopt.h>
1465 #endif])
1466
1467 dnl Check for stat.st_blocks
1468 AC_CHECK_MEMBERS([struct stat.st_blocks])
1469
1470 dnl Check for sin6_scope_id
1471 AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,,
1472 [#ifdef HAVE_SYS_TYPES_H
1473 #include <sys/types.h>
1474 #endif
1475 #ifdef HAVE_NETINET_IN_H
1476 #include <netinet/in.h>
1477 #endif])
1478
1479 dnl Check for ns_msg ptr member
1480 AC_CHECK_MEMBERS([ns_msg._msg_ptr],,,
1481 [#ifdef HAVE_SYS_TYPES_H
1482 #include <sys/types.h>
1483 #endif
1484 #ifdef HAVE_NETINET_IN_H
1485 # include <netinet/in.h>
1486 #endif
1487 #ifdef HAVE_ARPA_NAMESER_H
1488 # include <arpa/nameser.h>
1489 #endif])
1490
1491 dnl Check for the external timezone variables timezone and daylight
1492 AC_CACHE_CHECK([for timezone variable], ac_cv_have_timezone,
1493                AC_TRY_LINK([#include <time.h>],[timezone;],
1494                            ac_cv_have_timezone="yes", ac_cv_have_timezone="no"))
1495 if test "$ac_cv_have_timezone" = "yes"
1496 then
1497     AC_DEFINE(HAVE_TIMEZONE, 1, [Define if you have the timezone variable])
1498 fi
1499 AC_CACHE_CHECK([for daylight variable], ac_cv_have_daylight,
1500                AC_TRY_LINK([#include <time.h>],[daylight;],
1501                            ac_cv_have_daylight="yes", ac_cv_have_daylight="no"))
1502 if test "$ac_cv_have_daylight" = "yes"
1503 then
1504     AC_DEFINE(HAVE_DAYLIGHT, 1, [Define if you have the daylight variable])
1505 fi
1506
1507 dnl *** check for the need to define platform-specific symbols
1508
1509 case $host_cpu in
1510   *i[[3456789]]86*) WINE_CHECK_DEFINE([__i386__]) ;;
1511   *x86_64*)         WINE_CHECK_DEFINE([__x86_64__])
1512                     WINE_CHECK_DEFINE([_WIN64]) ;;
1513   *alpha*)          WINE_CHECK_DEFINE([__ALPHA__]) ;;
1514   *sparc*)          WINE_CHECK_DEFINE([__sparc__]) ;;
1515   *powerpc*)        WINE_CHECK_DEFINE([__powerpc__]) ;;
1516 esac
1517
1518 case $host_vendor in
1519   *sun*) WINE_CHECK_DEFINE([__sun__]) ;;
1520 esac
1521
1522 dnl **** Generate output files ****
1523
1524 AH_TOP([#define __WINE_CONFIG_H])
1525
1526 WINE_CONFIG_EXTRA_DIR(dlls/gdi/enhmfdrv)
1527 WINE_CONFIG_EXTRA_DIR(dlls/gdi/mfdrv)
1528 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1529 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1530 WINE_CONFIG_EXTRA_DIR(dlls/wineps.drv/data)
1531 WINE_CONFIG_EXTRA_DIR(include/wine)
1532
1533 MAKE_RULES=Make.rules
1534 AC_SUBST_FILE(MAKE_RULES)
1535
1536 MAKE_DLL_RULES=dlls/Makedll.rules
1537 AC_SUBST_FILE(MAKE_DLL_RULES)
1538
1539 MAKE_IMPLIB_RULES=dlls/Makeimplib.rules
1540 AC_SUBST_FILE(MAKE_IMPLIB_RULES)
1541
1542 MAKE_TEST_RULES=dlls/Maketest.rules
1543 AC_SUBST_FILE(MAKE_TEST_RULES)
1544
1545 MAKE_LIB_RULES=libs/Makelib.rules
1546 AC_SUBST_FILE(MAKE_LIB_RULES)
1547
1548 MAKE_PROG_RULES=programs/Makeprog.rules
1549 AC_SUBST_FILE(MAKE_PROG_RULES)
1550
1551 AC_CONFIG_FILES([
1552 Make.rules
1553 dlls/Makedll.rules
1554 dlls/Makeimplib.rules
1555 dlls/Maketest.rules
1556 libs/Makelib.rules
1557 programs/Makeprog.rules
1558 Makefile
1559 dlls/Makefile
1560 dlls/activeds/Makefile
1561 dlls/advapi32/Makefile
1562 dlls/advapi32/tests/Makefile
1563 dlls/advpack/Makefile
1564 dlls/advpack/tests/Makefile
1565 dlls/amstream/Makefile
1566 dlls/atl/Makefile
1567 dlls/avicap32/Makefile
1568 dlls/avifil32/Makefile
1569 dlls/cabinet/Makefile
1570 dlls/cabinet/tests/Makefile
1571 dlls/capi2032/Makefile
1572 dlls/cards/Makefile
1573 dlls/cfgmgr32/Makefile
1574 dlls/comcat/Makefile
1575 dlls/comcat/tests/Makefile
1576 dlls/comctl32/Makefile
1577 dlls/comctl32/tests/Makefile
1578 dlls/comdlg32/Makefile
1579 dlls/comdlg32/tests/Makefile
1580 dlls/compstui/Makefile
1581 dlls/crtdll/Makefile
1582 dlls/crypt32/Makefile
1583 dlls/crypt32/tests/Makefile
1584 dlls/cryptdll/Makefile
1585 dlls/cryptnet/Makefile
1586 dlls/ctl3d32/Makefile
1587 dlls/d3d8/Makefile
1588 dlls/d3d8/tests/Makefile
1589 dlls/d3d9/Makefile
1590 dlls/d3d9/tests/Makefile
1591 dlls/d3dim/Makefile
1592 dlls/d3drm/Makefile
1593 dlls/d3dx8/Makefile
1594 dlls/d3dxof/Makefile
1595 dlls/dbghelp/Makefile
1596 dlls/dciman32/Makefile
1597 dlls/ddraw/Makefile
1598 dlls/ddraw/tests/Makefile
1599 dlls/devenum/Makefile
1600 dlls/dinput/Makefile
1601 dlls/dinput/tests/Makefile
1602 dlls/dinput8/Makefile
1603 dlls/dmband/Makefile
1604 dlls/dmcompos/Makefile
1605 dlls/dmime/Makefile
1606 dlls/dmloader/Makefile
1607 dlls/dmscript/Makefile
1608 dlls/dmstyle/Makefile
1609 dlls/dmsynth/Makefile
1610 dlls/dmusic/Makefile
1611 dlls/dmusic32/Makefile
1612 dlls/dnsapi/Makefile
1613 dlls/dnsapi/tests/Makefile
1614 dlls/dplay/Makefile
1615 dlls/dplayx/Makefile
1616 dlls/dpnet/Makefile
1617 dlls/dpnhpast/Makefile
1618 dlls/dsound/Makefile
1619 dlls/dsound/tests/Makefile
1620 dlls/dswave/Makefile
1621 dlls/dxdiagn/Makefile
1622 dlls/dxerr8/Makefile
1623 dlls/dxerr9/Makefile
1624 dlls/dxguid/Makefile
1625 dlls/gdi/Makefile
1626 dlls/gdi/tests/Makefile
1627 dlls/glu32/Makefile
1628 dlls/glut32/Makefile
1629 dlls/gphoto2.ds/Makefile
1630 dlls/hhctrl.ocx/Makefile
1631 dlls/hlink/Makefile
1632 dlls/iccvid/Makefile
1633 dlls/icmp/Makefile
1634 dlls/ifsmgr.vxd/Makefile
1635 dlls/imaadp32.acm/Makefile
1636 dlls/imagehlp/Makefile
1637 dlls/imm32/Makefile
1638 dlls/infosoft/Makefile
1639 dlls/inseng/Makefile
1640 dlls/iphlpapi/Makefile
1641 dlls/iphlpapi/tests/Makefile
1642 dlls/itss/Makefile
1643 dlls/kernel/Makefile
1644 dlls/kernel/tests/Makefile
1645 dlls/lz32/Makefile
1646 dlls/lz32/tests/Makefile
1647 dlls/mapi32/Makefile
1648 dlls/mapi32/tests/Makefile
1649 dlls/mciavi32/Makefile
1650 dlls/mcicda/Makefile
1651 dlls/mciseq/Makefile
1652 dlls/mciwave/Makefile
1653 dlls/midimap/Makefile
1654 dlls/mlang/Makefile
1655 dlls/mlang/tests/Makefile
1656 dlls/mmdevldr.vxd/Makefile
1657 dlls/monodebg.vxd/Makefile
1658 dlls/mpr/Makefile
1659 dlls/mprapi/Makefile
1660 dlls/msacm32.drv/Makefile
1661 dlls/msacm32/Makefile
1662 dlls/msacm32/tests/Makefile
1663 dlls/msadp32.acm/Makefile
1664 dlls/mscms/Makefile
1665 dlls/mscms/tests/Makefile
1666 dlls/msdmo/Makefile
1667 dlls/msftedit/Makefile
1668 dlls/msg711.acm/Makefile
1669 dlls/mshtml/Makefile
1670 dlls/mshtml/tests/Makefile
1671 dlls/msi/Makefile
1672 dlls/msi/tests/Makefile
1673 dlls/msimg32/Makefile
1674 dlls/msisys.ocx/Makefile
1675 dlls/msnet32/Makefile
1676 dlls/msrle32/Makefile
1677 dlls/msvcrt/Makefile
1678 dlls/msvcrt/tests/Makefile
1679 dlls/msvcrt20/Makefile
1680 dlls/msvcrt40/Makefile
1681 dlls/msvcrtd/Makefile
1682 dlls/msvcrtd/tests/Makefile
1683 dlls/msvfw32/Makefile
1684 dlls/msvidc32/Makefile
1685 dlls/mswsock/Makefile
1686 dlls/msxml3/Makefile
1687 dlls/msxml3/tests/Makefile
1688 dlls/netapi32/Makefile
1689 dlls/netapi32/tests/Makefile
1690 dlls/newdev/Makefile
1691 dlls/ntdll/Makefile
1692 dlls/ntdll/tests/Makefile
1693 dlls/ntdsapi/Makefile
1694 dlls/objsel/Makefile
1695 dlls/odbc32/Makefile
1696 dlls/odbccp32/Makefile
1697 dlls/ole32/Makefile
1698 dlls/ole32/tests/Makefile
1699 dlls/oleacc/Makefile
1700 dlls/oleaut32/Makefile
1701 dlls/oleaut32/tests/Makefile
1702 dlls/olecli32/Makefile
1703 dlls/oledlg/Makefile
1704 dlls/olepro32/Makefile
1705 dlls/olesvr32/Makefile
1706 dlls/opengl32/Makefile
1707 dlls/powrprof/Makefile
1708 dlls/psapi/Makefile
1709 dlls/psapi/tests/Makefile
1710 dlls/qcap/Makefile
1711 dlls/quartz/Makefile
1712 dlls/quartz/tests/Makefile
1713 dlls/query/Makefile
1714 dlls/rasapi32/Makefile
1715 dlls/riched20/Makefile
1716 dlls/riched20/tests/Makefile
1717 dlls/riched32/Makefile
1718 dlls/rpcrt4/Makefile
1719 dlls/rpcrt4/tests/Makefile
1720 dlls/rsabase/Makefile
1721 dlls/rsabase/tests/Makefile
1722 dlls/rsaenh/Makefile
1723 dlls/rsaenh/tests/Makefile
1724 dlls/sane.ds/Makefile
1725 dlls/secur32/Makefile
1726 dlls/secur32/tests/Makefile
1727 dlls/security/Makefile
1728 dlls/sensapi/Makefile
1729 dlls/serialui/Makefile
1730 dlls/setupapi/Makefile
1731 dlls/setupapi/tests/Makefile
1732 dlls/sfc/Makefile
1733 dlls/shdocvw/Makefile
1734 dlls/shdocvw/tests/Makefile
1735 dlls/shell32/Makefile
1736 dlls/shell32/tests/Makefile
1737 dlls/shfolder/Makefile
1738 dlls/shlwapi/Makefile
1739 dlls/shlwapi/tests/Makefile
1740 dlls/snmpapi/Makefile
1741 dlls/spoolss/Makefile
1742 dlls/stdole2.tlb/Makefile
1743 dlls/stdole32.tlb/Makefile
1744 dlls/sti/Makefile
1745 dlls/strmiids/Makefile
1746 dlls/tapi32/Makefile
1747 dlls/twain_32/Makefile
1748 dlls/unicows/Makefile
1749 dlls/url/Makefile
1750 dlls/urlmon/Makefile
1751 dlls/urlmon/tests/Makefile
1752 dlls/user/Makefile
1753 dlls/user/tests/Makefile
1754 dlls/userenv/Makefile
1755 dlls/usp10/Makefile
1756 dlls/usp10/tests/Makefile
1757 dlls/uuid/Makefile
1758 dlls/uxtheme/Makefile
1759 dlls/uxtheme/tests/Makefile
1760 dlls/vdhcp.vxd/Makefile
1761 dlls/vdmdbg/Makefile
1762 dlls/version/Makefile
1763 dlls/version/tests/Makefile
1764 dlls/vmm.vxd/Makefile
1765 dlls/vnbt.vxd/Makefile
1766 dlls/vnetbios.vxd/Makefile
1767 dlls/vtdapi.vxd/Makefile
1768 dlls/vwin32.vxd/Makefile
1769 dlls/w32skrnl/Makefile
1770 dlls/winecrt0/Makefile
1771 dlls/wined3d/Makefile
1772 dlls/winedos/Makefile
1773 dlls/winemp3.acm/Makefile
1774 dlls/wineps.drv/Makefile
1775 dlls/winex11.drv/Makefile
1776 dlls/wininet/Makefile
1777 dlls/wininet/tests/Makefile
1778 dlls/winmm/Makefile
1779 dlls/winmm/joystick/Makefile
1780 dlls/winmm/tests/Makefile
1781 dlls/winmm/winealsa/Makefile
1782 dlls/winmm/winearts/Makefile
1783 dlls/winmm/wineaudioio/Makefile
1784 dlls/winmm/winecoreaudio/Makefile
1785 dlls/winmm/wineesd/Makefile
1786 dlls/winmm/winejack/Makefile
1787 dlls/winmm/winenas/Makefile
1788 dlls/winmm/wineoss/Makefile
1789 dlls/winnls32/Makefile
1790 dlls/winspool.drv/Makefile
1791 dlls/winspool.drv/tests/Makefile
1792 dlls/wintab32/Makefile
1793 dlls/wintrust/Makefile
1794 dlls/wldap32/Makefile
1795 dlls/wnaspi32/Makefile
1796 dlls/wow32/Makefile
1797 dlls/ws2_32/Makefile
1798 dlls/ws2_32/tests/Makefile
1799 dlls/wsock32/Makefile
1800 dlls/wtsapi32/Makefile
1801 documentation/Makefile
1802 fonts/Makefile
1803 include/Makefile
1804 libs/Makefile
1805 libs/port/Makefile
1806 libs/wine/Makefile
1807 libs/wpp/Makefile
1808 loader/Makefile
1809 programs/Makefile
1810 programs/clock/Makefile
1811 programs/cmdlgtst/Makefile
1812 programs/control/Makefile
1813 programs/eject/Makefile
1814 programs/expand/Makefile
1815 programs/explorer/Makefile
1816 programs/hh/Makefile
1817 programs/icinfo/Makefile
1818 programs/iexplore/Makefile
1819 programs/msiexec/Makefile
1820 programs/notepad/Makefile
1821 programs/oleview/Makefile
1822 programs/progman/Makefile
1823 programs/regedit/Makefile
1824 programs/regsvr32/Makefile
1825 programs/rpcss/Makefile
1826 programs/rundll32/Makefile
1827 programs/start/Makefile
1828 programs/taskmgr/Makefile
1829 programs/uninstaller/Makefile
1830 programs/view/Makefile
1831 programs/wcmd/Makefile
1832 programs/wineboot/Makefile
1833 programs/winebrowser/Makefile
1834 programs/winecfg/Makefile
1835 programs/wineconsole/Makefile
1836 programs/winedbg/Makefile
1837 programs/winefile/Makefile
1838 programs/winemenubuilder/Makefile
1839 programs/winemine/Makefile
1840 programs/winepath/Makefile
1841 programs/winetest/Makefile
1842 programs/winevdm/Makefile
1843 programs/winhelp/Makefile
1844 programs/winver/Makefile
1845 programs/wordpad/Makefile
1846 server/Makefile
1847 tools/Makefile
1848 tools/widl/Makefile
1849 tools/winapi/Makefile
1850 tools/winebuild/Makefile
1851 tools/winedump/Makefile
1852 tools/winegcc/Makefile
1853 tools/wmc/Makefile
1854 tools/wrc/Makefile])
1855
1856 AC_OUTPUT
1857
1858 if test "$have_x" = "no"
1859 then
1860   echo >&2
1861   AC_MSG_WARN([X development files not found. Wine will be built without])
1862   AC_MSG_WARN([X support, which currently does not work, and probably])
1863   AC_MSG_WARN([isn't what you want anyway. You will need to install devel])
1864   AC_MSG_WARN([ packages of Xlib/Xfree86 at the very least.])
1865 fi
1866
1867 if test "$wine_cv_opengl_version_OK" = "no"
1868 then
1869   echo >&2
1870   AC_MSG_WARN([Old Mesa headers detected. Wine will be built without Direct3D])
1871   AC_MSG_WARN([support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/).])
1872 fi
1873
1874 if test "$wine_cv_msg_freetype" = "yes"
1875 then
1876   echo >&2
1877   AC_MSG_WARN([Your system appears to have the FreeType 2 runtime libraries])
1878   AC_MSG_WARN([installed, but 'freetype-config' is not in your PATH. Install])
1879   AC_MSG_WARN([the freetype-devel package (or its equivalent on your distribution)])
1880   AC_MSG_WARN([to enable Wine to use TrueType fonts.])
1881 fi
1882
1883 if test -z "$FONTSSUBDIRS"
1884 then
1885   echo >&2
1886   if test "$FONTFORGE" = "false"
1887   then
1888     AC_MSG_WARN([FontForge is missing.])
1889   else
1890     AC_MSG_WARN([FreeType is missing.])
1891   fi
1892   AC_MSG_WARN([Fonts will not be built. Dialog text may be invisible or unaligned.])
1893 fi
1894
1895 if test -z "$ALSALIBS" -a \
1896         -z "$ARTSC_LIBS" -a \
1897         -z "$AUDIOIOLIBS" -a \
1898         -z "$NASLIBS" -a \
1899         -z "$ESD_LIBS" -a \
1900         -z "$ac_cv_lib_soname_jack" -a \
1901         "$ac_cv_header_sys_soundcard_h" != "yes" -a \
1902         "$ac_cv_header_machine_soundcard_h" != "yes" -a \
1903         "$ac_cv_header_soundcard_h" != "yes"
1904 then
1905   echo >&2
1906   AC_MSG_WARN([No sound system was found. Windows applications will be silent.])
1907   AC_MSG_WARN([The currently supported sound systems are:])
1908   AC_MSG_WARN([ALSA, ARTS, EsounD, AudioIO, Jack, NAS and OSS])
1909 fi
1910
1911 echo
1912 echo "Configure finished.  Do '${ac_make} depend && ${ac_make}' to compile Wine."
1913 echo
1914
1915 dnl Local Variables:
1916 dnl comment-start: "dnl "
1917 dnl comment-end: ""
1918 dnl comment-start-skip: "\\bdnl\\b\\s *"
1919 dnl compile-command: "autoconf && autoheader"
1920 dnl End: