source: trunk/base/aclocal.m4 @ 2814

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

If no dports tree was specified just make it a warning for now. eventually, we should look for a dports/ directory in the current checkout

  • Property svn:eol-style set to native
File size: 3.0 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 -n "$dportsdir" ; 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 -n "$1" ; then
26                  if test -d "$1" -a -e "$1/PortIndex" ; then
27                        dportsdir=$1
28                  fi
29                fi
30        fi
31
32        if test -n "$dportsdir" ; 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], ,  [ $PATH:/usr/bin:/bin ])
116
117        if test "x$MD5" = "x" ; then
118                AC_PATH_PROG([OPENSSL], [openssl],
119                        [AC_MSG_ERROR([No suitable md5 program found])],
120                        [ $PATH:/usr/local/openssl/bin:/usr/bin:/bin ])
121
122                MD5="$OPENSSL md5"
123        fi
124
125        AC_SUBST(MD5)
126])
Note: See TracBrowser for help on using the repository browser.