File: configure.in

package info (click to toggle)
jpilot 0.97-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,244 kB
  • ctags: 957
  • sloc: ansic: 13,558; makefile: 192; sh: 153
file content (182 lines) | stat: -rw-r--r-- 4,788 bytes parent folder | download
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
dnl Process this file with autoconf to produce a configure script.
AC_INIT(jpilot.c)

AC_CONFIG_HEADER(config.h)

dnl Checks for programs.
AC_PROG_CC

# Compile options
ccoptions=""
AC_ARG_WITH(ccoptions,
[  --with-ccoptions=       Options to pass to your C compiler])

if test "x$with_ccoptions" != "x"; then
   ccoptions=$with_ccoptions
   CFLAGS=""
   AC_MSG_CHECKING(for supplied cc options)
   AC_MSG_RESULT(Using supplied cc options $ccoptions)
fi
AC_SUBST(ccoptions)
cflags=$CFLAGS
AC_SUBST(cflags)

dnl Check for pilot-link libs
pilot_prefix=""
AC_ARG_WITH(pilot_prefix,
 [  --with-pilot-prefix=    Prefix to top level of pilot-link files
                            (e.g., = /usr/local if the pilot-link includes
                             are in /usr/local/include
                             and libs are in /usr/local/lib)])

if test "x$with_pilot_prefix" != "x"; then
   pilot_prefix=$with_pilot_prefix
fi

dnl Make sure that the pilot-link stuff actually exists
AC_MSG_CHECKING(for pilot-link header files)
pilotinclude=no
for pilot_incl in $pilot_prefix/include /usr/include /usr/local/include \
    /usr/extra/pilot/include /usr/include/libpisock; do
   if test -r "$pilot_incl/pi-config.h" ; then
      pilotinclude=yes
      PILOT_FLAGS="$PILOT_FLAGS -I$pilot_incl"
      break
   fi
done

if test $pilotinclude = no ; then
   AC_MSG_RESULT(no)
   AC_MSG_ERROR(Could not find the pilot-link header files)
else
   AC_MSG_RESULT(found at $pilot_incl)
fi


dnl Maybe installed
AC_MSG_CHECKING(for pilot library files)
pilotlibs=no
PILOT_LIBS="-lpisock"

for pilot_libs in $pilot_prefix/lib /usr/lib /usr/local/lib/ \
  /usr/extra/pilot/lib ; do
   if test -r "$pilot_libs/libpisock.so" ; then
      pilotlibs=yes
      PILOT_LIBS="-L$pilot_libs $PILOT_LIBS"
      break
   fi
   if test -r "$pilot_libs/libpisock.a" ; then
      pilotlibs=yes
      PILOT_LIBS="-L$pilot_libs $PILOT_LIBS"
      break
   fi
   if test -r "$pilot_libs/libpisock.sl" ; then
      pilotlibs=yes
      PILOT_LIBS="-L$pilot_libs $PILOT_LIBS"
      break
   fi
done

if test $pilotlibs = no ; then
   AC_MSG_RESULT(no)
   AC_MSG_ERROR(Could not find the pilot-link libraries)
else
   AC_MSG_RESULT(found at $pilot_libs)
fi

dnl Solaris needs the socket library
AC_CHECK_LIB(socket, main, PILOT_LIBS=$PILOT_LIBS" -lsocket", , )

AC_ARG_ENABLE(pl-test, [  --disable-pl-test       Do not try to compile \
a test pilot-link program], enable_pl_test=no, enable_pl_test=yes)

if test "x$enable_pl_test" = "xyes"; then
   dnl Link a tiny program to make sure we have the environment right
   AC_MSG_CHECKING(to see if I can compile a pilot link program)
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS="$CFLAGS $PILOT_FLAGS"
   ac_save_LIBS="$LIBS"
   LIBS="$LIBS $PILOT_LIBS"

   pilotcompile=no

   AC_TRY_LINK([#include "pi-config.h"
   #include "pi-socket.h"], [pi_close (0);] , pilotcompile=yes, , )


   if test $pilotcompile = no ; then
      AC_MSG_RESULT(no)
      AC_MSG_ERROR(Could not compile a test pilot-link program)
   else
      AC_MSG_RESULT(ok)
      AC_SUBST(PILOT_FLAGS)
      AC_SUBST(PILOT_LIBS)
   fi

CFLAGS="$save_CFLAGS"
LIBS="$save_LIBS"

fi


AC_ARG_ENABLE(plugins, [  --disable-plugins       Do not compile plugin support]\
, enable_plugins=no, enable_plugins=yes)

if test "x$enable_plugins" = "xyes"; then
   dnl Check for shared library calls
   AC_MSG_CHECKING(for dlopen)
   save_LIBS="$LIBS"
   LIBS="$LIBS -ldl"
   AC_TRY_LINK([#include <dlfcn.h>], [dlopen("huh",0);] , have_dlopen=yes, , )
   LIBS="$save_LIBS"

   if test "x$have_dlopen" = "xyes"; then
      AC_DEFINE(ENABLE_PLUGINS)
      AC_MSG_RESULT(ok, plugin support enabled)
   else
      AC_MSG_RESULT(Could not find dlopen - not using plugin support)
   fi
else
   AC_MSG_RESULT(Plugin support disabled by configure options)
fi



dnl Checking for GTK version
AM_PATH_GTK(1.2.0,,
  AC_MSG_ERROR([*** GTK >= 1.2.0 not installed - please install first ***]))

dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
AC_HEADER_TIME
AC_STRUCT_TM

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
AC_FUNC_UTIME_NULL
#AC_CHECK_FUNCS(mkdir mktime select strdup strstr setenv)
AC_CHECK_FUNCS(setenv)

AC_ARG_WITH(japanese,
[  --with-japanese         Use this for japanese support])
japanese=""
if test "x$with_japanese" != "x"; then
   AC_DEFINE(WITH_JAPANESE)
   AC_MSG_RESULT(Japanese support $japanese)
fi
AC_SUBST(japanese)

AC_ARG_WITH(with_flock,
[  --with-flock            Substitute flock instead of fnctl (for NFS)])
if test "x$with_flock" != "x"; then
   AC_DEFINE(USE_FLOCK)
   AC_MSG_RESULT(Using flock instead of fnctl)
fi

AC_OUTPUT(Makefile)