summaryrefslogtreecommitdiff
path: root/sci-mathematics/topcom/files/topcom-0.17.8-buildsystem.patch
blob: 2b517b441ed3b4889b9f99507048f27ad22f6be4 (plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
From 27284e6a9cb95dcd274abbe184b21eed8a899904 Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Sat, 7 May 2022 16:00:45 -0400
Subject: [PATCH 1/3] Gentoo's existing build system patch

---
 Makefile.am                |  5 -----
 configure.ac               |  8 +++-----
 lib-src-reg/Makefile.am    |  8 ++++----
 lib-src/Makefile.am        |  8 ++++----
 src-reg/Makefile.am        | 15 +++++----------
 src/Makefile.am            | 14 +++++---------
 wrap-gmp-gmpxx/Makefile.am |  4 ++--
 7 files changed, 23 insertions(+), 39 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 5dd0de0..4586f79 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1 @@
 SUBDIRS      = wrap-gmp-gmpxx lib-src-reg lib-src src-reg src examples
-EXTRA_DIST   = external/Makefile
-EXTRA_DIST  += external/gmp-6.1.1.tar.bz2
-EXTRA_DIST  += external/cddlib-0.94f-TOPCOM.tar.gz
-EXTRA_DIST  += external/gmpxx-patch
-
diff --git a/configure.ac b/configure.ac
index 6635345..a10fb97 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,9 @@ dnl Checks for programs.
 AC_PROG_CC
 AC_PROG_INSTALL
 AC_PROG_CXX
-AC_PROG_RANLIB
+LT_INIT
+AC_ENABLE_SHARED
+AC_DISABLE_STATIC
 
 dnl Checks for libraries.
 dnl Replace `main' with a function in -lg:
@@ -18,10 +20,6 @@ dnl Replace `main' with a function in -lstdc:
 dnl AC_CHECK_LIB(stdc, main)
 dnl Replace `main' with a function in -lstdc++:
 dnl AC_CHECK_LIB(stdc++, main)
-dnl Make libgmp:
-make -C external gmp
-dnl Make libcddgmp:
-make -C external cdd
 dnl Check for soplex:
 AC_CHECK_LIB(soplex, main, , csh -c 'echo soplex not found: --soplex will not work.')
 
diff --git a/lib-src-reg/Makefile.am b/lib-src-reg/Makefile.am
index fc8b005..d07b8f8 100644
--- a/lib-src-reg/Makefile.am
+++ b/lib-src-reg/Makefile.am
@@ -1,6 +1,6 @@
-lib_LIBRARIES = libCHECKREG.a
+lib_LTLIBRARIES = libCHECKREG.la
 
-libCHECKREG_a_SOURCES = \
+libCHECKREG_la_SOURCES = \
 SPXinterface.cc \
 LPinterface.cc \
 RegularityCheck.cc
@@ -12,9 +12,9 @@ LPinterface.hh
 
 AM_CPPFLAGS     = -I../lib-src 
 AM_CPPFLAGS    += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS    += -I../external/include
+AM_CPPFLAGS    += $(CPPFLAGS)
 AM_CPPFLAGS    += -I$(includedir)
 
 AM_CPPFLAGS    += -DVERBOSE -DGMPRATIONAL -ftemplate-depth-30
 
-AM_CXXFLAGS     = -O2
+AM_CXXFLAGS     = $(CXXFLAGS)
diff --git a/lib-src/Makefile.am b/lib-src/Makefile.am
index b2358cc..90b735a 100644
--- a/lib-src/Makefile.am
+++ b/lib-src/Makefile.am
@@ -1,6 +1,6 @@
-lib_LIBRARIES       = libTOPCOM.a
+lib_LTLIBRARIES       = libTOPCOM.la
 
-libTOPCOM_a_SOURCES = \
+libTOPCOM_la_SOURCES = \
 Admissibles.cc \
 CheckTriang.cc \
 Circuits.cc \
@@ -90,9 +90,9 @@ VirtualChiro.hh
 
 AM_CPPFLAGS     = -I../lib-src-reg
 AM_CPPFLAGS    += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS    += -I../external/include
+AM_CPPFLAGS    += $(CPPFLAGS)
 AM_CPPFLAGS    += -I$(includedir)
 
 AM_CPPFLAGS    += -DVERBOSE -DGMPRATIONAL -ftemplate-depth-35
 
-AM_CXXFLAGS     = -O2 -g
+AM_CXXFLAGS     = $(CXXFLAGS)
diff --git a/src-reg/Makefile.am b/src-reg/Makefile.am
index a351951..38f8f9f 100644
--- a/src-reg/Makefile.am
+++ b/src-reg/Makefile.am
@@ -2,20 +2,15 @@ bin_PROGRAMS = checkregularity
 
 checkregularity_SOURCES = checkregularity.cc
 
-LDADD           = ../lib-src-reg/libCHECKREG.a \
-                  ../lib-src/libTOPCOM.a \
-                  ../external/lib/libcddgmp.a \
-                  ../external/lib/libgmpxx.a \
-                  ../external/lib/libgmp.a
-
 AM_CPPFLAGS     = -I../lib-src
 AM_CPPFLAGS    += -I../lib-src-reg
+AM_CPPFLAGS    += -L../lib-src-reg
+AM_CPPFLAGS    += -L../lib-src
 AM_CPPFLAGS    += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS    += -I../external/include
+AM_CPPFLAGS    += $(CPPFLAGS)
 AM_CPPFLAGS    += -I$(includedir)
 
 
-AM_CPPFLAGS    += -DVERBOSE -DGMPRATIONAL -ftemplate-depth-30
-
-AM_CXXFLAGS     = -O2
+AM_CPPFLAGS    += -DVERBOSE -DGMPRATIONAL -ftemplate-depth-30 -lTOPCOM -lCHECKREG
 
+AM_CXXFLAGS     = $(CXXFLAGS) -L../lib-src-reg -L../lib-src -lTOPCOM -lCHECKREG
diff --git a/src/Makefile.am b/src/Makefile.am
index ff7e574..63a76fc 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -83,18 +83,14 @@ santos_triang_SOURCES              = santos_triang.cc
 santos_dim4_triang_SOURCES         = santos_dim4_triang.cc
 santos_22_triang_SOURCES           = santos_22_triang.cc
 
-LDADD           = ../lib-src/libTOPCOM.a \
-                  ../lib-src-reg/libCHECKREG.a \
-                  ../external/lib/libcddgmp.a \
-                  ../external/lib/libgmpxx.a \
-                  ../external/lib/libgmp.a
-
 AM_CPPFLAGS     = -I../lib-src
 AM_CPPFLAGS    += -I../lib-src-reg
+AM_CPPFLAGS    += -L../lib-src-reg
+AM_CPPFLAGS    += -L../lib-src
 AM_CPPFLAGS    += -I../wrap-gmp-gmpxx
-AM_CPPFLAGS    += -I../external/include
+AM_CPPFLAGS    += $(CPPFLAGS)
 AM_CPPFLAGS    += -I$(includedir)
 
-AM_CPPFLAGS    += -DVERBOSE -DGMPRATIONAL -ftemplate-depth-30
+AM_CPPFLAGS    += -DVERBOSE -DGMPRATIONAL -ftemplate-depth-30 -lTOPCOM -lCHECKREG
 
-AM_CXXFLAGS     = -O2
+AM_CXXFLAGS     = $(CXXFLAGS) -L../lib-src-reg -L../lib-src -lTOPCOM -lCHECKREG
diff --git a/wrap-gmp-gmpxx/Makefile.am b/wrap-gmp-gmpxx/Makefile.am
index b9ef8db..4c3f675 100644
--- a/wrap-gmp-gmpxx/Makefile.am
+++ b/wrap-gmp-gmpxx/Makefile.am
@@ -3,6 +3,6 @@ Integer.h \
 Rational.h
 
 AM_CPPFLAGS        = -I../external/include
-AM_CPPFLAGS       += -I$(includedir)
+AM_CPPFLAGS       += -I$(includedir) $(CPPFLAGS)
 
-AM_CXXFLAGS     = -O2
+AM_CXXFLAGS     = $(CXXFLAGS)
-- 
2.35.1

From 1980a3cba20ac549f488d7e00a01d3eee61485be Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Sat, 7 May 2022 16:14:57 -0400
Subject: [PATCH 2/3] configure.ac: don't try to invoke csh to print an
 informational message.

On systems that don't have csh, running "csh -c 'echo...'" will result
in an error; for example,

  ./configure: line 4102: csh: command not found

Autoconf already provides macros to print the status and results of
various checks, so here we switch this particular invocation to make
use of AC_MSG_CHECKING and AC_MSG_RESULT.

While we're at it, the old-fashioned AC_CHECK_LIB was updated to use
the newer AC_SEARCH_LIBS.
---
 configure.ac | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index a10fb97..0b2c0aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,7 +21,11 @@ dnl AC_CHECK_LIB(stdc, main)
 dnl Replace `main' with a function in -lstdc++:
 dnl AC_CHECK_LIB(stdc++, main)
 dnl Check for soplex:
-AC_CHECK_LIB(soplex, main, , csh -c 'echo soplex not found: --soplex will not work.')
+AC_MSG_CHECKING([for soplex])
+AC_SEARCH_LIBS([main],
+               [soplex],
+               [AC_MSG_RESULT([success])],
+               [AC_MSG_RESULT([failed, --soplex will not work])])
 
 dnl Checks for header files.
 AC_HEADER_STDC
-- 
2.35.1

From 041f20f5712262ab99bfdfe29e20355d5e4fbf5d Mon Sep 17 00:00:00 2001
From: Michael Orlitzky <michael@orlitzky.com>
Date: Sat, 7 May 2022 16:19:50 -0400
Subject: [PATCH 3/3] configure.ac: run autoupdate.

Autoconf-2.7x emits a few warnings while processing configure.ac. This
commit is the result of running "autoupdate" to fix them.
---
 configure.ac | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0b2c0aa..cddaef6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(TOPCOM, 0.17.8)
+AC_INIT([TOPCOM],[0.17.8])
 AC_CONFIG_SRCDIR(.)
 
 dnl Init automake.
@@ -27,12 +27,9 @@ AC_SEARCH_LIBS([main],
                [AC_MSG_RESULT([success])],
                [AC_MSG_RESULT([failed, --soplex will not work])])
 
-dnl Checks for header files.
-AC_HEADER_STDC
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
-dnl Checks for library functions.
-
-AC_OUTPUT(wrap-gmp-gmpxx/Makefile lib-src/Makefile lib-src-reg/Makefile src/Makefile src-reg/Makefile examples/Makefile Makefile)
+AC_CONFIG_FILES([wrap-gmp-gmpxx/Makefile lib-src/Makefile lib-src-reg/Makefile src/Makefile src-reg/Makefile examples/Makefile Makefile])
+AC_OUTPUT
-- 
2.35.1