3 # Run this to generate configure and initial GNUmakefiles
5 # This file is part of LilyPond, the GNU music typesetter.
7 # Copyright (C) 2002--2023 Jan Nieuwenhuizen <janneke@gnu.org>,
8 # Han-Wen Nienhuys <hanwen@xs4all.nl>
10 # LilyPond is free software: you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation, either version 3 of the License, or
13 # (at your option) any later version.
15 # LilyPond is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License
21 # along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
23 srcdir
=`dirname -- $0`
26 srcdir
=`cd "$srcdir"; pwd`
43 Usage: $0 [OPTION]... [CONFIGURE-OPTION]...
44 Generate LilyPond's 'configure' script, then execute it
45 with CONFIGURE-OPTION arguments.
47 --ci also set 'configure' flags for gitlab's CI
48 --currdir generate 'configure' script in current directory
49 instead of the location of 'autogen.sh'
50 --help display this help and exit
51 --noconfigure don't execute generated 'configure' script"
66 if test ! -w "$srcdir"; then
67 echo "Directory '$srcdir' is write-only, assuming option '--currdir'"
71 if test -n "$CURRDIR" && test ! -w "$builddir"; then
72 echo >&2 "$0: Directory '$builddir' is write-only, can't proceed"
76 parent
=`dirname "$builddir"`
77 if test "$srcdir" = "$builddir"; then
79 elif test "$srcdir" = "$parent"; then
85 if test -n "$CURRDIR"; then
87 if test "$prefix" != .
&& test "$prefix" != ..
; then
88 suffix
=" --srcdir $srcdir"
91 echo "Running autoconf in '$builddir' ..."
93 autoconf
-I "$srcdir" -o configure
"$srcdir/configure.ac" \
96 configure
="$prefix/configure"
99 echo "Running autoconf in '$srcdir' ..."
104 if test -n "$NOCONFIGURE"; then
105 echo "You can now run '$configure$suffix [...]'"
109 if test -n "$CI" ; then
110 conf_flags
="$conf_flags --enable-checking"
111 conf_flags
="$conf_flags --enable-gs-api"
112 conf_flags
="$conf_flags --disable-debugging"
114 CFLAGS
="$CFLAGS -Werror"
118 if test -z "${conf_flags}$*"; then
120 Warning: about to run the 'configure' script without arguments.
121 Add arguments to the '$0' command line
122 to pass them to 'configure'.
124 Invoke with '--noconfigure' to skip execution of 'configure'.
128 echo Running
$configure$suffix $conf_flags "$@" ...
129 exec "$configure" $suffix $conf_flags "$@"