1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
From: Ole Streicher <olebole@debian.org>
Date: Sun, 15 Jan 2017 16:35:33 +0100
Subject: Correct linker flags for pgsbox
---
C/GNUmakefile | 6 +++---
configure.ac | 5 +++--
makedefs.in | 2 ++
pgsbox/GNUmakefile | 2 +-
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/C/GNUmakefile b/C/GNUmakefile
index 22e7a6c..6b63ded 100644
--- a/C/GNUmakefile
+++ b/C/GNUmakefile
@@ -425,14 +425,14 @@ twcslint : test/twcslint
$(TEST_P) : % : test/%.c $(WCSLIB)
-@ echo ''
$(CC) $(CPPFLAGS) $(PGPLOTINC) $(CFLAGS) -c -o $@.o $<
- $(LD) -o $@ $@.o $(LDFLAGS) $(PGPLOTLIB) $(WCSLIB) $(FLIBS) $(LIBS)
+ $(LD) -o $@ $@.o $(LDFLAGS) $(CPGPLOTLIB) $(WCSLIB) $(FLIBS) $(LIBS)
-@ $(RM) $@.o
# TEST_B programs (PGSBOX and PGPLOT).
tpih2 : test/tpih2.c $(PGSBOXLIB) $(WCSLIB)
-@ echo ''
$(CC) $(CPPFLAGS) -I../pgsbox $(PGPLOTINC) $(CFLAGS) -c -o $@.o $<
- $(LD) -o $@ $@.o $(LDFLAGS) $(PGSBOXLIB) $(PGPLOTLIB) $(WCSLIB) \
+ $(LD) -o $@ $@.o $(LDFLAGS) $(PGSBOXLIB) $(PGPLOTLIB) $(CPGPLOTLIB) $(WCSLIB) \
$(FLIBS) $(LIBS)
-@ $(RM) $@.o
@@ -440,7 +440,7 @@ tpih2_cfitsio : test/tpih2.c $(PGSBOXLIB) $(WCSLIB)
-@ echo ''
$(CC) -DDO_CFITSIO $(CPPFLAGS) -I../pgsbox $(PGPLOTINC) \
$(CFITSIOINC) $(CFITSIO_CFLAGS) -c -o $@.o $<
- $(LD) -o $@ $@.o $(LDFLAGS) $(PGSBOXLIB) $(PGPLOTLIB) \
+ $(LD) -o $@ $@.o $(LDFLAGS) $(PGSBOXLIB) $(PGPLOTLIB) $(CPGPLOTLIB) \
$(CFITSIOLIB) $(WCSLIB) $(FLIBS) $(LIBS)
-@ $(RM) $@.o
diff --git a/configure.ac b/configure.ac
index 97f0792..c863065 100644
--- a/configure.ac
+++ b/configure.ac
@@ -525,8 +525,8 @@ if test "x$with_cfitsio" != xno -o \
[], [$PGPLOTLIB $LIBS])
AC_CHECK_LIB([pgplot], [pgbeg_], [PGPLOTLIB="-lpgplot $PGPLOTLIB"],
[], [$PGPLOTLIB $FLIBS $LIBS])
- AC_CHECK_LIB([cpgplot], [cpgbeg], [PGPLOTLIB="-lcpgplot $PGPLOTLIB"],
- [PGPLOTLIB=], [$PGPLOTLIB $FLIBS $LIBS])
+ AC_CHECK_LIB([cpgplot], [cpgbeg], [CPGPLOTLIB="-lcpgplot"],
+ [], [$CPGPLOTLIB $LIBS])
# Only need the PGPLOT include file to build PGSBOX.
if test "x$PGPLOTINC" != x; then
@@ -577,6 +577,7 @@ AC_SUBST([GETWCSTAB])
AC_SUBST([PGPLOTINC])
AC_SUBST([PGPLOTLIB])
+AC_SUBST([CPGPLOTLIB])
AC_SUBST([SUBDIRS])
AC_SUBST([TSTDIRS])
diff --git a/makedefs.in b/makedefs.in
index de92e55..0719591 100644
--- a/makedefs.in
+++ b/makedefs.in
@@ -156,6 +156,7 @@
# PGPLOT (see note 4 above).
PGPLOTINC := @PGPLOTINC@
PGPLOTLIB := @PGPLOTLIB@
+ CPGPLOTLIB := @CPGPLOTLIB@
# CFITSIO (see note 5 above).
CFITSIOINC := @CFITSIOINC@
@@ -245,6 +246,7 @@ show :: wcsconfig.h
-@ echo ' LDFLAGS := $(LDFLAGS)'
-@ echo ' PGPLOTINC := $(PGPLOTINC)'
-@ echo ' PGPLOTLIB := $(PGPLOTLIB)'
+ -@ echo ' CPGPLOTLIB := $(CPGPLOTLIB)'
-@ echo ' CFITSIOINC := $(CFITSIOINC)'
-@ echo ' CFITSIOLIB := $(CFITSIOLIB)'
-@ echo ' GETWCSTAB := $(GETWCSTAB)'
diff --git a/pgsbox/GNUmakefile b/pgsbox/GNUmakefile
index b970d21..4d7c208 100644
--- a/pgsbox/GNUmakefile
+++ b/pgsbox/GNUmakefile
@@ -247,7 +247,7 @@ cpgtest : cpgtest.c fscan.f lngvel.f $(PGSBOXLIB) $(WCSLIB)
-@ echo ''
$(FC) -I../Fortran $(FFLAGS) -c fscan.f lngvel.f
$(CC) $(CPPFLAGS) $(PGPLOTINC) $(CFLAGS) -o $@ $(^:.f=.o) \
- $(LDFLAGS) $(PGPLOTLIB) $(FLIBS) $(LIBS)
+ $(LDFLAGS) $(CPGPLOTLIB) $(PGPLOTLIB) $(FLIBS) $(LIBS)
-@ $(RM) fscan.o lngvel.o
GNUmakefile : ../makedefs ;
|