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