Commit ca5ded31 authored by Ian Lynagh's avatar Ian Lynagh

Have configure take arguments telling it where gmp is; fixes trac #957

parent 642ac8a0
......@@ -1054,4 +1054,26 @@ case $fptools_cv_timer_create_works in
esac
])
# FP_ARG_GMP
# -------------
AC_DEFUN([FP_ARG_GMP],
[
AC_ARG_WITH([gmp-includes],
[AC_HELP_STRING([--with-gmp-includes],
[directory containing gmp.h])],
[gmp_includes=$withval],
[gmp_includes=NONE])
AC_ARG_WITH([gmp-libraries],
[AC_HELP_STRING([--with-gmp-libraries],
[directory containing gmp library])],
[gmp_libraries=$withval],
[gmp_libraries=NONE])
])# FP_ARG_GMP
AC_DEFUN([CHECK_GMP],
[AC_REQUIRE([AC_PROG_CPP])
AC_REQUIRE([AC_PROG_CC])
])
# LocalWords: fi
......@@ -63,6 +63,25 @@ if test x"$srcdir" != 'x.' ; then
exit 1
fi
dnl--------------------------------------------------------------------
dnl * Deal with arguments telling us gmp is somewhere odd
dnl--------------------------------------------------------------------
FP_ARG_GMP
GMP_INCLUDE_DIRS=
GMP_LIB_DIRS=
if test "x$gmp_libraries" != "xNONE"; then
LDFLAGS="-L$gmp_libraries $LDFLAGS"
GMP_LIB_DIRS=$gmp_libraries
fi
if test "x$gmp_includes" != "xNONE"; then
CPPFLAGS="-I$gmp_includes $CPPFLAGS"
GMP_INCLUDE_DIRS=$gmp_includes
fi
AC_SUBST(GMP_INCLUDE_DIRS)
AC_SUBST(GMP_LIB_DIRS)
dnl--------------------------------------------------------------------
dnl * Choose host(/target/build) platform
dnl--------------------------------------------------------------------
......
......@@ -882,6 +882,9 @@ endif
HaveLibGmp = @HaveLibGmp@
LibGmp = @LibGmp@
GMP_INCLUDE_DIRS=@GMP_INCLUDE_DIRS@
GMP_LIB_DIRS=@GMP_LIB_DIRS@
#-----------------------------------------------------------------------------
# GMP framework (Mac OS X)
#
......
......@@ -292,6 +292,24 @@ endif
CLEAN_FILES += gmp/libgmp.a
# Need to get the GMP vars in through CPP to package.conf.in, and put
# quotes around each element.
empty =
space = $(empty) $(empty)
comma = ,
PACKAGE_CPP_OPTS += -DGMP_INCLUDE_DIRS='$(subst $(space),$(comma),$(patsubst %,"%",$(strip $(GMP_INCLUDE_DIRS))))'
PACKAGE_CPP_OPTS += -DGMP_LIB_DIRS='$(subst $(space),$(comma),$(patsubst %,"%",$(strip $(GMP_LIB_DIRS))))'
ifneq "$(GMP_INCLUDE_DIRS)" ""
SRC_HC_OPTS += -I$(GMP_INCLUDE_DIRS)
SRC_CC_OPTS += -I$(GMP_INCLUDE_DIRS)
SRC_HSC2HS_OPTS += -I$(GMP_INCLUDE_DIRS)
endif
ifneq "$(GMP_LIB_DIRS)" ""
SRC_LD_OPTS += -L$(GMP_LIB_DIRS)
endif
#-----------------------------------------------------------------------------
#
# Building the GUM SysMan
......
......@@ -15,13 +15,13 @@ hidden-modules:
import-dirs:
#ifdef INSTALLING
library-dirs: LIB_DIR
library-dirs: LIB_DIR GMP_LIB_DIRS
# ifdef mingw32_HOST_OS
, LIB_DIR"/gcc-lib"
/* force the dist-provided gcc-lib/ into scope. */
# endif
#else /* !INSTALLING */
library-dirs: FPTOOLS_TOP_ABS"/rts"
library-dirs: FPTOOLS_TOP_ABS"/rts" GMP_LIB_DIRS
# if !defined(HAVE_LIBGMP) && !defined(HAVE_FRAMEWORK_GMP)
, FPTOOLS_TOP_ABS"/rts/gmp"
# endif
......@@ -58,7 +58,7 @@ extra-libraries: "m" /* for ldexp() */
#endif
#ifdef INSTALLING
include-dirs: INCLUDE_DIR
include-dirs: INCLUDE_DIR GMP_INCLUDE_DIRS
# ifdef mingw32_HOST_OS
, INCLUDE_DIR"/mingw"
# endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment