Skip to content
Newer
Older
100644 473 lines (448 sloc) 15.4 KB
e74702b Initial revision
Tanaka Akira authored
1 #!/bin/sh
2 #
3 # mkmakemod.sh: generate Makefile.in files for module building
4 #
5 # Options:
6 # -m = file is already generated; only build the second stage
7 # -i = do not build second stage
8 #
9 # Args:
10 # $1 = subdirectory to look in, relative to $top_srcdir
11 # $2 = final output filename, within the $1 directory
12 #
13 # This script must be run from the top-level build directory, and $top_srcdir
14 # must be set correctly in the environment.
15 #
16 # This looks in $1, and uses all the *.mdd files there. Each .mdd file
17 # defines one module. The .mdd file is actually a shell script, which will
18 # be sourced. It may define the following shell variables:
19 #
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
20 # name name of this module
21 # moddeps modules on which this module depends (default none)
22 # nozshdep non-empty indicates no dependence on the `zsh/main' pseudo-module
23 # alwayslink if non-empty, always link the module into the executable
24 # autobins builtins defined by the module, for autoloading
25 # autoinfixconds infix condition codes defined by the module, for
26 # autoloading (without the leading `-')
27 # autoprefixconds like autoinfixconds, but for prefix condition codes
28 # autoparams parameters defined by the module, for autoloading
29 # automathfuncs math functions defined by the module, for autoloading
30 # objects .o files making up this module (*must* be defined)
31 # proto .syms files for this module (default generated from $objects)
32 # headers extra headers for this module (default none)
33 # hdrdeps extra headers on which the .mdh depends (default none)
34 # otherincs extra headers that are included indirectly (default none)
e74702b Initial revision
Tanaka Akira authored
35 #
36 # The .mdd file may also include a Makefile.in fragment between lines
37 # `:<<\Make' and `Make' -- this will be copied into Makemod.in.
38 #
39 # The resulting Makemod.in knows how to build each module that is defined.
c73dd46 Fixes from Thorsten Dahlheimer.
Peter Stephenson authored
40 # For each module it also knows how to build a .mdh file. Each source file
e74702b Initial revision
Tanaka Akira authored
41 # should #include the .mdh file for the module it is a part of. The .mdh
42 # file #includes the .mdh files for any module dependencies, then each of
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
43 # $headers, and then each .epro (for global declarations). It will
e74702b Initial revision
Tanaka Akira authored
44 # be recreated if any of the dependency .mdh files changes, or if any of
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
45 # $headers or $hdrdeps changes. When anything depends on it, all the .epros
e74702b Initial revision
Tanaka Akira authored
46 # and $otherincs will be made up to date, but the .mdh file won't actually
47 # be rebuilt if those files change.
48 #
49 # The order of sections of the output file is thus:
50 # simple generated macros
51 # macros generated from *.mdd
52 # included Makemod.in.in
53 # rules generated from *.mdd
54 # The order dependencies are basically that the generated macros are required
55 # in Makemod.in.in, but some of the macros that it creates are needed in the
56 # later rules.
57 #
58
59 # sed script to normalise a pathname
60 sed_normalise='
61 s,^,/,
62 s,$,/,
63 :1
64 s,/\./,/,
65 t1
66 :2
67 s,/[^/.][^/]*/\.\./,/,
68 s,/\.[^/.][^/]*/\.\./,/,
69 s,/\.\.[^/][^/]*/\.\./,/,
70 t2
71 s,^/$,.,
72 s,^/,,
73 s,\(.\)/$,\1,
74 '
75
76 # decide which stages to process
77 first_stage=true
78 second_stage=true
79 if test ."$1" = .-m; then
80 shift
81 first_stage=false
82 elif test ."$1" = .-i; then
83 shift
84 second_stage=false
85 fi
86
87 top_srcdir=`echo $top_srcdir | sed "$sed_normalise"`
88 the_subdir=$1
89 the_makefile=$2
90
91 if $first_stage; then
92
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
93 dir_top=`echo $the_subdir | sed 's,[^/][^/]*,..,g'`
94
c73dd46 Fixes from Thorsten Dahlheimer.
Peter Stephenson authored
95 trap "rm -f $the_subdir/${the_makefile}.in; exit 1" 1 2 15
e74702b Initial revision
Tanaka Akira authored
96 echo "creating $the_subdir/${the_makefile}.in"
97 exec 3>&1 >$the_subdir/${the_makefile}.in
98 echo "##### ${the_makefile}.in generated automatically by mkmakemod.sh"
99 echo "##### DO NOT EDIT!"
100 echo
101 echo "##### ===== DEFINITIONS ===== #####"
102 echo
103 echo "makefile = ${the_makefile}"
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
104 echo "dir_top = ${dir_top}"
105 echo "subdir = ${the_subdir}"
e74702b Initial revision
Tanaka Akira authored
106 echo
107
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
108 bin_mods=`grep link=static ./config.modules | \
109 sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`
110 dyn_mods="`grep link=dynamic ./config.modules | \
111 sed -e '/^#/d' -e 's/ .*/ /' -e 's/^name=/ /'`"
112 module_list="${bin_mods}${dyn_mods}"
113
4c5d9ae 24498: tweak to grep config.h instead of config.status for dynamic co…
Peter Stephenson authored
114 if grep '^#define DYNAMIC ' config.h >/dev/null; then
e74702b Initial revision
Tanaka Akira authored
115 is_dynamic=true
116 else
117 is_dynamic=false
118 fi
119
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
120 here_mddnames=
e74702b Initial revision
Tanaka Akira authored
121 all_subdirs=
122 all_modobjs=
123 all_modules=
124 all_mdds=
125 all_mdhs=
126 all_proto=
127 lastsub=//
128 for module in $module_list; do
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
129 modfile="`grep '^name='$module' ' ./config.modules | \
130 sed -e 's/^.* modfile=//' -e 's/ .*//'`"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
131 case $modfile in
132 $the_subdir/$lastsub/*) ;;
133 $the_subdir/*/*)
134 lastsub=`echo $modfile | sed 's,^'$the_subdir'/,,;s,/[^/]*$,,'`
7194a50 unposted: fix patterns previous patch
Andrey Borzenkov authored
135 case "$all_subdirs " in
79b9ccd 13412: avoid duplicates in subdirecory list for recursive build
Andrey Borzenkov authored
136 *" $lastsub "* ) ;;
137 * )
138 all_subdirs="$all_subdirs $lastsub"
139 ;;
140 esac
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
141 ;;
142 $the_subdir/*)
143 mddname=`echo $modfile | sed 's,^.*/,,;s,\.mdd$,,'`
144 here_mddnames="$here_mddnames $mddname"
e74702b Initial revision
Tanaka Akira authored
145 build=$is_dynamic
146 case $is_dynamic@$bin_mods in
147 *" $module "*)
148 build=true
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
149 all_modobjs="$all_modobjs modobjs.${mddname}" ;;
e74702b Initial revision
Tanaka Akira authored
150 true@*)
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
151 all_modules="$all_modules ${mddname}.\$(DL_EXT)" ;;
e74702b Initial revision
Tanaka Akira authored
152 esac
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
153 all_mdds="$all_mdds ${mddname}.mdd"
154 $build && all_mdhs="$all_mdhs ${mddname}.mdh"
155 $build && all_proto="$all_proto proto.${mddname}"
e74702b Initial revision
Tanaka Akira authored
156 ;;
157 esac
158 done
159 echo "MODOBJS =$all_modobjs"
160 echo "MODULES =$all_modules"
161 echo "MDDS =$all_mdds"
162 echo "MDHS =$all_mdhs"
163 echo "PROTOS =$all_proto"
164 echo "SUBDIRS =$all_subdirs"
165 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
166 echo "ENTRYOBJ = \$(dir_src)/modentry..o"
167 echo "NNTRYOBJ ="
168 echo "ENTRYOPT = -emodentry"
169 echo "NNTRYOPT ="
170 echo
e74702b Initial revision
Tanaka Akira authored
171
172 echo "##### ===== INCLUDING Makemod.in.in ===== #####"
173 echo
174 cat $top_srcdir/Src/Makemod.in.in
175 echo
176
177 case $the_subdir in
178 Src) modobjs_sed= ;;
179 Src/*) modobjs_sed="| sed 's\" \" "`echo $the_subdir | sed 's,^Src/,,'`"/\"g' " ;;
180 *) modobjs_sed="| sed 's\" \" ../$the_subdir/\"g' " ;;
181 esac
182
183 other_mdhs=
184 remote_mdhs=
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
185 other_exports=
186 remote_exports=
187 other_modules=
188 remote_modules=
189 for mddname in $here_mddnames; do
e74702b Initial revision
Tanaka Akira authored
190
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
191 unset name moddeps nozshdep alwayslink hasexport
192 unset autobins autoinfixconds autoprefixconds autoparams automathfuncs
7c45854 14077: revert clint's build patches on 19.04.2001
Andrey Borzenkov authored
193 unset objects proto headers hdrdeps otherincs
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
194 . $top_srcdir/$the_subdir/${mddname}.mdd
195 q_name=`echo $name | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
e74702b Initial revision
Tanaka Akira authored
196 test -n "${moddeps+set}" || moddeps=
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
197 test -n "$nozshdep" || moddeps="$moddeps zsh/main"
e74702b Initial revision
Tanaka Akira authored
198 test -n "${proto+set}" ||
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
199 proto=`echo $objects '' | sed 's,\.o ,.syms ,g'`
e74702b Initial revision
Tanaka Akira authored
200
201 dobjects=`echo $objects '' | sed 's,\.o ,..o ,g'`
202 modhdeps=
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
203 mododeps=
204 exportdeps=
205 imports=
206 q_moddeps=
e74702b Initial revision
Tanaka Akira authored
207 for dep in $moddeps; do
49a1ad7 13194: change in module configuration system
Peter Stephenson authored
208 depfile="`grep '^name='$dep' ' ./config.modules | \
209 sed -e 's/^.* modfile=//' -e 's/ .*//'`"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
210 q_dep=`echo $dep | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`
211 q_moddeps="$q_moddeps $q_dep"
212 eval `echo $depfile | sed 's,/\([^/]*\)\.mdd$,;depbase=\1,;s,^,loc=,'`
213 case "$binmod" in
214 *" $dep "* )
215 dep=zsh/main
216 ;;
217 esac
218
e74702b Initial revision
Tanaka Akira authored
219 case $the_subdir in
220 $loc)
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
221 mdh="${depbase}.mdh"
222 export="${depbase}.export"
223 case "$dep" in
224 zsh/main )
225 mdll="\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "
226 ;;
227 * )
228 mdll="${depbase}.\$(DL_EXT) "
229 ;;
230 esac
e74702b Initial revision
Tanaka Akira authored
231 ;;
232 $loc/*)
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
233 mdh="\$(dir_top)/$loc/${depbase}.mdh"
e74702b Initial revision
Tanaka Akira authored
234 case "$other_mdhs " in
235 *" $mdh "*) ;;
236 *) other_mdhs="$other_mdhs $mdh" ;;
237 esac
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
238 export="\$(dir_top)/$loc/${depbase}.export"
239 case "$other_exports " in
240 *" $export "*) ;;
241 *) other_exports="$other_exports $export" ;;
242 esac
243 case "$dep" in
244 zsh/main )
245 mdll="\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "
246 ;;
247 * )
248 mdll="\$(dir_top)/$loc/${depbase}.\$(DL_EXT) "
249 ;;
250 esac
251 case "$other_modules " in
252 *" $mdll "*) ;;
253 *) other_modules="$other_modules $mdll" ;;
254 esac
e74702b Initial revision
Tanaka Akira authored
255 ;;
256 *)
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
257 mdh="\$(dir_top)/$loc/${depbase}.mdh"
e74702b Initial revision
Tanaka Akira authored
258 case "$remote_mdhs " in
259 *" $mdh "*) ;;
260 *) remote_mdhs="$remote_mdhs $mdh" ;;
261 esac
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
262 export="\$(dir_top)/$loc/${depbase}.export"
263 case "$remote_exports " in
264 *" $export "*) ;;
265 *) remote_exports="$remote_exports $export" ;;
266 esac
267 case "$dep" in
268 zsh/main )
269 mdll="\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "
270 ;;
271 * )
272 mdll="\$(dir_top)/$loc/${depbase}.\$(DL_EXT) "
273 ;;
274 esac
275 case "$remote_modules " in
276 *" $mdll "*) ;;
277 *) remote_modules="$remote_modules $mdll" ;;
278 esac
e74702b Initial revision
Tanaka Akira authored
279 ;;
280 esac
281 modhdeps="$modhdeps $mdh"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
282 exportdeps="$exportdeps $export"
283 imports="$imports \$(IMPOPT)$export"
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
284 case "$mododeps " in
285 *" $mdll "* )
286 :
287 ;;
288 * )
289 mododeps="$mododeps $mdll"
290 ;;
291 esac
e74702b Initial revision
Tanaka Akira authored
292 done
293
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
294 echo "##### ===== DEPENDENCIES GENERATED FROM ${mddname}.mdd ===== #####"
295 echo
296 echo "MODOBJS_${mddname} = $objects"
297 echo "MODDOBJS_${mddname} = $dobjects \$(@E@NTRYOBJ)"
298 echo "SYMS_${mddname} = $proto"
299 echo "EPRO_${mddname} = "`echo $proto '' | sed 's,\.syms ,.epro ,g'`
300 echo "INCS_${mddname} = \$(EPRO_${mddname}) $otherincs"
301 echo "EXPIMP_${mddname} = $imports \$(EXPOPT)$mddname.export"
302 echo "NXPIMP_${mddname} ="
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
303 echo "LINKMODS_${mddname} = $mododeps"
304 echo "NOLINKMODS_${mddname} = "
e74702b Initial revision
Tanaka Akira authored
305 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
306 echo "proto.${mddname}: \$(EPRO_${mddname})"
307 echo "\$(SYMS_${mddname}): \$(PROTODEPS)"
e74702b Initial revision
Tanaka Akira authored
308 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
309 echo "${mddname}.export: \$(SYMS_${mddname})"
310 echo " ( echo '#!'; cat \$(SYMS_${mddname}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$@"
e74702b Initial revision
Tanaka Akira authored
311 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
312 echo "modobjs.${mddname}: \$(MODOBJS_${mddname})"
313 echo " echo '' \$(MODOBJS_${mddname}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp"
e74702b Initial revision
Tanaka Akira authored
314 echo
315 if test -z "$alwayslink"; then
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
316 case " $all_modules" in *" ${mddname}."*)
317 echo "install.modules-here: install.modules.${mddname}"
318 echo "uninstall.modules-here: uninstall.modules.${mddname}"
319 echo
320 ;; esac
321 instsubdir=`echo $name | sed 's,^,/,;s,/[^/]*$,,'`
322 echo "install.modules.${mddname}: ${mddname}.\$(DL_EXT)"
7270c28 14401: workaround for script execution under Cygwin
Andrey Borzenkov authored
323 echo " \$(SHELL) \$(sdir_top)/mkinstalldirs \$(DESTDIR)\$(MODDIR)${instsubdir}"
60da953 14018: honor STRIPFLAGS when installing modules
Clint Adams authored
324 echo " \$(INSTALL_PROGRAM) \$(STRIPFLAGS) ${mddname}.\$(DL_EXT) \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
325 echo
326 echo "uninstall.modules.${mddname}:"
327 echo " rm -f \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"
328 echo
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
329 echo "${mddname}.\$(DL_EXT): \$(MODDOBJS_${mddname}) ${mddname}.export $exportdeps \$(@LINKMODS@_${mddname})"
e74702b Initial revision
Tanaka Akira authored
330 echo ' rm -f $@'
7c45854 14077: revert clint's build patches on 19.04.2001
Andrey Borzenkov authored
331 echo " \$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) \$(MODDOBJS_${mddname}) \$(@LINKMODS@_${mddname}) \$(LIBS) "
e74702b Initial revision
Tanaka Akira authored
332 echo
333 fi
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
334 echo "${mddname}.mdhi: ${mddname}.mdhs \$(INCS_${mddname})"
e74702b Initial revision
Tanaka Akira authored
335 echo " @test -f \$@ || echo 'do not delete this file' > \$@"
336 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
337 echo "${mddname}.mdhs: ${mddname}.mdd"
338 echo " @\$(MAKE) -f \$(makefile) \$(MAKEDEFS) ${mddname}.mdh.tmp"
339 echo " @if cmp -s ${mddname}.mdh ${mddname}.mdh.tmp; then \\"
340 echo " rm -f ${mddname}.mdh.tmp; \\"
341 echo " echo \"\\\`${mddname}.mdh' is up to date.\"; \\"
e74702b Initial revision
Tanaka Akira authored
342 echo " else \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
343 echo " mv -f ${mddname}.mdh.tmp ${mddname}.mdh; \\"
344 echo " echo \"Updated \\\`${mddname}.mdh'.\"; \\"
e74702b Initial revision
Tanaka Akira authored
345 echo " fi"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
346 echo " echo 'timestamp for ${mddname}.mdh against ${mddname}.mdd' > \$@"
e74702b Initial revision
Tanaka Akira authored
347 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
348 echo "${mddname}.mdh: ${modhdeps} ${headers} ${hdrdeps} ${mddname}.mdhi"
349 echo " @\$(MAKE) -f \$(makefile) \$(MAKEDEFS) ${mddname}.mdh.tmp"
350 echo " @mv -f ${mddname}.mdh.tmp ${mddname}.mdh"
351 echo " @echo \"Updated \\\`${mddname}.mdh'.\""
e74702b Initial revision
Tanaka Akira authored
352 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
353 echo "${mddname}.mdh.tmp:"
e74702b Initial revision
Tanaka Akira authored
354 echo " @( \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
355 echo " echo '#ifndef have_${q_name}_module'; \\"
356 echo " echo '#define have_${q_name}_module'; \\"
357 echo " echo; \\"
358 echo " echo '# ifndef IMPORTING_MODULE_${q_name}'; \\"
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
359 echo " if test @SHORTBOOTNAMES@ = yes; then \\"
360 echo " echo '# ifndef MODULE'; \\"
361 echo " fi; \\"
362 echo " echo '# define boot_ boot_${q_name}'; \\"
363 echo " echo '# define cleanup_ cleanup_${q_name}'; \\"
b0c5f09 see 23479: add initial features support for modules
Peter Stephenson authored
364 echo " echo '# define features_ features_${q_name}'; \\"
365 echo " echo '# define enables_ enables_${q_name}'; \\"
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
366 echo " echo '# define setup_ setup_${q_name}'; \\"
367 echo " echo '# define finish_ finish_${q_name}'; \\"
368 echo " if test @SHORTBOOTNAMES@ = yes; then \\"
369 echo " echo '# endif /* !MODULE */'; \\"
370 echo " fi; \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
371 echo " echo '# endif /* !IMPORTING_MODULE_${q_name} */'; \\"
e74702b Initial revision
Tanaka Akira authored
372 echo " echo; \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
373 if test -n "$moddeps"; then (
374 set x $q_moddeps
e74702b Initial revision
Tanaka Akira authored
375 echo " echo '/* Module dependencies */'; \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
376 for hdep in $modhdeps; do
377 shift
378 echo " echo '# define IMPORTING_MODULE_${1} 1'; \\"
379 echo " echo '# include \"${hdep}\"'; \\"
380 done
e74702b Initial revision
Tanaka Akira authored
381 echo " echo; \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
382 ) fi
e74702b Initial revision
Tanaka Akira authored
383 if test -n "$headers"; then
384 echo " echo '/* Extra headers for this module */'; \\"
385 echo " for hdr in $headers; do \\"
de06c83 29214: use -I rather than explicit path to find headers
Peter Stephenson authored
386 echo " echo '# include \"'\$\$hdr'\"'; \\"
e74702b Initial revision
Tanaka Akira authored
387 echo " done; \\"
388 echo " echo; \\"
389 fi
390 if test -n "$proto"; then
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
391 echo " echo '# undef mod_import_variable'; \\"
392 echo " echo '# undef mod_import_function'; \\"
393 echo " echo '# if defined(IMPORTING_MODULE_${q_name}) && defined(MODULE)'; \\"
394 echo " echo '# define mod_import_variable @MOD_IMPORT_VARIABLE@'; \\"
395 echo " echo '# define mod_import_function @MOD_IMPORT_FUNCTION@'; \\"
396 echo " echo '# else'; \\"
397 echo " echo '# define mod_import_function'; \\"
398 echo " echo '# define mod_import_variable'; \\"
399 echo " echo '# endif /* IMPORTING_MODULE_${q_name} && MODULE */'; \\"
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
400 echo " for epro in \$(EPRO_${mddname}); do \\"
401 echo " echo '# include \"'\$\$epro'\"'; \\"
e74702b Initial revision
Tanaka Akira authored
402 echo " done; \\"
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
403 echo " echo '# undef mod_import_variable'; \\"
404 echo " echo '# define mod_import_variable'; \\"
405 echo " echo '# undef mod_import_variable'; \\"
406 echo " echo '# define mod_import_variable'; \\"
407 echo " echo '# ifndef mod_export'; \\"
408 echo " echo '# define mod_export @MOD_EXPORT@'; \\"
409 echo " echo '# endif /* mod_export */'; \\"
e74702b Initial revision
Tanaka Akira authored
410 echo " echo; \\"
411 fi
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
412 echo " echo '#endif /* !have_${q_name}_module */'; \\"
e74702b Initial revision
Tanaka Akira authored
413 echo " ) > \$@"
414 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
415 echo "\$(MODOBJS_${mddname}) \$(MODDOBJS_${mddname}): ${mddname}.mdh"
e74702b Initial revision
Tanaka Akira authored
416 sed -e '/^ *: *<< *\\Make *$/,/^Make$/!d' \
417 -e 's/^ *: *<< *\\Make *$//; /^Make$/d' \
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
418 < $top_srcdir/$the_subdir/${mddname}.mdd
e74702b Initial revision
Tanaka Akira authored
419 echo
420
421 done
422
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
423 if test -n "$remote_mdhs$other_mdhs$remote_exports$other_exports$remote_modules$other_modules"; then
e74702b Initial revision
Tanaka Akira authored
424 echo "##### ===== DEPENDENCIES FOR REMOTE MODULES ===== #####"
425 echo
426 for mdh in $remote_mdhs; do
427 echo "$mdh: FORCE"
428 echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdh"
429 echo
430 done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
431 if test -n "$other_mdhs"; then
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
432 echo "${other_mdhs}:" | sed 's,^ ,,'
433 echo " false # should only happen with make -n"
434 echo
435 fi
436 for export in $remote_exports; do
437 echo "$export: FORCE"
438 echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$export"
439 echo
440 done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
441 if test -n "$other_exports"; then
442 echo "${other_exports}:" | sed 's,^ ,,'
e74702b Initial revision
Tanaka Akira authored
443 echo " false # should only happen with make -n"
444 echo
445 fi
c88d3a5 Andrej, 12623: Fix dynamic linking for cygwin.
Bart Schaefer authored
446 for mdll in $remote_modules; do
447 echo "$mdll: FORCE"
448 echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdll"
449 echo
450 done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'
451 if test -n "$other_modules"; then
452 echo "${other_modules}:" | sed 's,^ ,,'
453 echo " false # should only happen with make -n"
454 echo
4f1aa82 Andrej: Dynamic loading on cygwin
Peter Stephenson authored
455 fi
e74702b Initial revision
Tanaka Akira authored
456 fi
457
458 echo "##### End of ${the_makefile}.in"
459
460 exec >&3 3>&-
461
462 fi
463
4b44bbb unposted; based on 14679 (me) and 14693 (Bart): Allow processing by both
Andrey Borzenkov authored
464 if $second_stage ; then
c73dd46 Fixes from Thorsten Dahlheimer.
Peter Stephenson authored
465 trap "rm -f $the_subdir/${the_makefile}; exit 1" 1 2 15
e74702b Initial revision
Tanaka Akira authored
466
d83af1a 19420: Update configure.ac for better Autconf 2.50 support.
Peter Stephenson authored
467 ${CONFIG_SHELL-/bin/sh} ./config.status \
468 --file=$the_subdir/${the_makefile}:$the_subdir/${the_makefile}.in ||
c73dd46 Fixes from Thorsten Dahlheimer.
Peter Stephenson authored
469 exit 1
e74702b Initial revision
Tanaka Akira authored
470 fi
471
472 exit 0
Something went wrong with that request. Please try again.