1
dnl @synopsis AC_SET_DEFAULT_PATHS_SYSTEM
3
dnl the most interesting changes go about windows-targets - where the
4
dnl default_prefix is set to /programs, and quite some directories are
5
dnl aliased: sbindir := libdir := bindir and the docprefix-defaults are
6
dnl also a bit different, even on FHS2-compliant systems where the
7
dnl mandir is going to $prefix/man only if prefix=/usr, otherwise they
8
dnl shall go to $datadir/man. We use an extra docprefix to express it
9
dnl which is either defined as being prefix or datadir. not SUBSTed
13
dnl @author Guido Draheim <guidod@gmx.de>
14
dnl @version 2001-08-25
15
dnl @license GPLWithACException
17
AC_DEFUN([AC_SET_DEFAULT_PATHS_SYSTEM],
18
[AC_REQUIRE([AC_CANONICAL_HOST]) # --------------------------------------------
19
case "$prefix:$ac_default_prefix" in
22
AC_MSG_CHECKING(default prefix path)
23
case "${target_os}" in
24
*cygwin* | *mingw* | *uwin* | *djgpp | *emx* )
25
if test "${host_os}" = "${target_os}" ; then
26
ac_default_prefix="/programs"
27
result="(win/dos target)"
30
*:/usr/local/cross-tools/$target_alias/bin:*)
31
ac_default_prefix="/usr/local/cross-tools/$target_alias" ;;
32
*:/usr/local/$target_alias/bin:*)
33
ac_default_prefix="/usr/local/$target_alias" ;;
34
*:/usr/local/$target_cpu-$target_os/bin:*)
35
ac_default_prefix="/usr/local/$target_cpu-$target_os" ;;
37
ac_default_prefix="/programs" ;;
39
result="(win/dos cross-compiler)"
43
AC_MSG_RESULT($ac_default_prefix $result)
46
AC_MSG_CHECKING(default prefix system)
47
result="$prefix" ; test "$result" = "NONE" && result="$ac_default_prefix"
49
/programs | /programs/*) result="is win-/programs"
50
# on win/dos, .exe .dll and .cfg live in the same directory
51
libdir=`echo $libdir |sed -e 's:^..exec_prefix./lib$:${bindir}:'`
52
sbindir=`echo $sbindir |sed -e 's:^..exec_prefix./sbin$:${libdir}:'`
53
sysconfdir=`echo $sysconfdir |sed -e 's:^..prefix./etc$:${sbindir}:'`
54
libexecdir=`echo $libexecdir |sed -e 's:/libexec$:/system:'`
55
# help-files shall be set with --infodir, docprefix is datadir
56
docprefix="${datadir}"
57
mandir=`echo $mandir \
58
|sed -e 's:^..prefix./man$:${datadir}/info:'`
59
includedir=`echo $includedir \
60
|sed -e 's:^..prefix./include$:${datadir}/include:'`
61
# other state files (but /etc) are moved to datadir
62
sharedstatedir=`echo $sharedstatedir \
63
|sed -e 's:^..prefix./com$:${datadir}/default:'`
64
localstatedir=`echo $localstatedir \
65
|sed -e 's:^..prefix./var$:${datadir}/current:'`
67
/usr) result="is /usr-shipped"
68
# doc files are left at prefix
70
# state files go under /top
71
sysconfdir=`echo $sysconfdir |sed -e 's:^..prefix./etc$:/etc:'`
72
sharedstatedir=`echo $sharedstatedir \
73
|sed -e 's:^..prefix./com$:/etc/default:'`
74
# $prefix/var is going to end up in /var/lib
75
localstatedir=`echo $localstatedir \
76
|sed -e 's:^..prefix./var$:/var/lib:'`
78
/opt | /opt/*) result="is /opt-package"
79
# state files go under /top/prefix
80
sysconfdir=`echo $sysconfdir \
81
|sed -e 's:^..prefix./etc$:/etc${prefix}:'`
82
sharedstatedir=`echo $sharedstatedir \
83
|sed -e 's:^..prefix./com$:/etc/default${prefix}:'`
84
# $prefix/var is going to to be /var$prefix... once again
85
localstatedir=`echo $localstatedir \
86
|sed -e 's:^..prefix./var$:/var${prefix}:'`
87
# doc files are left at prefix
90
*) result="is /local-package"
91
# doc files are moved from prefix down to datadir
92
docprefix="${datadir}"
93
mandir=`echo $mandir \
94
|sed -e 's:^..prefix./man$:${datadir}/man:'`
95
infodir=`echo $infodir \
96
|sed -e 's:^..prefix./infodir$:${datadir}/info:'`
97
# never use $prefix/com - that is no good idea
98
sharedstatedir=`echo $sharedstatedir \
99
|sed -e 's:^..prefix./com$:${sysconfdir}/default:'`
102
AC_MSG_RESULT($result)
103
# --------------------------------------------------------