-
Notifications
You must be signed in to change notification settings - Fork 76
/
Makefile.contribs
84 lines (82 loc) · 3.11 KB
/
Makefile.contribs
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
# -*-Makefile-*-
#
# Main authors:
# Christian Schulte <schulte@gecode.org>
# Guido Tack <tack@gecode.org>
# Grégoire Dooms <dooms@info.ucl.ac.be>
#
#
# Copyright:
# Christian Schulte, 2005
# Guido Tack, 2005
# Grégoire Dooms, 2005
#
# This file is part of Gecode, the generic constraint
# development environment:
# http://www.gecode.org
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
CONTRIBS := $(shell ls -d contribs/* 2>/dev/null )
contribdirs:
@rm -f configure.ac
@(echo "dnl This file was generated by Makefile.contribs."; \
echo "dnl Do not edit! Modifications will get lost!"; \
echo "dnl Edit configure.ac.in instead."; echo ""; \
cat configure.ac.in \
) > configure.ac
@for i in $(CONTRIBS); do \
if test ! -d $$i ; then continue ; fi; \
if test -f $$i.dis* ; then \
echo "Skipping disabled contrib $$i"; \
elif test -f $$i/configure -a '(' -f $$i/vti.ac -o -f $$i/shortdesc.ac ')' ; then \
mv configure.ac configure.ac.1; \
sed -e "s|\(dnl @SUBDIRS@\)|AC_CONFIG_SUBDIRS($$i) \1|g" \
configure.ac.1 > configure.ac; \
if test -f $$i/vti.ac; then \
echo "Add variable contrib from $$i"; \
mv configure.ac configure.ac.1; \
(sed -e "s|\(dnl @VTIS@\)|m4_include($$i/vti.ac) \1|g" \
configure.ac.1 > configure.ac); \
else \
mv configure.ac configure.ac.1; \
echo "Add contrib from $$i"; \
DESC="`head -n 1 $$i/shortdesc.ac`"; \
sed -e "s|\(dnl @CONTRIBS@\)|AC_GECODE_ENABLE_CONTRIB($${i#*\/},\"$$DESC\",[]) \1|g" \
configure.ac.1 > configure.ac; \
fi ;\
else \
if test ! -f $$i/configure; then \
echo "Skipping contrib $$i : no configure script"; \
else \
echo "Skipping contrib $$i : no shortdescr.ac or vis.ac file "; \
fi; \
fi;\
done
@rm -f configure.ac.1
@echo "\n// STATISTICS: support-any\n" >> gecode/support/config.hpp.in
@echo Running autoconf on generated configure.ac ...
@autoconf
@autoheader
@mv gecode/support/config.hpp.in config.hpp.in.1
@perl misc/fixautoheader.perl < config.hpp.in.1 \
> gecode/support/config.hpp.in
@rm config.hpp.in.1
@echo done.