Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Enable building of shared libraries in generic tarball (ticket #198)

  • Loading branch information...
commit 92adcf04b4e41874b80c6ac1c865e9f972568b5b 1 parent c6561b1
@mzero mzero authored
View
4 NOTES-2012.4.0.0
@@ -36,7 +36,7 @@ TODO
[x] fix to build.hs (ticket #195)
[x] bugs in build.sh (ticket #197)
[x] build instructions in the tarball (ticket #207)
-[] merge in shared library patch (ticket #198)
+[x] merge in shared library patch (ticket #198)
MAC TODO
--------
@@ -59,4 +59,4 @@ WEB TODO
[] pretty up and update release timetable page (ticket #131)
-[] close tickets: 195, 197, 207
+[] close tickets: 195, 197, 198, 207
View
20 src/generic/tarball/configure.ac
@@ -104,6 +104,25 @@ AC_ARG_ENABLE(profiling,
[ENABLE_PROFILING=YES]
)
+# Not building shared libraries by default.
+AC_ARG_ENABLE(shared,
+[AC_HELP_STRING([--enable-shared],
+ [Build shared versions of libraries for dynamic linking. (default=disable)])],
+ [case "${enableval}" in
+ yes)
+ ENABLE_SHARED=YES
+ ;;
+ no)
+ ENABLE_SHARED=NO
+ ;;
+ *)
+ AC_MSG_ERROR([The --enable-shared value should be "yes" or "no"])
+ ;;
+ esac
+ ],
+ [ENABLE_SHARED=NO]
+)
+
AC_ARG_ENABLE(unsupported-ghc-version,
[AC_HELP_STRING([--enable-unsupported-ghc-version],
@@ -250,6 +269,7 @@ AC_SUBST([PERL])
AC_SUBST([USER_INSTALL])
AC_SUBST([ENABLE_PROFILING])
+AC_SUBST([ENABLE_SHARED])
AC_SUBST([ALLOW_UNSUPPORTED_GHC])
AC_OUTPUT
View
11 src/generic/tarball/scripts/build.sh
@@ -74,6 +74,12 @@ build_pkg () {
if test "${ENABLE_PROFILING}" = "YES"; then
CABAL_PROFILING_FLAG="--enable-library-profiling"
fi
+ if test "${ENABLE_SHARED}" = "YES"; then
+ CABAL_SHARED_FLAG="--enable-shared"
+
+ # Work around for Cabal's inability to pass this option
+ GHC_PKG_FLAG_SHARED="--ghc-option=-package-conf=../../${PACKAGE_DB}"
+ fi
# Work around for Cabal 1.8.0.2 not registering properly
GHC_PKG_FLAG=--ghc-pkg-option=--package-conf="../../${PACKAGE_DB}"
@@ -88,8 +94,9 @@ build_pkg () {
tell ./Setup configure --package-db="../../${PACKAGE_DB}" --prefix="${prefix}" \
--with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} \
${HAPPY_FLAG1} ${HAPPY_FLAG2} ${ALEX_FLAG} \
- ${CABAL_INSTALL_FLAG} ${CABAL_PROFILING_FLAG} \
- ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} ${GHC_PKG_FLAG} ${USER_PKG_FLAG} \
+ ${CABAL_INSTALL_FLAG} ${CABAL_PROFILING_FLAG} ${CABAL_SHARED_FLAG} \
+ ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} \
+ ${GHC_PKG_FLAG} ${GHC_PKG_FLAG_SHARED} ${USER_PKG_FLAG} \
|| die "Configuring the ${PKG} package failed"
tell ./Setup build ${VERBOSE} \
View
1  src/generic/tarball/scripts/config.in
@@ -17,3 +17,4 @@ PERL=@PERL@
ALLOW_UNSUPPORTED_GHC=@ALLOW_UNSUPPORTED_GHC@
USER_INSTALL=@USER_INSTALL@
ENABLE_PROFILING=@ENABLE_PROFILING@
+ENABLE_SHARED=@ENABLE_SHARED@

0 comments on commit 92adcf0

Please sign in to comment.
Something went wrong with that request. Please try again.