Added aRts driver.
[wine/wine64.git] / configure.ac
blob3c247be8db0a12d096c5e7321052de58578481d4
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.
5 m4_define(WINE_VERSION,regexp(m4_include(VERSION),[version \([-.0-9A-Za-z]+\)],[\1]))
7 AC_PREREQ(2.50)
8 AC_INIT([Wine],WINE_VERSION)
9 AC_CONFIG_SRCDIR(server/atom.c)         
10 AC_CONFIG_HEADERS(include/config.h)
11 AC_CONFIG_AUX_DIR(tools)
13 dnl **** Command-line arguments ****
15 dnl Default values
16 LIBEXT=so       # library type .so or .a
18 AC_ARG_ENABLE(debug, AC_HELP_STRING([--disable-debug],[compile out all debugging messages]))
19 AC_ARG_ENABLE(trace, AC_HELP_STRING([--disable-trace],[compile out TRACE messages]))
20 AC_ARG_ENABLE(opengl,AC_HELP_STRING([--enable-opengl],[force usage of OpenGL even if the latter is thread-safe via pthread]))
21 AC_ARG_WITH(curses,     AC_HELP_STRING([--without-curses],[do not use curses]))
22 AC_ARG_WITH(reentrant-x,AC_HELP_STRING([--without-reentrant-x],[compile for use with non-reentrant X libraries]))
24 AC_SUBST(OPTIONS)
25 if test "x$enable_debug" = "xno"
26 then
27     AC_DEFINE(NO_DEBUG_MSGS,1,[Define to disable all debug messages.])
29 if test "x$enable_trace" = "xno" -o "x$enable_debug" = "xno"
30 then
31     AC_DEFINE(NO_TRACE_MSGS,1,[Define to disable trace messages.])
34 dnl **** Check for some programs ****
36 AC_CANONICAL_TARGET
37 AC_PROG_MAKE_SET
38 AC_PROG_CC
39 AC_PROG_CPP
40 AC_PATH_XTRA
41 AC_PROG_YACC
42 AC_PROG_LEX
44 dnl **** Just additional warning checks, since AC_PROG just sets 'yacc' even
45 dnl **** without one present.
46 AC_CHECK_PROGS(XYACC,$YACC bison yacc,none)
47 if test "$XYACC" = "none"
48 then
49   AC_MSG_ERROR([no suitable bison/yacc found. Please install the 'bison' package.])
51 AC_CHECK_PROGS(XLEX,$LEX flex lex,none)
52 if test "$XLEX" = "none"
53 then
54   AC_MSG_ERROR([no suitable lex found. Please install the 'flex' package.])
56 AC_PROG_RANLIB
57 AC_PROG_INSTALL
58 AC_PROG_LN_S
59 AC_CHECK_PROG(C2MAN,c2man,c2man,\$(TOPSRCDIR)/tools/c2man.pl)
60 AC_PATH_PROG(LDCONFIG, ldconfig, true, /sbin:/usr/sbin:$PATH)
62 dnl Check for lint
63 AC_CHECK_PROGS(LINT, lclint lint)
64 if test "$LINT" = "lint"
65 then
66   LINTFLAGS="$LINTFLAGS -errchk=%all,no%longptr64 -errhdr=%user -Ncheck=macro -Nlevel=4"
67   dnl LINTFLAGS='-D_SIZE_T "-Dsize_t=unsigned long" -errchk=longptr64'
69 AC_SUBST(LINT)
70 AC_SUBST(LINTFLAGS)
72 case $host_os in
73   *cygwin*) LDCOMBINE="ld -r --enable-stdcall-fixup" ;;
74          *) LDCOMBINE="ld -r" ;;
75 esac
76 AC_SUBST(LDCOMBINE)
78 dnl **** Check for some libraries ****
80 dnl Check for -lm
81 AC_CHECK_LIB(m,sqrt)
82 dnl Check for -li386 for NetBSD and OpenBSD
83 AC_CHECK_LIB(i386,i386_set_ldt)
84 dnl Check for -lossaudio for NetBSD
85 AC_CHECK_LIB(ossaudio,_oss_ioctl)
86 dnl Check for -lw for Solaris
87 AC_CHECK_FUNCS(iswalnum,,AC_CHECK_LIB(w,iswalnum))
88 dnl Check for -lnsl for Solaris
89 AC_CHECK_FUNCS(gethostbyname,,AC_CHECK_LIB(nsl,gethostbyname))
90 dnl Check for -lsocket for Solaris
91 AC_CHECK_FUNCS(connect,,AC_CHECK_LIB(socket,connect))
92 dnl Check for -lxpg4 for FreeBSD
93 AC_CHECK_LIB(xpg4,_xpg4_setrunelocale)
94 dnl Check for -lmmap for OS/2
95 AC_CHECK_LIB(mmap,mmap)
97 dnl Check for openpty
98 UTILLIBS=""
99 AC_SUBST(UTILLIBS)
100 AC_CHECK_FUNCS(openpty,,
101         [AC_CHECK_LIB(util,openpty,
102                 [AC_DEFINE(HAVE_OPENPTY)
103                 UTILLIBS="-lutil"]
104         )])
106 DLLIBS=""
107 AC_SUBST(DLLIBS)
108 AC_CHECK_HEADERS(dlfcn.h,
109     [AC_CHECK_FUNCS(dlopen,,
110         [AC_CHECK_LIB(dl,dlopen,
111                      [AC_DEFINE(HAVE_DLOPEN,1,[Define if you have dlopen])
112                      DLLIBS="-ldl"],
113                      LIBEXT="a")]
114         )],
115         LIBEXT="a"
116     )
118 JPEGLIB=""
119 AC_SUBST(JPEGLIB)
120 AC_CHECK_HEADERS(jpeglib.h,
121     AC_CHECK_LIB(jpeg,jpeg_start_decompress,
122         AC_DEFINE(HAVE_LIBJPEG,1,[Define if you have libjpeg including devel headers])
123         JPEGLIB="-ljpeg"
124     )
128 AC_SUBST(XLIB)
129 AC_SUBST(XFILES)
130 XFILES=""
131 AC_SUBST(OPENGLFILES)
132 OPENGLFILES=""
133 AC_SUBST(GLU32FILES)
134 GLU32FILES=""
135 if test "$have_x" = "yes"
136 then
137     XLIB="-lXext -lX11"
138     ac_save_CPPFLAGS="$CPPFLAGS"
139     CPPFLAGS="$CPPFLAGS $X_CFLAGS"
141     dnl *** All of the following tests require X11/Xlib.h
142     AC_CHECK_HEADERS(X11/Xlib.h,
143       [
144         dnl *** Check for X keyboard extension
145         AC_CHECK_HEADERS(X11/XKBlib.h,
146             [ dnl *** If X11/XKBlib.h exists...
147               AC_CHECK_LIB(X11, XkbQueryExtension,
148               AC_DEFINE(HAVE_XKB, 1, [Define if you have the XKB extension]),,
149               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
150             ],
151             AC_MSG_WARN([[Xkb extension not found, Wine will be built without it]])
152         )
154         dnl *** Check for X Shm extension
155         AC_CHECK_HEADERS(X11/extensions/XShm.h,
156             [ dnl *** If X11/extensions/XShm.h exists...
157               AC_CHECK_LIB(Xext, XShmQueryExtension,
158               AC_DEFINE(HAVE_LIBXXSHM, 1, [Define if you have the X Shm extension]),,
159               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
160             ],
161             AC_MSG_WARN([[XShm extension not found, Wine will be built without it]])
162         )
164         dnl *** Check for X shape extension
165         AC_CHECK_HEADERS(X11/extensions/shape.h,
166             [ dnl *** If X11/extensions/shape.h exists...
167               AC_CHECK_LIB(Xext,XShapeQueryExtension,
168               AC_DEFINE(HAVE_LIBXSHAPE, 1, [Define if you have the X Shape extension]),,
169               $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
170             ],
171             AC_MSG_WARN([[XShape extension not found, Wine will be built without it]])
172         )
173         
174         dnl *** Check for XFree86 DGA / DGA 2.0 extension
175         AC_CHECK_HEADERS(X11/extensions/xf86dga.h,
176             [ dnl *** If X11/extensions/xf86dga.h exists, check 
177               dnl *** for XDGAQueryExtension()...
178               AC_CHECK_LIB(Xxf86dga, XDGAQueryExtension,
179                 [ dnl *** If found...
180                   AC_DEFINE(HAVE_LIBXXF86DGA2, 1,
181                             [Define if you have the Xxf86dga library version 2])
182                   X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
183                ],
184                 [ dnl *** If not found, look for XF86DGAQueryExtension()
185                   dnl *** instead (DGA 2.0 not found)...
186                   AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension,
187                     [ AC_DEFINE(HAVE_LIBXXF86DGA, 1,
188                                 [Define if you have the Xxf86dga library version 1])
189                       X_PRE_LIBS="$X_PRE_LIBS -lXxf86dga"
190                     ],,
191                     $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
192                   )
193                 ],
194                 $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
195               )
196             ],
197             AC_MSG_WARN([[DGA extension not found, Wine will be built without it]])
198         )
200         dnl *** Check for XFree86 VMODE extension
201         AC_CHECK_HEADERS(X11/extensions/xf86vmode.h,
202             [ dnl *** If X11/extensions/xf86vmode.h exists...
203                 AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryExtension,
204                   [ AC_DEFINE(HAVE_LIBXXF86VM, 1, [Define if you have the Xxf86vm library])
205                      X_PRE_LIBS="$X_PRE_LIBS -lXxf86vm"
206                   ],,
207                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
208                 )
209             ],
210             AC_MSG_WARN([[XFree86 VMODE extension not found, Wine will be built without it]])
211         )
213         dnl *** Check for XVideo extension supporting XvImages
214         AC_CHECK_HEADERS(X11/extensions/Xvlib.h,
215             [ dnl *** If X11/extensions/Xvlib.h exists...
216                 AC_CHECK_LIB(Xv, XvShmCreateImage,
217                   [ AC_DEFINE(HAVE_XVIDEO, 1, [Define if the X libraries support XVideo])
218                      X_PRE_LIBS="$X_PRE_LIBS -lXv"
219                   ],,
220                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
221                 )
222             ],
223             AC_MSG_WARN([[XVideo extension not found, Wine will be built without it]])
224         )
226         dnl *** Check for XRender extension
227         AC_CHECK_HEADERS(X11/extensions/Xrender.h,
228             [ dnl *** If X11/extensions/Xrender.h exists...
229                 AC_CHECK_LIB(Xrender, XRenderQueryExtension,
230                   [ AC_DEFINE(HAVE_LIBXRENDER, 1, [Define if you have the XRender extension library])
231                      X_PRE_LIBS="$X_PRE_LIBS -lXrender"
232                   ],,
233                   $X_LIBS -lXext -lX11 $X_EXTRA_LIBS
234                 )
235             ],
236             AC_MSG_WARN([[XRender extension not found, Wine will be built without it]])
237         )
239       ]
240     ) dnl *** End of X11/Xlib.h check
242     dnl Check for the presence of OpenGL
243     if test "x$enable_opengl" != "xno"
244     then
245         if test -f /usr/X11R6/lib/libGL.a -a ! -f /usr/X11R6/lib/libGL.so
246         then
247             AC_MSG_ERROR([/usr/X11R6/lib/libGL.a is present on your system.
248 This prevents linking to OpenGL. Delete the file and restart configure.])
249         fi
251         AC_CHECK_HEADERS(GL/gl.h GL/glx.h GL/glext.h)
252         if test "$ac_cv_header_GL_gl_h" = "yes" -a "$ac_cv_header_GL_glx_h" = "yes"
253         then
254             dnl Check for some problems due to old Mesa versions
255             AC_CACHE_CHECK([for up-to-date OpenGL version], wine_cv_opengl_version_OK,
256               AC_TRY_COMPILE(
257                 [#include <GL/gl.h>],
258                 [GLenum test = GL_UNSIGNED_SHORT_5_6_5;],
259                 [wine_cv_opengl_version_OK="yes"],
260                 [wine_cv_opengl_version_OK="no"]
261               )
262             )
264             dnl Check for the thread-safety of the OpenGL library
265             AC_CACHE_CHECK([for thread-safe OpenGL version], 
266                            wine_cv_opengl_version_threadsafe,
267               [saved_libs=$LIBS
268                LIBS="$X_LIBS -lGL"
269                AC_TRY_LINK([],[pthread_getspecific();],
270                               [wine_cv_opengl_version_threadsafe="yes"],
271                               [wine_cv_opengl_version_threadsafe="no"])
272                LIBS=$saved_libs]
273             )
275             if test "$wine_cv_opengl_version_OK" = "yes" -a \( "$wine_cv_opengl_version_threadsafe" = "no" -o "x$enable_opengl" = "xyes" \)
276             then
277                 dnl Check for the presence of the library
278                 AC_CHECK_LIB(GL,glXCreateContext,
279                              X_PRE_LIBS="$X_PRE_LIBS -lGL"
280                              ,,
281                              $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
283                 if test "$ac_cv_lib_GL_glXCreateContext" = "yes"
284                 then
285                         OPENGLFILES='$(OPENGLFILES)'
286                         AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is present on the system])
288                         AC_CHECK_LIB(GL,glXGetProcAddressARB,
289                                      AC_DEFINE(HAVE_GLX_GETPROCADDRESS, 1,
290                                                [Define if the OpenGL library supports the glXGetProcAddressARB call]),,
291                                      $X_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS)
293                         if test "$ac_cv_lib_GL_glXGetProcAddressARB" = "yes"
294                         then
295                                AC_CACHE_CHECK([for OpenGL extension functions prototypes], wine_cv_extension_prototypes,
296                                   [AC_TRY_COMPILE([#include <GL/gl.h>
297                                                   #ifdef HAVE_GL_GLEXT_H
298                                                   # include <GL/glext.h>
299                                                   #endif
300                                                   ],
301                                                  [PFNGLCOLORTABLEEXTPROC test_proc;],
302                                                  [wine_cv_extension_prototypes="yes"],
303                                                  [wine_cv_extension_prototypes="no"]
304                                   )]
305                                 )
306                                 if test "$wine_cv_extension_prototypes" = "yes"
307                                 then
308                                     AC_DEFINE(HAVE_GLEXT_PROTOTYPES, 1,
309                                               [Define if the OpenGL headers define extension typedefs])
310                                 fi
311                         fi
313                 fi
314                 dnl Check for GLU32 library.
315                 AC_CHECK_LIB(GLU,gluLookAt,
316                              [X_PRE_LIBS="$X_PRE_LIBS -lGLU"
317                              GLU32FILES='$(GLU32FILES)']
318                              ,,
319                              $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS
320                 )
321              fi
322          fi
323     fi
325     CPPFLAGS="$ac_save_CPPFLAGS"
326     XFILES='$(XFILES)'
327 else
328     XLIB=""
329     X_CFLAGS=""
330     X_LIBS=""
333 dnl **** Check which curses lib to use ***
334 CURSESLIBS=""
335 if test "x$with_curses" != "xno"
336 then
337     AC_CHECK_HEADERS(ncurses.h,
338         [AC_CHECK_LIB(ncurses,waddch,
339             [AC_DEFINE(HAVE_LIBNCURSES, 1, [Define if you have the ncurses library (-lncurses)])
340              CURSESLIBS="-lncurses"],
341              [AC_CHECK_HEADERS(curses.h,
342                  [AC_CHECK_LIB(curses,waddch,
343                      [AC_DEFINE(HAVE_LIBCURSES, 1, [Define if you have the curses library (-lcurses)])
344                       CURSESLIBS="-lcurses"])])])])
345     saved_libs="$LIBS"
346     LIBS="$CURSESLIBS $LIBS"
347     AC_CHECK_FUNCS(getbkgd resizeterm)
348     LIBS="$saved_libs"
350 AC_SUBST(CURSESLIBS)
352 CUPSLIBS=""
353 dnl **** Check for CUPS ****
354 wine_cv_warn_cups_h=no
355 AC_CHECK_LIB(cups,cupsGetPPD,
356         [AC_CHECK_HEADER(cups/cups.h,
357             [AC_DEFINE(HAVE_CUPS, 1, [Define if we have CUPS])
358             CUPSLIBS="-lcups"],
359             wine_cv_warn_cups_h=yes)]
361 AC_SUBST(CUPSLIBS)
363 dnl **** Check for FreeType 2 ****
364 AC_CHECK_LIB(freetype,FT_Init_FreeType,ft_lib=yes,ft_lib=no,$X_LIBS)
365 if test "$ft_lib" = "no"
366 then
367     FREETYPELIBS=""
368     FREETYPEINCL=""
369     wine_cv_msg_freetype=no
370 else
371     AC_CHECK_PROG(ft_devel,freetype-config,freetype-config,no)
372     if test "$ft_devel" = "no"
373     then
374         AC_CHECK_PROG(ft_devel2,freetype2-config,freetype2-config,no)
375         if test "$ft_devel2" = "freetype2-config"
376         then
377                 ft_devel=$ft_devel2
378         fi
379     fi
380     if test "$ft_devel" = "no"
381     then
382         FREETYPELIBS=""
383         FREETYPEINCL=""
384         wine_cv_msg_freetype=yes
385     else
386         FREETYPELIBS=`$ft_devel --libs`
387         FREETYPEINCL=`$ft_devel --cflags`
388         ac_save_CPPFLAGS="$CPPFLAGS"
389         CPPFLAGS="$FREETYPEINCL $CPPFLAGS"
390         AC_CHECK_HEADERS(freetype/freetype.h \
391                          freetype/ftglyph.h \
392                          freetype/tttables.h \
393                          freetype/ftnames.h \
394                          freetype/ftsnames.h \
395                          freetype/ttnameid.h \
396                          freetype/ftoutln.h \
397                          freetype/internal/sfnt.h)
398         AC_TRY_CPP([#include <ft2build.h>
399                     #include <freetype/fttrigon.h>],
400                     [AC_DEFINE(HAVE_FREETYPE_FTTRIGON_H, 1,
401           [Define if you have the <freetype/fttrigon.h> header file.])
402                     wine_cv_fttrigon=yes],
403                     wine_cv_fttrigon=no)
404         CPPFLAGS="$ac_save_CPPFLAGS"
405         dnl Check that we have at least freetype/freetype.h
406         if test "$ac_cv_header_freetype_freetype_h" = "yes" -a "$wine_cv_fttrigon" = "yes"
407         then
408             AC_DEFINE(HAVE_FREETYPE, 1, [Define if FreeType 2 is installed])
409             wine_cv_msg_freetype=no
410         else
411             FREETYPELIBS=""
412             FREETYPEINCL=""
413             wine_cv_msg_freetype=yes
414         fi
415     fi
417 AC_SUBST(FREETYPELIBS)
418 AC_SUBST(FREETYPEINCL)
420 dnl **** Check for parport (currently Linux only) ****
421 AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
422  AC_TRY_COMPILE(
423    [#include <linux/ppdev.h>],
424    [ioctl (1,PPCLAIM,0)],
425    [ac_cv_c_ppdev="yes"],
426    [ac_cv_c_ppdev="no"])
428 if test "$ac_cv_c_ppdev" = "yes"
429 then
430     AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev.h for parallel port access])
433 dnl **** Check for IPX (currently Linux only) ****
434 AC_CACHE_CHECK([for GNU style IPX support], ac_cv_c_ipx_gnu,
435  AC_TRY_COMPILE(
436    [#include <sys/socket.h>
437     #include <netipx/ipx.h>],
438    [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
439    [ac_cv_c_ipx_gnu="yes"],
440    [ac_cv_c_ipx_gnu="no"])
442 if test "$ac_cv_c_ipx_gnu" = "yes"
443 then
444     AC_DEFINE(HAVE_IPX_GNU, 1, [Define if IPX should use netipx/ipx.h from libc])
447 if test "$ac_cv_c_ipx_gnu" = "no"
448 then
449  AC_CACHE_CHECK([for linux style IPX support], ac_cv_c_ipx_linux,
450   AC_TRY_COMPILE(
451     [#include <sys/socket.h>
452      #include <asm/types.h>
453      #include <linux/ipx.h>],
454     [((struct sockaddr_ipx *)0)->sipx_family == AF_IPX],
455     [ac_cv_c_ipx_linux="yes"],
456     [ac_cv_c_ipx_linux="no"])
457   )
458   if test "$ac_cv_c_ipx_linux" = "yes"
459   then
460       AC_DEFINE(HAVE_IPX_LINUX, 1, [Define if IPX includes are taken from Linux kernel])
461   fi
464 dnl **** Check for Open Sound System ****
465 AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h soundcard.h, break)
467 AC_CACHE_CHECK([for Open Sound System],
468         ac_cv_c_opensoundsystem,
469         AC_TRY_COMPILE([
470         #if defined(HAVE_SYS_SOUNDCARD_H)
471                 #include <sys/soundcard.h>
472         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
473                 #include <machine/soundcard.h>
474         #elif defined(HAVE_SOUNDCARD_H)
475                 #include <soundcard.h>
476         #endif
477         ],[
479 /* check for one of the Open Sound System specific SNDCTL_ defines */
480 #if !defined(SNDCTL_DSP_STEREO)
481 #error No open sound system
482 #endif
483 ],ac_cv_c_opensoundsystem="yes",ac_cv_c_opensoundsystem="no"))
485 if test "$ac_cv_c_opensoundsystem" = "yes"
486 then
487     AC_DEFINE(HAVE_OSS, 1, [Define if you have the Open Sound system])
490 AC_CACHE_CHECK([for Open Sound System/MIDI interface],
491         ac_cv_c_opensoundsystem_midi,
492         AC_TRY_COMPILE([
493         #if defined(HAVE_SYS_SOUNDCARD_H)
494                 #include <sys/soundcard.h>
495         #elif defined(HAVE_MACHINE_SOUNDCARD_H)
496                 #include <machine/soundcard.h>
497         #elif defined(HAVE_SOUNDCARD_H)
498                 #include <soundcard.h>
499         #endif
500         ],[
502 /* check for one of the Open Sound System specific SNDCTL_SEQ defines */
503 #if !defined(SNDCTL_SEQ_SYNC)
504 #error No open sound system MIDI interface
505 #endif
506 ],ac_cv_c_opensoundsystem_midi="yes",ac_cv_c_opensoundsystem_midi="no"))
508 if test "$ac_cv_c_opensoundsystem_midi" = "yes"
509 then
510     AC_DEFINE(HAVE_OSS_MIDI, 1, [Define if you have the Open Sound system (MIDI interface)])
513 dnl **** Check for aRts Sound Server ****
514 AC_PATH_PROG(ARTSCCONFIG, artsc-config)
515 AC_CACHE_CHECK([for aRts Sound server],
516         ac_cv_c_artsserver,
517         if test x$ARTSCCONFIG = x -o x$ARTSCCONFIG = x'"$ARTSCCONFIG"';
518         then
519             ac_cv_c_artsserver=no
520         else
521             ARTSC_CFLAGS=`$ARTSCCONFIG --cflags`
522             ARTSC_LIBS=`$ARTSCCONFIG --libs`
523             ac_cv_c_artsserver=no
524             save_CFLAGS="$CFLAGS"
525             CFLAGS="$CFLAGS $ARTSC_CFLAGS"
526             AC_TRY_COMPILE([
527              #include <artsc.h>
528             ],[
529              arts_stream_t stream;
530             ],[
531             ac_cv_c_artsserver=yes
532             ])
533             CFLAGS="$save_CFLAGS"
534         fi)
536 if test "$ac_cv_c_artsserver" = "yes"
537 then
538     AC_SUBST(ARTSLIBS, $ARTSC_LIBS)
539     AC_SUBST(ARTSINCL, $ARTSC_CFLAGS)
541     AC_DEFINE(HAVE_ARTS, 1, [Define if you have ARTS sound server])
544 dnl **** Check for broken glibc mmap64 ****
546 AC_CACHE_CHECK( [whether mmap64 works defined as mmap], ac_cv_mmap64_works,
547         AC_TRY_RUN([
548                 #define _FILE_OFFSET_BITS 64
549                 #include <stdio.h>
550                 #include <unistd.h>
551                 #include <fcntl.h>
552                 #include <sys/mman.h>
553                 #include <errno.h>
555                 int main(int argc,char **argv) {
556                         int fd = open("conftest.map",O_CREAT|O_RDWR,0600);
557                         if (fd == -1) exit(1);
559                         unlink("conftest.map");
561                         write(fd,"test",4);
563                         if ((-1 == mmap(0,4,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0)) &&
564                             (errno == EINVAL)
565                         ) {
566                                 exit(1);
567                         }
568                         close(fd);
569                         fprintf(stderr,"success!\n");
570                         exit(0);
571                 }
573         ],
574     ac_cv_mmap64_works="yes",
575     ac_cv_mmap64_works="no",
576     ac_cv_mmap64_works="no") )
578 if test "$ac_cv_mmap64_works" = "yes"
579 then
580     AC_DEFINE(_FILE_OFFSET_BITS, 64, [Set this to 64 to enable 64-bit file support on Linux])
583 dnl **** Check for gcc strength-reduce bug ****
585 if test "x${GCC}" = "xyes"
586 then
587   CFLAGS="$CFLAGS -Wall"
588   AC_CACHE_CHECK( [for gcc strength-reduce bug], ac_cv_c_gcc_strength_bug,
589                   AC_TRY_RUN([
590 int     L[[4]] = {0,1,2,3};
591 int main(void) {
592   static int Array[[3]];
593   unsigned int B = 3;
594   int i;
595   for(i=0; i<B; i++) Array[[i]] = i - 3;
596   for(i=0; i<4 - 1; i++) L[[i]] = L[[i + 1]];
597   L[[i]] = 4;
598   
599   exit( Array[[1]] != -2 || L[[2]] != 3);
601     ac_cv_c_gcc_strength_bug="no",
602     ac_cv_c_gcc_strength_bug="yes",
603     ac_cv_c_gcc_strength_bug="yes") )
604   if test "$ac_cv_c_gcc_strength_bug" = "yes"
605   then
606     CFLAGS="$CFLAGS -fno-strength-reduce"
607   fi
609   dnl Check for -mpreferred-stack-boundary
610   AC_CACHE_CHECK([for gcc -mpreferred-stack-boundary=2 support],
611                  ac_cv_c_gcc_stack_boundary,
612   [saved_cflags=$CFLAGS
613   CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
614   AC_TRY_COMPILE(,[return 0],ac_cv_c_gcc_stack_boundary="yes",ac_cv_c_gcc_stack_boundary="no")
615   CFLAGS=$saved_cflags
616   ])
617   if test "$ac_cv_c_gcc_stack_boundary" = "yes"
618   then
619     CFLAGS="$CFLAGS -mpreferred-stack-boundary=2"
620   fi
623 dnl **** Check if we need to place .type inside a .def directive ****
625 AC_CACHE_CHECK([whether .type must sit inside a .def directive],
626                ac_cv_c_type_in_def,
627 [saved_libs=$LIBS
628 LIBS="conftest_asm.s $LIBS"
629 cat > conftest_asm.s <<EOF
630         .globl _ac_test
631         .def _ac_test; .scl 2; .type 32; .endef
632 _ac_test:
633         .long 0
635 AC_TRY_LINK(,,ac_cv_c_type_in_def="yes",ac_cv_c_type_in_def="no")
636 LIBS=$saved_libs])
637 if test "$ac_cv_c_type_in_def" = "yes"
638 then
639   AC_DEFINE(NEED_TYPE_IN_DEF, 1, [Define if .type asm directive must be inside a .def directive])
642 dnl **** Check for underscore on external symbols ****
644 AC_CACHE_CHECK([whether external symbols need an underscore prefix],
645                ac_cv_c_extern_prefix,
646 [saved_libs=$LIBS
647 LIBS="conftest_asm.s $LIBS"
648 cat > conftest_asm.s <<EOF
649         .globl _ac_test
650 _ac_test:
651         .long 0
653 AC_TRY_LINK([extern int ac_test;],[if (ac_test) return 1],
654             ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")
655 LIBS=$saved_libs])
656 if test "$ac_cv_c_extern_prefix" = "yes"
657 then
658   AC_DEFINE(NEED_UNDERSCORE_PREFIX, 1,
659             [Define if symbols declared in assembly code need an underscore prefix])
662 dnl **** Check whether stdcall symbols need to be decorated ****
664 AC_CACHE_CHECK([whether stdcall symbols need to be decorated],
665                ac_cv_c_stdcall_decoration,
666 [saved_libs=$LIBS
667 LIBS="conftest_asm.s $LIBS"
668 if test "$ac_cv_c_extern_prefix" = "yes"
669 then
670 cat > conftest_asm.s <<EOF
671         .globl _ac_test@0
672 _ac_test@0:
674 else
675 cat > conftest_asm.s <<EOF
676         .globl ac_test@0
677 ac_test@0:
680 AC_TRY_LINK([extern void __attribute__((__stdcall__)) ac_test(void);],
681             [ac_test(); return 0],
682             ac_cv_c_stdcall_decoration="yes",ac_cv_c_stdcall_decoration="no")
683 LIBS=$saved_libs])
684 if test "$ac_cv_c_stdcall_decoration" = "yes"
685 then
686   AC_DEFINE(NEED_STDCALL_DECORATION, 1,
687             [Define if stdcall symbols need to be decorated])
690 dnl **** Check for .string in assembler ****
692 AC_CACHE_CHECK([whether assembler accepts .string],
693                ac_cv_c_asm_string,
694 [saved_libs=$LIBS
695 LIBS="conftest_asm.s $LIBS"
696 cat > conftest_asm.s <<EOF
697         .string "test"
699 AC_TRY_LINK(,,ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no")
700 LIBS=$saved_libs])
701 if test "$ac_cv_c_asm_string" = "yes"
702 then
703   AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .ascii])
706 dnl **** Check for working dll ****
708 LDSHARED=""
709 LDDLLFLAGS=""
710 if test "$LIBEXT" = "so"
711 then
712   AC_CACHE_CHECK([whether we can build a GNU style ELF dll],
713                  ac_cv_c_dll_gnuelf,
714   [saved_cflags=$CFLAGS
715   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0,-Bsymbolic"
716   AC_TRY_LINK(,[return 1],ac_cv_c_dll_gnuelf="yes",ac_cv_c_dll_gnuelf="no")
717   CFLAGS=$saved_cflags
718   ])
719   if test "$ac_cv_c_dll_gnuelf" = "yes"
720   then
721     LDSHARED="\$(CC) -shared \$(SONAME:%=-Wl,-soname,%)"
722     LDDLLFLAGS="-Wl,-Bsymbolic"
723   else
724     AC_CACHE_CHECK(whether we can build a UnixWare (Solaris) dll,
725                  ac_cv_c_dll_unixware,
726     [saved_cflags=$CFLAGS
727     CFLAGS="$CFLAGS -fPIC -Wl,-G,-h,conftest.so.1.0,-B,symbolic"
728     AC_TRY_LINK(,[return 1],ac_cv_c_dll_unixware="yes",ac_cv_c_dll_unixware="no")
729     CFLAGS=$saved_cflags
730     ])
731     if test "$ac_cv_c_dll_unixware" = "yes"
732     then
733       LDSHARED="\$(CC) -Wl,-G \$(SONAME:%=-Wl,-h,%)"
734       LDDLLFLAGS="-Wl,-B,symbolic"
735     fi
736   fi
737   if test "$ac_cv_c_dll_gnuelf" = "no" -a "$ac_cv_c_dll_unixware" = "no"
738   then
739     LIBEXT="a"
740     AC_CHECK_PROG(DLLWRAP,dllwrap,dllwrap,false)
741     if test "$DLLWRAP" = "dllwrap"; then
742       dnl FIXME - check whether dllwrap works correctly...
743       case $host_os in
744         *cygwin*)
745             LIBEXT="dll"
746             ;;
747       esac
748     fi
749   fi
752 if test "$LIBEXT" = "a"; then
753   AC_MSG_ERROR(
754 [could not find a way to build shared libraries.
755 It is currently not possible to build Wine without shared library
756 (.so) support to allow transparent switch between .so and .dll files.
757 If you are using Linux, you will need a newer binutils.]
761 DLLFLAGS=""
762 LDPATH=""
764 if test "$LIBEXT" = "so"; then
765     DLLFLAGS="-fPIC"
766     DLLEXT=".so"
767     LDPATH="LD_LIBRARY_PATH=\"\$(TOPOBJDIR)/unicode:\$\$LD_LIBRARY_PATH\""
768 elif test "$LIBEXT" = "dll"; then
769     #DLLFLAGS="-fPIC" # -fPIC doesn't work(at least in cygwin-b20) - FIXME
770     DLLEXT=""
771     LDPATH="PATH=\"\$(TOPOBJDIR)/unicode:\$\$PATH\""
774 AC_SUBST(DLLFLAGS)
775 AC_SUBST(DLLEXT)
776 AC_SUBST(LDSHARED)
777 AC_SUBST(LDDLLFLAGS)
778 AC_SUBST(LIBEXT)
779 AC_SUBST(LDPATH)
781 dnl **** Check for reentrant libc ****
783 dnl For cross-compiling we blindly assume that libc is reentrant. This is
784 dnl ok since non-reentrant libc is quite rare (mostly old libc5 versions).
786 AC_DEFUN([WINE_CHECK_ERRNO],
788   AC_CACHE_CHECK(for reentrant libc: $1, wine_cv_libc_r_$1,
789   [AC_TRY_RUN([int myerrno = 0;
790 char buf[256];
791 int *$1(){return &myerrno;}
792 main(){connect(0,buf,255); exit(!myerrno);}],
793   wine_cv_libc_r_$1=yes, wine_cv_libc_r_$1=no,
794   wine_cv_libc_r_$1=yes )
796 if test "$wine_cv_libc_r_$1" = "yes"
797 then
798     wine_cv_libc_reentrant=$1 
802 wine_cv_libc_reentrant=no 
803 dnl Linux style errno location
804 WINE_CHECK_ERRNO(__errno_location)
805 dnl FreeBSD style errno location
806 WINE_CHECK_ERRNO(__error)
807 dnl Solaris style errno location
808 WINE_CHECK_ERRNO(___errno)
809 dnl UnixWare style errno location
810 WINE_CHECK_ERRNO(__thr_errno)
811 dnl NetBSD style errno location
812 WINE_CHECK_ERRNO(__errno)
814 if test "$wine_cv_libc_reentrant" != "no" 
815 then
816   AC_DEFINE_UNQUOTED(ERRNO_LOCATION,$wine_cv_libc_reentrant,
817                      [Define to the name of the function returning errno for reentrant libc])
820 dnl **** Check for reentrant X libraries ****
822 dnl This may fail to determine whether X libraries are reentrant if
823 dnl AC_PATH_XTRA does not set x_libraries. In this case manual configuration
824 dnl is possible with the --without-reentrant-x option.
826 if test "$have_x" = "yes" -a "$wine_cv_libc_reentrant" != "no"
827 then
828 AC_CACHE_CHECK( [for reentrant X libraries], wine_cv_x_reentrant,
829   [ if test "x$with_reentrant_x" = "xno" 
830     then
831         wine_cv_x_reentrant=no
832     else
833         libX11_check=none
834         for dir in "$x_libraries" /usr/lib /usr/local/lib /lib; do
835             if test -r $dir/libX11.so; then
836                 libX11_check="-D $dir/libX11.so"
837                 break 1
838             fi
839             if test -r $dir/libX11.a; then
840                 libX11_check="$dir/libX11.a"
841                 break 1
842             fi
843         done
844         if test "$libX11_check" != "none"; then
845             if nm $libX11_check | grep $wine_cv_libc_reentrant >/dev/null 2>&1
846             then
847                 wine_cv_x_reentrant=yes
848             else
849                 wine_cv_x_reentrant=no
850             fi
851         else
852             wine_cv_x_reentrant=unknown
853         fi
854     fi ] )
855 else
856     wine_cv_x_reentrant=no
858 if test "$wine_cv_x_reentrant" = "no"
859 then
860   AC_DEFINE(NO_REENTRANT_X11, 1,
861             [Define if X libraries are not reentrant (compiled without -D_REENTRANT)])
865 dnl **** Check for functions ****
867 AC_FUNC_ALLOCA()
868 AC_CHECK_FUNCS(\
869         __libc_fork \
870         _lwp_create \
871         _pclose \
872         _popen \
873         _stricmp \
874         _strnicmp \
875         clone \
876         ecvt \
877         finite \
878         fpclass \
879         ftruncate64 \
880         getnetbyaddr \
881         getnetbyname \
882         getpagesize \
883         getprotobyname \
884         getprotobynumber \
885         getrlimit \
886         getservbyport \
887         getsockopt \
888         inet_network \
889         lseek64 \
890         lstat \
891         memmove \
892         mmap \
893         pclose \
894         pread \
895         popen \
896         pwrite \
897         rfork \
898         select \
899         sendmsg \
900         settimeofday \
901         sigaltstack \
902         statfs \
903         strcasecmp \
904         strerror \
905         strncasecmp \
906         tcgetattr \
907         timegm \
908         usleep \
909         vfscanf \
910         wait4 \
911         waitpid \
914 dnl **** Check for header files ****
916 AC_CHECK_HEADERS(\
917         arpa/inet.h \
918         arpa/nameser.h \
919         direct.h \
920         elf.h \
921         float.h \
922         ieeefp.h \
923         io.h \
924         libio.h \
925         libutil.h \
926         link.h \
927         linux/cdrom.h \
928         linux/input.h \
929         linux/joystick.h \
930         linux/serial.h \
931         linux/ucdrom.h \
932         net/if.h \
933         netdb.h \
934         netinet/in.h \
935         netinet/in_systm.h \
936         netinet/ip.h \
937         netinet/tcp.h \
938         pty.h \
939         resolv.h \
940         sched.h \
941         socket.h \
942         stdint.h \
943         strings.h \
944         sys/cdio.h \
945         sys/errno.h \
946         sys/file.h \
947         sys/filio.h \
948         sys/ipc.h \
949         sys/link.h \
950         sys/lwp.h \
951         sys/mman.h \
952         sys/modem.h \
953         sys/mount.h \
954         sys/msg.h \
955         sys/param.h \
956         sys/ptrace.h \
957         sys/reg.h \
958         sys/signal.h \
959         sys/shm.h \
960         sys/socket.h \
961         sys/sockio.h \
962         sys/statfs.h \
963         sys/strtio.h \
964         sys/syscall.h \
965         sys/time.h \
966         sys/user.h \
967         sys/wait.h \
968         sys/v86.h \
969         sys/v86intr.h \
970         sys/vfs.h \
971         sys/vm86.h \
972         syscall.h \
973         ucontext.h \
974         unistd.h \
976 AC_HEADER_STAT()
978 dnl **** Check for types ****
980 AC_C_CONST
981 AC_C_INLINE
982 AC_TYPE_MODE_T
983 AC_TYPE_OFF_T
984 AC_TYPE_PID_T
985 AC_TYPE_SIZE_T
986 AC_CHECK_SIZEOF(long long,0)
988 AC_CACHE_CHECK([whether linux/input.h is for real],
989         wine_cv_linux_input_h,
990         AC_TRY_COMPILE([
991             #include <linux/input.h>
992         ] , [
993             int foo = EVIOCGBIT(EV_ABS,42);
994             int bar = BTN_PINKIE;
995             int fortytwo = 42;
996         ],
997         wine_cv_linux_input_h=yes,
998         wine_cv_linux_input_h=no,
999         no
1000         )
1001     )
1002     if test "$wine_cv_linux_input_h" = "yes"
1003     then
1004         AC_DEFINE(HAVE_CORRECT_LINUXINPUT_H, 1,
1005                   [Define if we have linux/input.h AND it contains the INPUT event API])
1006     fi
1008    
1009 AC_CACHE_CHECK([whether we can use re-entrant gethostbyname_r Linux style],
1010         wine_cv_linux_gethostbyname_r_6,
1011         AC_TRY_COMPILE([
1012 #include <netdb.h>
1013         ], [
1014     char *name=NULL;
1015     struct hostent he;
1016     struct hostent *result;
1017     char *buf=NULL;
1018     int bufsize=0;
1019     int res,errnr;
1020     char *addr=NULL;
1021     int addrlen=0;
1022     int addrtype=0;
1023     res=gethostbyname_r(name,&he,buf,bufsize,&result,&errnr);
1024     res=gethostbyaddr_r(addr, addrlen, addrtype,&he,buf,bufsize,&result,&errnr);
1025     ],
1026         wine_cv_linux_gethostbyname_r_6=yes,
1027         wine_cv_linux_gethostbyname_r_6=no
1028         )
1029    )
1030    if test "$wine_cv_linux_gethostbyname_r_6" = "yes"
1031    then
1032       AC_DEFINE(HAVE_LINUX_GETHOSTBYNAME_R_6, 1,
1033                 [Define if Linux-style gethostbyname_r and gethostbyaddr_r are available])
1034    fi
1036 if test "$ac_cv_header_linux_joystick_h" = "yes"
1037 then
1038    AC_CACHE_CHECK([whether linux/joystick.h uses the Linux 2.2+ API],
1039         wine_cv_linux_joystick_22_api,
1040         AC_TRY_COMPILE([
1041         #include <sys/ioctl.h>
1042         #include <linux/joystick.h>
1044         struct js_event blub;
1045         #if !defined(JS_EVENT_AXIS) || !defined(JS_EVENT_BUTTON)
1046         #error "no 2.2 header"
1047         #endif
1048         ],/*empty*/,
1049         wine_cv_linux_joystick_22_api=yes,
1050         wine_cv_linux_joystick_22_api=no,
1051         wine_cv_linux_joystick_22_api=no
1052         )
1053    )
1054    if test "$wine_cv_linux_joystick_22_api" = "yes"
1055    then
1056       AC_DEFINE(HAVE_LINUX_22_JOYSTICK_API, 1,
1057                 [Define if <linux/joystick.h> defines the Linux 2.2 joystick API])
1058    fi
1061 dnl **** statfs checks ****
1063 if test "$ac_cv_header_sys_vfs_h" = "yes"
1064 then
1065     AC_CACHE_CHECK( [whether sys/vfs.h defines statfs],
1066                     wine_cv_sys_vfs_has_statfs,
1067         AC_TRY_COMPILE([
1068         #include <sys/types.h>
1069         #ifdef HAVE_SYS_PARAM_H
1070         # include <sys/param.h>
1071         #endif
1072         #include <sys/vfs.h>
1073         ],[
1074                 struct statfs stfs;
1076                 memset(&stfs,0,sizeof(stfs));
1077         ],wine_cv_sys_vfs_has_statfs=yes,wine_cv_sys_vfs_has_statfs=no
1078         )
1079     )
1080     if test "$wine_cv_sys_vfs_has_statfs" = "yes"
1081     then
1082       AC_DEFINE(STATFS_DEFINED_BY_SYS_VFS, 1,
1083                 [Define if the struct statfs is defined by <sys/vfs.h>])
1084     fi
1087 if test "$ac_cv_header_sys_statfs_h" = "yes"
1088 then
1089     AC_CACHE_CHECK( [whether sys/statfs.h defines statfs],
1090                     wine_cv_sys_statfs_has_statfs,
1091         AC_TRY_COMPILE([
1092         #include <sys/types.h>
1093         #ifdef HAVE_SYS_PARAM_H
1094         # include <sys/param.h>
1095         #endif
1096         #include <sys/statfs.h>
1097         ],[
1098                 struct statfs stfs;
1099         ],wine_cv_sys_statfs_has_statfs=yes,wine_cv_sys_statfs_has_statfs=no
1100         )
1101     )
1102     if test "$wine_cv_sys_statfs_has_statfs" = "yes"
1103     then
1104       AC_DEFINE(STATFS_DEFINED_BY_SYS_STATFS, 1,
1105                 [Define if the struct statfs is defined by <sys/statfs.h>])
1106     fi
1109 if test "$ac_cv_header_sys_mount_h" = "yes"
1110 then
1111     AC_CACHE_CHECK( [whether sys/mount.h defines statfs],
1112                     wine_cv_sys_mount_has_statfs,
1113         AC_TRY_COMPILE([
1114         #include <sys/types.h>
1115         #ifdef HAVE_SYS_PARAM_H
1116         # include <sys/param.h>
1117         #endif
1118         #include <sys/mount.h>
1119         ],[
1120                 struct statfs stfs;
1121         ],wine_cv_sys_mount_has_statfs=yes,wine_cv_sys_mount_has_statfs=no
1122         )
1123     )
1124     if test "$wine_cv_sys_mount_has_statfs" = "yes"
1125     then
1126       AC_DEFINE(STATFS_DEFINED_BY_SYS_MOUNT, 1,
1127                 [Define if the struct statfs is defined by <sys/mount.h>])
1128     fi
1131 dnl *** Check for some structure members
1133 dnl Macro to check if a structure contains a specified member
1134 dnl Usage: WINE_CHECK_STRUCT_MEMBER(struct,member,[includes,[action-if-found,[action-if-not-found]]])
1136 AC_DEFUN([WINE_CHECK_STRUCT_MEMBER],
1137 [AC_CACHE_CHECK([for $2 in struct $1], ac_cv_c_$1_$2,
1138  AC_TRY_COMPILE([$3],[struct $1 s; s.$2 = 0],ac_cv_c_$1_$2="yes",ac_cv_c_$1_$2="no"))
1139 AS_IF([ test "x$ac_cv_c_$1_$2" = "xyes"],[$4],[$5])
1142 dnl **** FIXME: what about mixed cases, where we need two of them? ***
1144 WINE_CHECK_STRUCT_MEMBER(statfs,f_bfree,
1145 [#include <sys/types.h>
1146 #ifdef HAVE_SYS_PARAM_H
1147 # include <sys/param.h>
1148 #endif
1149 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1150 # include <sys/mount.h>
1151 #else
1152 # ifdef STATFS_DEFINED_BY_SYS_VFS
1153 #  include <sys/vfs.h>
1154 # else
1155 #  ifdef STATFS_DEFINED_BY_SYS_STATFS
1156 #   include <sys/statfs.h>
1157 #  endif
1158 # endif
1159 #endif],
1160     [AC_DEFINE(STATFS_HAS_BFREE, 1, [Define if the struct statfs has the member bfree])])
1162 WINE_CHECK_STRUCT_MEMBER(statfs,f_bavail,
1163 [#include <sys/types.h>
1164 #ifdef HAVE_SYS_PARAM_H
1165 # include <sys/param.h>
1166 #endif
1167 #ifdef STATFS_DEFINED_BY_SYS_MOUNT
1168 # include <sys/mount.h>
1169 #else
1170 # ifdef STATFS_DEFINED_BY_SYS_VFS
1171 #  include <sys/vfs.h>
1172 # else
1173 #  ifdef STATFS_DEFINED_BY_SYS_STATFS
1174 #   include <sys/statfs.h>
1175 #  endif
1176 # endif
1177 #endif],
1178     [AC_DEFINE(STATFS_HAS_BAVAIL, 1, [Define if the struct statfs has the member bavail])])
1180 dnl Check for file descriptor passing with msg_accrights
1181 WINE_CHECK_STRUCT_MEMBER(msghdr,msg_accrights,
1182 [#include <sys/types.h>
1183 #include <sys/socket.h>],
1184     [AC_DEFINE(HAVE_MSGHDR_ACCRIGHTS, 1, [Define if struct msghdr contains msg_accrights])])
1186 dnl Check for the sa_len member in struct sockaddr
1187 WINE_CHECK_STRUCT_MEMBER(sockaddr,sa_len,
1188 [#include <sys/types.h>
1189 #include <sys/socket.h>],
1190     [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [Define if struct sockaddr contains sa_len])])
1192 dnl Check for the sun_len member in struct sockaddr_un
1193 WINE_CHECK_STRUCT_MEMBER(sockaddr_un,sun_len,
1194 [#include <sys/types.h>
1195 #include <sys/socket.h>
1196 #include <sys/un.h>],
1197     [AC_DEFINE(HAVE_SOCKADDR_SUN_LEN, 1, [Define if struct sockaddr_un contains sun_len])])
1199 dnl *** check for the need to define __i386__
1201 case $target_cpu in
1202   *i[3456789]86* )
1203     AC_CACHE_CHECK([whether we need to define __i386__],ac_cv_cpp_def_i386,
1204       AC_EGREP_CPP(yes,[#ifndef __i386__
1206 #endif],
1207  ac_cv_cpp_def_i386="yes", ac_cv_cpp_def_i386="no"))
1208     ;;
1209 esac
1210 if test "$ac_cv_cpp_def_i386" = "yes"
1211 then
1212     CFLAGS="$CFLAGS -D__i386__"
1213     LINTFLAGS="$LINTFLAGS -D__i386__"
1216 dnl **** Generate output files ****
1218 dnl Macro to create non-existent directories from config.status
1219 dnl Usage: WINE_CONFIG_EXTRA_DIR(dirname)
1220 AC_DEFUN([WINE_CONFIG_EXTRA_DIR],
1221 [AC_CONFIG_COMMANDS([$1],[test -d "$1" || (AC_MSG_NOTICE([creating $1]) && mkdir "$1")])])
1223 AH_TOP([#define __WINE_CONFIG_H])
1225 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/d3ddevice)
1226 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dclipper)
1227 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/ddraw)
1228 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/direct3d)
1229 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dpalette)
1230 WINE_CONFIG_EXTRA_DIR(dlls/ddraw/dsurface)
1231 WINE_CONFIG_EXTRA_DIR(dlls/dinput/joystick)
1232 WINE_CONFIG_EXTRA_DIR(dlls/dinput/keyboard)
1233 WINE_CONFIG_EXTRA_DIR(dlls/dinput/mouse)
1234 WINE_CONFIG_EXTRA_DIR(dlls/kernel/messages)
1235 WINE_CONFIG_EXTRA_DIR(dlls/kernel/tests)
1236 WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
1237 WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
1238 WINE_CONFIG_EXTRA_DIR(dlls/user/tests)
1239 WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
1240 WINE_CONFIG_EXTRA_DIR(include/wine)
1241 WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
1242 WINE_CONFIG_EXTRA_DIR(programs/winetest/tests)
1244 AC_CONFIG_COMMANDS([include/wine/version.h],
1245 [AC_MSG_NOTICE([creating include/wine/version.h])
1246 cat >$tmp/version.h <<CEOF
1247 /* Generated automatically by configure; DO NOT EDIT! */
1248 #define WINE_RELEASE_INFO "Wine version $wine_version"
1249 CEOF
1250 if cmp -s $tmp/version.h include/wine/version.h 2>/dev/null; then
1251   AC_MSG_NOTICE([include/wine/version.h is unchanged])
1252   rm -f $tmp/version.h
1253 else
1254   rm -f include/wine/version.h
1255   mv $tmp/version.h include/wine/version.h
1256 fi],
1257 [wine_version=$PACKAGE_VERSION])
1259 MAKE_RULES=Make.rules
1260 AC_SUBST_FILE(MAKE_RULES)
1262 MAKE_DLL_RULES=dlls/Makedll.rules
1263 AC_SUBST_FILE(MAKE_DLL_RULES)
1265 MAKE_PROG_RULES=programs/Makeprog.rules
1266 AC_SUBST_FILE(MAKE_PROG_RULES)
1268 AC_CONFIG_FILES([
1269 Make.rules
1270 dlls/Makedll.rules
1271 programs/Makeprog.rules
1272 Makefile
1273 console/Makefile
1274 controls/Makefile
1275 debugger/Makefile
1276 dlls/Makefile
1277 dlls/advapi32/Makefile
1278 dlls/avicap32/Makefile
1279 dlls/avifil32/Makefile
1280 dlls/comctl32/Makefile
1281 dlls/commdlg/Makefile
1282 dlls/crtdll/Makefile
1283 dlls/crypt32/Makefile
1284 dlls/dciman32/Makefile
1285 dlls/ddraw/Makefile
1286 dlls/devenum/Makefile
1287 dlls/dinput/Makefile
1288 dlls/dplay/Makefile
1289 dlls/dplayx/Makefile
1290 dlls/dsound/Makefile
1291 dlls/gdi/Makefile
1292 dlls/glu32/Makefile
1293 dlls/icmp/Makefile
1294 dlls/imagehlp/Makefile
1295 dlls/imm32/Makefile
1296 dlls/kernel/Makefile
1297 dlls/lzexpand/Makefile
1298 dlls/mapi32/Makefile
1299 dlls/mpr/Makefile
1300 dlls/msacm/Makefile
1301 dlls/msdmo/Makefile
1302 dlls/msimg32/Makefile
1303 dlls/msnet32/Makefile
1304 dlls/msrle32/Makefile
1305 dlls/msvcrt/Makefile
1306 dlls/msvcrt20/Makefile
1307 dlls/msvideo/Makefile
1308 dlls/netapi32/Makefile
1309 dlls/ntdll/Makefile
1310 dlls/odbc32/Makefile
1311 dlls/ole32/Makefile
1312 dlls/oleaut32/Makefile
1313 dlls/olecli/Makefile
1314 dlls/oledlg/Makefile
1315 dlls/olepro32/Makefile
1316 dlls/olesvr/Makefile
1317 dlls/opengl32/Makefile
1318 dlls/psapi/Makefile
1319 dlls/qcap/Makefile
1320 dlls/quartz/Makefile
1321 dlls/rasapi32/Makefile
1322 dlls/richedit/Makefile
1323 dlls/rpcrt4/Makefile
1324 dlls/serialui/Makefile
1325 dlls/setupapi/Makefile
1326 dlls/shdocvw/Makefile
1327 dlls/shell32/Makefile
1328 dlls/shfolder/Makefile
1329 dlls/shlwapi/Makefile
1330 dlls/sti/Makefile
1331 dlls/tapi32/Makefile
1332 dlls/ttydrv/Makefile
1333 dlls/url/Makefile
1334 dlls/urlmon/Makefile
1335 dlls/user/Makefile
1336 dlls/version/Makefile
1337 dlls/win32s/Makefile
1338 dlls/winaspi/Makefile
1339 dlls/winedos/Makefile
1340 dlls/wineps/Makefile
1341 dlls/wininet/Makefile
1342 dlls/winmm/Makefile
1343 dlls/winmm/joystick/Makefile
1344 dlls/winmm/mcianim/Makefile
1345 dlls/winmm/mciavi/Makefile
1346 dlls/winmm/mcicda/Makefile
1347 dlls/winmm/mciseq/Makefile
1348 dlls/winmm/mciwave/Makefile
1349 dlls/winmm/midimap/Makefile
1350 dlls/winmm/wavemap/Makefile
1351 dlls/winmm/winearts/Makefile
1352 dlls/winmm/wineoss/Makefile
1353 dlls/winnls/Makefile
1354 dlls/winsock/Makefile
1355 dlls/winspool/Makefile
1356 dlls/wintrust/Makefile
1357 dlls/wow32/Makefile
1358 dlls/wsock32/Makefile
1359 dlls/x11drv/Makefile
1360 documentation/Makefile
1361 files/Makefile
1362 graphics/Makefile
1363 graphics/enhmetafiledrv/Makefile
1364 graphics/metafiledrv/Makefile
1365 graphics/win16drv/Makefile
1366 graphics/x11drv/Makefile
1367 if1632/Makefile
1368 include/Makefile
1369 library/Makefile
1370 libtest/Makefile
1371 loader/Makefile
1372 loader/ne/Makefile
1373 memory/Makefile
1374 misc/Makefile
1375 miscemu/Makefile
1376 msdos/Makefile
1377 objects/Makefile
1378 ole/Makefile
1379 programs/Makefile
1380 programs/avitools/Makefile
1381 programs/clock/Makefile
1382 programs/cmdlgtst/Makefile
1383 programs/control/Makefile
1384 programs/notepad/Makefile
1385 programs/osversioncheck/Makefile
1386 programs/progman/Makefile
1387 programs/regapi/Makefile
1388 programs/regtest/Makefile
1389 programs/uninstaller/Makefile
1390 programs/view/Makefile
1391 programs/wcmd/Makefile
1392 programs/wineconsole/Makefile
1393 programs/winemine/Makefile
1394 programs/winetest/Makefile
1395 programs/winhelp/Makefile
1396 programs/winver/Makefile
1397 relay32/Makefile
1398 scheduler/Makefile
1399 server/Makefile
1400 tools/Makefile
1401 tools/winapi/Makefile
1402 tools/winebuild/Makefile
1403 tools/winedump/Makefile
1404 tools/wmc/Makefile
1405 tools/wrc/Makefile
1406 tsx11/Makefile
1407 unicode/Makefile
1408 win32/Makefile
1409 windows/Makefile
1410 windows/x11drv/Makefile ])
1412 AC_OUTPUT
1414 if test "$have_x" = "no"
1415 then
1416   echo
1417   echo "*** Warning: X development files not found. Wine will be built without"
1418   echo "*** X support, which currently does not work, and would probably not be"
1419   echo "*** what you want anyway. You will need to install devel packages of"
1420   echo "*** Xlib/Xfree86 at the very least."
1423 if test "$ac_cv_lib_ncurses_resizeterm" = "no" -a "$ac_cv_lib_ncurses_waddch" = "yes"
1424 then
1425   echo
1426   echo "*** Warning: resizeterm not found in ncurses. Wine will be built without"
1427   echo "*** terminal resize support. Consider upgrading ncurses."
1430 if test "$wine_cv_libc_reentrant" = "no" 
1431 then
1432   echo
1433   echo "*** Warning: non-reentrant libc detected. Wine will be built without"
1434   echo "*** threading support. Consider upgrading libc to a more recent"
1435   echo "*** reentrant version of libc."
1438 if test "$wine_cv_opengl_version_OK" = "no"
1439 then
1440   echo
1441   echo "*** Warning: old Mesa headers detected. Wine will be built without Direct3D"
1442   echo "*** support. Consider upgrading your Mesa libraries (http://www.mesa3d.org/)."
1445 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "x"
1446 then
1447   echo
1448   echo "*** Warning: the OpenGL version you have installed relies on libpthread for"
1449   echo "*** thread-safety. To prevent crashes, OpenGL support has been removed."
1450   echo "*** A fix for glibc 2.1.3 that seems to work is included in this version of Wine,"
1451   echo "*** start configure with '--enable-opengl' to force OpenGL support."
1454 if test "$wine_cv_opengl_version_threadsafe" = "yes" -a "x$enable_opengl" = "xyes"
1455 then
1456   echo
1457   echo "*** Warning: you explicitly linked in a thread-safe OpenGL version. If you"
1458   echo "*** experience unusual crashes on DirectDraw games, try first to disable OpenGL"
1459   echo "*** support before reporting bugs."
1462 if test "$wine_cv_warn_cups_h" = "yes"
1463 then
1464   echo
1465   echo "*** Note: You have cups runtime libraries, but no development"
1466   echo "*** libraries. Install the cups-devel package or whichever package"
1467   echo "*** contains cups.h to enable CUPS support in Wine."
1470 if test "$wine_cv_msg_freetype" = "yes"
1471 then
1472   echo
1473   echo "*** Note: Your system appears to have the FreeType 2 runtime libraries"
1474   echo "*** installed, but 'freetype-config' is not in your PATH. Install the"
1475   echo "*** freetype-devel package (or its equivalent on your distribution) to"
1476   echo "*** enable Wine to use TrueType fonts."
1479 echo
1480 echo "Configure finished.  Do 'make depend && make' to compile Wine."
1481 echo
1483 dnl Local Variables:
1484 dnl comment-start: "dnl "
1485 dnl comment-end: ""
1486 dnl comment-start-skip: "\\bdnl\\b\\s *"
1487 dnl compile-command: "autoconf"
1488 dnl End: