~ubuntu-branches/ubuntu/lucid/autoconf-archive/lucid

« back to all changes in this revision

Viewing changes to html/ax_enable_builddir_uname.html

  • Committer: Bazaar Package Importer
  • Author(s): Deng Xiyue
  • Date: 2009-05-12 17:30:18 UTC
  • mfrom: (1.1.9 upstream) (3.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090512173018-s7y88nfoxpaauztk
Tags: 20090426-1
* New upstream release.
* Update Standard-Version to 3.8.1:
  + List original Debianizer.
  + Point to versioned license file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
 
"http://www.w3.org/TR/html4/strict.dtd">
3
 
<html lang="en">
4
 
 <head>
5
 
  <title>
6
 
   Autoconf Macro: ax_enable_builddir_uname
7
 
  </title>
8
 
  <link rel="stylesheet" type="text/css" href="autoconf-archive.css">
9
 
 </head>
10
 
 <body>
11
 
  <table summary="web navigation" style="width:100%;">
12
 
   <tbody>
13
 
    <tr>
14
 
     <td style="width:25%;" align="center" valign="top">
15
 
      <a href=
16
 
      "http://autoconf-archive.cryp.to/ax_enable_builddir_uname.m4">Download M4
17
 
      Source</a>
18
 
     </td>
19
 
     <td style="width:25%;" align="center" valign="top">
20
 
      <a href=
21
 
      "http://git.cryp.to/autoconf-archive?a=history;f=ax_enable_builddir_uname.m4">
22
 
      Macro History</a>
23
 
     </td>
24
 
     <td style="width:25%;" align="center" valign="top">
25
 
      <a href="macros-by-category.html">Category Index</a>
26
 
     </td>
27
 
     <td style="width:25%;" align="center" valign="top">
28
 
      <form method="get" action="http://www.google.com/search">
29
 
       <div>
30
 
        <input name="sitesearch" value="autoconf-archive.cryp.to" type=
31
 
        "hidden"><a href="http://www.google.com/">Search</a>: <input name="q"
32
 
        size="10" maxlength="255" type="text">
33
 
       </div>
34
 
      </form>
35
 
     </td>
36
 
    </tr>
37
 
   </tbody>
38
 
  </table>
39
 
  <hr>
40
 
  <h1>
41
 
   ax_enable_builddir_uname
42
 
  </h1>
43
 
  <h2>
44
 
   Obsolete Macro
45
 
  </h2>
46
 
  <p class="indent">
47
 
   Use <a href="ax_enable_builddir.html">AX_ENABLE_BUILDDIR</a> in combination
48
 
   with AC_CANONICAL_HOST.
49
 
  </p>
50
 
  <h2>
51
 
   Synopsis
52
 
  </h2>
53
 
  <p class="indent" style="white-space:nowrap;">
54
 
   <code>AX_ENABLE_BUILDDIR_UNAME [(dirstring-or-command
55
 
   [,Makefile.mk])]</code>
56
 
  </p>
57
 
  <h2>
58
 
   Description
59
 
  </h2>
60
 
  <div class="indent">
61
 
   <p>
62
 
    If the current configure was run within the srcdir then we move all
63
 
    configure-files into a subdir and let the configure steps continue there.
64
 
    We provide an option --disable-builddir to suppress the move into a
65
 
    separate builddir.
66
 
   </p>
67
 
   <p>
68
 
    Defaults:
69
 
   </p>
70
 
   <pre>
71
 
  $1 = $build (defaults to `uname -msr`.d)
72
 
  $2 = Makefile.mk
73
 
  $3 = -all
74
 
</pre>
75
 
   <p>
76
 
    This macro must be called before AM_INIT_AUTOMAKE. It creates a default
77
 
    toplevel srcdir Makefile from the information found in the created toplevel
78
 
    builddir Makefile. It just copies the variables and rule-targets, each
79
 
    extended with a default rule-execution that recurses into the build
80
 
    directory of the current "BUILD". You can override the auto-dection through
81
 
    `uname -msr | tr " /" "__"`.d at build-time of course, as in
82
 
   </p>
83
 
   <pre>
84
 
  make BUILD=i386-mingw-cross
85
 
</pre>
86
 
   <p>
87
 
    After the default has been created, additional rules can be appended that
88
 
    will not just recurse into the subdirectories and only ever exist in the
89
 
    srcdir toplevel makefile - these parts are read from the $2 = Makefile.mk
90
 
    file
91
 
   </p>
92
 
   <p>
93
 
    The automatic rules are usually scanning the toplevel Makefile for lines
94
 
    like '#### $build |$builddir' to recognize the place where to recurse into.
95
 
    Usually, the last one is the only one used. However, almost all targets
96
 
    have an additional "*-all" rule which makes the script to recurse into
97
 
    _all_ variants of the current BUILD (!!) setting. The "-all" suffix can be
98
 
    overriden for the macro as well.
99
 
   </p>
100
 
   <p>
101
 
    A special rule is only given for things like "dist" that will copy the
102
 
    tarball from the builddir to the sourcedir (or $(PUB)) for reason of
103
 
    convenience.
104
 
   </p>
105
 
  </div>
106
 
  <h2>
107
 
   Author
108
 
  </h2>
109
 
  <p class="indent">
110
 
   Guido U. Draheim &lt;guidod@gmx.de&gt;
111
 
  </p>
112
 
  <h2>
113
 
   Last Modified
114
 
  </h2>
115
 
  <p class="indent">
116
 
   2008-04-12
117
 
  </p>
118
 
  <h2>
119
 
   M4 Source Code
120
 
  </h2>
121
 
  <div class="indent">
122
 
   <pre class="m4source">
123
 
AC_DEFUN([AX_ENABLE_BUILDDIR_UNAME],[
124
 
AC_REQUIRE([AC_CANONICAL_HOST])[]dnl
125
 
AC_REQUIRE([AX_CONFIGURE_ARGS])[]dnl
126
 
AC_BEFORE([$0],[AM_INIT_AUTOMAKE])dnl
127
 
AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
128
 
AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
129
 
SUB="."
130
 
AC_ARG_ENABLE([builddir], AC_HELP_STRING(
131
 
  [--disable-builddir],[disable automatic build in subdir of sources])
132
 
  ,[SUB="$enableval"], [SUB="yes"])
133
 
if test ".$ac_srcdir_defaulted" != ".no" ; then
134
 
if test ".$srcdir" = ".." ; then
135
 
  if test -f config.status ; then
136
 
    AC_MSG_NOTICE(toplevel srcdir already configured... skipping subdir build)
137
 
  else
138
 
    test ".$SUB" = "."  &amp;&amp; SUB="."
139
 
    test ".$SUB" = ".no"  &amp;&amp; SUB="."
140
 
    test ".$BUILD" = "." &amp;&amp; BUILD=`uname -msr | tr " /" "__"`.d
141
 
    test ".$SUB" = ".yes" &amp;&amp; SUB="m4_ifval([$1], [$1],[$BUILD])"
142
 
    if test ".$SUB" != ".." ; then    # we know where to go and
143
 
      AS_MKDIR_P([$SUB])
144
 
      echo __.$SUB.__ &gt; $SUB/conftest.tmp
145
 
      cd $SUB
146
 
      if grep __.$SUB.__ conftest.tmp &gt;/dev/null 2&gt;/dev/null ; then
147
 
        rm conftest.tmp
148
 
        AC_MSG_RESULT([continue configure in default builddir "./$SUB"])
149
 
      else
150
 
        AC_MSG_ERROR([could not change to default builddir "./$SUB"])
151
 
      fi
152
 
      srcdir=`echo "$SUB" |
153
 
              sed -e 's,^\./,,;s,[[^/]]$,&amp;/,;s,[[^/]]*/,../,g;s,[[/]]$,,;'`
154
 
      # going to restart from subdirectory location
155
 
      test -f $srcdir/config.log   &amp;&amp; mv $srcdir/config.log   .
156
 
      test -f $srcdir/confdefs.h   &amp;&amp; mv $srcdir/confdefs.h   .
157
 
      test -f $srcdir/conftest.log &amp;&amp; mv $srcdir/conftest.log .
158
 
      test -f $srcdir/$cache_file  &amp;&amp; mv $srcdir/$cache_file  .
159
 
      AC_MSG_RESULT(....exec $SHELL "$srcdir/[$]0" "--srcdir=$srcdir" "--enable-builddir=$SUB" $ac_configure_args)
160
 
      case "[$]0" in # restart
161
 
       [/\\]*) eval $SHELL "'[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
162
 
       *) eval $SHELL "'$srcdir/[$]0'" "'--srcdir=$srcdir'" "'--enable-builddir=$SUB'" $ac_configure_args ;;
163
 
      esac ; exit $?
164
 
    fi
165
 
  fi
166
 
fi fi
167
 
dnl ac_path_prog uses "set dummy" to override $@ which would defeat the "exec"
168
 
AC_PATH_PROG(SED,gsed sed, sed)
169
 
AS_VAR_POPDEF([SED])dnl
170
 
AS_VAR_POPDEF([SUB])dnl
171
 
AC_CONFIG_COMMANDS([buildir],[dnl .............. config.status ..............
172
 
AS_VAR_PUSHDEF([SUB],[ax_enable_builddir])dnl
173
 
AS_VAR_PUSHDEF([TOP],[top_srcdir])dnl
174
 
AS_VAR_PUSHDEF([SRC],[ac_top_srcdir])dnl
175
 
AS_VAR_PUSHDEF([SED],[ax_enable_builddir_sed])dnl
176
 
pushdef([END],[Makefile.mk])dnl
177
 
  SRC="$ax_enable_builddir_srcdir"
178
 
  if test ".$SUB" = "." ; then
179
 
    if test -f "$TOP/Makefile" ; then
180
 
      AC_MSG_NOTICE([skipping TOP/Makefile - left untouched])
181
 
    else
182
 
      AC_MSG_NOTICE([skipping TOP/Makefile - not created])
183
 
    fi
184
 
  else
185
 
    AC_MSG_NOTICE([create TOP/Makefile guessed from local Makefile])
186
 
     x='`' ; cat &gt;$tmp/conftemp.sed &lt;&lt;_EOF
187
 
/^\$/n
188
 
x
189
 
/^\$/bS
190
 
x
191
 
/\\\\\$/{H;d;}
192
 
{H;s/.*//;x;}
193
 
bM
194
 
:S
195
 
x
196
 
/\\\\\$/{h;d;}
197
 
{h;s/.*//;x;}
198
 
:M
199
 
s/\\(\\n\\)     /\\1 /g
200
 
/^      /d
201
 
/^[[    ]]*[[\\#]]/d
202
 
/^VPATH *=/d
203
 
s/^srcdir *=.*/srcdir = ./
204
 
s/^top_srcdir *=.*/top_srcdir = ./
205
 
/[[:=]]/!d
206
 
/^\\./d
207
 
s/:.*/:/
208
 
/:\$/s/ /  /g
209
 
/:\$/s/  / /g
210
 
/^.*[[=]]/!s%\$% ; (cd \$(BUILD) \\&amp;\\&amp; \$(ISNOTSRCDIR) \\&amp;\\&amp; \$(MAKE) "\$\@") || exit ; \$(MAKE) done "RULE=\$\@"%
211
 
_EOF
212
 
    test ".$USE_MAINTAINER_MODE" = ".no" || \
213
 
        cp "$tmp/conftemp.sed" "$SRC/makefile.sed~"            ## DEBUGGING
214
 
    echo 'BUILD=`uname -msr | tr " /" "__"`.d' &gt;$SRC/Makefile
215
 
    echo 'ISNOTSRCDIR=test ! -f configure' &gt;&gt;$SRC/Makefile
216
 
    $SED -f $tmp/conftemp.sed Makefile &gt;&gt;$SRC/Makefile
217
 
    echo 'done: ;@ if grep "$(RULE)-done .*:" Makefile &gt; /dev/null; then dnl
218
 
    echo $(MAKE) $(RULE)-done ; $(MAKE) $(RULE)-done ; else true ; fi' dnl
219
 
    &gt;&gt; $SRC/Makefile
220
 
    if test -f "$SRC/m4_ifval([$2],[$2],[END])" ; then
221
 
      AC_MSG_NOTICE([extend TOP/Makefile with TOP/m4_ifval([$2],[$2],[END])])
222
 
      cat $SRC/END &gt;&gt;$SRC/Makefile
223
 
    fi
224
 
    AC_MSG_NOTICE([make uses BUILD=$SUB (on $ax_enable_builddir_host:)])
225
 
  fi
226
 
popdef([END])dnl
227
 
AS_VAR_POPDEF([SED])dnl
228
 
AS_VAR_POPDEF([SRC])dnl
229
 
AS_VAR_POPDEF([TOP])dnl
230
 
AS_VAR_POPDEF([SUB])dnl
231
 
],[dnl
232
 
ax_enable_builddir_srcdir="$srcdir"                    # $srcdir
233
 
ax_enable_builddir_host="$HOST"                        # $HOST / $host
234
 
ax_enable_builddir_version="$VERSION"                  # $VERSION
235
 
ax_enable_builddir_package="$PACKAGE"                  # $PACKAGE
236
 
ax_enable_builddir_sed="$ax_enable_builddir_sed"       # $SED
237
 
ax_enable_builddir="$ax_enable_builddir"               # $SUB
238
 
])dnl
239
 
])
240
 
</pre>
241
 
  </div>
242
 
  <h2>
243
 
   License
244
 
  </h2>
245
 
  <div class="indent">
246
 
   <span style="white-space:nowrap;">Copyright &copy; 2008 Guido U. Draheim
247
 
   &lt;guidod@gmx.de&gt;</span>
248
 
   <p>
249
 
    This program is free software; you can redistribute it and/or modify it
250
 
    under the terms of the GNU General Public License as published by the Free
251
 
    Software Foundation; either version 2 of the License, or (at your option)
252
 
    any later version.
253
 
   </p>
254
 
   <p>
255
 
    This program is distributed in the hope that it will be useful, but WITHOUT
256
 
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
257
 
    FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
258
 
    more details.
259
 
   </p>
260
 
   <p>
261
 
    You should have received a copy of the GNU General Public License along
262
 
    with this program. If not, see &lt;<a href=
263
 
    "http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.
264
 
   </p>
265
 
   <p>
266
 
    As a special exception, the respective Autoconf Macro's copyright owner
267
 
    gives unlimited permission to copy, distribute and modify the configure
268
 
    scripts that are the output of Autoconf when processing the Macro. You need
269
 
    not follow the terms of the GNU General Public License when using or
270
 
    distributing such scripts, even though portions of the text of the Macro
271
 
    appear in them. The GNU General Public License (GPL) does govern all other
272
 
    use of the material that constitutes the Autoconf Macro.
273
 
   </p>
274
 
   <p>
275
 
    This special exception to the GPL applies to versions of the Autoconf Macro
276
 
    released by the Autoconf Macro Archive. When you make and distribute a
277
 
    modified version of the Autoconf Macro, you may extend this special
278
 
    exception to the GPL to apply to your modified version as well.
279
 
   </p>
280
 
  </div>
281
 
 </body>
282
 
</html>