]> git.pld-linux.org Git - projects/rc-scripts.git/blame - configure.ac
Don't fail if arrays are already assembled (ex raid10 with 4 devices, one device...
[projects/rc-scripts.git] / configure.ac
CommitLineData
7e04fe0e 1
eab54caf 2AC_INIT([rc-scripts], [0.4.16], [pld-devel-en@lists.pld-linux.org], [rc-scripts])
180afce2
ER
3
4dnl Do not require AUTHORS, ChangeLog, NEWS, and README to exist
5AM_INIT_AUTOMAKE([foreign])
2c883f5e 6
05a11ced 7ALL_LINGUAS="pl de"
763b88c2
AM
8
9echo -n "Finding shell scripts"
10SHSCRIPTS=""
f67ce454 11for shfile in $(find ${srcdir}/rc.d ${srcdir}/sysconfig ${srcdir}/lib ! -path "*/\.*/*" ! -name "*~" -type f); do
763b88c2 12 echo -n "."
2450b5fc 13 if (LC_ALL=C file ${shfile} | grep -q 'shell script'); then
763b88c2
AM
14 SHSCRIPTS="${SHSCRIPTS} ${shfile}"
15 fi
16done
17echo "done"
7e04fe0e 18
19dnl Checks for programs.
20AC_PROG_CC
21AC_ISC_POSIX
22AC_PROG_INSTALL
23AC_PROG_LN_S
24AC_PROG_MAKE_SET
25
26pppdir='${sysconfdir}/ppp'
7e04fe0e 27sysconfigdir='${sysconfdir}/sysconfig'
8dbd5412 28updir='${sysconfigdir}/interfaces/up.d'
29downdir='${sysconfigdir}/interfaces/down.d'
f67ce454 30networkscriptsdir='${exec_prefix}/lib/${PACKAGE}'
7e04fe0e 31rcdir='${sysconfdir}/rc.d'
c393d0f5 32initdir='${sysconfdir}/init'
e340dffe 33firmwaredir='${exec_prefix}/lib/firmware'
f67ce454 34docdir="${prefix}/doc/${PACKAGE}-${VERSION}"
5d3bb684 35
dcd32750 36dnl i18n support
5d3bb684
AF
37AC_PATH_PROGS(MSGMERGE, msgmerge)
38AC_PATH_PROGS(GMSGFMT, gmsgfmt msgfmt)
39
d0936237
ER
40if test -z "$MSGMERGE" || test -z "$GMSGFMT"; then
41 AC_MSG_ERROR(install gettext-devel to be able to regenerate translations)
42fi
43
dcd32750
AF
44CATALOGS=
45POTFILES=
46for lang in $ALL_LINGUAS; do
47 CATALOGS="$CATALOGS $lang.gmo"
48 POTFILES="$POTFILES $lang.po"
49done
7e04fe0e 50
dcd32750 51POTSRC=
2c883f5e 52for src in $SHSCRIPTS; do
dcd32750
AF
53 POTSRC="$POTSRC \$(top_srcdir)/$src"
54done
55AC_ARG_WITH(localedir,
56 [ --with-localedir=PATH specify where the locale stuff should go ])
57
58if test "x$LOCALEDIR" = "x"; then
59 if test "x$with_localedir" != "x"; then
60 LOCALEDIR=$with_localedir
61 else
62 LOCALEDIR='$(prefix)/share/locale'
63 fi
64fi
65
66localedir=$LOCALEDIR
67gnulocaledir=$LOCALEDIR
68
69if test "`eval echo $sysconfdir`" = "NONE/etc"; then
70 defaultdir="/usr/local/etc"
71else
72 defaultdir="`eval echo $sysconfdir`"
73fi
74
b8b29800 75AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
d0936237
ER
76if test "$PKG_CONFIG" = no; then
77 AC_MSG_ERROR(You need to install pkgconfig package)
78fi
79
b8b29800 80GLIBDIR=none
057b40ee
JR
81AC_MSG_CHECKING([glib2])
82GLIB_LIBS="-Wl,-static `$PKG_CONFIG --libs --static glib-2.0` -Wl,-Bdynamic"
83GLIB_CFLAGS="`$PKG_CONFIG --cflags-only-I glib-2.0`"
84if test "x$GLIB_LIBS" = "x"; then
85 AC_MSG_ERROR(no)
ff1ffbdb 86fi
057b40ee 87AC_MSG_RESULT(yes)
b8b29800 88
911954df
ER
89DPKG_C_GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.],
90 DPKG_C_GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.])
91 DPKG_C_GCC_ATTRIBUTE(const,const,[int x],const,CONST,[Define if constant functions a la GCC 2.5 and higher are available.])
92 DPKG_C_GCC_ATTRIBUTE(unused,unused,[int x],unused,UNUSED,[Define if unused variables la GCC 2.5 and higher are available.])
93 DPKG_C_GCC_ATTRIBUTE(format...,format,[char *y, ...],[format(printf,1,2)],PRINTFFORMAT,[Define if printf-format argument lists a la GCC are available.]))
94
95AC_CHECK_TYPE(ptrdiff_t,int)
868bbbe0 96AC_CHECK_HEADERS([stddef.h sys/capability.h getopt.h])
911954df 97
dcd32750
AF
98dnl Output
99AC_SUBST(BASHSCRIPTS)
100AC_SUBST(CATALOGS)
101AC_SUBST(POTFILES)
102AC_SUBST(POTSRC)
103AC_SUBST(localedir)
104AC_SUBST(gnulocaledir)
d0936237 105
7e04fe0e 106AC_SUBST(pppdir)
107AC_SUBST(networkscriptsdir)
108AC_SUBST(sysconfigdir)
8dbd5412 109AC_SUBST(updir)
110AC_SUBST(downdir)
7e04fe0e 111AC_SUBST(rcdir)
c393d0f5 112AC_SUBST(initdir)
7e04fe0e 113AC_SUBST(docdir)
e8ff2d72 114AC_SUBST(firmwaredir)
057b40ee
JR
115AC_SUBST(GLIB_LIBS)
116AC_SUBST(GLIB_CFLAGS)
7e04fe0e 117
911954df
ER
118AH_BOTTOM([
119#ifdef HAVE_STDDEF_H
120#include <stddef.h>
121#endif
122
123/* Use the definitions: */
124
125/* The maximum length of a #! interpreter displayed by dpkg-deb. */
126#ifdef PATH_MAX
127#define INTERPRETER_MAX PATH_MAX
128#else
129#define INTERPRETER_MAX 1024
130#endif
131
132/* GNU C attributes. */
133#ifndef FUNCATTR
134#ifdef HAVE_GNUC25_ATTRIB
135#define FUNCATTR(x) __attribute__(x)
136#else
137#define FUNCATTR(x)
138#endif
139#endif
140
141/* GNU C printf formats, or null. */
142#ifndef ATTRPRINTF
143#ifdef HAVE_GNUC25_PRINTFFORMAT
144#define ATTRPRINTF(si,tc) format(printf,si,tc)
145#else
146#define ATTRPRINTF(si,tc)
147#endif
148#endif
149#ifndef PRINTFFORMAT
150#define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
151#endif
152
153/* GNU C nonreturning functions, or null. */
154#ifndef ATTRNORETURN
155#ifdef HAVE_GNUC25_NORETURN
156#define ATTRNORETURN noreturn
157#else /* ! HAVE_GNUC25_NORETURN */
158#define ATTRNORETURN
159#endif /* HAVE_GNUC25_NORETURN */
160#endif /* ATTRNORETURN */
161
162#ifndef NONRETURNING
163#define NONRETURNING FUNCATTR((ATTRNORETURN))
164#endif /* NONRETURNING */
165
166/* Combination of both the above. */
167#ifndef NONRETURNPRINTFFORMAT
168#define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
169#endif
170
171/* GNU C constant functions, or null. */
172#ifndef ATTRCONST
173#ifdef HAVE_GNUC25_CONST
174#define ATTRCONST const
175#else
176#define ATTRCONST
177#endif
178#endif
179#ifndef CONSTANT
180#define CONSTANT FUNCATTR((ATTRCONST))
181#endif
182
183/* GNU C unused functions, or null. */
184#ifndef ATTRUNUSED
185#ifdef HAVE_GNUC25_UNUSED
186#define ATTRUNUSED
187#else
188#define ATTRUNUSED
189#endif
190#endif
191#ifndef UNUSED
192#define UNUSED FUNCATTR((ATTRUNUSED))
193#endif
194])
195
42801b46 196AC_CONFIG_HEADERS(src/config.h)
911954df
ER
197AC_CONFIG_FILES([Makefile \
198 src/Makefile \
f67ce454 199 lib/Makefile \
911954df
ER
200 doc/Makefile \
201 man/Makefile \
34bc0141
ER
202 man/de/Makefile \
203 man/es/Makefile \
204 man/fr/Makefile \
205 man/ja/Makefile \
206 man/ru/Makefile \
207 man/sv/Makefile \
8dbd5412 208 ppp/Makefile \
763b88c2 209 isapnp/Makefile \
7e04fe0e 210 sysconfig/Makefile \
15371203 211 sysconfig/cpusets/Makefile \
763b88c2 212 sysconfig/hwprofiles/Makefile \
ca263bb1
AF
213 sysconfig/interfaces/Makefile \
214 sysconfig/interfaces/data/Makefile \
8dbd5412 215 sysconfig/interfaces/up.d/Makefile \
216 sysconfig/interfaces/up.d/all/Makefile \
217 sysconfig/interfaces/up.d/ip/Makefile \
218 sysconfig/interfaces/up.d/ipx/Makefile \
219 sysconfig/interfaces/up.d/ppp/Makefile \
220 sysconfig/interfaces/up.d/tnl/Makefile \
221 sysconfig/interfaces/down.d/Makefile \
222 sysconfig/interfaces/down.d/all/Makefile \
223 sysconfig/interfaces/down.d/ip/Makefile \
224 sysconfig/interfaces/down.d/ipx/Makefile \
225 sysconfig/interfaces/down.d/ppp/Makefile \
226 sysconfig/interfaces/down.d/tnl/Makefile \
36ddc8d8 227 rc.d/Makefile rc.d/init.d/Makefile \
dcd32750 228 po/Makefile \
660dddce 229 ])
763b88c2 230AC_OUTPUT
This page took 0.243064 seconds and 4 git commands to generate.