From 1c1c123897c9e754cd48c123a50abf882403b6aa Mon Sep 17 00:00:00 2001 From: Winfried Date: Tue, 14 Dec 2010 03:33:31 +0000 Subject: [PATCH] Adapted Makefile.am/Makefile.nix to build choice: shared xor static --- Makefile.in | 1 - codec/Makefile.am | 6 ++++-- codec/Makefile.in | 6 +++--- libjp3dvm/Makefile.am | 11 ++++++++--- libjp3dvm/Makefile.in | 15 ++++++++------- 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Makefile.in b/Makefile.in index 31c40681..34b2d6a8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -203,7 +203,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff --git a/codec/Makefile.am b/codec/Makefile.am index 5b3e8cf4..819b91a3 100644 --- a/codec/Makefile.am +++ b/codec/Makefile.am @@ -4,8 +4,10 @@ USERLIBS = INCLUDES = -I. -I../libjp3dvm CFLAGS = -Wall $(INCLUDES) -if with_staticlibs -CFLAGS += -static +if with_sharedlibs +CFLAGS += -DOPJ_EXPORTS +else +CFLAGS += -DOPJ_STATIC endif bin_PROGRAMS = jp3d_to_volume volume_to_jp3d diff --git a/codec/Makefile.in b/codec/Makefile.in index 59ab5eaa..dd4b2f87 100644 --- a/codec/Makefile.in +++ b/codec/Makefile.in @@ -37,7 +37,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ -@with_staticlibs_TRUE@am__append_1 = -static +@with_sharedlibs_TRUE@am__append_1 = -DOPJ_EXPORTS +@with_sharedlibs_FALSE@am__append_2 = -DOPJ_STATIC bin_PROGRAMS = jp3d_to_volume$(EXEEXT) volume_to_jp3d$(EXEEXT) subdir = jp3d/codec DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in @@ -93,7 +94,7 @@ AWK = @AWK@ BUILD_NR = @BUILD_NR@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ -CFLAGS = -Wall $(INCLUDES) $(am__append_1) +CFLAGS = -Wall $(INCLUDES) $(am__append_1) $(am__append_2) CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ @@ -198,7 +199,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ diff --git a/libjp3dvm/Makefile.am b/libjp3dvm/Makefile.am index 2d7663e1..434fa977 100644 --- a/libjp3dvm/Makefile.am +++ b/libjp3dvm/Makefile.am @@ -27,10 +27,16 @@ DOS2UNIX = dos2unix dos2unix: @$(DOS2UNIX) $(SRCS) $(INCLS) - -INCLUDES = -I../.. -I.. -I. +INCLUDES = -I../.. -I. COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 +if with_sharedlibs +COMPILERFLAGS += -DOPJ_EXPORTS +else +COMPILERFLAGS += -DOPJ_STATIC +libopenjp3dvm_la_LDFLAGS += -static +endif + CFLAGS = $(COMPILERFLAGS) $(INCLUDES) #CFLAGS += -DJP3D_VERSION="\"$(MAJOR).$(MINOR).$(BUILD)\"" @@ -56,7 +62,6 @@ all-local: install-data-hook: (cd $(DESTDIR)${prefix}/include && rm -f openjpeg3d.h) - (cd ${prefix}/include/${headerdir} && mv openjpeg3d.h openjpeg3d.h) (cd $(DESTDIR)${prefix}/include && \ $(LN_S) ${headerdir}/openjpeg3d.h openjpeg3d.h) diff --git a/libjp3dvm/Makefile.in b/libjp3dvm/Makefile.in index 68566059..6a6c74ad 100644 --- a/libjp3dvm/Makefile.in +++ b/libjp3dvm/Makefile.in @@ -36,6 +36,9 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@with_sharedlibs_TRUE@am__append_1 = -DOPJ_EXPORTS +@with_sharedlibs_FALSE@am__append_2 = -DOPJ_STATIC +@with_sharedlibs_FALSE@am__append_3 = -static subdir = jp3d/libjp3dvm DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in @@ -215,7 +218,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -248,9 +250,8 @@ MINOR = @JP3D_MINOR_NR@ BUILD = @JP3D_BUILD_NR@ CURRENT = `expr $(MAJOR) + $(MINOR)` lib_LTLIBRARIES = libopenjp3dvm.la -libopenjp3dvm_la_LDFLAGS = -no-undefined \ - -version-info $(CURRENT):$(BUILD):$(MINOR) - +libopenjp3dvm_la_LDFLAGS = -no-undefined -version-info \ + $(CURRENT):$(BUILD):$(MINOR) $(am__append_3) SRCS = bio.c cio.c dwt.c event.c jp3d.c jp3d_lib.c volume.c mct.c mqc.c \ openjpeg.c pi.c raw.c t1.c t1_3d.c t2.c tcd.c tgt.c @@ -262,8 +263,9 @@ include_HEADERS = openjpeg3d.h # Converts cr/lf to just lf DOS2UNIX = dos2unix -INCLUDES = -I../.. -I.. -I. -COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 +INCLUDES = -I../.. -I. +COMPILERFLAGS = -Wall -O3 -ffast-math -std=c99 $(am__append_1) \ + $(am__append_2) #CFLAGS += -DJP3D_VERSION="\"$(MAJOR).$(MINOR).$(BUILD)\"" headerdir = openjpeg3d-$(MAJOR).$(MINOR) all: all-am @@ -634,7 +636,6 @@ all-local: install-data-hook: (cd $(DESTDIR)${prefix}/include && rm -f openjpeg3d.h) - (cd ${prefix}/include/${headerdir} && mv openjpeg3d.h openjpeg3d.h) (cd $(DESTDIR)${prefix}/include && \ $(LN_S) ${headerdir}/openjpeg3d.h openjpeg3d.h)