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