~ubuntu-branches/ubuntu/warty/happy/warty

« back to all changes in this revision

Viewing changes to configure.in

  • Committer: Bazaar Package Importer
  • Author(s): Ian Lynagh (wibble)
  • Date: 2004-04-03 15:51:47 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040403155147-47pwz4txfls12i4q
Tags: 1.13-0tarball-5
Fix pragmas (missing #) in Parser.hs as recent GHCs were barfing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
echo ''
46
46
echo "*** The top of your build tree is: $hardtop"
47
 
AC_SUBST(hardtop)
 
47
# subst of hardtop is done below after we've computed hardtop_plat.
48
48
 
49
49
dnl--------------------------------------------------------------------
50
50
dnl * Choose host(/target/build) platform
93
93
        HostVendor_CPP='dec'
94
94
        HostOS_CPP='osf3'
95
95
        ;;
96
 
alpha*-unknown-linux)
 
96
alpha*-unknown-linux*)
97
97
        HostPlatform=alpha-unknown-linux
98
98
        TargetPlatform=alpha-unknown-linux
99
99
        BuildPlatform=alpha-unknown-linux
203
203
        HostOS_CPP='mingw32'
204
204
        exeext='.exe'
205
205
        ;;
 
206
mips-*-linux*)
 
207
        HostPlatform=mips-unknown-linux # hack again
 
208
        TargetPlatform=mips-unknown-linux
 
209
        BuildPlatform=mips-unknown-linux
 
210
        HostPlatform_CPP='mips_unknown_linux'
 
211
        HostArch_CPP='mips'
 
212
        HostVendor_CPP='unknown'
 
213
        HostOS_CPP='linux'
 
214
        ;;
 
215
hppa*-*-linux*)
 
216
        HostPlatform=hppa-unknown-linux # hack again
 
217
        TargetPlatform=hppa-unknown-linux
 
218
        BuildPlatform=hppa-unknown-linux
 
219
        HostPlatform_CPP='hppa_unknown_linux'
 
220
        HostArch_CPP='hppa'
 
221
        HostVendor_CPP='unknown'
 
222
        HostOS_CPP='linux'
 
223
        ;;
 
224
arm*-linux*)
 
225
        HostPlatform=arm-unknown-linux # hack again
 
226
        TargetPlatform=arm-unknown-linux                      
 
227
        BuildPlatform=arm-unknown-linux
 
228
        HostPlatform_CPP='arm_unknown_linux'
 
229
        HostArch_CPP='arm'
 
230
        HostVendor_CPP='unknown'
 
231
        HostOS_CPP='linux'
 
232
        ;;
 
233
ia64-*-linux*)
 
234
        HostPlatform=ia64-unknown-linux # hack again
 
235
        TargetPlatform=ia64-unknown-linux
 
236
        BuildPlatform=ia64-unknown-linux
 
237
        HostPlatform_CPP='ia64_unknown_linux'
 
238
        HostArch_CPP='ia64'
 
239
        HostVendor_CPP='unknown'
 
240
        HostOS_CPP='linux'
 
241
        ;;
 
242
m68k-*-linux*)
 
243
        HostPlatform=m68k-unknown-linux # hack again          
 
244
        TargetPlatform=m68k-unknown-linux
 
245
        BuildPlatform=m68k-unknown-linux
 
246
        HostPlatform_CPP='m68k_unknown_linux'
 
247
        HostArch_CPP='m68k'
 
248
        HostVendor_CPP='unknown'
 
249
        HostOS_CPP='linux'
 
250
        ;;
206
251
m68k-next-nextstep2)
207
252
        HostPlatform_CPP='m68k_next_nextstep2'
208
253
        HostArch_CPP='m68k'
266
311
        HostVendor_CPP='ibm'
267
312
        HostOS_CPP='aix'
268
313
        ;;
269
 
powerpc-apple-macosx*)
270
 
      HostPlatform=powerpc-apple-macosx
271
 
      TargetPlatform=powerpc-apple-macosx #hack
272
 
      BuildPlatform=powerpc-apple-macosx #hack
273
 
        HostPlatform_CPP='powerpc_apple_macosx'
 
314
powerpc-apple-darwin*)
 
315
        HostPlatform=powerpc-apple-darwin
 
316
        TargetPlatform=powerpc-apple-darwin #hack
 
