From aab833c5df8456efc58529b6e5100bec6b9969bd Mon Sep 17 00:00:00 2001 From: bustico Date: Thu, 15 Jan 2015 14:21:29 +0000 Subject: ° compile with fPIC by default ° pkg-config: use Libs.private for pcre and extra libs ° fix formatting in debian changelog --- src/Makefile | 32 +++++++++++++++----------------- src/Makefile.osx | 38 +++++++++++++++++--------------------- src/ivy-c.pc.in | 5 +++-- src/ivy-glib.pc.in | 5 +++-- src/ivy-tcl.pc.in | 5 +++-- 5 files changed, 41 insertions(+), 44 deletions(-) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index f9fbd11..2f2e2dc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -21,11 +21,9 @@ MINOR=15 PERHAPS64 := $(shell getconf LONG_BIT | perl -ne "print /64/ ? '64' : '';") LIB = /lib$(PERHAPS64) -ifeq ($(PERHAPS64),64) - FPIC=-fPIC -else - FPIC= -endif + +# by default use fPIC on all systems +FPIC ?= -fPIC ifndef PREFIX export PREFIX=/usr/local @@ -45,7 +43,7 @@ HAVE_GLIB = $(shell pkg-config --exists glib-2.0 && echo 'yes') GLIBINC = `pkg-config --cflags glib-2.0` GLIBLIB = `pkg-config --libs glib-2.0` GLUTINC = -I/usr/include -I. -GLUTLIB = -L. -lglut -lGLU -lGL -lX11 -lXmu +GLUTLIB = -L. -lglut -lGLU -lGL -lX11 -lXmu # use these if you want standard Tcl ( 8.3 on debian woody ... ) #TCLVERS = `perl -e '@_=sort map (m|/usr/lib/libtcl(\d\.\d)\.so|, glob ("/usr/lib/libtcl*")); print pop @_'` @@ -73,11 +71,11 @@ ifeq ($(CASESENSITIVE), "no") REGCOMP_OPT=REG_ICASE else PCRE_OPT=0 - REGCOMP_OPT=REG_EXTENDED + REGCOMP_OPT=REG_EXTENDED endif #PCREOBJ = `pcre-config --prefix`/lib/libpcre.a -PCREOBJ = +PCREOBJ = ifeq ($(shell uname -s),SunOS) EXTRALIB=-lsocket -lnsl # for solaris @@ -96,7 +94,7 @@ LIBTOOL=ar q # linux and solaris REGEXP= -DUSE_PCRE_REGEX -DPCRE_OPT=$(PCRE_OPT) # on activeTCL , set #define CHANNEL to null, and add ivyloop.o in the ivytcl target, # see below -CHANNEL = -DTCL_CHANNEL_INTEGRATION +CHANNEL = -DTCL_CHANNEL_INTEGRATION # DEBUG CFLAGS_DEBUG = -g -Wall -Wshadow -DDEBUG $(FPIC) @@ -113,7 +111,7 @@ endif BUGGY_DEBIAN_OPTION = -DPCRECPP_EXP_DEFN="" -DPCRECPP_EXP_DECL="" -OMPCFLAGS = $(CFLAGS) -fopenmp -DOPENMP=1 +OMPCFLAGS = $(CFLAGS) -fopenmp -DOPENMP=1 -D_REENTRANT OMPLIB = -lgomp -lpthread OBJ = ivyloop.o timer.o ivysocket.o ivy.o ivybuffer.o ivyfifo.o ivybind.o intervalRegexp.o param.o @@ -130,7 +128,7 @@ STATICTARGETLIBS=libivy.a libgivy.a libxtivy.a libtclivy.a ifeq ($(HAVE_GLIB),yes) TARGETLIBS += libglibivy.so.$(MAJOR).$(MINOR) - STATICTARGETLIBS += libglibivy.a + STATICTARGETLIBS += libglibivy.a endif @@ -144,7 +142,7 @@ endif all: static-libs shared-libs pkgconf tools libomp: libivy_omp.a libivy_omp.so.$(MAJOR).$(MINOR) omp: libomp - @(cd $(TOOLS_DIR) && $(MAKE) omp) + @(cd $(TOOLS_DIR) && $(MAKE) omp) static-libs: $(STATICTARGETLIBS) # not yet need Modified Glut libglutivy.a @@ -178,7 +176,7 @@ ivyglibloop.o: ivyglibloop.c ivyglibloop.h libivy.a: $(OBJ) rm -f $@ - $(LIBTOOL) $@ $(OBJ) + $(LIBTOOL) $@ $(OBJ) libivy_omp.a: $(OMPOBJ) rm -f $@ @@ -297,10 +295,10 @@ installliblinks: installlibs ln -fs $(PREFIX)$(LIB)/libtclivy.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)$(LIB)/libtclivy.so.$(MAJOR) ln -fs $(PREFIX)$(LIB)/libivy_omp.so.$(MAJOR).$(MINOR) $(DESTDIR)$(PREFIX)$(LIB)/libivy_omp.so -installbins: +installbins: @(cd $(TOOLS_DIR) && $(MAKE) install) -installbins_omp: +installbins_omp: @(cd $(TOOLS_DIR) && $(MAKE) install_omp) @@ -333,9 +331,9 @@ rpm:: pkgconf: for f in *.pc.in ; do \ - sed -e 's,@PREFIX@,$(PREFIX),; s,@MAJOR@,$(MAJOR),; s,@MINOR@,$(MINOR),; s,@PCREINC@,$(PCREINC),; s,@REGEXP@,$(REGEXP),; s,@PCRELIB@,$(PCRELIB),; s,@EXTRALIB@,$(EXTRALIB),' $$f > $$(echo $$f | cut -f 1,2 -d .); \ + sed -e 's,@PREFIX@,$(PREFIX),; s,@MAJOR@,$(MAJOR),; s,@MINOR@,$(MINOR),; s,@PCRELIB@,$(PCRELIB),; s,@EXTRALIB@,$(EXTRALIB),' $$f > $$(echo $$f | cut -f 1,2 -d .); \ done installpkgconf: pkgconf test -d $(DESTDIR)$(PREFIX)/lib/pkgconfig || mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig - install -m 644 *.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig + install -m 644 *.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig diff --git a/src/Makefile.osx b/src/Makefile.osx index 7e4aad6..2d6b6d4 100644 --- a/src/Makefile.osx +++ b/src/Makefile.osx @@ -21,15 +21,11 @@ MINOR=15 LIB=/lib -LBITS := $(shell getconf LONG_BIT) -ifeq ($(LBITS),64) - FPIC = -fPIC -else - FPIC = -endif +# by default use fPIC on all systems +FPIC ?= -fPIC ifndef PREFIX - PREFIX=/opt/local + PREFIX=/opt/local endif PCREINC = $(shell pcre-config --cflags) @@ -40,7 +36,7 @@ ifeq ($(CASESENSITIVE), "no") REGCOMP_OPT=REG_ICASE else PCRE_OPT=0 - REGCOMP_OPT=REG_EXTENDED + REGCOMP_OPT=REG_EXTENDED endif REGEXP= -DUSE_PCRE_REGEX -DPCRE_OPT=$(PCRE_OPT) @@ -51,9 +47,9 @@ GLIBOBJ = ivyglibloop.o ivysocket.o ivy.o ivybuffer.o ivyfifo.o ivybind.o interv TOOLS_DIR = ../tools # you should first install gcc version >= 4.3 -# gcc (g++) 4.3 is the first gcc version which support openmp under macosx +# gcc (g++) 4.3 is the first gcc version which support openmp under macosx # using macport greatly simplify gcc install : port install gcc44 -OMPCC = gcc-mp-4.4 +OMPCC = gcc-mp-4.4 OMPCPP = g++-mp-4.4 OMPLIBTOOL =ar q OMPCFLAGS = -g -Wall $(FPIC) -fopenmp -DOPENMP=1 @@ -83,10 +79,10 @@ CFLAGS = -g -Wall -Wshadow $(FPIC) all: static-libs shared-libs pkgconf tools -libomp: libivy_omp.a +libomp: libivy_omp.a omp: libomp - @(cd $(TOOLS_DIR) && $(MAKE) -f Makefile.osx omp) + @(cd $(TOOLS_DIR) && $(MAKE) -f Makefile.osx omp) static-libs: libivy.a libglibivy.a @@ -100,9 +96,9 @@ ivy_omp.o: ivy.c ivysocket_omp.o: ivysocket.c $(OMPCC) -c $(OMPCFLAGS) -o ivysocket_omp.o ivysocket.c - + ivyglibloop.o: ivyglibloop.c ivyglibloop.h - $(CC) -c $(CFLAGS) $(GLIBINC) ivyglibloop.c + $(CC) -c $(CFLAGS) $(GLIBINC) ivyglibloop.c libivy.a: $(OBJ) rm -f $@ @@ -119,16 +115,16 @@ libivy.dylib: $(OBJ) libivy_omp.dylib: $(OMPOBJ) $(OMPCC) -dynamiclib -install_name $(DESTDIR)$(PREFIX)$(LIB)/lib/libivy_omp.dylib -o $@ $(OMPOBJ) $(PCRELIB) $(OMPLIB) #$(OMPCC) -dynamiclib -o $@ $(OMPOBJ) $(PCRELIB) $(OMPLIB) - + libglibivy.a: $(GLIBOBJ) rm -f $@ $(LIBTOOL) $@ $(GLIBOBJ) libglibivy.dylib: $(GLIBOBJ) - $(CC) $(CFLAGS) -dynamiclib -install_name $(DESTDIR)$(PREFIX)/lib/libglibivy.dylib -o $@ $(GLIBOBJ) $(PCRELIB) $(GLIBLIB) + $(CC) $(CFLAGS) -dynamiclib -install_name $(DESTDIR)$(PREFIX)/lib/libglibivy.dylib -o $@ $(GLIBOBJ) $(PCRELIB) $(GLIBLIB) #$(CC) $(CFLAGS) -dynamiclib -o $@ $(GLIBOBJ) $(PCRELIB) $(GLIBLIB) - + # ------------------------------------------------------------------------------------------ @@ -140,7 +136,7 @@ installlibs: static-libs shared-libs install -m644 libivy.dylib $(DESTDIR)$(PREFIX)/lib/ install -m644 libglibivy.a $(DESTDIR)$(PREFIX)/lib/ install -m644 libglibivy.dylib $(DESTDIR)$(PREFIX)/lib/ - + includes: test -d $(DESTDIR)$(PREFIX)/include/Ivy || mkdir -p $(DESTDIR)$(PREFIX)/include/Ivy install -m644 ivy.h $(DESTDIR)$(PREFIX)/include/Ivy/ @@ -163,7 +159,7 @@ installbins: tools install_name_tool -change libivy.dylib $(DESTDIR)$(PREFIX)/lib/libivy.dylib $(DESTDIR)$(PREFIX)/bin/ivyperf -tools: static-libs +tools: static-libs @(cd $(TOOLS_DIR) && $(MAKE) -f Makefile.osx) install: installlibs installbins includes installpkgconf @@ -176,9 +172,9 @@ clean: # ------------------------------------------------------------------------------------------ -pkgconf: +pkgconf: for f in *.pc.in ; do \ - sed -e 's,@PREFIX@,$(PREFIX),; s,@MAJOR@,$(MAJOR),; s,@MINOR@,$(MINOR),; s,@PCREINC@,$(PCREINC),; s,@REGEXP@,$(REGEXP),; s,@PCRELIB@,$(PCRELIB),; s,@EXTRALIB@,$(EXTRALIB),' $$f > $$(echo $$f | cut -f 1,2 -d .); \ + sed -e 's,@PREFIX@,$(PREFIX),; s,@MAJOR@,$(MAJOR),; s,@MINOR@,$(MINOR),; s,@PCRELIB@,$(PCRELIB),; s,@EXTRALIB@,$(EXTRALIB),' $$f > $$(echo $$f | cut -f 1,2 -d .); \ done installpkgconf: pkgconf diff --git a/src/ivy-c.pc.in b/src/ivy-c.pc.in index b4f90bd..d13af92 100644 --- a/src/ivy-c.pc.in +++ b/src/ivy-c.pc.in @@ -6,5 +6,6 @@ includedir=${prefix}/include Name: ivy-c Description: A software bus Version: @MAJOR@.@MINOR@ -Libs: -L${libdir} -livy @PCREINC@ @EXTRALIB@ -Cflags: -I${includedir} @REGEXP@ @PCRELIB@ +Libs: -L${libdir} -livy +Libs.private: @PCRELIB@ @EXTRALIB@ +Cflags: -I${includedir} diff --git a/src/ivy-glib.pc.in b/src/ivy-glib.pc.in index 5794064..3e778a7 100644 --- a/src/ivy-glib.pc.in +++ b/src/ivy-glib.pc.in @@ -7,5 +7,6 @@ Name: ivy-glib Description: A software bus (Glib main loop) Requires: glib-2.0 Version: @MAJOR@.@MINOR@ -Libs: -L${libdir} -lglibivy @PCRELIB@ @EXTRALIB@ -Cflags: -I${includedir} @REGEXP@ @PCREINC@ +Libs: -L${libdir} -lglibivy +Libs.private: @PCRELIB@ @EXTRALIB@ +Cflags: -I${includedir} diff --git a/src/ivy-tcl.pc.in b/src/ivy-tcl.pc.in index 86c9ef3..c6c0077 100644 --- a/src/ivy-tcl.pc.in +++ b/src/ivy-tcl.pc.in @@ -6,5 +6,6 @@ includedir=${prefix}/include Name: ivy-tcl Description: A software bus (TCL main loop) Version: @MAJOR@.@MINOR@ -Libs: -L${libdir} -ltclivy @PCREINC@ @EXTRALIB@ -Cflags: -I${includedir} @REGEXP@ @PCRELIB@ +Libs: -L${libdir} -ltclivy +Libs.private: @PCRELIB@ @EXTRALIB@ +Cflags: -I${includedir} -- cgit v1.1