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 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332
|
dnl Process this file with autoconf to produce a configure script.
AC_INIT(jpilot.c)
AC_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AC_DISABLE_STATIC
AC_LIBTOOL_DLOPEN
AM_PROG_LIBTOOL
AC_PROG_INSTALL
dnl Checks for programs.
PACKAGE=jpilot
VERSION="0.99.2"
if test "x$prefix" = "xNONE"; then
AC_DEFINE_UNQUOTED(BASE_DIR, "$ac_default_prefix")
else
AC_DEFINE_UNQUOTED(BASE_DIR, "$prefix")
fi
#
# This is for ncc
#
AC_ARG_WITH(for_NCC,
[ --with-prometheon For use with Prometheon: http://www.prometheon.net/])
if test "x$with_prometheon" != "x"; then
AC_DEFINE(WITH_PROMETHEON)
AC_MSG_RESULT(Compiling for Prometheon)
fi
# 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 start gettext
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
ALL_LINGUAS="ja de fr da sv es nl ca cs no it"
dnl ud_GNU_GETTEXT
dnl AM_WITH_NLS()
AM_GNU_GETTEXT
if test "x$MSGFMT" = "xno"; then
if test "x$GMSGFMT" = "xno"; then
AC_MSG_RESULT(I can't find gettext)
AC_MSG_ERROR(Either install gettext or use 'configure --disable-nls')
fi
fi
dnl AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
dnl end gettext
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=${FORCE_PILOT_INCLUDES:-no}
if test $pilotinclude = no ; then
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-version.h" ; then
pilotinclude=yes
PILOT_FLAGS="$PILOT_FLAGS -I$pilot_incl"
break
fi
done
fi
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=${FORCE_PILOT_LIBS:-no}
PILOT_LIBS="-lpisock"
if test $pilotlibs = no ; then
for pilot_libs in $pilot_prefix/lib /usr/lib /usr/local/lib/ \
/usr/extra/pilot/lib ; do
if test -r $pilot_libs/libpisock.so >/dev/null 2>&1 ; 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
fi
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 Check to make sure pilot-link library can be linked
pilotcompile=no
dnl *************************
dnl * Link a tiny program to make sure we have the environment right
dnl *************************
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"
AC_TRY_LINK([#include "pi-version.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
dnl *************************
dnl * Try to run a pilot-link program (tests dynamic linking)
dnl *************************
AC_MSG_CHECKING(running a pilot-link program )
AC_TRY_RUN([
#include <pi-version.h>
int main()
{
return 0;
}
],
AC_MSG_RESULT([ok]),
AC_MSG_ERROR([
* Can not run a pilot-link test program
* Make sure libpisock can be found by ld
* Check /etc/ld.so.conf and run ldconfig
* This test can be disabled by the --disable-pl-test option])
, )
dnl *************************
dnl * Check pilot-link version for USB support in pilot-link >= 0.10.0
dnl *************************
#Check pilot-link version
AC_MSG_CHECKING(pilot-link version )
AC_TRY_RUN([
#include <pi-version.h>
int main()
{
if ((PILOT_LINK_VERSION<=0) && (PILOT_LINK_MAJOR<10)) {
/* 0.10.0 or older (0.9.5) */
return 95;
} else {
return 100;
}
}
], , , )
if test "$ac_status" = "100"; then
AC_MSG_RESULT([0.10.0 or newer... good])
fi
if test "$ac_status" = "95"; then
AC_MSG_RESULT(0.9.x or older)
AC_MSG_RESULT([*** Upgrade pilot-link to >0.10.0 and reconfigure/compile to use USB devices])
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)
PLUGIN_SUPPORT=0
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"
AC_CHECK_FUNCS(dlopen)
if test "x$ac_cv_func_dlopen" = "xyes"; then
have_dlopen=yes
else
for lib in dl; do
AC_CHECK_LIB($lib, dlopen, [LIBS="$LIBS -ldl";
have_dlopen=yes; break])
done
fi
if test "x$have_dlopen" = "xyes"; then
AC_DEFINE(ENABLE_PLUGINS)
PLUGIN_SUPPORT=1
AC_SUBST(PLUGIN_SUPPORT)
else
AC_MSG_RESULT(Could not find dlopen - not using plugin support)
fi
else
AC_MSG_RESULT(Plugin support disabled by configure options)
fi
AC_ARG_ENABLE(private, [ --disable-private Do not use private records feature],
enable_private=no, enable_private=yes)
if test "x$enable_private" = "xyes"; then
AC_DEFINE(ENABLE_PRIVATE)
else
AC_MSG_RESULT(Private record 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 string.h locale.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(memmove strchr memcpy strdup setenv \
getcwd strerror)
AC_CHECK_FUNCS(setenv)
AC_CHECK_HEADERS([openssl/md5.h], OPEN_SSL_MD5=1, OPEN_SSL_MD5=0)
AC_CHECK_HEADERS([openssl/des.h], OPEN_SSL_DES=1, OPEN_SSL_DES=0)
if test "$OPEN_SSL_MD5" = "1"; then
if test "$OPEN_SSL_DES" = "1"; then
MAKE_KEYRING=1
AC_SUBST(MAKE_KEYRING)
fi
fi
if test "$MAKE_KEYRING" != "1"; then
AC_MSG_NOTICE([Open SSL headers not found, Keyring will not be built])
fi
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
dnl For Irix
abilib=$ABILIB
if test "x$abilib" = "x"; then
AC_DEFINE_UNQUOTED(ABILIB, "lib")
else
AC_DEFINE_UNQUOTED(ABILIB, "$abilib")
fi
AC_SUBST(ABILIB)
AC_OUTPUT([Makefile jpilot.spec \
SyncTime/Makefile Expense/Makefile KeyRing/Makefile \
intl/Makefile po/Makefile.in SlackBuild],
[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
|