# HG changeset patch # User John Donoghue # Date 1386638594 18000 # Node ID cfcbe03c9160b465e48ede9c13eece734a6e7719 # Parent ab6116aa10393798004e7ec105b0349be796f5e4 installer: Enable documentation build and add to installer. * makefile: add ENABLE_DOCS variable. * configure.ac: add --enable-docs arg (default yes) * makeinst-script.sh: - fix some \ vs \\ issues in script. - add shortcuts for documentation (if docs were created) * octave.mk: use --enable-docs if ENABLE_DOCS variable is yes, and install html and PDF docs. diff -r ab6116aa1039 -r cfcbe03c9160 Makefile.in --- a/Makefile.in Sun Dec 08 20:51:14 2013 -0500 +++ b/Makefile.in Mon Dec 09 20:23:14 2013 -0500 @@ -47,6 +47,9 @@ # Attempt to build LLVM and enable Octave's experimental JIT compiler. ENABLE_JIT := @ENABLE_JIT@ +# Build octave docs +ENABLE_DOCS := @ENABLE_DOCS@ + # Use openblas for octave ENABLE_OPENBLAS := @ENABLE_OPENBLAS@ diff -r ab6116aa1039 -r cfcbe03c9160 configure.ac --- a/configure.ac Sun Dec 08 20:51:14 2013 -0500 +++ b/configure.ac Mon Dec 09 20:23:14 2013 -0500 @@ -86,6 +86,12 @@ [if test "$enableval" = no; then ENABLE_JAVA=no; fi], []) AC_SUBST(ENABLE_JAVA) +ENABLE_DOCS=yes +AC_ARG_ENABLE([docs], + [AS_HELP_STRING([--disable-docs], [Disable Octave docs])], + [if test "$enableval" = no; then ENABLE_DOCS=no; fi], []) +AC_SUBST(ENABLE_DOCS) + MXE_NATIVE_BUILD=no AC_ARG_ENABLE([native-build], [AS_HELP_STRING([--enable-native-build], diff -r ab6116aa1039 -r cfcbe03c9160 makeinst-script.sh --- a/makeinst-script.sh Sun Dec 08 20:51:14 2013 -0500 +++ b/makeinst-script.sh Mon Dec 09 20:23:14 2013 -0500 @@ -15,7 +15,7 @@ cd $TOPDIR -# find icon +# find octave shortcut icon ICON=`find $OCTAVE_SOURCE -name octave-logo.ico -printf "%P" | head -1 | sed 's,/,\\\\,g'` # extract version number @@ -39,7 +39,7 @@ !define MAIN_APP_EXE "octave.exe" !define INSTALL_TYPE "SetShellVarContext current" !define PRODUCT_ROOT_KEY "HKLM" -!define PRODUCT_KEY "Software\Octave" +!define PRODUCT_KEY "Software\\Octave" ###################################################################### @@ -59,7 +59,7 @@ BrandingText "\${APP_NAME}" XPStyle on InstallDir "C:\\Octave\\Octave-\${OCTAVE_VERSION}" -Icon "$OCTAVE_SOURCE\\$ICON" +Icon "\${INSTALLER_FILES}/octave-logo.ico" ###################################################################### ; MUI settings @@ -85,7 +85,7 @@ !insertmacro MUI_PAGE_INSTFILES -!define MUI_FINISHPAGE_RUN "\$INSTDIR\bin\\\${MAIN_APP_EXE}" +!define MUI_FINISHPAGE_RUN "\$INSTDIR\\bin\\\${MAIN_APP_EXE}" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM @@ -129,7 +129,7 @@ ; Write the uninstall keys for Windows SetOutPath "\$INSTDIR" WriteRegStr HKLM "Software\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "DisplayName" "Octave" - WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "UninstallString" "\$INSTDIR\uninstall.exe" + WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "UninstallString" "\$INSTDIR\\uninstall.exe" WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoModify" 1 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" "NoRepair" 1 WriteUninstaller "uninstall.exe" @@ -140,19 +140,34 @@ CreateDirectory "\$SMPROGRAMS\\Octave" CreateShortCut "\$SMPROGRAMS\\Octave\\Uninstall.lnk" "\$INSTDIR\\uninstall.exe" "" "\$INSTDIR\\uninstall.exe" 0 - CreateShortCut "\$SMPROGRAMS\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0 - CreateShortCut "\$SMPROGRAMS\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0 - + CreateShortCut "\$SMPROGRAMS\\Octave\\Octave.lnk" "\$INSTDIR\\bin\\octave.exe" "" "\$INSTDIR\\$ICON" 0 + CreateShortCut "\$SMPROGRAMS\\Octave\\Octave (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0 +EOF + # if we have documentation files, create shortcuts + if [ -d $OCTAVE_SOURCE/share/doc/octave ]; then + cat >> octave.nsi << EOF + CreateDirectory "\$SMPROGRAMS\\Octave\\Documentation" + CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave C++ Classes (PDF).lnk" "\$INSTDIR\\share\\doc\\octave\\liboctave.pdf" "" "" 0 + CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave C++ Classes (HTML).lnk" "\$INSTDIR\\share\\doc\\octave\\liboctave.html\\index.html" "" "" 0 + CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave (PDF).lnk" "\$INSTDIR\\share\\doc\\octave\\octave.pdf" "" "" 0 + CreateShortCut "\$SMPROGRAMS\\Octave\\Documentation\\Octave (HTML).lnk" "\$INSTDIR\\share\\doc\\octave\\octave.html\\index.html" "" "" 0 +EOF + fi + + cat >> octave.nsi << EOF SectionEnd Section "Uninstall" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Octave" - DeleteRegKey HKLM "Software\Octave" + DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave" + DeleteRegKey HKLM "Software\\Octave" ; Remove shortcuts - Delete "\$SMPROGRAMS\Octave\*.*" - RMDir "\$SMPROGRAMS\Octave" + Delete "\$SMPROGRAMS\\Octave\\Documentation\\*.*" + RMDir "\$SMPROGRAMS\\Octave\\Documentation" + + Delete "\$SMPROGRAMS\\Octave\\*.*" + RMDir "\$SMPROGRAMS\\Octave" EOF @@ -197,9 +212,9 @@ Goto done is_error: StrCpy \$1 \$0 - ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" ProductName + ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion" ProductName IfErrors 0 +4 - ReadRegStr \$0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" Version + ReadRegStr \$0 HKLM "SOFTWARE\\Microsoft\\Windows\\CurrentVersion" Version IfErrors 0 +2 StrCpy \$0 "Unknown" MessageBox MB_ICONSTOP|MB_OK "This version of Octave cannot be installed on this system. Octave is supported only on Windows NT systems. Current system: \$0 (version: \$1)" @@ -214,7 +229,7 @@ Push \$0 Push \$1 Push \$2 - IfFileExists "\$INSTDIR\bin\octave-\${OCTAVE_VERSION}.exe" 0 otherver + IfFileExists "\$INSTDIR\\bin\\octave-\${OCTAVE_VERSION}.exe" 0 otherver MessageBox MB_OK|MB_ICONSTOP "Another Octave installation (with the same version) has been detected. Please uninstall it first." Abort otherver: @@ -260,13 +275,13 @@ ClearErrors ReadEnvStr \$R0 "JAVA_HOME" - StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}" + StrCpy \$R0 "\$R0\\bin\\\${JAVAEXE}" IfErrors 0 continue ;; 1) found it in JAVA_HOME ClearErrors - ReadRegStr \$R1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion" - ReadRegStr \$R0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\\\$R1" "JavaHome" - StrCpy \$R0 "\$R0\bin\\\${JAVAEXE}" + ReadRegStr \$R1 HKLM "SOFTWARE\\JavaSoft\\Java Runtime Environment" "CurrentVersion" + ReadRegStr \$R0 HKLM "SOFTWARE\\JavaSoft\\Java Runtime Environment\\\$R1" "JavaHome" + StrCpy \$R0 "\$R0\\bin\\\${JAVAEXE}" IfErrors 0 continue ;; 2) found it in the registry IfErrors JRE_Error diff -r ab6116aa1039 -r cfcbe03c9160 src/octave.mk --- a/src/octave.mk Sun Dec 08 20:51:14 2013 -0500 +++ b/src/octave.mk Mon Dec 09 20:23:14 2013 -0500 @@ -22,6 +22,10 @@ $(PKG)_ENABLE_JAVA_CONFIGURE_OPTIONS := --disable-java endif +ifeq ($(ENABLE_DOCS),yes) + $(PKG)_ENABLE_DOCS_CONFIGURE_OPTIONS := --enable-docs +endif + ifeq ($(ENABLE_OPENBLAS),yes) $(PKG)_DEPS += openblas $(PKG)_BLAS_OPTION := --with-blas=openblas @@ -80,6 +84,7 @@ $($(PKG)_ENABLE_64_CONFIGURE_OPTIONS) \ $($(PKG)_ENABLE_JAVA_CONFIGURE_OPTIONS) \ $($(PKG)_ENABLE_JIT_CONFIGURE_OPTIONS) \ + $($(PKG)_ENABLE_DOCS_CONFIGURE_OPTIONS) \ $($(PKG)_EXTRA_CONFIGURE_OPTIONS) \ PKG_CONFIG='$(MXE_PKG_CONFIG)' \ PKG_CONFIG_PATH='$(HOST_LIBDIR)/pkgconfig' \ @@ -89,6 +94,11 @@ ## location set by the configure --prefix option, and the other ## in a directory tree that will have just Octave files. $(MAKE) -C '$(1)/.build' -j '$(JOBS)' install DESTDIR='$(3)' + + if [ "x$(ENABLE_DOCS)" == "xyes" ]; then \ + $(MAKE) -C '$(1)/.build' -j '$(JOBS)' DESTDIR=$(3) install-pdf install-html; \ + fi + if [ $(MXE_SYSTEM) != msvc ]; then \ $(MAKE) -C '$(1)/.build' -j '$(JOBS)' DESTDIR=$(TOP_DIR)/octave install; \ fi