317
        BuildPlatform=powerpc-apple-darwin #hack
 
318
        HostPlatform_CPP='powerpc_apple_darwin'
 
319
        HostArch_CPP='powerpc'
 
320
        HostVendor_CPP='apple'
 
321
        HostOS_CPP='darwin'
 
322
        ;;
 
323
powerpc-*-linux*)
 
324
        HostPlatform=powerpc-unknown-linux
 
325
        TargetPlatform=powerpc-unknown-linux
 
326
        BuildPlatform=powerpc-unknown-linux
 
327
        HostPlatform_CPP='powerpc_unknown_linux'
274
328
        HostArch_CPP='powerpc'
275
 
        HostVendor_CPP='apple'
276
 
        HostOS_CPP='macosx'
 
329
        HostVendor_CPP='unknown'
 
330
        HostOS_CPP='linux'
277
331
        ;;
278
332
sparc-sun-sunos4*)
279
333
        HostPlatform=sparc-sun-sunos4
293
347
        HostVendor_CPP='sun'
294
348
        HostOS_CPP='solaris2'
295
349
        ;;
 
350
sparc-unknown-linux*)
 
351
   HostPlatform=sparc-unknown-linux
 
352
   TargetPlatform=sparc-unknown-linux
 
353
   BuildPlatform=sparc-unknown-linux
 
354
        HostPlatform_CPP='sparc-unknown-linux'
 
355
        HostArch_CPP='sparc'
 
356
        HostVendor_CPP='unknown'
 
357
        HostOS_CPP='linux'
 
358
        ;;
 
359
s390-ibm-linux*)
 
360
        HostPlatform=s390-ibm-linux
 
361
        TargetPlatform=s390-ibm-linux #hack
 
362
        BuildPlatform=s390-ibm-linux #hack
 
363
        HostPlatform_CPP='s390_ibm_linux'
 
364
        HostArch_CPP='s390'
 
365
        HostVendor_CPP='ibm'
 
366
        HostOS_CPP='linux'
 
367
        ;;
296
368
*)
297
369
        echo "Unrecognised platform: $HostPlatform"
298
370
        exit 1
336
408
 
337
409
AC_SUBST(exeext)
338
410
 
 
411
#
 
412
# The native format for 'hardtop' (i.e., right kind of slashes on a Win32 box).
 
413
# (but with b-slashes being escaped).
 
414
case $HostPlatform in
 
415
  i386-unknown-mingw32 | i386-unknown-cygwin32)
 
416
        # get rid off /cygdrive/ prefix
 
417
        hardtop=`echo ${hardtop} | sed -e 's%^/cygdrive/\(.\)/%\1:/%' `
 
418
        hardtop_plat=`cygpath -w ${hardtop} | sed -e 's@\\\\@\\\\\\\\@g' `
 
419
        ;;
 
420
  *)
 
421
        hardtop_plat=${hardtop}
 
422
        ;;
 
423
esac
 
424
AC_SUBST(hardtop)
 
425
AC_SUBST(hardtop_plat)
 
426
 
339
427
dnl --------------------------------------------------------------
340
428
dnl * Project specific configuration options
341
429
dnl --------------------------------------------------------------
426
514
fi;
427
515
 
428
516
 
 
517
dnl ** Enable multi-thread friendly RTS?
 
518
dnl --------------------------------------------------------------
 
519
AC_ARG_ENABLE(threaded-rts,
 
520
[  --enable-threaded-rts
 
521
        Support better interop with OS threads.
 
522
],
 
523
[ThreadedRts=YES],
 
524
[ThreadedRts=NO]
 
525
)
 
526
AC_SUBST(ThreadedRts)
 
527
 
