From 0a1f68edebf6206adf9c7f776a69277727ffcf63 Mon Sep 17 00:00:00 2001 From: DRC Date: Wed, 24 Feb 2010 07:24:26 +0000 Subject: [PATCH] Visual C++ libraries can't be made to work with MinGW because of the dependency on msvcr90.dll, so build a separate installer for MinGW libraries git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@151 632fc199-4ca6-4c93-a231-07263d6284db --- BUILDING.txt | 12 +++++-- Makefile.am | 5 +++ README-turbo.txt | 56 +++++++++++++---------------- release/libjpeg-turbo.nsi | 75 +++++++++++++++++++++++++-------------- win/Makefile | 10 ++---- 5 files changed, 90 insertions(+), 68 deletions(-) diff --git a/BUILDING.txt b/BUILDING.txt index 9611766..a3cea30 100644 --- a/BUILDING.txt +++ b/BUILDING.txt @@ -293,8 +293,14 @@ make udmg later, whereas the 64-bit fork is compatible with OS X 10.6 and later. OS X 10.4 compatibility SDK required. +make nsi + + When using MinGW, this creates a Win32 installer for the GCC version of the + libjpeg-turbo SDK. This requires the Nullsoft Install System + (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH. + make -f win/Makefile dist - This creates a Win32 installer for the libjpeg-turbo SDK. This requires the - Nullsoft Install System (http://nsis.sourceforge.net/.) makensis.exe should - be in your PATH. + This creates a Win32 installer for the Visual C++ version of the + libjpeg-turbo SDK. This requires the Nullsoft Install System + (http://nsis.sourceforge.net/.) makensis.exe should be in your PATH. diff --git a/Makefile.am b/Makefile.am index 08dc1b3..407ed58 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,3 +164,8 @@ sunpkg: all ${DEBARCH} ${srcdir} $(CC) $(CXX) endif + +nsi: all + makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo-gcc \ + -DWLIBDIR=.libs -DWSRCDIR=$(srcdir) -DWBLDDIR=. -DWHDRDIR=. \ + -DPLATFORM="GCC" -DGCC $(srcdir)/release/libjpeg-turbo.nsi diff --git a/README-turbo.txt b/README-turbo.txt index ccf7d7e..684f9f4 100755 --- a/README-turbo.txt +++ b/README-turbo.txt @@ -117,23 +117,34 @@ of libjpeg by setting ({lib} = lib, lib32, lib64, or lib/amd64, as appropriate.) -This is useful, for instance, if you want to build an application that -leverages the libjpeg-turbo colorspace extensions (see below.) On Linux and -Solaris systems, you would still need to manipulate the LD_LIBRARY_PATH or sym -links appropriately to use libjpeg-turbo at run time. On such systems, you can -pass -R /opt/libjpeg-turbo/{lib} to the linker to force the use of -libjpeg-turbo at run time rather than libjpeg (also useful if you want to -leverage the colorspace extensions), or you can link against the libjpeg-turbo -static library. - -To force a Linux or Solaris application to link against the static version of -libjpeg-turbo, you can use the following linker options: +If using Cygwin, then set + + CPATH=/cygdrive/c/libjpeg-turbo-gcc/include + and + LIBRARY_PATH=/cygdrive/c/libjpeg-turbo-gcc/lib + +If using MinGW, then set + + CPATH=/c/libjpeg-turbo-gcc/include + and + LIBRARY_PATH=/c/libjpeg-turbo-gcc/lib + +Building against libjpeg-turbo is useful, for instance, if you want to build an +application that leverages the libjpeg-turbo colorspace extensions (see below.) +On Linux and Solaris systems, you would still need to manipulate the +LD_LIBRARY_PATH or sym links appropriately to use libjpeg-turbo at run time. +On such systems, you can pass -R /opt/libjpeg-turbo/{lib} to the linker to +force the use of libjpeg-turbo at run time rather than libjpeg (also useful if +you want to leverage the colorspace extensions), or you can link against the +libjpeg-turbo static library. + +To force a Linux, Solaris, or MinGW application to link against the static +version of libjpeg-turbo, you can use the following linker options: -Wl,-Bstatic -ljpeg -Wl,-Bdynamic -or you can simply add /opt/libjpeg-turbo/{lib}/libjpeg.a to the linker command -line (the latter is the only way to link against the static version of -libjpeg-turbo on OS X.) +On OS X, simply add /opt/libjpeg-turbo/{lib}/libjpeg.a to the linker command +line (this also works on Linux and Solaris.) To build Visual C++ applications using libjpeg-turbo, add c:\libjpeg-turbo\include to your system or user INCLUDE environment variable @@ -141,23 +152,6 @@ and c:\libjpeg-turbo\lib to your system or user LIB environment variable, and then link against either jpeg.lib (to use jpeg62.dll) or jpeg-static.lib (to use the static version of libjpeg-turbo.) -If building an application using Cygwin, then set - - CPATH=/cygdrive/c/libjpeg-turbo/include - and - LIBRARY_PATH=/cygdrive/c/libjpeg-turbo/lib - -If using MinGW, then set - - CPATH=/c/libjpeg-turbo/include - and - LIBRARY_PATH=/c/libjpeg-turbo/lib - -and link using -ljpeg in both cases. NOTE: The static libraries shipped with -the Windows version of libjpeg-turbo cannot be used with MinGW and Cygwin. If -you wish to link statically with libjpeg-turbo using MinGW or Cygwin, then you -will need to build libjpeg-turbo from source using GCC. - ===================== Colorspace Extensions ===================== diff --git a/release/libjpeg-turbo.nsi b/release/libjpeg-turbo.nsi index 61923b5..6142d66 100644 --- a/release/libjpeg-turbo.nsi +++ b/release/libjpeg-turbo.nsi @@ -1,6 +1,6 @@ -Name "libjpeg-turbo SDK" -OutFile ${WSRCDIR}\libjpeg-turbo.exe -InstallDir ${WINSTDIR} +Name "libjpeg-turbo SDK for ${PLATFORM}" +OutFile ${WBLDDIR}\${APPNAME}.exe +InstallDir c:\${APPNAME} SetCompressor bzip2 @@ -10,35 +10,47 @@ Page instfiles UninstPage uninstConfirm UninstPage instfiles -Section "libjpeg-turbo SDK (required)" +Section "libjpeg-turbo SDK for ${PLATFORM} (required)" SectionIn RO SetOutPath $SYSDIR - File "${WSRCDIR}\turbojpeg.dll" - File "${WSRCDIR}\jpeg62.dll" +!ifdef GCC + File "${WLIBDIR}\libturbojpeg.dll" + File "${WLIBDIR}\libjpeg-62.dll" +!else + File "${WLIBDIR}\turbojpeg.dll" + File "${WLIBDIR}\jpeg62.dll" +!endif SetOutPath $INSTDIR\lib - File "${WSRCDIR}\turbojpeg.lib" - File "${WSRCDIR}\turbojpeg-static.lib" - File "${WSRCDIR}\jpeg.lib" - File "${WSRCDIR}\jpeg-static.lib" +!ifdef GCC + File "${WLIBDIR}\libturbojpeg.dll.a" + File "${WLIBDIR}\libturbojpeg.a" + File "${WLIBDIR}\libjpeg.dll.a" + File "${WLIBDIR}\libjpeg.a" +!else + File "${WLIBDIR}\turbojpeg.lib" + File "${WLIBDIR}\turbojpeg-static.lib" + File "${WLIBDIR}\jpeg.lib" + File "${WLIBDIR}\jpeg-static.lib" +!endif SetOutPath $INSTDIR\include - File "win\jconfig.h" - File "jerror.h" - File "jmorecfg.h" - File "jpeglib.h" - File "turbojpeg.h" + File "${WHDRDIR}\jconfig.h" + File "${WSRCDIR}\jerror.h" + File "${WSRCDIR}\jmorecfg.h" + File "${WSRCDIR}\jpeglib.h" + File "${WSRCDIR}\turbojpeg.h" SetOutPath $INSTDIR - File "README" - File "README-turbo.txt" - File "libjpeg.doc" - File "LGPL.txt" - File "LICENSE.txt" + File "${WSRCDIR}\README" + File "${WSRCDIR}\README-turbo.txt" + File "${WSRCDIR}\libjpeg.doc" + File "${WSRCDIR}\LGPL.txt" + File "${WSRCDIR}\LICENSE.txt" - WriteRegStr HKLM "SOFTWARE\libjpeg-turbo ${VERSION}" "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "SOFTWARE\${APPNAME} ${VERSION}" "Install_Dir" "$INSTDIR" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libjpeg-turbo ${VERSION}" "DisplayName" "libjpeg-turbo SDK ${VERSION}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libjpeg-turbo ${VERSION}" "UninstallString" '"$INSTDIR\uninstall_${VERSION}.exe"' - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libjpeg-turbo ${VERSION}" "NoModify" 1 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libjpeg-turbo ${VERSION}" "NoRepair" 1 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "DisplayName" "libjpeg-turbo SDK v${VERSION} for ${PLATFORM}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "UninstallString" '"$INSTDIR\uninstall_${VERSION}.exe"' + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoRepair" 1 WriteUninstaller "uninstall_${VERSION}.exe" SectionEnd @@ -46,15 +58,24 @@ Section "Uninstall" SetShellVarContext all - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\libjpeg-turbo ${VERSION}" - DeleteRegKey HKLM "SOFTWARE\libjpeg-turbo ${VERSION}" + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" + DeleteRegKey HKLM "SOFTWARE\${APPNAME} ${VERSION}" +!ifdef GCC + Delete $SYSDIR\libjpeg-62.dll + Delete $SYSDIR\libturbojpeg.dll + Delete $INSTDIR\lib\libturbojpeg.dll.a" + Delete $INSTDIR\lib\libturbojpeg.a" + Delete $INSTDIR\lib\libjpeg.dll.a" + Delete $INSTDIR\lib\libjpeg.a" +!else Delete $SYSDIR\jpeg62.dll Delete $SYSDIR\turbojpeg.dll Delete $INSTDIR\lib\jpeg.lib Delete $INSTDIR\lib\jpeg-static.lib Delete $INSTDIR\lib\turbojpeg.lib Delete $INSTDIR\lib\turbojpeg-static.lib +!endif Delete $INSTDIR\include\jconfig.h" Delete $INSTDIR\include\jerror.h" Delete $INSTDIR\include\jmorecfg.h" diff --git a/win/Makefile b/win/Makefile index 4fdd58f..382857c 100755 --- a/win/Makefile +++ b/win/Makefile @@ -229,15 +229,11 @@ $(ODIR)/jpegut.exe: $(ODIR)/jpegut.obj $(ODIR)/turbojpeg.lib $(LINK) $(LDFLAGS) -out:$@ $^ -WINSTDIR=c:\\libjpeg-turbo -WSRCDIR=windows - dist: all $(RM) $(ODIR)/libjpeg-turbo.exe - makensis /nocd //DVERSION=$(VERSION) //DWINSTDIR=$(WINSTDIR) \ - //DWSRCDIR=$(WSRCDIR) release/libjpeg-turbo.nsi || \ - makensis /nocd /DVERSION=$(VERSION) /DWINSTDIR=$(WINSTDIR) \ - /DWSRCDIR=$(WSRCDIR) release/libjpeg-turbo.nsi # Cygwin doesn't like the // + makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo \ + -DWLIBDIR=windows -DWSRCDIR=. -DWBLDDIR=windows -DWHDRDIR=win \ + -DPLATFORM="Visual C++" release/libjpeg-turbo.nsi test: testclean $(ODIR)/cjpeg.exe $(ODIR)/djpeg.exe $(ODIR)/jpegtran.exe \ -- 2.40.0