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
  
258
  
259
  
260
  
261
  
262
  
263
  
264
  
265
  
266
  
267
  
268
  
269
  
270
  
271
  
272
  
273
  
274
  
275
  
276
  
277
  
278
  
279
  
280
  
281
  
282
  
283
  
284
  
285
  
286
  
287
  
288
  
289
  
290
  
291
  
292
  
293
  
294
  
295
  
296
  
297
  
298
  
# @configure_input@ 
SRCDIR=@srcdir@ 
VPATH=@srcdir@ 
prefix=@prefix@ 
 
@SET_MAKE@ 
 
INSTALL=@INSTALL@ 
 
CC=@CC@ 
CPPFLAGS=@CPPFLAGS@ 
CFLAGS=@REALCFLAGS@ 
JOINEDCFLAGS=@CFLAGS@ 
LDFLAGS=$(CFLAGS) @LDFLAGS@ 
 
PIKEVERSION=@PIKEVERSION@ 
 
all:    @MAKE_GMP@ @MAKE_GDBM@ @MAKE_ZLIB@ pike extern 
 
pike: force 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS) @LINKFORSHARED@") 
 
extern: force 
        @(cd extern;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" all) 
 
gmp: force 
        -@(cd gmp;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" all) 
 
gdbm: force 
        -@(cd gdbm;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" all) 
 
zlib: force 
        -@(cd zlib;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" libz.a) 
 
force: 
 
# These are here for compatibility with the easy-start makefile 
easy: all 
hard: all 
 
depend: 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" depend) 
        echo "You need to run configure once again." 
 
verify: all verify_other 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" verify) 
 
verbose_verify: all verify_other 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" verbose_verify) 
 
verify_other: 
        @if test "@MAKE_ZLIB@" = "zlib"; then \ 
          $(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" verify_zlib; \ 
        fi 
        @if test "@MAKE_GMP@" = "gmp"; then \ 
          $(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" verify_gmp; \ 
        fi 
 
verify_zlib: 
        @(cd zlib;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" test) 
 
verify_gmp: 
        @(cd gmp;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" check) 
 
new_peep_engine: 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" new_peep_engine) 
 
check: verify 
 
clean: 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" clean) 
        @(cd extern;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" clean) 
 
install_all: install_pike install 
 
install: all install_only 
 
install_only:  
        $(SRCDIR)/mkdir -p $(prefix)/roxen/ 
        @if test -d $(prefix)/roxen/server.old/.; then \ 
          if test -d $(prefix)/roxen/server.older/.; then \ 
            echo; \ 
            echo "Warning, deleting old server \"$(prefix)/roxen/server.older\""; \ 
            echo; \ 
            rm -rf $(prefix)/roxen/server.older; \ 
          fi; \ 
          mv -f $(prefix)/roxen/server.old $(prefix)/roxen/server.older; \ 
        fi 
        @if test -d $(prefix)/roxen/server/.; then \ 
          mv -f $(prefix)/roxen/server $(prefix)/roxen/server.old ; \ 
        fi 
        cp -r $(SRCDIR)/server $(prefix)/roxen/ 
        @rm -rf $(prefix)/roxen/server/CVS $(prefix)/roxen/server/*/CVS\ 
                $(prefix)/roxen/server/*/*/CVS 
        cp pike/$(PIKEVERSION)/src/pike $(prefix)/roxen/server/bin 
        -@rm -f $(prefix)/roxen/server/bin/roxen >/dev/null 2>&1 
        ln $(prefix)/roxen/server/bin/pike $(prefix)/roxen/server/bin/roxen 
#       cp $(SRCDIR)/pike/$(PIKEVERSION)/bin/feature_list $(prefix)/roxen/server/bin 
        test -d $(prefix)/roxen/local/. || mkdir $(prefix)/roxen/local 
        test -d $(prefix)/roxen/local/modules/. || mkdir $(prefix)/roxen/local/modules 
        test -d $(prefix)/roxen/local/nfonts/. || mkdir $(prefix)/roxen/local/nfonts 
        test -d $(prefix)/roxen/server/lib/. || mkdir $(prefix)/roxen/server/lib 
        test -d $(prefix)/roxen/server/lib/pike/. || mkdir $(prefix)/roxen/server/lib/pike 
        @for d in `cd $(SRCDIR)/pike/$(PIKEVERSION)/lib; find . -type d -print`; do \ 
          if test -d $(prefix)/roxen/server/lib/pike/$$d; then :; else \ 
            mkdir $(prefix)/roxen/server/lib/pike/$$d || exit 1;\ 
          fi; \ 
        done 
        @for d in `cd pike/$(PIKEVERSION)/lib; find . -type d -print`; do \ 
          if test -d $(prefix)/roxen/server/lib/pike/$$d; then :; else \ 
            mkdir $(prefix)/roxen/server/lib/pike/$$d || exit 1;\ 
          fi; \ 
        done 
        @for f in `cd $(SRCDIR)/pike/$(PIKEVERSION)/lib; find . -type f -print`; do \ 
          if cmp $(SRCDIR)/pike/$(PIKEVERSION)/lib/$$f $(prefix)/roxen/server/lib/pike/$$f 2>&1 >/dev/null; then :; else \ 
            if test -f $(prefix)/roxen/server/lib/pike/$$f; then \ 
              mv -f $(prefix)/roxen/server/lib/pike/$$f $(prefix)/roxen/server/lib/pike/$$f.old; \ 
            else :; fi; \ 
            if cp -f $(SRCDIR)/pike/$(PIKEVERSION)/lib/$$f $(prefix)/roxen/server/lib/pike/$$f; then :; else \ 
              echo "Failed to copy $$f"; \ 
              exit 1; \ 
            fi; \ 
          fi; \ 
        done 
        @for f in `cd pike/$(PIKEVERSION)/src/lib; find . -type f -print`; do \ 
          if cmp pike/$(PIKEVERSION)/src/lib/$$f $(prefix)/roxen/server/lib/pike/$$f 2>&1 >/dev/null; then :; else \ 
            if test -f $(prefix)/roxen/server/lib/pike/$$f; then \ 
              mv -f $(prefix)/roxen/server/lib/pike/$$f $(prefix)/roxen/server/lib/pike/$$f.old; \ 
            else :; fi; \ 
            if cp -f pike/$(PIKEVERSION)/src/lib/$$f $(prefix)/roxen/server/lib/pike/$$f; then :; else \ 
              echo "Failed to copy $$f"; \ 
              exit 1; \ 
            fi; \ 
          fi; \ 
        done 
        test -d $(prefix)/roxen/server/include/. || mkdir $(prefix)/roxen/server/include 
        test -d $(prefix)/roxen/server/include/pike/. || mkdir $(prefix)/roxen/server/include/pike 
        for a in $(SRCDIR)/pike/$(PIKEVERSION)/src/*.h ./pike/$(PIKEVERSION)/src/*.h; do $(INSTALL) $$a $(prefix)/roxen/server/include/pike; done 
        -@(cd extern;$(MAKE) install "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)";cd ../) 
        -@$(SRCDIR)/mkdir -p $(prefix)/roxen/logs 
        -@$(SRCDIR)/mkdir -p $(prefix)/roxen/configurations 
        -chmod a+x $(prefix) 
        -chmod a+x $(prefix)/roxen 
        -chmod a+x $(prefix)/roxen/server 
        -@for d in fonts nfonts modules etc bin base_server more_modules \ 
                   config_actions server_templates \ 
                   languages roxen-images protocols unfinishedmodules; do \ 
          echo Modifying permissions for directory $(prefix)/roxen/server/$$d... ; \ 
          find $(prefix)/roxen/server/$$d -type d -exec chmod a+x '{}' \; ; \ 
          chmod -R a+r $(prefix)/roxen/server/$$d ;\ 
        done 
        -@for f in BUGS CHANGES CONTRIBUTORS COPYING GPL INSTALLING \ 
                README README.ssl3 TODO; do \ 
          if test -f $(SRCDIR)/$f ; then \ 
            echo Copying $f...; cp $(SRCDIR)/$f $(prefix)/roxen/$f; \ 
          else :; fi; \ 
        done 
        -@for f in cgi fcgi install.pike pdbi.pike pike roxen roxen_hostname; \ 
        do \ 
          if test -f $(prefix)/roxen/server/bin/$$f ; then \ 
            echo Modifying permissions for file $(prefix)/roxen/server/bin/$$f... ; \ 
            chmod a+rx $(prefix)/roxen/server/bin/$$f; \ 
          else :; fi; \ 
        done 
        @echo Roxen installed. 
 
install_pike: all 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" install) 
 
localinstall: all 
        cp pike/$(PIKEVERSION)/src/pike $(SRCDIR)/server/bin/ 
        -@rm -f $(SRCDIR)/server/bin/roxen >/dev/null 2>&1 
        ln $(SRCDIR)/server/bin/pike $(SRCDIR)/server/bin/roxen 
        @for d in lib lib/pike; do \ 
          if [ -d "$(SRCDIR)/server/$$d/." ]; then : ; else \ 
            echo "$$d"; \ 
            mkdir "$(SRCDIR)/server/$$d" || exit 1; \ 
            chmod a+rx "$(SRCDIR)/server/$$d/."; \ 
            chmod u+w "$(SRCDIR)/server/$$d/."; \ 
          fi; \ 
        done 
        @for d in `cd "pike/$(PIKEVERSION)/src/lib"; find . -type d -print`; do \ 
          if [ -d "$(SRCDIR)/server/lib/pike/$$d/." ]; then : ; else \ 
            echo "lib/pike/$$d"; \ 
            mkdir "$(SRCDIR)/server/lib/pike/$$d" || exit 1; \ 
            chmod a+rx "$(SRCDIR)/server/lib/pike/$$d/."; \ 
            chmod u+w "$(SRCDIR)/server/lib/pike/$$d/."; \ 
          fi; \ 
        done 
        @for f in `cd "pike/$(PIKEVERSION)/src/lib"; find . -type f -print`; do \ 
          if cmp "$(SRCDIR)/server/lib/pike/$$f" "pike/$(PIKEVERSION)/src/lib/$$f" >/dev/null 2>&1 ; \ 
          then : ; else \ 
            echo "lib/pike/$$f"; \ 
            if [ -f "$(SRCDIR)/server/lib/pike/$$f" ]; then \ 
              mv -f "$(SRCDIR)/server/lib/pike/$$f" "$(SRCDIR)/server/lib/pike/$$f.old"; \ 
            else : ; fi; \ 
            cp "pike/$(PIKEVERSION)/src/lib/$$f" "$(SRCDIR)/server/lib/pike/$$f" || exit 1; \ 
            chmod a+r "$(SRCDIR)/server/lib/pike/$$f"; \ 
            chmod u+w "$(SRCDIR)/server/lib/pike/$$f"; \ 
          fi ; \ 
        done 
        (cd extern; $(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" localinstall) 
 
spotless:  clean 
        @(cd extern;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" spotless) 
        @(cd pike/$(PIKEVERSION)/src;$(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" spotless) 
        rm -f server/bin/selfdir server/bin/roxen_hostname pike/$(PIKEVERSION)/src/pike\ 
        pike/$(PIKEVERSION)/src/pike.old server/bin/proxygarb  
        find . '(' -name '#*#' -o -name '*~' -o -name '.*~' -o -name '*.bak'\ 
        -o -name '.pine-debug*' -o -name '.*.bak' -o -name core -o -name \ 
        config.cache -o -name config.status -o -name config.log -o -name \ 
        "*.a" ')'  -print -exec /bin/rm '{}'  ';' 
        rm -rf server/logs 
        rm -rf logs 
 
 
distribute:     spotless 
        @(cd extern; $(MAKE) "prefix=$(prefix)" "CC=$(CC)" "LDFLAGS=$(LDFLAGS)" distribute) 
 
run_autoconf: 
        @(cd $(SRCDIR); pike/$(PIKEVERSION)/src/run_autoconf .) 
 
weak_cleanup: 
        @for f in `find $(SRCDIR) -type f -name '*~' -print` \ 
          `find $(SRCDIR) -type f -name '.#*' -print` \ 
          `find $(SRCDIR) -type f -name '#*' -print`; do \ 
          echo $$f; rm $$f || exit 1; \ 
        done 
 
bump_version.stamp: 
        @touch bump_version.stamp 
 
bump_version: bump_version.stamp 
        @if test -f $(SRCDIR)/server/base_server/roxen.pike.new; then \ 
          echo Deleting old $(SRCDIR)/server/base_server/roxen.pike.new...; \ 
          rm $(SRCDIR)/server/base_server/roxen.pike.new || exit 1; \ 
        else : ; fi 
        @(cd $(SRCDIR); \ 
          echo Updating sources...; \ 
          if cvs -q update -dA|egrep '^[CM?]'; then exit 1; else : ; fi; \ 
        ) 
        @(cd $(SRCDIR)/server/base_server; \ 
          echo Bumping version...; \ 
          build=`sed <roxen.pike -e'/__roxen_build__/s/[^0-9]*//gp' -ed|head -1`; \ 
          newbuild=`echo $$build 1+p|dc`; \ 
          sed <roxen.pike -e"/__roxen_build__/s/$$build/$$newbuild/" >roxen.pike.new; \ 
          checkbuild=`sed <roxen.pike.new -e'/__roxen_build__/s/[^0-9]*//gp' -ed|head -1`; \ 
          if test "x$$newbuild" = "x$$checkbuild"; then \ 
            mv -f roxen.pike.new roxen.pike || exit 1; \ 
            echo "Successfull bump to build $$newbuild."; \ 
          else \ 
            echo "Version bump failed: $$newbuild != $$checkbuild."; \ 
            exit 1; \ 
          fi; \ 
          version=`sed <roxen.pike -e'/__roxen_version__/s/[^.0-9]*//gp' -ed|head -1`; \ 
          cvs ci -m "Version bumped to $version.$build by bump_version." roxen.pike || exit 1; \ 
          echo "Roxen $$version.$$build" >../../VERSION; \ 
          cat ../../VERSION; \ 
        ) 
        @(cd $(SRCDIR); \ 
          echo Tagging...; \ 
          cvs tag `cat VERSION | tr 'A-Z.' 'a-z_'`||exit 1; \ 
        ) 
        @touch bump_version 
 
ChangeLog.gz: 
        cd $(SRCDIR); pike tools/make_changelog.pike | gzip -9 > ChangeLog.gz 
 
ChangeLog.rxml.gz: 
        cd $(SRCDIR); pike tools/make_changelog.pike --rxml |gzip -9 > ChangeLog.rxml.gz 
 
 
pre_dist: bump_version weak_cleanup run_autoconf depend 
        @(cd pike; $(MAKE) pre_dist) 
 
dist: ChangeLog.gz ChangeLog.rxml.gz 
        @if test -f $(SRCDIR)/VERSION; then :; else \ 
          echo 'You need to make pre_dist first!'; \ 
          exit 1; \ 
        fi 
        @version=`cat $(SRCDIR)/VERSION | tr 'A-Z.' 'a-z_'`; \ 
        if ls -d $$version*; then \ 
          echo Deleting old distributions...; \ 
          rm -rf $$version* || exit 1; \ 
        else :; fi; \ 
        mkdir $$version; \ 
        (cd $(SRCDIR); tar cf - .)|(cd $$version; tar xf -; make dist_clean); \ 
        tar cf - $$version | gzip -9 >$$version-nda.tar.gz; \ 
        if (cd $$version; make keep_dbapi || exit 1); then \ 
          mv $$version/dbapi.tar . || exit 1; \ 
        else :; fi; \ 
        (cd $$version; make censor_dbapi); \ 
        tar cf - $$version | gzip -9 >$$version.tar.gz; \ 
        (cd $$version; make censor_crypto); \ 
        tar cf - $$version | gzip -9 >$$version-int.tar.gz; \ 
        (cd $$version; tar xf ../dbapi.tar); \ 
        tar cf - $$version | gzip -9 >$$version-nda-int.tar.gz