tag 407462 patch thanks Hi Carlo,
here's a proposed patch for including a shared (with -fPIC, naturally) version of the C bindings. I was able to get the Perl module work on amd64 with this. The build system is quite weird; please consider making it a bit less confusing by modifying sys_linux/g77_gcc.conf straight in the .diff.gz instead of copying it from debian/ during the build process. There's some cruft in debian/ as well (*.old, g77_elf.conf.debian). Cheers, -- Niko Tyni [EMAIL PROTECTED]
diff --git a/debian/changelog b/debian/changelog index 9a0f0a1..6d79658 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +pgplot5 (5.2.2-9.1) unstable; urgency=low + + * NMU. + * Remove unneeded debian/compc, a "hack to get around a strange + makefile problem" that was ignoring compiler flags. + * Include a shared version of the C binding library, needed by + the Perl bindings. (Closes: #407462) + + -- Niko Tyni <[EMAIL PROTECTED]> Fri, 07 Sep 2007 23:09:06 +0300 + pgplot5 (5.2.2-9) unstable; urgency=low * Changing Maintainer field upon request of [EMAIL PROTECTED] diff --git a/debian/compc b/debian/compc deleted file mode 100644 index d972e7f..0000000 --- a/debian/compc +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/perl - -print "This is a hack to get around a strange makefile problem\n"; - -while (<>) { - $com = "cc -c $_"; - print "$com"; - system $com; -} - - -1; #OK diff --git a/debian/g77_gcc.conf.debian b/debian/g77_gcc.conf.debian index 0e462fc..db0ef27 100644 --- a/debian/g77_gcc.conf.debian +++ b/debian/g77_gcc.conf.debian @@ -107,8 +107,12 @@ # Optional: Needed if SHARED_LIB is set. # How to create a shared library from a trailing list of object files. + + SHARED_LD_PGPLOT_OPTS="-o $SHARED_LIB -Wl,-soname,libpgplot.so.\$(VM) -L/usr/X11R6/lib -lX11 -lc -lg2c" + + SHARED_LD_CPGPLOT_OPTS="-o libcpgplot.so -Wl,-soname,libcpgplot.so.\$(VM) -L. -lpgplot" - SHARED_LD="g77 -shared -o $SHARED_LIB -Wl,-soname,libpgplot.so.\$(VM) -L/usr/X11R6/lib -lX11 -lc -lg2c" + SHARED_LD="g77 -shared" # Optional: # On systems such as Solaris 2.x, that allow specification of the diff --git a/debian/rules b/debian/rules index 9c6e7ab..9d3e514 100755 --- a/debian/rules +++ b/debian/rules @@ -42,7 +42,7 @@ build-stamp: # perl debian/changeperl cd $(bdir);make FFLAGC="-u -Wall -O2" CFLAGC="-Wall -DPG_PPU -O3" all;make clean;make FFLAGC="-u -Wall -O2" CFLAGC="-Wall -DPG_PPU -O3" cpg;make pgplot.html;make pgplot-routines.tex # -cd $(bdir); rm *.o - cd $(bdir) ; make clean; make FFLAGC="-u -Wall -O2 -fPIC" CFLAGC="-Wall -fPIC -D_REENTRANT -DPG_PPU -O3" VM="$(version_major)" shared + cd $(bdir) ; make clean; make FFLAGC="-u -Wall -O2 -fPIC" CFLAGC="-Wall -fPIC -D_REENTRANT -DPG_PPU -O3" VM="$(version_major)" shared cpg-shared touch build-stamp clean: @@ -66,9 +66,13 @@ install-stamp: build-stamp $(INSTALL_DATA) $(bdir)/libpgplot.a $(packagedir)/usr/lib/ $(INSTALL_DATA) $(bdir)/libcpgplot.a $(packagedir)/usr/lib/ $(INSTALL_DATA) $(bdir)/libpgplot.so $(packagedir)/usr/lib/libpgplot.so.$(version) + $(INSTALL_DATA) $(bdir)/libcpgplot.so $(packagedir)/usr/lib/libcpgplot.so.$(version) strip --strip-unneeded $(packagedir)/usr/lib/libpgplot.so.$(version) + strip --strip-unneeded $(packagedir)/usr/lib/libcpgplot.so.$(version) ln -s lib$(package).so.$(version) $(packagedir)/usr/lib/lib$(package).so.$(version_major) + ln -s libcpgplot.so.$(version) $(packagedir)/usr/lib/libcpgplot.so.$(version_major) ln -s lib$(package).so.$(version_major) $(packagedir)/usr/lib/lib$(package).so + ln -s libcpgplot.so.$(version_major) $(packagedir)/usr/lib/libcpgplot.so # chmod 644 $(packagedir)/usr/lib/$(npackage)/* $(INSTALL_DATA) $(bdir)/cpgplot.h $(packagedir)/usr/include/ # $(INSTALL_STRIP) $(bdir)/pgdisp $(packagedir)/usr/bin/ @@ -150,7 +154,7 @@ binary-arch: build install dh_fixperms -a # dh_suidregister -a dh_installdeb -a - dh_shlibdeps -a + dh_shlibdeps -a -L$(npackage) dh_gencontrol -a dh_md5sums -a dh_builddeb -a diff --git a/makemake b/makemake index 47e3509..6e7972b 100755 --- a/makemake +++ b/makemake @@ -658,6 +658,8 @@ CPGPLOT_LIB=$CPGPLOT_LIB # SHARED_LIB=$SHARED_LIB SHARED_LD=$SHARED_LD +SHARED_LD_PGPLOT_OPTS=$SHARED_LD_PGPLOT_OPTS +SHARED_LD_CPGPLOT_OPTS=$SHARED_LD_CPGPLOT_OPTS # # The libraries that the shared PGPLOT library depends upon. # This is for systems that allow one to specify what libraries @@ -823,7 +825,7 @@ libpgplot.a : $(PG_ROUTINES) $(PG_NON_STANDARD) $(GR_ROUTINES) \ shared: $(PG_ROUTINES) $(PG_NON_STANDARD) \ $(GR_ROUTINES) $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES) - $(SHARED_LD) `ls $(PG_ROUTINES) \ + $(SHARED_LD) $(SHARED_LD_PGPLOT_OPTS) `ls $(PG_ROUTINES) \ $(PG_NON_STANDARD) $(GR_ROUTINES) $(DISPATCH_ROUTINE) \ $(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq` $(SHARED_LIB_LIBS) @@ -835,7 +837,7 @@ if test -n "$SHARED_LIB" -a -n "$SHARED_LD"; then cat >> makefile << \EOD $(SHARED_LIB): $(PG_ROUTINES) $(PG_NON_STANDARD) \ $(GR_ROUTINES) $(DISPATCH_ROUTINE) $(DRIVERS) $(SYSTEM_ROUTINES) - $(SHARED_LD) `ls $(PG_ROUTINES) \ + $(SHARED_LD) $(SHARED_LD_PGPLOT_OPTS) `ls $(PG_ROUTINES) \ $(PG_NON_STANDARD) $(GR_ROUTINES) $(DISPATCH_ROUTINE) \ $(DRIVERS) $(SYSTEM_ROUTINES) | sort | uniq` $(SHARED_LIB_LIBS) EOD @@ -1050,18 +1052,26 @@ cpg: libcpgplot.a cpgplot.h cpgdemo @echo 'will be needed.' @echo ' ' +cpg-shared: libcpgplot.so + pgbind: $(SRC)/cpg/pgbind.c $(CCOMPL) $(CFLAGC) $(SRC)/cpg/pgbind.c -o pgbind libcpgplot.a cpgplot.h: $(PG_SOURCE) pgbind ./pgbind $(PGBIND_FLAGS) -h -w $(PG_SOURCE) -# $(CCOMPL) -c $(CFLAGC) cpg*.c - ls *.c | perl ../compc + $(CCOMPL) -c $(CFLAGC) cpg*.c rm -f cpg*.c ar ru libcpgplot.a cpg*.o $(RANLIB) libcpgplot.a rm -f cpg*.o +libcpgplot.so: $(PG_SOURCE) pgbind + ./pgbind $(PGBIND_FLAGS) -w $(PG_SOURCE) + $(CCOMPL) -c $(CFLAGC) cpg*.c + rm -f cpg*.c + $(SHARED_LD) $(SHARED_LD_CPGPLOT_OPTS) cpg*.o + rm -f cpg*.o + cpgdemo: cpgplot.h $(SRC)/cpg/cpgdemo.c libcpgplot.a $(CCOMPL) $(CFLAGD) -c -I. $(SRC)/cpg/cpgdemo.c $(FCOMPL) -o cpgdemo cpgdemo.o $(CPGPLOT_LIB) $(LIBS)