Add --enable-image-decoders build option.

Bug #169304 r=bryner sr=alecf
This commit is contained in:
seawood%netscape.com 2003-01-10 01:21:14 +00:00
Родитель e96cc515dd
Коммит c1dab7e090
11 изменённых файлов: 682 добавлений и 609 удалений

Просмотреть файл

@ -60,6 +60,7 @@ MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
MOZ_DBGRINFO_MODULES = @MOZ_DBGRINFO_MODULES@
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
MOZ_IMG_DECODERS= @MOZ_IMG_DECODERS@
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
MOZ_PERF_METRICS = @MOZ_PERF_METRICS@
MOZ_LEAKY = @MOZ_LEAKY@

1120
configure поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -3468,6 +3468,42 @@ else
MOZ_EXTENSIONS=`${CYGWIN_WRAPPER} ${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
fi
dnl ========================================================
dnl Image decoders
dnl ========================================================
MOZ_IMG_DECODERS_DEFAULT="ppm png gif jpeg bmp mng xbm"
case "$target_os" in
cygwin*|mingw*|msvc*|mksnt*|os2)
MOZ_IMG_DECODERS_DEFAULT="$MOZ_IMG_DECODERS_DEFAULT icon"
;;
esac
MOZ_ARG_ENABLE_STRING(image-decoders,
[ --enable-image-decoders[={mod1,mod2,default,all,none}]
Enable specific image decoders],
[ for option in `echo $enableval | sed 's/,/ /g'`; do
if test "$option" = "yes" || test "$option" = "all"; then
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
elif test "$option" = "no" || test "$option" = "none"; then
MOZ_IMG_DECODERS=""
elif test "$option" = "default"; then
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
elif test `echo "$option" | grep -c \^-` != 0; then
option=`echo $option | sed 's/^-//'`
MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
else
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
fi
done],
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
dnl Remove dupes
if test -n "${_CYGWIN_PERL}"; then
MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
else
MOZ_IMG_DECODERS=`${CYGWIN_WRAPPER} ${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
fi
dnl ========================================================
dnl experimental ldap features
dnl ========================================================
@ -4651,6 +4687,7 @@ AC_SUBST(MOZ_DEBUG_FLAGS)
AC_SUBST(MOZ_DEBUG_LDFLAGS)
AC_SUBST(MOZ_DBGRINFO_MODULES)
AC_SUBST(MOZ_EXTENSIONS)
AC_SUBST(MOZ_IMG_DECODERS)
AC_SUBST(MOZ_JSDEBUGGER)
AC_SUBST(ENABLE_EAZEL_PROFILER)
AC_SUBST(EAZEL_PROFILER_CFLAGS)

Просмотреть файл

@ -47,24 +47,19 @@ CPPSRCS = \
nsImageModule.cpp \
$(NULL)
DEFINES += $(foreach d,$(filter-out icon mng,$(MOZ_IMG_DECODERS)),\
-DIMG_BUILD_${d})
LOCAL_INCLUDES = \
-I$(srcdir)/../src \
-I$(srcdir)/../decoders/gif \
-I$(srcdir)/../decoders/jpeg \
-I$(srcdir)/../decoders/png \
-I$(srcdir)/../decoders/bmp \
-I$(srcdir)/../decoders/xbm \
-I$(srcdir)/../decoders/ppm \
$(foreach d,$(filter-out icon mng,$(MOZ_IMG_DECODERS)), \
-I$(srcdir)/../decoders/${d}) \
$(NULL)
SHARED_LIBRARY_LIBS = \
../src/$(LIB_PREFIX)imglib2_s.$(LIB_SUFFIX) \
../decoders/gif/$(LIB_PREFIX)imggif_s.$(LIB_SUFFIX) \
../decoders/jpeg/$(LIB_PREFIX)imgjpeg_s.$(LIB_SUFFIX) \
../decoders/png/$(LIB_PREFIX)imgpng_s.$(LIB_SUFFIX) \
../decoders/bmp/$(LIB_PREFIX)imgbmp_s.$(LIB_SUFFIX) \
../decoders/xbm/$(LIB_PREFIX)imgxbm_s.$(LIB_SUFFIX) \
../decoders/ppm/$(LIB_PREFIX)imgppm_s.$(LIB_SUFFIX) \
$(foreach d,$(filter-out icon mng,$(MOZ_IMG_DECODERS)), \
../decoders/${d}/$(LIB_PREFIX)img${d}_s.$(LIB_SUFFIX))\
$(NULL)
EXTRA_DSO_LIBS = \
@ -73,6 +68,7 @@ EXTRA_DSO_LIBS = \
EXTRA_DSO_LDOPTS = \
$(LIBS_DIR) \
$(JPEG_LIBS) \
$(PNG_LIBS) $(ZLIB_LIBS) \
$(EXTRA_DSO_LIBS) \
@ -81,3 +77,13 @@ EXTRA_DSO_LDOPTS = \
include $(topsrcdir)/config/rules.mk
export::
@echo "$(MOZ_IMG_DECODERS)" > tmp_img_list
@if `cmp -s _img_list tmp_img_list`; then \
rm -f tmp_img_list; \
else \
rm -f _img_list; \
mv tmp_img_list _img_list; \
touch Makefile; \
fi

Просмотреть файл

@ -30,26 +30,37 @@
#include "imgRequest.h"
#include "imgRequestProxy.h"
#ifdef IMG_BUILD_gif
// gif
#include "imgContainerGIF.h"
#include "nsGIFDecoder2.h"
#endif
#ifdef IMG_BUILD_bmp
// bmp/ico
#include "nsBMPDecoder.h"
#include "nsICODecoder.h"
#endif
#ifdef IMG_BUILD_png
// png
#include "nsPNGDecoder.h"
#endif
#ifdef IMG_BUILD_jpeg
// jpeg
#include "nsJPEGDecoder.h"
#endif
#ifdef IMG_BUILD_xbm
// xbm
#include "nsXBMDecoder.h"
#endif
#ifdef IMG_BUILD_ppm
// ppm
#include "nsPPMDecoder.h"
#endif
// objects that just require generic constructors
@ -58,25 +69,37 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(imgContainer)
NS_GENERIC_FACTORY_CONSTRUCTOR(imgLoader)
NS_GENERIC_FACTORY_CONSTRUCTOR(imgRequestProxy)
#ifdef IMG_BUILD_gif
// gif
NS_GENERIC_FACTORY_CONSTRUCTOR(imgContainerGIF)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIFDecoder2)
#endif
#ifdef IMG_BUILD_jpeg
// jpeg
NS_GENERIC_FACTORY_CONSTRUCTOR(nsJPEGDecoder)
#endif
#ifdef IMG_BUILD_bmp
// bmp
NS_GENERIC_FACTORY_CONSTRUCTOR(nsICODecoder)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBMPDecoder)
#endif
#ifdef IMG_BUILD_png
// png
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGDecoder)
#endif
#ifdef IMG_BUILD_xbm
// xbm
NS_GENERIC_FACTORY_CONSTRUCTOR(nsXBMDecoder)
#endif
#ifdef IMG_BUILD_ppm
// ppm
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPPMDecoder)
#endif
static const nsModuleComponentInfo components[] =
{
@ -97,6 +120,7 @@ static const nsModuleComponentInfo components[] =
"@mozilla.org/image/request;1",
imgRequestProxyConstructor, },
#ifdef IMG_BUILD_gif
// gif
{ "GIF image container",
NS_GIFCONTAINER_CID,
@ -106,7 +130,9 @@ static const nsModuleComponentInfo components[] =
NS_GIFDECODER2_CID,
"@mozilla.org/image/decoder;2?type=image/gif",
nsGIFDecoder2Constructor, },
#endif
#ifdef IMG_BUILD_jpeg
// jpeg
{ "JPEG decoder",
NS_JPEGDECODER_CID,
@ -120,7 +146,9 @@ static const nsModuleComponentInfo components[] =
NS_JPEGDECODER_CID,
"@mozilla.org/image/decoder;2?type=image/jpg",
nsJPEGDecoderConstructor, },
#endif
#ifdef IMG_BUILD_bmp
// bmp
{ "ICO Decoder",
NS_ICODECODER_CID,
@ -130,7 +158,9 @@ static const nsModuleComponentInfo components[] =
NS_BMPDECODER_CID,
"@mozilla.org/image/decoder;2?type=image/bmp",
nsBMPDecoderConstructor, },
#endif
#ifdef IMG_BUILD_png
// png
{ "PNG Decoder",
NS_PNGDECODER_CID,
@ -140,7 +170,9 @@ static const nsModuleComponentInfo components[] =
NS_PNGDECODER_CID,
"@mozilla.org/image/decoder;2?type=image/x-png",
nsPNGDecoderConstructor, },
#endif
#ifdef IMG_BUILD_xbm
// xbm
{ "XBM Decoder",
NS_XBMDECODER_CID,
@ -154,7 +186,10 @@ static const nsModuleComponentInfo components[] =
NS_XBMDECODER_CID,
"@mozilla.org/image/decoder;2?type=image/xbm",
nsXBMDecoderConstructor, },
#endif
#ifdef IMG_BUILD_ppm
// ppm
{ "pbm decoder",
NS_PPMDECODER_CID,
@ -168,6 +203,7 @@ static const nsModuleComponentInfo components[] =
NS_PPMDECODER_CID,
"@mozilla.org/image/decoder;2?type=image/x-portable-pixmap",
nsPPMDecoderConstructor, },
#endif
};
PR_STATIC_CALLBACK(nsresult)

