File: acinclude.m4

package info (click to toggle)
vbox3 0.1.7.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 660 kB
  • ctags: 273
  • sloc: ansic: 3,454; sh: 1,831; makefile: 119; tcl: 22
file content (131 lines) | stat: -rw-r--r-- 3,977 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131

AC_DEFUN(AC_FIND_FILE,
[
   $3=NO
   for i in $2;
   do
      for j in $1;
      do
         if test -r "$i/$j"
         then
            $3=$i
            break 2
         fi
      done
   done
])

AC_DEFUN(AC_PATH_PKGLOGDIR,
[
   packagelogdir="`eval echo ${packagelogdir:-/var/log}`"

   AC_ARG_WITH(packagelogdir,
      [  --with-logdir=DIR       where logs should be stored [/var/log]],
      [ packagelogdir=${withval} ])
                
   AC_SUBST(packagelogdir)
])

AC_DEFUN(AC_PATH_PKGLOCKDIR,
[
   packagelockdir="`eval echo ${packagelockdir:-/var/lock}`"

   AC_ARG_WITH(packagelockdir,
      [  --with-lockdir=DIR      where locks should be stored [/var/lock]],
      [ packagelockdir=${withval} ])
                
   AC_SUBST(packagelockdir)
])                

AC_DEFUN(AC_PATH_PKGPIDDIR,
[
   packagepiddir="`eval echo ${packagepiddir:-/var/run}`"

   AC_ARG_WITH(packagepiddir,
      [  --with-piddir=DIR       where PID's should be stored [/var/run]],
      [ packagepiddir=${withval} ])
                
   AC_SUBST(packagepiddir)
])
                         
AC_DEFUN(AC_PATH_TCL,
[
   ac_tcl_inc=""
   ac_tcl_lib=""

   AC_ARG_WITH(tcl-include,
      [  --with-tcl-include=DIR  where the tcl include is installed. ],
      [ ac_tcl_inc="$withval" ])
                   
   AC_ARG_WITH(tcl-library,
      [  --with-tcl-library=DIR  where the tcl library is installed. ],
      [ ac_tcl_lib="$withval" ])

   tcl_include=""
   tcl_library=""
                   
   AC_CHECK_LIB(m, cos,
      [
         AC_CHECK_LIB(dl, dlerror,
            [
               AC_CHECKING([whether tcl is installed in a standard location...])

               AC_CHECK_LIB(tcl, Tcl_CreateInterp,
                  [ tcl_library="-ltcl -lm -ldl" ],
                  [
                     AC_CHECKING([whether tcl is installed in a special locations...])

                     searchstring="$ac_tcl_lib /lib /usr/lib /usr/local/lib /opt/lib /opt/tcl/lib"

                     AC_FIND_FILE(libtcl.so, $searchstring, searchresult)

                     if (test ! "$searchresult" = "NO")
                     then
                        AC_CHECK_LIB(tcl, Tcl_CreateInterp,
                           [ tcl_library="-L$searchresult -ltcl -lm -ldl" ],
                           ,
                           -L$searchresult -lm -ldl)
                     fi
                  ],
                  -lm -ldl)
            ])
      ])

   if (test ! "$tcl_library" = "")
   then
      AC_CHECK_HEADERS(tcl.h,
         ,
         [
            AC_MSG_CHECKING([for tcl.h in a special location])

            searchstring="$ac_tcl_inc /usr/include /usr/local/include /opt/include /opt/tcl/include"

            AC_FIND_FILE(tcl.h, $searchstring, searchresult)

            if (test ! "$searchresult" = "NO")
            then
               AC_MSG_RESULT([$searchresult])

               tcl_include="-I$searchresult"
            else
               AC_MSG_RESULT([no])

               AC_MSG_WARN([***********************************************************])
               AC_MSG_WARN([* The tcl header file can not be located!                 *])
               AC_MSG_WARN([***********************************************************])
            fi
         ])
   else
      AC_MSG_WARN([***********************************************************])
      AC_MSG_WARN([* The tcl library can not be located!                     *])
      AC_MSG_WARN([*                                                         *])
      AC_MSG_WARN([* If tcl is installed but no tcl.so exists (but something *])
      AC_MSG_WARN([* like tcl8.0.so or tcl8.1.so), create a link 'tcl.so'    *])
      AC_MSG_WARN([* that points to your installed tcl library and start     *])
      AC_MSG_WARN([* ./configure again!                                      *])
      AC_MSG_WARN([***********************************************************])
   fi

   AC_SUBST(tcl_library)
   AC_SUBST(tcl_include)
])