]> git.lyx.org Git - lyx.git/blobdiff - config/lyxinclude.m4
LogUi.ui: string redundancy.
[lyx.git] / config / lyxinclude.m4
index 23bb3fc96e2813923d90009752f63c35c7ec6ac0..446dce894e462b1de813f6b7ff99cfe224c704e8 100644 (file)
@@ -14,7 +14,7 @@ build_type=release
 AC_MSG_CHECKING([for build type])
 AC_ARG_ENABLE(build-type,
   AC_HELP_STRING([--enable-build-type=TYPE],[set build setting according to TYPE=dev(elopment), rel(ease) or pre(release)]),
-  [case $enableval in 
+  [case $enableval in
     dev*) lyx_devel_version=yes
           build_type=development;;
     pre*) lyx_prerelease=yes
@@ -48,7 +48,7 @@ AC_ARG_WITH(version-suffix,
   [if test "x$withval" = "xyes";
    then
      withval="-"AC_PACKAGE_VERSION
-     ac_configure_args=`echo $ac_configure_args | sed "s,--with-version-suffix,--with-version-suffix=$withval,"`
+     ac_configure_args=`echo "$ac_configure_args" | sed "s,--with-version-suffix,--with-version-suffix=$withval,"`
    fi
    AC_SUBST(version_suffix,$withval)
    RPM_VERSION_SUFFIX="--with-version-suffix=$withval"])
@@ -423,12 +423,27 @@ fi])
 dnl Usage: LYX_USE_INCLUDED_BOOST : select if the included boost should
 dnl        be used.
 AC_DEFUN([LYX_USE_INCLUDED_BOOST],[
+       AC_MSG_CHECKING([whether to use boost included library])
        AC_ARG_WITH(included-boost,
            [  --without-included-boost  do not use the boost lib supplied with LyX, try to find one in the system directories - compilation will abort if nothing suitable is found],
-           [lyx_cv_with_included_boost=$withval
-               AC_MSG_RESULT([$with_included_boost])],
+           [lyx_cv_with_included_boost=$withval],
            [lyx_cv_with_included_boost=yes])
        AM_CONDITIONAL(USE_INCLUDED_BOOST, test x$lyx_cv_with_included_boost = xyes)
+       AC_MSG_RESULT([$lyx_cv_with_included_boost])
+       if test x$lyx_cv_with_included_boost != xyes ; then
+               AC_CHECK_LIB(boost_signals, main, [lyx_boost_underscore=yes], [], [-lm])
+               AC_CHECK_LIB(boost_signals-mt, main, [lyx_boost_underscore_mt=yes], [], [-lm $LIBTHREAD])
+               if test x$lyx_boost_underscore_mt = xyes ; then
+                       BOOST_MT="-mt"
+               else
+                       BOOST_MT=""
+                       if test x$lyx_boost_plain != xyes -a x$lyx_boost_underscore != xyes ; then
+                               LYX_ERROR([No suitable boost library found (do not use --without-included-boost)])
+                       fi
+               fi
+               AC_SUBST(BOOST_SEP)
+               AC_SUBST(BOOST_MT)
+       fi
 ])
 
 
@@ -595,32 +610,40 @@ AC_ARG_WITH(packaging,
   esac])
 AC_MSG_RESULT($lyx_use_packaging)
 lyx_install_macosx=false
+lyx_install_cygwin=false
 case $lyx_use_packaging in
    macosx) AC_DEFINE(USE_MACOSX_PACKAGING, 1, [Define to 1 if LyX should use a MacOS X application bundle file layout])
           PACKAGE=LyX${version_suffix}
           default_prefix="/Applications/${PACKAGE}.app"
           bindir='${prefix}/Contents/MacOS'
           libdir='${prefix}/Contents/Resources'
-          datadir='${prefix}/Contents/Resources'
+          datarootdir='${prefix}/Contents/Resources'
           pkgdatadir='${datadir}'