Просмотреть файл

@ -26,15 +26,16 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = ppm png gif jpeg bmp mng xbm
DIRS = $(MOZ_IMG_DECODERS)
ifneq (,$(findstring icon,$(MOZ_IMG_DECODERS)))
ifeq ($(OS_ARCH),WINNT)
DIRS += icon/win icon
DIRS := icon/win $(DIRS)
endif
ifeq ($(OS_ARCH),OS2)
DIRS += icon/os2 icon
DIRS := icon/os2 $(DIRS)
endif
endif # icon
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -29,7 +29,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = imgbmp
LIBRARY_NAME = imgbmp_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsBMPModule

Просмотреть файл

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = imggif
LIBRARY_NAME = imggif_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsGIFModule2

Просмотреть файл

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = imgjpeg
LIBRARY_NAME = imgjpeg_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsJPEGDecoderModule

Просмотреть файл

@ -28,7 +28,6 @@ include $(DEPTH)/config/autoconf.mk
MODULE = imgpng
LIBRARY_NAME = imgpng_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsPNGDecoderModule

Просмотреть файл

@ -1,44 +0,0 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 2001 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = imgppm
LIBRARY_NAME = imgppm_s
EXPORT_LIBRARY = 1
FORCE_STATIC_LIB = 1
MODULE_NAME = nsPPMDecoderModule
REQUIRES = xpcom \
gfx \
imglib2 \
$(NULL)
CPPSRCS = nsPPMDecoder.cpp
include $(topsrcdir)/config/rules.mk