429
528
dnl ** Enable the construction of Win32 DLLs?
430
529
dnl --------------------------------------------------------------
431
530
AC_ARG_ENABLE(win32-dlls,
529
628
dnl ** figure out how to invoke cpp directly (gcc -E is no good)
530
629
AC_PROG_CPP
531
630
 
532
 
dnl ** does the C compiler support the following options?
533
 
FPTOOLS_CC_FLAG(-mwin32,CC_SUPPORTS_MWIN32)
534
 
FPTOOLS_CC_FLAG(-mno-cygwin,CC_SUPPORTS_MNO_CYGWIN)
 
631
dnl ** Without optimization some INLINE trickery fails for GHCi
 
632
SRC_CC_OPTS="-O"
535
633
 
536
 
EXTRA_CC_OPTS="$CC_SUPPORTS_MNO_CYGWIN $CC_SUPPORTS_MWIN32"
537
 
SRC_CC_OPTS="-O $EXTRA_CC_OPTS"
538
 
CPPFLAGS="$EXTRA_CC_OPTS $CPPFLAGS"
 
634
dnl ** Try to add -mno-cygwin to the C compiler options for mingw32 targets
 
635
if test x"$TargetOS_CPP" = x"mingw32"; then
 
636
  FPTOOLS_CC_FLAG(-mno-cygwin,CC_SUPPORTS_MNO_CYGWIN)
 
637
  SRC_CC_OPTS="$CC_SUPPORTS_MNO_CYGWIN $SRC_CC_OPTS"
 
638
  CPPFLAGS="$CC_SUPPORTS_MNO_CYGWIN $CPPFLAGS"
 
639
fi
539
640
AC_SUBST(SRC_CC_OPTS)
540
641
 
541
642
dnl ** figure out how to do context diffs
542
643
FPTOOLS_PROG_DIFF
543
644
 
544
645
dnl ** Find find command (for Win32's benefit)
545
 
AC_PATH_PROG(FindCmd, find)
 
646
FPTOOLS_FIND_FIND
546
647
 
547
648
dnl ** look for a decent parser generator (bison preferred)
548
649
dnl (FPTOOLS_PROG_YACCY is AC_PROG_YACC, but with some extra testing 
552
653
dnl ** Find lex command (lex or flex) - *doesn't* use autoconf's
553
654
dnl    AC_PROG_LEX, since it doesn't actually check whether 'lex'
554
655
dnl    exists if 'flex' doesn't.
555
 
AC_PROG_LEX_STRICT
 
656
dnl AC_PROG_LEX_STRICT
556
657
 
557
658
dnl ** figure out how to do a BSD-ish install
558
659
AC_PROG_INSTALL
563
664
dnl ** how to invoke `ar' and `ranlib'
564
665
FPTOOLS_PROG_AR_AND_RANLIB
565
666
 
566
 
 
567
667
dnl ** Check to see whether ln -s works
568
668
AC_PROG_LN_S
569
669
 
591
691
  AC_MSG_RESULT([Warning: You will not be able to build the documentation.])
592
692
fi
593
693
case $Catalog in
 
694
   yes) # assume it is provided by other means (e.g., SGML_CATALOG_FILES env var).
 
695
        Catalog=
 
696
        ;;
594
697
   glafp*) 
595
698
        case $HostOS_CPP in
596
699
           mingw32)
613
716
AC_SUBST(CompressCmd)
614
717
AC_SUBST(CompressSuffix)
615
718
 
 
719
AC_ARG_ENABLE(src-tree-happy,
 
720
[  --enable-src-tree-happy
 
721
        Build and use source tree (fptools/happy) version of happy.
 
722
],
 
723
[UseSrcTreeHappy=YES],
 
724
[UseSrcTreeHappy=NO]
 
725
)
616
726
dnl ** check for installed happy binary + version
617
727
dnl    (don't do it if we're booting from .hc files though.)
618
728
if test "$BootingFromHc" = "NO"; then
631
741
AC_HEADER_STDC
632
742
 
633
743
dnl ** check for specific header (.h) files that we are interested in
634
 
AC_CHECK_HEADERS(Files.h arpa/inet.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h inttypes.h limits.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdint.h stdlib.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/limits.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netdb.h netinet/in.h netinet/tcp.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/un.h sys/utsname.h sys/vadvise.h sys/wait.h termio.h termios.h time.h types.h unistd.h utime.h values.h vfork.h bfd.h winsock.h)
 
744
AC_CHECK_HEADERS(Files.h arpa/inet.h assert.h console.h ctype.h dirent.h errno.h fcntl.h float.h ftw.h grp.h ieee754.h inttypes.h limits.h malloc.h memory.h nlist.h pascal.h pwd.h sgtty.h siginfo.h signal.h stat.h stdint.h stdlib.h stddef.h stdarg.h string.h sys/fault.h sys/file.h sys/ioctl.h sys/limits.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/socket.h netdb.h netinet/in.h netinet/tcp.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/un.h sys/utsname.h sys/vadvise.h sys/wait.h termio.h termios.h time.h types.h unistd.h utime.h values.h vfork.h bfd.h winsock.h pthread.h sys/uio.h)
635
745
 
