]> TLD Linux GIT Repositories - rc-scripts.git/blob - configure.ac
- disable lock checks (happens on LUKS2 and fails during system boot)
[rc-scripts.git] / configure.ac
1
2 AC_INIT([rc-scripts], [0.5.2], [tld-devel@lists.tld-linux.org], [rc-scripts])
3
4 dnl Do not require AUTHORS, ChangeLog, NEWS, and README to exist
5 AM_INIT_AUTOMAKE([foreign])
6
7 ALL_LINGUAS="pl de"
8
9 echo -n "Finding shell scripts"
10 SHSCRIPTS=""
11 for shfile in $(find ${srcdir}/rc.d ${srcdir}/sysconfig ${srcdir}/lib ! -path "*/\.*/*" ! -name "*~" -type f); do
12     echo -n "."
13     if (LC_ALL=C file ${shfile} | grep -q 'shell script'); then
14         SHSCRIPTS="${SHSCRIPTS} ${shfile}"
15     fi
16 done
17 echo "done"
18
19 dnl Checks for programs.
20 AC_PROG_CC
21 AC_ISC_POSIX
22 AC_PROG_INSTALL
23 AC_PROG_LN_S
24 AC_PROG_MAKE_SET
25
26 pppdir='${sysconfdir}/ppp'
27 sysconfigdir='${sysconfdir}/sysconfig'
28 updir='${sysconfigdir}/interfaces/up.d'
29 downdir='${sysconfigdir}/interfaces/down.d'
30 networkscriptsdir='${exec_prefix}/lib/${PACKAGE}'
31 rcdir='${sysconfdir}/rc.d'
32 initdir='${sysconfdir}/init'
33 firmwaredir='${exec_prefix}/lib/firmware'
34 docdir="${prefix}/doc/${PACKAGE}-${VERSION}"
35
36 dnl i18n support
37 AC_PATH_PROGS(MSGMERGE, msgmerge)
38 AC_PATH_PROGS(GMSGFMT, gmsgfmt msgfmt)
39
40 if test -z "$MSGMERGE" || test -z "$GMSGFMT"; then
41         AC_MSG_ERROR(install gettext-devel to be able to regenerate translations)
42 fi
43
44 CATALOGS=
45 POTFILES=
46 for lang in $ALL_LINGUAS; do
47         CATALOGS="$CATALOGS $lang.gmo"
48         POTFILES="$POTFILES $lang.po"
49 done
50
51 POTSRC=
52 for src in $SHSCRIPTS; do
53         POTSRC="$POTSRC \$(top_srcdir)/$src"
54 done
55 AC_ARG_WITH(localedir,
56         [  --with-localedir=PATH      specify where the locale stuff should go ])
57
58 if 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
64 fi
65
66 localedir=$LOCALEDIR
67 gnulocaledir=$LOCALEDIR
68
69 if test "`eval echo $sysconfdir`" = "NONE/etc"; then
70         defaultdir="/usr/local/etc"
71 else
72         defaultdir="`eval echo $sysconfdir`"
73 fi
74
75 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
76 if test "$PKG_CONFIG" = no; then
77         AC_MSG_ERROR(You need to install pkgconfig package)
78 fi
79
80 GLIBDIR=none
81 AC_MSG_CHECKING([glib2])
82 GLIB_LIBS="-Wl,-static `$PKG_CONFIG --libs --static glib-2.0` -Wl,-Bdynamic"
83 GLIB_CFLAGS="`$PKG_CONFIG --cflags-only-I glib-2.0`"
84 if test "x$GLIB_LIBS" = "x"; then
85         AC_MSG_ERROR(no)
86 fi
87 AC_MSG_RESULT(yes)
88
89 DPKG_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
95 AC_CHECK_TYPE(ptrdiff_t,int)
96 AC_CHECK_HEADERS([stddef.h sys/capability.h getopt.h])
97
98 dnl Output
99 AC_SUBST(BASHSCRIPTS)
100 AC_SUBST(CATALOGS)
101 AC_SUBST(POTFILES)
102 AC_SUBST(POTSRC)
103 AC_SUBST(localedir)
104 AC_SUBST(gnulocaledir)
105
106 AC_SUBST(pppdir)
107 AC_SUBST(networkscriptsdir)
108 AC_SUBST(sysconfigdir)
109 AC_SUBST(updir)
110 AC_SUBST(downdir)
111 AC_SUBST(rcdir)
112 AC_SUBST(initdir)
113 AC_SUBST(docdir)
114 AC_SUBST(firmwaredir)
115 AC_SUBST(GLIB_LIBS)
116 AC_SUBST(GLIB_CFLAGS)
117
118 AH_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
196 AC_CONFIG_HEADERS(src/config.h)
197 AC_CONFIG_FILES([Makefile \
198         src/Makefile \
199         lib/Makefile \
200         doc/Makefile \
201         man/Makefile \
202         man/de/Makefile \
203         man/es/Makefile \
204         man/fr/Makefile \
205         man/ja/Makefile \
206         man/ru/Makefile \
207         man/sv/Makefile \
208         ppp/Makefile \
209         isapnp/Makefile \
210         sysconfig/Makefile \
211         sysconfig/cpusets/Makefile \
212         sysconfig/hwprofiles/Makefile \
213         sysconfig/interfaces/Makefile \
214         sysconfig/interfaces/data/Makefile \
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 \
227         rc.d/Makefile rc.d/init.d/Makefile \
228         po/Makefile \
229         ])
230 AC_OUTPUT