Ticket #198: haskell-platform-enable-shared.diff

File haskell-platform-enable-shared.diff, 2.9 kB (added by dogmaT, 3 years ago)

Patch that enables building shared libriaries. It is based on public HaskellPlatform? darcs repository.

  • src/generic/tarball/configure.ac

    diff -rN -u old-haskell-platform/src/generic/tarball/configure.ac new-haskell-platform/src/generic/tarball/configure.ac
    old new  
    104104  [ENABLE_PROFILING=YES] 
    105105) 
    106106 
     107# Not building shared libraries by default. 
     108AC_ARG_ENABLE(shared, 
     109[AC_HELP_STRING([--enable-shared], 
     110                [Build shared versions of libraries for dynamic linking. (default=disable)])], 
     111  [case "${enableval}" in 
     112     yes) 
     113       ENABLE_SHARED=YES 
     114       ;; 
     115     no) 
     116       ENABLE_SHARED=NO 
     117       ;; 
     118     *) 
     119       AC_MSG_ERROR([The --enable-shared value should be "yes" or "no"]) 
     120       ;; 
     121   esac 
     122  ], 
     123  [ENABLE_SHARED=NO] 
     124) 
     125 
    107126 
    108127AC_ARG_ENABLE(unsupported-ghc-version, 
    109128[AC_HELP_STRING([--enable-unsupported-ghc-version], 
     
    250269 
    251270AC_SUBST([USER_INSTALL]) 
    252271AC_SUBST([ENABLE_PROFILING]) 
     272AC_SUBST([ENABLE_SHARED]) 
    253273AC_SUBST([ALLOW_UNSUPPORTED_GHC]) 
    254274 
    255275AC_OUTPUT 
  • src/generic/tarball/scripts/build.sh

    diff -rN -u old-haskell-platform/src/generic/tarball/scripts/build.sh new-haskell-platform/src/generic/tarball/scripts/build.sh
    old new  
    7474  if test "${ENABLE_PROFILING}" = "YES"; then 
    7575    CABAL_PROFILING_FLAG="--enable-library-profiling" 
    7676  fi 
     77  if test "${ENABLE_SHARED}" = "YES"; then 
     78    CABAL_SHARED_FLAG="--enable-shared" 
     79 
     80    # Work around for Cabal's inability to pass this option 
     81    GHC_PKG_FLAG_SHARED="--ghc-option=-package-conf=../../${PACKAGE_DB}" 
     82  fi 
    7783 
    7884  # Work around for Cabal 1.8.0.2 not registering properly 
    7985  GHC_PKG_FLAG=--ghc-pkg-option=--package-conf="../../${PACKAGE_DB}"  
     
    8894  tell ./Setup configure --package-db="../../${PACKAGE_DB}" --prefix="${prefix}" \ 
    8995    --with-compiler=${GHC} --with-hc-pkg=${GHC_PKG} --with-hsc2hs=${HSC2HS} \ 
    9096    ${HAPPY_FLAG1} ${HAPPY_FLAG2} ${ALEX_FLAG} \ 
    91     ${CABAL_INSTALL_FLAG} ${CABAL_PROFILING_FLAG} \ 
    92     ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} ${GHC_PKG_FLAG} ${USER_PKG_FLAG} \ 
     97    ${CABAL_INSTALL_FLAG} ${CABAL_PROFILING_FLAG} ${CABAL_SHARED_FLAG} \ 
     98    ${EXTRA_CONFIGURE_OPTS} ${VERBOSE} \ 
     99    ${GHC_PKG_FLAG} ${GHC_PKG_FLAG_SHARED} ${USER_PKG_FLAG} \ 
    93100    || die "Configuring the ${PKG} package failed" 
    94101 
    95102  tell ./Setup build ${VERBOSE} \ 
  • src/generic/tarball/scripts/config.in

    diff -rN -u old-haskell-platform/src/generic/tarball/scripts/config.in new-haskell-platform/src/generic/tarball/scripts/config.in
    old new  
    1717ALLOW_UNSUPPORTED_GHC=@ALLOW_UNSUPPORTED_GHC@ 
    1818USER_INSTALL=@USER_INSTALL@ 
    1919ENABLE_PROFILING=@ENABLE_PROFILING@ 
     20ENABLE_SHARED=@ENABLE_SHARED@