1AC_DEFUN([GPKG_CHECK_RPM],
2[
3AC_ARG_WITH([rpmbuild],
4[AS_HELP_STRING([--with-rpmbuild=PATH],
5[Program to use for building RPMs])])
6
7AC_MSG_CHECKING([for rpmbuild or rpm])
8if test -x "${with_rpmbuild}"
9then
10    RPMBUILD="${with_rpmbuild}"
11    AC_MSG_RESULT([${RPMBUILD} (from parameter)])
12else
13    AC_MSG_RESULT([using autodetection])
14    AC_CHECK_PROGS(RPMBUILD, [rpmbuild rpm], false)
15    AC_MSG_CHECKING([for rpmbuild or rpm])
16    AC_MSG_RESULT([${RPMBUILD} (autodetected)])
17fi
18AC_SUBST([RPMBUILD])
19AM_CONDITIONAL([ENABLE_RPM], [test "$RPMBUILD" != "false"])
20
21])
22
23AC_DEFUN([GPKG_CHECK_LINUX],
24[
25	# effective_target has to be determined in advance
26	AC_REQUIRE([AC_NEED_BYTEORDER_H])
27
28	is_linux=false
29	case "$effective_target" in
30		*linux*)
31			is_linux=true
32			;;
33	esac
34	AM_CONDITIONAL([HAVE_LINUX], ["$is_linux"])
35
36	# required for docdir
37	# FIXME: Implicit dependency
38	# AC_REQUIRE(GP_CHECK_DOC_DIR)
39
40	AC_ARG_WITH([hotplug-doc-dir],
41	[AS_HELP_STRING([--with-hotplug-doc-dir=PATH],
42	[Where to install hotplug scripts as docs [default=autodetect]])])
43
44	if "$is_linux"; then
45		AC_MSG_CHECKING([for hotplug doc dir])
46		if test "x${with_hotplug_doc_dir}" != "x"
47		then # given as parameter
48		    hotplugdocdir="${with_hotplug_doc_dir}"
49		    AC_MSG_RESULT([${hotplugdocdir} (from parameter)])
50		else # start at docdir
51		    hotplugdocdir="${docdir}/linux-hotplug"
52		    AC_MSG_RESULT([${hotplugdocdir} (default)])
53		fi
54	else
55		hotplugdocdir=""
56	fi
57
58	AC_ARG_WITH([hotplug-usermap-dir],
59	[AS_HELP_STRING([--with-hotplug-usermap-dir=PATH],
60	[Where to install hotplug scripts as docs [default=autodetect]])])
61
62	if "$is_linux"; then
63		AC_MSG_CHECKING([for hotplug usermap dir])
64		if test "x${with_hotplug_usermap_dir}" != "x"
65		then # given as parameter
66		    hotplugusermapdir="${with_hotplug_usermap_dir}"
67		    AC_MSG_RESULT([${hotplugusermapdir} (from parameter)])
68		else # start at docdir
69		    hotplugusermapdir="${docdir}/linux-hotplug"
70		    AC_MSG_RESULT([${hotplugusermapdir} (default)])
71		fi
72	else
73		hotplugusermapdir=""
74	fi
75
76	# Let us hope that automake does not create "" directories
77	# on non-Linux systems now.
78	AC_SUBST([hotplugdocdir])
79	AC_SUBST([hotplugusermapdir])
80])
81
82