]> git.lyx.org Git - lyx.git/blobdiff - config/lyxinclude.m4
make "make distcheck" work
[lyx.git] / config / lyxinclude.m4
index d1b3b8488fd72f99258bd01512c71cd3ca523e28..15f28fe870713c6c8c3a013a525ed0eefaae45a5 100644 (file)
@@ -550,6 +550,39 @@ AC_SUBST(FRONTENDS_PROGS)
 ])
 
 
+## Check what kind of packaging should be used at install time. 
+## The default is autodetected. 
+AC_DEFUN([LYX_USE_PACKAGING],
+[AC_MSG_CHECKING([what packaging should be used])
+AC_ARG_WITH(packaging,
+  [  --with-packaging=THIS   Use THIS packaging for installation:
+                           Possible values: posix, windows, macosx],
+  [lyx_use_packaging="$withval"], [
+  case $host in
+    *-apple-darwin*) lyx_use_packaging=macosx ;;
+     *-pc-mingw32*) lyx_use_packaging=windows;;
+                  *) lyx_use_packaging=posix;;
+  esac])
+AC_MSG_RESULT($lyx_use_packaging)
+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]) 
+           default_prefix="/Applications/LyX.app"
+          bindir='${prefix}/Contents/MacOS'
+          libdir='${prefix}/Contents/Resources'
+          datadir='${prefix}/Contents/Resources'
+          mandir='${prefix}/Contents/Resources/man' ;;
+  windows) AC_DEFINE(USE_WINDOWS_PACKAGING, 1, [Define to 1 if LyX should use a Windows-style file layout]) 
+           default_prefix="C:/Program Files/LyX"
+          bindir='${prefix}/bin'
+          libdir='${prefix}/Resources'
+          datadir='${prefix}/Resources'
+          mandir='${prefix}/Resources/man' ;;
+    posix) AC_DEFINE(USE_POSIX_PACKAGING, 1, [Define to 1 if LyX should use a POSIX-style file layout]) 
+          default_prefix=$ac_default_prefix ;;
+    *) LYX_ERROR([Unknown packaging type $lyx_use_packaging]) ;;
+esac
+])
+
 
 ## ------------------------------------------------------------------------
 ## Find a file (or one of more files in a list of dirs)