636
746
AC_CHECK_HEADER(readline/readline.h, HaveReadlineReadlineH=YES, HaveReadlineReadlineH=NO)
637
747
AC_CHECK_HEADER(readline/history.h, HaveReadlineHistoryH=YES, HaveReadlineHistoryH=NO)
666
776
dnl ** check for valloc (in sunos, solaris, mips, amiga, next, minix, ultrix)
667
777
AC_CHECK_HEADER(malloc.h,AC_CHECK_FUNCS(valloc))
668
778
 
 
779
dnl ** check for POSIX regex
 
780
HavePosixRegex=NO
 
781
AC_CHECK_HEADER(regex.h,AC_CHECK_FUNC(regcomp, HavePosixRegex=YES))
 
782
AC_SUBST(HavePosixRegex)
 
783
 
669
784
dnl ** how do we get a timezone name, and UTC offset ?
670
785
AC_STRUCT_TIMEZONE
671
786
 
682
797
dnl ** do we have long longs?
683
798
FPTOOLS_C_LONG_LONG
684
799
 
 
800
dnl ** check what fields struct msghdr contains
 
801
FPTOOLS_MSGHDR_MSG_ACCRIGHTS
 
802
FPTOOLS_MSGHDR_MSG_CONTROL
 
803
 
685
804
dnl ** what are the sizes of various types
686
805
dnl    (these must come before GHC_CHECK_ALIGNMENT)
687
806
AC_CHECK_SIZEOF(char,               1)
744
863
FPTOOLS_CHECK_HTYPE(sig_atomic_t, Int32)
745
864
FPTOOLS_CHECK_HTYPE(clock_t)
746
865
FPTOOLS_CHECK_HTYPE(time_t)
 
866
FPTOOLS_CHECK_HTYPE(dev_t, Word32)
 
867
FPTOOLS_CHECK_HTYPE(ino_t)
 
868
FPTOOLS_CHECK_HTYPE(mode_t)
 
869
FPTOOLS_CHECK_HTYPE(off_t)
 
870
FPTOOLS_CHECK_HTYPE(pid_t)
 
871
FPTOOLS_CHECK_HTYPE(gid_t)
 
872
FPTOOLS_CHECK_HTYPE(uid_t)
 
873
FPTOOLS_CHECK_HTYPE(cc_t)
 
874
FPTOOLS_CHECK_HTYPE(speed_t)
 
875
FPTOOLS_CHECK_HTYPE(tcflag_t)
 
876
FPTOOLS_CHECK_HTYPE(nlink_t)
 
877
FPTOOLS_CHECK_HTYPE(ssize_t)
747
878
 
748
879
dnl ** Map OpenGL data types to Haskell types
749
880
if test $GhcLibsWithHOpenGL = YES ; then
763
894
FPTOOLS_CHECK_HTYPE(GLclampd)
764
895
fi
765
896
 
766
 
FPTOOLS_CHECK_CCONSTS(E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EADV EAFNOSUPPORT EAGAIN EALREADY EBADF EBADMSG EBADRPC EBUSY ECHILD ECOMM ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDIRTY EDOM EDQUOT EEXIST EFAULT EFBIG EFTYPE EHOSTDOWN EHOSTUNREACH EIDRM EILSEQ EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENONET ENOPROTOOPT ENOSPC ENOSR ENOSTR ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROCLIM EPROCUNAVAIL EPROGMISMATCH EPROGUNAVAIL EPROTO EPROTONOSUPPORT EPROTOTYPE ERANGE EREMCHG EREMOTE EROFS ERPCMISMATCH ERREMOTE ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESRMNT ESTALE ETIME ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV)
767
 
 
768
897
dnl ** can we open files in binary mode?
769
898
FPTOOLS_O_BINARY
770
899
 
841
970
 
842
971
 
843
972
dnl ** check for specific library functions that we are interested in
844
 
AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect readlink setitimer stat lstat symlink sysconf timelocal times vadvise vfork localtime_r gmtime_r)
 
973
AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect readlink setitimer stat lstat symlink sysconf timelocal times vadvise vfork localtime_r gmtime_r readdir_r)
845
974
 
