diff options
| author | Antonin Descampe <antonin@gmail.com> | 2011-03-04 10:53:27 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2011-03-04 10:53:27 +0000 |
| commit | 86edc0a40e991c77581a73bf74d60d3f500e6961 (patch) | |
| tree | a0da3deeb53d376c2b0014d3668462c37a0e5314 /libopenjpeg/Makefile.am | |
| parent | 89456eed517d6ecd768373f340e0e7f613e467ab (diff) | |
updated autotools files to improve build and install procedures (credit to Vincent Torri)
Diffstat (limited to 'libopenjpeg/Makefile.am')
| -rw-r--r-- | libopenjpeg/Makefile.am | 169 |
1 files changed, 83 insertions, 86 deletions
diff --git a/libopenjpeg/Makefile.am b/libopenjpeg/Makefile.am index b2d2490b..614fc073 100644 --- a/libopenjpeg/Makefile.am +++ b/libopenjpeg/Makefile.am @@ -1,98 +1,95 @@ -MAJOR = @MAJOR_NR@ -MINOR = @MINOR_NR@ -BUILD = @BUILD_NR@ -CURRENT=`expr $(MAJOR) + $(MINOR)` +MAINTAINERCLEANFILES = Makefile.in -lib_LTLIBRARIES = libopenjpeg.la - -INCLUDES = -I.. -I. +includesdir = $(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR) +includes_HEADERS = openjpeg.h -libopenjpeg_la_LDFLAGS = -no-undefined \ - -version-info $(CURRENT):$(BUILD):$(MINOR) - -SRCS = bio.c cio.c dwt.c event.c image.c j2k.c j2k_lib.c jp2.c jpt.c \ - mct.c mqc.c openjpeg.c pi.c raw.c t1.c t2.c tcd.c tgt.c +lib_LTLIBRARIES = libopenjpeg.la -INCLS = bio.h cio.h dwt.h event.h fix.h image.h int.h j2k.h j2k_lib.h \ - jp2.h jpt.h mct.h mqc.h pi.h raw.h t1.h t2.h tcd.h tgt.h opj_malloc.h \ - opj_includes.h +libopenjpeg_la_CPPFLAGS = \ +-I. \ +-I$(top_srcdir)/libopenjpeg \ +-I$(top_builddir)/libopenjpeg \ +@LCMS1_CFLAGS@ \ +@LCMS2_CFLAGS@ +libopenjpeg_la_CFLAGS = +libopenjpeg_la_LIBADD = @LCMS1_LIBS@ @LCMS2_LIBS@ +libopenjpeg_la_LDFLAGS = -no-undefined -version-info @lt_version@ -libopenjpeg_la_SOURCES = $(SRCS) $(INCLS) +libopenjpeg_la_SOURCES = \ +bio.c \ +cio.c \ +dwt.c \ +event.c \ +image.c \ +j2k.c \ +j2k_lib.c \ +jp2.c \ +jpt.c \ +mct.c \ +mqc.c \ +openjpeg.c \ +pi.c \ +raw.c \ +t1.c \ +t2.c \ +tcd.c \ +tgt.c \ +bio.h \ +cio.h \ +dwt.h \ +event.h \ +fix.h \ +image.h \ +int.h \ +j2k.h \ +j2k_lib.h \ +jp2.h \ +jpt.h \ +mct.h \ +mqc.h \ +pi.h \ +raw.h \ +t1.h \ +t1_luts.h \ +t2.h \ +tcd.h \ +tgt.h \ +opj_malloc.h \ +opj_includes.h -includedir = ${prefix}/include/openjpeg-$(MAJOR).$(MINOR) -include_HEADERS = openjpeg.h +EXTRA_DIST = \ +CMakeLists.txt -# Converts cr/lf to just lf -DOS2UNIX = dos2unix +install-data-hook: + cd $(DESTDIR)$(includedir) && \ + rm -f openjpeg.h && \ + $(LN_S) openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h \ + openjpeg.h + @rm -rf $(top_builddir)/report.txt + @echo -e " (LA)\t$(libdir)/libopenjpeg.la" >> $(top_builddir)/report.txt + @( $(call solist) ) >> $(top_builddir)/report.txt + @echo -e " (A)\t\t$(base)/$(a)" >> $(top_builddir)/report.txt + @echo -e " (H)\t\t$(includedir)/openjpeg-$(MAJOR_NR).$(MINOR_NR)/openjpeg.h" >> $(top_builddir)/report.txt + @echo -e " (LN)\t$(includedir)/openjpeg.h" >> $(top_builddir)/report.txt -dos2unix: - @$(DOS2UNIX) $(SRCS) $(INCLS) +uninstall-hook: + rm -f $(DESTDIR)$(includedir)/openjpeg.h -COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 +solist = $(foreach f, $(dll) $(so), echo -e ' $(SO_PREFIX)\t$(base)/$(f)' ;) +get_tok = $(shell grep -E "^$(1)=" $(lib_LTLIBRARIES) | cut -d "'" -f 2) +base = $(call get_tok,libdir) +so = $(call get_tok,library_names) +a = $(call get_tok,old_library) -if with_sharedlibs -COMPILERFLAGS += -DOPJ_EXPORTS +if HAVE_WIN32 +SO_PREFIX = (DLL) +dll = $(call get_tok,dlname) else -COMPILERFLAGS += -DOPJ_STATIC -libopenjpeg_la_LDFLAGS += -static -endif - -CFLAGS = $(COMPILERFLAGS) $(INCLUDES) - -headerdir = openjpeg-$(MAJOR).$(MINOR) - -all-local: - @$(INSTALL) -d ../bin - @rm -rf .report_dir - @$(INSTALL) -d .report_dir -if build_so -if with_sharedlibs - @find .libs -type f -name "*\.so*" -exec cp -P {} .report_dir \; - @find .libs -type l -name "*\.so*" -exec cp -P {} .report_dir \; -else !with_sharedlibs - @find .libs -type f -name "*\.a" -exec cp -P {} .report_dir \; -endif !with_sharedlibs -endif -if build_dll -if with_sharedlibs - @find .libs -type f -name "*\.dll" -exec cp -P {} .report_dir \; - @find .libs -type f -name "*\.a" -exec cp -P {} .report_dir \; -else !with_sharedlibs - @find .libs -type f -name "*\.a" -exec cp -P {} .report_dir \; -endif !with_sharedlibs +if HAVE_DARWIN +SO_PREFIX = (DY) +dll = +else +SO_PREFIX = (SO) +dll = endif -if build_dylib -if with_sharedlibs - @find .libs -type f -name "*\.dylib" -exec cp -P {} .report_dir \; -else !with_sharedlibs - @find .libs -type l -name "*\.a" -exec cp -P {} .report_dir \; -endif !with_sharedlibs endif - @cp -a .report_dir/* ../bin - @echo "" > .report.txt - @echo "Installing: ${prefix}/include/${headerdir}/" >> .report.txt - @echo "Installing: ${prefix}/include/${headerdir}/openjpeg.h" >> .report.txt - @echo "Installing: ${prefix}/lib/libopenjpeg.la" >> .report.txt - @(cd .report_dir; \ - for file in `ls *.dll 2> /dev/null` ; do \ - echo "Installing: ${prefix}/bin/$${file}" >> ../.report.txt ; \ - done ; \ - for file in `ls *.a 2> /dev/null` ; do \ - echo "Installing: ${prefix}/lib/$${file}" >> ../.report.txt ; \ - done ; \ - for file in `ls *.so* 2> /dev/null` ; do \ - echo "Installing: ${prefix}/lib/$${file}" >> ../.report.txt ; \ - done ; \ - for file in `ls *.dylib 2> /dev/null` ; do \ - echo "Installing: ${prefix}/lib/$${file}" >> ../.report.txt ; \ - done \ - ) - @rm -rf .report_dir - -install-data-hook: - (cd $(DESTDIR)${prefix}/include && rm -f openjpeg.h) - (cd $(DESTDIR)${prefix}/include && \ - $(LN_S) ${headerdir}/openjpeg.h openjpeg.h) - -uninstall-hook: - (cd $(DESTDIR)${prefix}/include && rm -rf openjpeg.h ${headerdir}) |
