2 AC_INIT([rc-scripts], [0.4.11], [pld-rc-scripts@lists.pld-linux.org], [rc-scripts])
7 echo -n "Finding shell scripts"
9 for shfile in $(find ${srcdir}/rc.d ${srcdir}/sysconfig ${srcdir}/lib ! -path "*/\.*/*" ! -name "*~" -type f); do
11 if (LC_ALL=C file ${shfile} | grep -q 'shell script'); then
12 SHSCRIPTS="${SHSCRIPTS} ${shfile}"
17 dnl Checks for programs.
24 pppdir='${sysconfdir}/ppp'
25 sysconfigdir='${sysconfdir}/sysconfig'
26 updir='${sysconfigdir}/interfaces/up.d'
27 downdir='${sysconfigdir}/interfaces/down.d'
28 networkscriptsdir='${exec_prefix}/lib/${PACKAGE}'
29 rcdir='${sysconfdir}/rc.d'
30 initdir='${sysconfdir}/init'
31 firmwaredir='${exec_prefix}/lib/firmware'
32 docdir="${prefix}/doc/${PACKAGE}-${VERSION}"
35 AC_PATH_PROGS(MSGMERGE, msgmerge)
36 AC_PATH_PROGS(GMSGFMT, gmsgfmt msgfmt)
38 if test -z "$MSGMERGE" || test -z "$GMSGFMT"; then
39 AC_MSG_ERROR(install gettext-devel to be able to regenerate translations)
44 for lang in $ALL_LINGUAS; do
45 CATALOGS="$CATALOGS $lang.gmo"
46 POTFILES="$POTFILES $lang.po"
50 for src in $SHSCRIPTS; do
51 POTSRC="$POTSRC \$(top_srcdir)/$src"
53 AC_ARG_WITH(localedir,
54 [ --with-localedir=PATH specify where the locale stuff should go ])
56 if test "x$LOCALEDIR" = "x"; then
57 if test "x$with_localedir" != "x"; then
58 LOCALEDIR=$with_localedir
60 LOCALEDIR='$(prefix)/share/locale'
65 gnulocaledir=$LOCALEDIR
67 if test "`eval echo $sysconfdir`" = "NONE/etc"; then
68 defaultdir="/usr/local/etc"
70 defaultdir="`eval echo $sysconfdir`"
73 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
74 if test "$PKG_CONFIG" = no; then
75 AC_MSG_ERROR(You need to install pkgconfig package)
79 AC_MSG_CHECKING([glib2])
80 GLIB_LIBS="-Wl,-static `$PKG_CONFIG --libs --static glib-2.0` -Wl,-Bdynamic"
81 GLIB_CFLAGS="`$PKG_CONFIG --cflags-only-I glib-2.0`"
82 if test "x$GLIB_LIBS" = "x"; then
87 DPKG_C_GCC_ATTRIBUTE([,,],supported,[int x],[,,],ATTRIB,[Define if function attributes a la GCC 2.5 and higher are available.],
88 DPKG_C_GCC_ATTRIBUTE(noreturn,noreturn,[int x],noreturn,NORETURN,[Define if nonreturning functions a la GCC 2.5 and higher are available.])
89 DPKG_C_GCC_ATTRIBUTE(const,const,[int x],const,CONST,[Define if constant functions a la GCC 2.5 and higher are available.])
90 DPKG_C_GCC_ATTRIBUTE(unused,unused,[int x],unused,UNUSED,[Define if unused variables la GCC 2.5 and higher are available.])
91 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 AC_CHECK_TYPE(ptrdiff_t,int)
94 AC_CHECK_HEADERS([stddef.h sys/capability.h getopt.h])
102 AC_SUBST(gnulocaledir)
105 AC_SUBST(networkscriptsdir)
106 AC_SUBST(sysconfigdir)
112 AC_SUBST(firmwaredir)
114 AC_SUBST(GLIB_CFLAGS)
121 /* Use the definitions: */
123 /* The maximum length of a #! interpreter displayed by dpkg-deb. */
125 #define INTERPRETER_MAX PATH_MAX
127 #define INTERPRETER_MAX 1024
130 /* GNU C attributes. */
132 #ifdef HAVE_GNUC25_ATTRIB
133 #define FUNCATTR(x) __attribute__(x)
139 /* GNU C printf formats, or null. */
141 #ifdef HAVE_GNUC25_PRINTFFORMAT
142 #define ATTRPRINTF(si,tc) format(printf,si,tc)
144 #define ATTRPRINTF(si,tc)
148 #define PRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc)))
151 /* GNU C nonreturning functions, or null. */
153 #ifdef HAVE_GNUC25_NORETURN
154 #define ATTRNORETURN noreturn
155 #else /* ! HAVE_GNUC25_NORETURN */
157 #endif /* HAVE_GNUC25_NORETURN */
158 #endif /* ATTRNORETURN */
161 #define NONRETURNING FUNCATTR((ATTRNORETURN))
162 #endif /* NONRETURNING */
164 /* Combination of both the above. */
165 #ifndef NONRETURNPRINTFFORMAT
166 #define NONRETURNPRINTFFORMAT(si,tc) FUNCATTR((ATTRPRINTF(si,tc),ATTRNORETURN))
169 /* GNU C constant functions, or null. */
171 #ifdef HAVE_GNUC25_CONST
172 #define ATTRCONST const
178 #define CONSTANT FUNCATTR((ATTRCONST))
181 /* GNU C unused functions, or null. */
183 #ifdef HAVE_GNUC25_UNUSED
190 #define UNUSED FUNCATTR((ATTRUNUSED))
194 AC_CONFIG_HEADERS(src/config.h)
195 AC_CONFIG_FILES([Makefile \
209 sysconfig/cpusets/Makefile \
210 sysconfig/hwprofiles/Makefile \
211 sysconfig/interfaces/Makefile \
212 sysconfig/interfaces/data/Makefile \
213 sysconfig/interfaces/up.d/Makefile \
214 sysconfig/interfaces/up.d/all/Makefile \
215 sysconfig/interfaces/up.d/ip/Makefile \
216 sysconfig/interfaces/up.d/ipx/Makefile \
217 sysconfig/interfaces/up.d/ppp/Makefile \
218 sysconfig/interfaces/up.d/tnl/Makefile \
219 sysconfig/interfaces/down.d/Makefile \
220 sysconfig/interfaces/down.d/all/Makefile \
221 sysconfig/interfaces/down.d/ip/Makefile \
222 sysconfig/interfaces/down.d/ipx/Makefile \
223 sysconfig/interfaces/down.d/ppp/Makefile \
224 sysconfig/interfaces/down.d/tnl/Makefile \
225 rc.d/Makefile rc.d/init.d/Makefile \