-          mandir='${datadir}/man' 
+          mandir='${datadir}/man'
           lyx_install_macosx=true ;;
   windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout])
           PACKAGE=LyX${version_suffix}
           default_prefix="C:/Program Files/${PACKAGE}"
           bindir='${prefix}/bin'
           libdir='${prefix}/Resources'
-          datadir='${prefix}/Resources'
+          datarootdir='${prefix}/Resources'
           pkgdatadir='${datadir}'
           mandir='${prefix}/Resources/man' ;;
     posix) AC_DEFINE(USE_POSIX_PACKAGING, 1, [Define to 1 if LyX should use a POSIX-style file layout])
           PACKAGE=lyx${version_suffix}
           program_suffix=$version_suffix
           pkgdatadir='${datadir}/${PACKAGE}'
-          default_prefix=$ac_default_prefix ;;
+          default_prefix=$ac_default_prefix
+          case ${host} in
+          *cygwin*) lyx_install_cygwin=true ;;
+          esac ;;
     *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
 esac
 AM_CONDITIONAL(INSTALL_MACOSX, $lyx_install_macosx)
+AM_CONDITIONAL(INSTALL_CYGWIN, $lyx_install_cygwin)
+dnl Next two lines are only for autoconf <= 2.59
+datadir='${datarootdir}'
+AC_SUBST(datarootdir)
 AC_SUBST(pkgdatadir)
 AC_SUBST(program_suffix)
 ])
@@ -688,7 +711,7 @@ fi
 
 
 dnl Set VAR to the canonically resolved absolute equivalent of PATHNAME,
-dnl (which may be a relative path, and need not refer to any existing 
+dnl (which may be a relative path, and need not refer to any existing
 dnl entity).
 
 dnl On Win32-MSYS build hosts, the returned path is resolved to its true
@@ -732,8 +755,8 @@ do
 done])
 
 dnl Extract the single digits from PACKAGE_VERSION and make them available.
-dnl Defines LYX_MAJOR_VERSION, LYX_MINOR_VERSION, LYX_RELEASE_LEVEL, and
-dnl LYX_RELEASE_PATCH, the latter being possibly equal to 0.
+dnl Defines LYX_MAJOR_VERSION, LYX_MINOR_VERSION, LYX_RELEASE_LEVEL,
+dnl LYX_RELEASE_PATCH (possibly equal to 0), LYX_DIR_VER, and LYX_USERDIR_VER.
 AC_DEFUN([LYX_SET_VERSION_INFO],
 [lyx_major=`echo $PACKAGE_VERSION | sed -e 's/[[.]].*//'`
  lyx_patch=`echo $PACKAGE_VERSION | sed -e "s/^$lyx_major//" -e 's/^.//'`
@@ -742,8 +765,12 @@ AC_DEFUN([LYX_SET_VERSION_INFO],
  lyx_release=`echo $lyx_patch | sed -e 's/[[^0-9]].*//'`
  lyx_patch=`echo $lyx_patch | sed -e "s/^$lyx_release//" -e 's/^[[.]]//' -e 's/[[^0-9]].*//'`
  test "x$lyx_patch" = "x" && lyx_patch=0
+ lyx_dir_ver=LYX_DIR_${lyx_major}${lyx_minor}x
+ lyx_userdir_ver=LYX_USERDIR_${lyx_major}${lyx_minor}x
  AC_SUBST(LYX_MAJOR_VERSION,$lyx_major)
  AC_SUBST(LYX_MINOR_VERSION,$lyx_minor)
  AC_SUBST(LYX_RELEASE_LEVEL,$lyx_release)
  AC_SUBST(LYX_RELEASE_PATCH,$lyx_patch)
+ AC_SUBST(LYX_DIR_VER,"$lyx_dir_ver")
+ AC_SUBST(LYX_USERDIR_VER,"$lyx_userdir_ver")
 ])