X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=configure.ac;h=d243fa27f6a7be42bb60e1ea11a9603c8254aadb;hb=cbc7228335a0489362d8f5deadaecacc8731a4ce;hp=c0ea36e017665d7bb94eb9eb8913d9fecbd38fb2;hpb=86e9447a19d640645adca35aba68e9da4ea5b72c;p=ghc-hetmet.git diff --git a/configure.ac b/configure.ac index c0ea36e..d243fa2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,11 +3,11 @@ dnl (run "grep '^dnl \*' configure.ac | sed -e 's/dnl / /g; s/\*\*/ +/g;'" dnl (or some such) to see the outline of this file) dnl # -# (c) The AQUA Project, Glasgow University, 1994-1998 +# (c) The AQUA Project, Glasgow University, 1994-2004 # # Configure script template for the Glasgow functional programming tools # -# Process with 'autoconf' to get a working configure script. +# Process with 'autoreconf' to get a working configure script. # # For the generated configure script, do "./configure --help" to # see what flags are available. (Better yet, read the documentation!) @@ -406,6 +406,16 @@ powerpc-unknown-openbsd*) HostVendor_CPP='unknown' HostOS_CPP='openbsd' ;; +powerpc64-unknown-linux*) + HostPlatform=powerpc64-unknown-linux + TargetPlatform=powerpc64-unknown-linux + BuildPlatform=powerpc64-unknown-linux + HostPlatform_CPP='powerpc64_unknown_linux' + HostArch_CPP='powerpc64' + HostVendor_CPP='unknown' + HostOS_CPP='linux' + ;; + s390-ibm-linux*) HostPlatform=s390-ibm-linux TargetPlatform=s390-ibm-linux #hack @@ -557,6 +567,14 @@ AC_SUBST(hardtop_plat) AC_MSG_RESULT(${hardtop}) +# We don't support building in directories with spaces. +case "$hardtop" in + *' '*) AC_MSG_ERROR([ + The build system does not support building in a directory containing + space characters. Suggestion: move the build tree somewhere else.]) + ;; +esac + dnl -------------------------------------------------------------- dnl * Project specific configuration options dnl -------------------------------------------------------------- @@ -568,17 +586,15 @@ dnl use either is considered a Feature. dnl ** What command to use to compile compiler sources ? dnl -------------------------------------------------------------- -AC_ARG_WITH(ghc, +AC_ARG_WITH([ghc], [AC_HELP_STRING([--with-ghc=ARG], - [Use ARG as the path to GHC [default=autodetect]])], -[ WithGhc="$withval" ], -[ - if test "$GHC" = ""; then - AC_PATH_PROG(GHC,ghc) + [Use ARG as the path to GHC [default=autodetect]])], + [WithGhc="$withval"], + [if test "$GHC" = ""; then + AC_PATH_PROG([GHC], [ghc]) fi - WithGhc=$GHC -]) -AC_SUBST(WithGhc) + WithGhc="$GHC"]) +AC_SUBST([WithGhc]) AC_ARG_WITH(hc, [AC_HELP_STRING([--with-hc=ARG], @@ -614,7 +630,9 @@ AC_ARG_WITH(gcc, withval=`cygpath -w ${withval} | sed -e 's@\\\\@/@g' ` fi fi; - CC="$withval"], + CC="$withval" + export CC + ], [WhatGccIsCalled="gcc"] ) AC_SUBST(WhatGccIsCalled) @@ -726,21 +744,6 @@ AC_ARG_ENABLE(objectio, ) AC_SUBST(GhcLibsWithObjectIO) -dnl ** Enable the building of the OpenAL binding? -dnl -------------------------------------------------------------- -AC_ARG_ENABLE([openal], - AC_HELP_STRING([--enable-openal], - [Build OpenAL binding [[default=autodetect]]]), - [ if test x"$enableval" = x"yes"; then - GhcLibsWithOpenAL=YES - else - GhcLibsWithOpenAL=NO - fi - ], - [GhcLibsWithOpenAL=YES]) - -AC_SUBST([GhcLibsWithOpenAL]) - dnl ** .NET interop support? dnl -------------------------------------------------------------- AC_ARG_ENABLE(dotnet, @@ -809,9 +812,8 @@ dnl ** look for GCC and find out which version dnl Figure out which C compiler to use. Gcc is preferred. dnl If gcc, make sure it's at least 2.1 dnl -AC_PROG_CC -FPTOOLS_HAVE_GCC -FPTOOLS_GCC_NEEDS_NO_OMIT_LFPTR +FP_HAVE_GCC +FP_MINGW_GCC dnl ** figure out how to invoke cpp directly (gcc -E is no good) AC_PROG_CPP @@ -831,6 +833,9 @@ FP_PROG_CONTEXT_DIFF dnl ** Find find command (for Win32's benefit) FP_PROG_FIND +dnl ** Find sort command (for the benefit of Win32 environs) +FP_PROG_SORT + dnl ** figure out how to do a BSD-ish install AC_PROG_INSTALL @@ -858,15 +863,12 @@ AC_PATH_PROGS(TarCmd,gtar tar,tar) dnl ** check for DocBook toolchain FP_CHECK_DOCBOOK_DTD -FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/xml/docbook/stylesheet/nwalsh /usr/share/sgml/docbook/docbook-xsl-stylesheets* /usr/share/sgml/docbook/xsl-stylesheets* /opt/kde?/share/apps/ksgmltools2/docbook/xsl /usr/share/docbook-xsl /usr/share/sgml/docbkxsl]) +FP_DIR_DOCBOOK_XSL([/usr/share/xml/docbook/stylesheet/nwalsh/current /usr/share/xml/docbook/stylesheet/nwalsh /usr/share/sgml/docbook/docbook-xsl-stylesheets* /usr/share/sgml/docbook/xsl-stylesheets* /opt/kde?/share/apps/ksgmltools2/docbook/xsl /usr/share/docbook-xsl /usr/share/sgml/docbkxsl /usr/local/share/xsl/docbook /sw/share/xml/xsl/docbook-xsl]) FP_PROG_FO_PROCESSOR dnl ** check for ghc-pkg command FP_PROG_GHC_PKG -dnl Check whether this GHC has readline installed -FPTOOLS_GHC_HAS_READLINE - AC_ARG_WITH(greencard, [AC_HELP_STRING([--with-greencard=ARG], [Use ARG as the path to greencard [default=autodetct]])], @@ -945,8 +947,6 @@ AC_SYS_LARGEFILE dnl ** check for specific header (.h) files that we are interested in AC_CHECK_HEADERS([bfd.h ctype.h dirent.h dlfcn.h errno.h fcntl.h grp.h limits.h locale.h nlist.h pthread.h pwd.h signal.h sys/mman.h sys/resource.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/utsname.h sys/wait.h termios.h time.h utime.h windows.h winsock.h]) -AC_CHECK_HEADER([unistd.h], [AC_CHECK_FUNCS(lchown)]) - AC_CHECK_HEADER([readline/readline.h], [HaveReadlineReadlineH=YES], [HaveReadlineReadlineH=NO]) AC_CHECK_HEADER([readline/history.h], [HaveReadlineHistoryH=YES], [HaveReadlineHistoryH=NO]) @@ -959,41 +959,9 @@ else fi AC_SUBST(GhcLibsWithReadline) -dnl ** check for OpenGL/GLUT include paths and libraries -FP_CHECK_GLUT - -if test x"$no_GLU" = xyes; then - GhcLibsWithOpenGL=NO -else - GhcLibsWithOpenGL=YES -fi -AC_SUBST([GhcLibsWithOpenGL]) - -if test x"$no_GLUT" = xyes; then - GhcLibsWithGLUT=NO -else - GhcLibsWithGLUT=YES -fi -AC_SUBST([GhcLibsWithGLUT]) - -dnl ** check for OpenGL include files -fp_save_cppflags="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $X_CFLAGS" -if test x"$use_quartz_opengl" = xyes; then - AC_CHECK_HEADERS([OpenGL/gl.h]) -else - AC_CHECK_HEADERS([GL/gl.h]) -fi -CPPFLAGS="$fp_save_cppflags" - dnl ** check if it is safe to include both and AC_HEADER_TIME -dnl ** check for POSIX regex -HavePosixRegex=NO -AC_CHECK_HEADERS([regex.h], [AC_CHECK_FUNCS(regcomp, [HavePosixRegex=YES])]) -AC_SUBST(HavePosixRegex) - dnl ** how do we get a timezone name, and UTC offset ? AC_STRUCT_TIMEZONE @@ -1041,24 +1009,6 @@ fi FP_CHECK_ALIGNMENT(unsigned short) FP_CHECK_ALIGNMENT(void *) -dnl ** Map OpenGL data types to Haskell types -if test $GhcLibsWithOpenGL = YES ; then -FPTOOLS_CHECK_HTYPE(GLboolean) -FPTOOLS_CHECK_HTYPE(GLbyte) -FPTOOLS_CHECK_HTYPE(GLubyte) -FPTOOLS_CHECK_HTYPE(GLshort) -FPTOOLS_CHECK_HTYPE(GLushort) -FPTOOLS_CHECK_HTYPE(GLint) -FPTOOLS_CHECK_HTYPE(GLuint) -FPTOOLS_CHECK_HTYPE(GLsizei) -FPTOOLS_CHECK_HTYPE(GLenum) -FPTOOLS_CHECK_HTYPE(GLbitfield) -FPTOOLS_CHECK_HTYPE(GLfloat) -FPTOOLS_CHECK_HTYPE(GLclampf) -FPTOOLS_CHECK_HTYPE(GLdouble) -FPTOOLS_CHECK_HTYPE(GLclampd) -fi - FP_CHECK_FUNC([WinExec], [@%:@include ], [WinExec("",0)]) @@ -1090,15 +1040,10 @@ if test "$ac_cv_type_signal" = void; then fi dnl ** check for more functions -AC_CHECK_FUNCS([ftime getclock getgrgid_r getgrnam_r getpagesize getpwnam_r getpwuid_r getpwnam getpwuid getrusage gettimeofday gmtime_r localtime_r lstat readdir_r readlink setenv setitimer siginterrupt symlink sysconf times unsetenv]) - -dnl ** Solaris2 needs additionl flag for getpw*_r() -case "$TargetPlatform" in - *-solaris2*) - unix_SRC_HSC2HS_OPTS="-D_POSIX_PTHREAD_SEMANTICS" - AC_SUBST(unix_SRC_HSC2HS_OPTS) - ;; -esac +dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too. +AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times]) +dnl ** For ghc/rts/gmp: +AC_CHECK_FUNCS([getpagesize]) dnl ** check whether this machine has gmp3 installed AC_CHECK_LIB(gmp, __gmpz_fdiv_qr, HaveLibGmp=YES; LibGmp=gmp, @@ -1141,11 +1086,6 @@ dnl the order of these tests matters: bfd needs liberty AC_CHECK_LIB(iberty, xmalloc) AC_CHECK_LIB(bfd, bfd_init) -dnl ** check for wide-char classifications -dnl FreeBSD has an emtpy wctype.h, so test one of the affected -dnl functions if it's really there. -AC_CHECK_HEADERS([wctype.h], [AC_CHECK_FUNCS(iswspace)]) - dnl ** check for readline, for Hugs and hslibs' Readline dnl ncurses supersedes termcap and curses, but for compatibility, dnl we have to check for all... @@ -1184,16 +1124,6 @@ dnl ** check for math library AC_CHECK_LIB([m], [atan], [LIBS="-lm $LIBS"; LIBM="-lm"], [LIBM=]) AC_SUBST([LIBM]) -dnl ** check for X Window System -AC_PATH_XTRA() - -if test "$no_x" = yes; then - GhcLibsWithX11=NO -else - GhcLibsWithX11=YES -fi -AC_SUBST([GhcLibsWithX11]) - dnl ################################################################ dnl Check for libraries dnl ################################################################ @@ -1298,37 +1228,6 @@ else AC_SUBST(HaveRtldNow) fi -dnl ---------- usleep ---------- -dnl --- stolen from guile configure --- -dnl --- FIXME: /usr/include/unistd.h can't be right? - -### On some systems usleep has no return value. If it does have one, -### we'd like to return it; otherwise, we'll fake it. -AC_CACHE_CHECK([return type of usleep], cv_func_usleep_return_type, - [AC_EGREP_HEADER(changequote(<, >)changequote([, ]), - /usr/include/unistd.h, - [cv_func_usleep_return_type=void], - [cv_func_usleep_return_type=int])]) -case "$cv_func_usleep_return_type" in - "void" ) - AC_DEFINE([USLEEP_RETURNS_VOID], [1], [Define if the system headers declare usleep to return void.]) - ;; -esac - -dnl -------------------------------------------------- -dnl * test for GTK+ -dnl -------------------------------------------------- - -AC_PATH_PROGS([GTK_CONFIG], [gtk-config gtk12-config]) -if test -n "$GTK_CONFIG"; then - AC_CACHE_CHECK([for version of GTK+], [fp_cv_gtk_version], - [fp_cv_gtk_version=`$GTK_CONFIG --version`]) - FP_COMPARE_VERSIONS([$fp_cv_gtk_version], [-lt], [1.2], - [AC_MSG_WARN([GTK+ not usable, need at least version 1.2]) - GTK_CONFIG=]) -fi -AC_SUBST([GTK_CONFIG]) - dnl -------------------------------------------------- dnl * Miscellaneous feature tests dnl -------------------------------------------------- @@ -1348,24 +1247,25 @@ AC_C_BIGENDIAN dnl ** check for leading underscores in symbol names FP_LEADING_UNDERSCORE -dnl ** check for ld, and whether ld has -x option -AC_PATH_PROG(LdCmdRaw, ld) -case $HostOS_CPP in - mingw32) - if test "${OSTYPE}" == "msys" - then - LdCmd=${LdCmdRaw} - else - LdCmd=`cygpath -w ${LdCmdRaw} | sed -e 's@\\\\@/@g' ` - fi - ;; - *) LdCmd=${LdCmdRaw} - ;; -esac -AC_SUBST(LdCmd) -FPTOOLS_LD_X +dnl ** check for ld, whether it has an -x option, and if it is GNU ld +FP_PROG_LD_X +FP_PROG_LD_IS_GNU + +dnl ** check for Apple-style dead-stripping support +dnl (.subsections-via-symbols assembler directive) + -FP_EMPTY_STRUCTS +AC_MSG_CHECKING(for .subsections_via_symbols) +AC_TRY_COMPILE(,[__asm__ (".subsections_via_symbols");], + [ + AC_MSG_RESULT(yes) + AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[1], + [Define to 1 if Apple-style dead-stripping is supported.]) + ], + [ + AC_DEFINE([HAVE_SUBSECTIONS_VIA_SYMBOLS],[0], + [Define to 1 if Apple-style dead-stripping is supported.]) + ]) AC_CONFIG_FILES([mk/config.mk]) AC_CONFIG_COMMANDS([mk/stamp-h],[echo timestamp > mk/stamp-h])