source: trunk/base/aclocal.m4 @ 2941

Last change on this file since 2941 was 2941, checked in by ssen, 17 years ago

Merge from ssen-platform-1

  • Property svn:eol-style set to native
File size: 3.4 KB
Line 
1builtin(include,tcl.m4)
2
3dnl This macro checks if the user specified a dports tree
4dnl explicitly. If not, search for it
5
6# OD_PATH_DPORTSDIR(DEFAULT_DPORTSDIR)
7#---------------------------------------
8AC_DEFUN([OD_PATH_DPORTSDIR],[
9        dnl For ease of reading, run after gcc has been found/configured
10        AC_REQUIRE([AC_PROG_CC])
11
12        AC_ARG_WITH(dports-dir, [AC_HELP_STRING([--with-dports-dir=DIR], [Specify alternate dports directory])], [ dportsdir="$withval" ] )
13
14
15        AC_MSG_CHECKING([for dports tree])
16       
17        if test "x$dportsdir" != "x" ; then
18          if test -d "$dportsdir" -a -e "$dportsdir/PortIndex" ; then
19                :
20          else
21                AC_MSG_ERROR([$dportsdir not a valid dports tree])
22          fi
23        else
24                dnl If the user didn't give a path, look for default
25                if test "x$1" != "x" ; then
26                  if test -d "$1" -a -e "$1/PortIndex" ; then
27                        dportsdir=$1
28                  fi
29                fi
30        fi
31
32        if test "x$dportsdir" != "x" ; then
33                AC_MSG_RESULT($dportsdir)
34                DPORTSDIR="$dportsdir"
35                AC_SUBST(DPORTSDIR)
36        else
37                AC_MSG_WARN([No dports tree found])
38        fi
39
40        ])
41
42
43# OD_PATH_PORTCONFIGDIR(DEFAULT_PORTCONFIGDIR, PREFIX)
44#---------------------------------------
45AC_DEFUN([OD_PATH_PORTCONFIGDIR],[
46        dnl if the user actually specified --prefix, shift
47        dnl portconfigdir to $prefix/etc/ports
48        AC_REQUIRE([OD_PATH_DPORTSDIR])
49       
50        AC_MSG_CHECKING([for ports config directory])
51
52        if test "$2" != "NONE" ; then
53                dnl user gave --prefix
54                portconfigdir='${sysconfdir}/ports'
55        else
56                dnl just use the default /etc/ports
57                portconfigdir='/etc/ports'
58        fi
59
60
61        AC_MSG_RESULT([$portconfigdir])
62        PORTCONFIGDIR="$portconfigdir"
63        AC_SUBST(PORTCONFIGDIR)
64
65        ])
66
67# OD_CHECK_INSTALLUSER
68#-------------------------------------------------
69AC_DEFUN([OD_CHECK_INSTALLUSER],[
70        dnl if with user specifies --with-install-user,
71        dnl use it. otherwise default to platform defaults
72        AC_REQUIRE([OD_PATH_PORTCONFIGDIR])
73
74        AC_ARG_WITH(install-user, [AC_HELP_STRING([--with-install-user=USER], [Specify user ownership of installed files])], [ DSTUSR=$withval ] )
75
76        AC_MSG_CHECKING([for install user])
77        if test "x$DSTUSR" = "x" ; then
78           DSTUSR=root
79        fi
80
81        AC_MSG_RESULT([$DSTUSR])
82        AC_SUBST(DSTUSR)
83])
84
85# OD_CHECK_INSTALLGROUP
86#-------------------------------------------------
87AC_DEFUN([OD_CHECK_INSTALLGROUP],[
88        dnl if with user specifies --with-install-group,
89        dnl use it. otherwise default to platform defaults
90        AC_REQUIRE([OD_CHECK_INSTALLUSER])
91
92        AC_ARG_WITH(install-group, [AC_HELP_STRING([--with-install-group=GROUP], [Specify group ownership of installed files])], [ DSTGRP=$withval ] )
93
94        AC_MSG_CHECKING([for install group])
95        if test "x$DSTGRP" = "x" ; then
96           
97           case $host_os in
98           darwin*)
99                DSTGRP="admin"
100                ;;
101           *)
102                DSTGRP="wheel"
103                ;;
104           esac
105        fi
106
107        AC_MSG_RESULT([$DSTGRP])
108        AC_SUBST(DSTGRP)
109])
110
111# OD_PROG_MD5
112#---------------------------------------
113AC_DEFUN([OD_PROG_MD5],[
114
115        AC_PATH_PROG([MD5], [md5], ,  [/usr/bin:/usr/sbin:/bin:/sbin])
116
117        if test "x$MD5" = "x" ; then
118                AC_CONFIG_SUBDIRS([src/programs/md5])
119                MD5='${prefix}/bin/md5'
120                REPLACEMENT_PROGS="$REPLACEMENT_PROGS md5"
121        fi
122
123        AC_SUBST(MD5)
124])
125
126# OD_PROG_MTREE
127#---------------------------------------
128AC_DEFUN([OD_PROG_MTREE],[
129
130        AC_PATH_PROG([MTREE], [mtree], ,  [/usr/bin:/usr/sbin:/bin:/sbin])
131
132        if test "x$MTREE" = "x" ; then
133                AC_CONFIG_SUBDIRS([src/programs/mtree])
134                MTREE='$(TOPSRCDIR)/src/programs/mtree/mtree'
135#               MTREE='${prefix}/bin/mtree'
136                REPLACEMENT_PROGS="$REPLACEMENT_PROGS mtree"
137        fi
138
139        AC_SUBST(MTREE)
140])
Note: See TracBrowser for help on using the repository browser.