846
975
dnl ** check whether this machine has gmp3 installed
847
976
AC_CHECK_LIB(gmp,  __gmpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp,
848
977
  AC_CHECK_LIB(gmp3, __gmpz_fdiv_qr,  HaveLibGmp=YES; LibGmp=gmp3,
849
 
    HaveLibGmp=No; LibGmp=not-installed))
 
978
    HaveLibGmp=NO; LibGmp=not-installed))
850
979
AC_SUBST(HaveLibGmp)
851
980
AC_SUBST(LibGmp)
852
981
 
 
982
if test "$HaveLibGmp" = "NO"; then
 
983
if test "$HostArch_CPP" = "ia64"; then
 
984
AC_MSG_ERROR([You need to install libgmp (the in-tree version does not work on IA64).])
 
985
fi;
 
986
fi;
 
987
 
853
988
dnl ** check whether this machine has GNU regex in libc.
854
989
FPTOOLS_REGEX_IN_LIBC
855
990
 
902
1037
*) AC_PATH_XTRA() ;;
903
1038
esac
904
1039
 
 
1040
FPTOOLS_HAVE_OPENGL
 
1041
 
905
1042
dnl ################################################################
906
1043
dnl Check for libraries
907
1044
dnl ################################################################
908
1045
 
 
1046
dnl ** check for libdl & RTLD_NEXT
 
1047
 
909
1048
AC_CHECK_LIB(dl, dlopen, 
910
1049
        [HaveLibDL=YES
911
1050
         AC_DEFINE(HAVE_LIBDL)
914
1053
AC_CHECK_FUNCS(dlopen)
915
1054
AC_SUBST(HaveLibDL)
916
1055
 
 
1056
dnl ** sometimes RTLD_NEXT is hidden in #ifdefs we really don't wan to set
 
1057
AC_MSG_CHECKING(for RTLD_NEXT from dlfcn.h)
 
1058
AC_EGREP_CPP(yes,
 
1059
[
 
1060
 #include <dlfcn.h>
 
1061
 #ifdef RTLD_NEXT
 
1062
        yes
 
1063
 #endif
 
1064
], [
 
1065
  AC_MSG_RESULT(yes)
 
1066
  AC_DEFINE(HAVE_RTLDNEXT)
 
1067
  HaveRtldNext=YES
 
1068
], [
 
1069
  AC_MSG_RESULT(no)
 
1070
  HaveRtldNext=NO
 
1071
  ])    
 
1072
AC_SUBST(HaveRtldNext)
 
1073
 
 
1074
dnl ** RTLD_LOCAL isn't available on cygwin
 
1075
AC_MSG_CHECKING(for RTLD_LOCAL from dlfcn.h)
 
1076
AC_EGREP_CPP(yes,
 
1077
[
 
1078
 #include <dlfcn.h>
 
1079
 #ifdef RTLD_LOCAL
 
1080
        yes
 
1081
 #endif
 
1082
], [
 
1083
  AC_MSG_RESULT(yes)
 
1084
  AC_DEFINE(HAVE_RTLDLOCAL)
 
1085
  HaveRtldLocal=YES
 
1086
], [
 
1087
  AC_MSG_RESULT(no)
 
1088
  HaveRtldLocal=NO
 
1089
  ])    
 
1090
AC_SUBST(HaveRtldLocal)
 
1091
 
917
1092
FPTOOLS_CHECK_LIB_NOWARN(m, atan)
918
1093
 
919
1094
dnl --------------------------------------------------
973
1148
dnl ** code before data?
974
1149
FPTOOLS_CODE_BEFORE_DATA
975
1150
 
 
1151
dnl ** check for ld, and whether ld has -x option
 
1152
AC_PATH_PROG(LdCmdRaw, ld)
 
1153
case $HostOS_CPP in
 
1154
 mingw32) LdCmd=`cygpath -w ${LdCmdRaw} | sed -e 's@\\\\@/@g' `
 
1155
           ;;
 
1156
 *) LdCmd=${LdCmdRaw}
 
1157
    ;;
 
1158
esac
 
1159
AC_SUBST(LdCmd)
 
1160
FPTOOLS_LD_X
976
1161
 
977
1162
AC_OUTPUT(mk/config.mk, echo timestamp > mk/stamp-h )