]> git.donarmstrong.com Git - lilypond.git/blob - configure.in
* configure.in (NCSB_DIR): fix --with-ncsb-dir option.
[lilypond.git] / configure.in
1 dnl configure.in   -*-shell-script-*-
2 dnl Process this file with autoconf to produce a configure script. 
3
4 # Bootstrap the init proces.
5 AC_INIT
6
7 # Bootstrap StepMake configure
8 # For user package:
9 AC_CONFIG_AUX_DIR([stepmake/bin])
10
11 # For stepmake package:
12 # AC_CONFIG_AUX_DIR(bin)
13
14
15 STEPMAKE_INIT
16
17 # List a file that identifies your package.
18 AC_CONFIG_SRCDIR([lily/main.cc])
19
20 # Move to aclocal.m4?
21 AC_CONFIG_HEADER([$CONFIGFILE.hh:config.hh.in])
22
23 # Uncomment the configuration options your package needs.
24
25 DOCUMENTATION=yes
26 AC_ARG_ENABLE(documentation,
27     [  --enable-documentation  build Documentation.  Default: on],
28     [DOCUMENTATION=$enableval])
29 AC_SUBST(DOCUMENTATION)
30
31 gui_b=no
32 AC_ARG_ENABLE(gui,
33     [  --enable-gui            compile with experimental GNOME output module.  Default: off],
34     [gui_b=$enableval])
35
36
37 NCSB_DIR=unknown
38 AC_ARG_WITH(ncsb-dir,
39 [  --with-ncsb-dir=DIR     location of Century Schoolbook fonts
40                             Default: detect with locate(1)],
41     [NCSB_DIR=$withval])
42
43
44 reloc_b=no
45 AC_ARG_ENABLE(relocation,
46     [  --enable-relocation     compile with dynamic relocation.  Default: off],
47     [reloc_b=$enableval])
48
49 FRAMEWORKDIR=".."
50 AC_ARG_WITH(framework-dir,
51     [  --with-framework-dir=DIR
52                           relative location of framework],[
53         if test "$withval" = "yes" -o "$withval" = "no"; then
54             AC_MSG_WARN(Usage: --with-framework-dir=../lib/FRAMEWORK/DIR)
55         else
56             FRAMEWORKDIR="${withval}"
57             LDFLAGS="$LDFLAGS -Wl,--rpath,'\$\${ORIGIN}/$FRAMEWORKDIR/lib'"
58         fi
59         ])
60 AC_DEFINE_UNQUOTED(FRAMEWORKDIR, ["${FRAMEWORKDIR}"])
61
62 LINK_GXX_STATICALLY=no
63 AC_ARG_ENABLE(static-gxx,
64     [  --enable-static-gxx     link libstdc++.a statically. Default: off],
65     [LINK_GXX_STATICALLY=$enableval])
66 AC_SUBST(LINK_GXX_STATICALLY)
67
68 # must come before any header checks
69 STEPMAKE_COMPILE
70
71 STEPMAKE_PYTHON(REQUIRED, 2.2)
72 STEPMAKE_GCC(REQUIRED, 2.8)
73 STEPMAKE_CXX(REQUIRED)
74 STEPMAKE_GXX(REQUIRED, 3.0.5)
75 STEPMAKE_CXXTEMPLATE
76 STEPMAKE_LIB(REQUIRED)
77 STEPMAKE_DLOPEN
78 # Do not use bison 1.50 and 1.75.
79 # 1.29 is required fr %locations, but I'm not sure it's enough --ns
80 STEPMAKE_BISON(OPTIONAL, 1.29)
81 STEPMAKE_FLEX(REQUIRED)
82 STEPMAKE_FLEXLEXER(REQUIRED)
83 STEPMAKE_FLEXLEXER_LOCATION
84 AC_LANG_C
85 STEPMAKE_LOCALE
86 STEPMAKE_GETTEXT
87 STEPMAKE_MSGFMT(REQUIRED)
88 STEPMAKE_TEXMF(REQUIRED)
89 STEPMAKE_TEXMF_DIRS
90 STEPMAKE_GUILE_DEVEL(REQUIRED, 1.6.5)
91 STEPMAKE_MAKEINFO(REQUIRED)
92 STEPMAKE_PYTHON_DEVEL(REQUIRED)
93
94 STEPMAKE_PATH_PROG(GHOSTSCRIPT, gs, OPTIONAL, 8.15)
95
96 STEPMAKE_PROGS(MFTRACE, mftrace, REQUIRED, 1.1.9)
97 STEPMAKE_PATH_PROG(FONTFORGE, fontforge, REQUIRED, 20050624)
98
99 AC_CHECK_HEADERS([assert.h grp.h libio.h pwd.h sys/stat.h wchar.h])
100 AC_LANG_PUSH(C++)
101 AC_CHECK_HEADERS([sstream])
102 AC_LANG_POP(C++)
103 AC_HEADER_STAT
104 AC_FUNC_MEMCMP
105 AC_FUNC_VPRINTF
106 AC_CHECK_FUNCS([chroot fopencookie funopen gettext isinf mbrtowc memmem snprintf vsnprintf wcrtomb])
107 AC_CHECK_HEADERS([utf8/wchar.h], LIBS="$LIBS -lutf8")
108 AC_SEARCH_LIBS(mbrtowc, [mingwex msvcp60])
109
110 STEPMAKE_PROGS(PKG_CONFIG, pkg-config, REQUIRED, 0.9.0)
111
112 if test "$gui_b" = "yes"; then
113     STEPMAKE_GTK2(gtk+-2.0, REQUIRED, 2.4.0)
114 fi
115
116 if test "$reloc_b" = "yes"; then
117     AC_DEFINE(ARGV0_RELOCATION)
118 fi
119
120 AC_MSG_CHECKING([New Century Schoolbook PFB files])
121 if test "$NCSB_DIR" = "unknown"; then
122   # use `type' command rather than external program `which'
123   type locate >& /dev/null
124   if test "$?" = "0"; then
125       for d in `locate c059033l.pfb `; do
126           if test -f `dirname "$d"`/c059033l.afm ; then
127               NCSB_DIR=`dirname "$d"`
128               break 
129           fi
130       done
131       if test "$NCSB_DIR" = "unknown";  then
132           AC_MSG_WARN(Could not find c059033l.pfb. Use --enable-ncsb-path to set path)
133       fi
134   else
135      AC_MSG_WARN(Could not find locate(1). Use --enable-ncsb-path to set path to c059033l.pfb)
136   fi
137 fi
138
139 AC_MSG_RESULT($NCSB_DIR)
140 AC_SUBST(NCSB_DIR)
141
142 STEPMAKE_PANGO_FT2(pangoft2, REQUIRED, 1.6.0)
143 #STEPMAKE_PANGO(pango, REQUIRED, 1.6.0)
144 STEPMAKE_FONTCONFIG(fontconfig, REQUIRED, 2.2.0)
145 STEPMAKE_FREETYPE2(freetype2, REQUIRED, 0)
146
147 STEPMAKE_WINDOWS
148
149 ## Optional tools for building documentation, website, extra fonts.
150
151 # guile executable for some scripts
152 STEPMAKE_GUILE(OPTIONAL)
153
154 # perl for help2man.
155 STEPMAKE_PERL(OPTIONAL)
156
157 # New makeinfo for multi-page website docs Simply always require new
158 # makeinfo should avoid bug reports; if people want to build lily
159 # without the docs, they can find this comment and use an older
160 # makeinfo--but hopefully won't report makeinfo problems.
161 STEPMAKE_PROGS(MAKEINFO, makeinfo, REQUIRED, 4.7)
162
163 if test "$optimise_b" = yes; then
164     DEFINES="$DEFINES -DSTRING_UTILS_INLINED"
165     AC_DEFINE(STRINGS_UTILS_INLINED)
166 fi
167
168 AC_DEFINE_UNQUOTED(FLOWER_VERSION, "${FULL_FLOWER_VERSION}")
169
170 # Gather requirements and generate output.
171 STEPMAKE_END
172
173 test -n "$CONFIGURATION" && mc=" conf=$CONFIGURATION" || mc=""
174
175 cat <<EOF
176
177 Type:
178     make$mc all       to build LilyPond
179     make$mc install   to install LilyPond
180     make$mc help      to see all possible targets
181
182 EOF