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