File: configure.in

package info (click to toggle)
ccrypt 1.7-11
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 968 kB
  • ctags: 390
  • sloc: ansic: 3,833; sh: 1,113; lisp: 650; makefile: 111; sed: 19
file content (125 lines) | stat: -rw-r--r-- 4,091 bytes parent folder | download | duplicates (3)
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
dnl  Copyright (C) 2000-2004 Peter Selinger.
dnl  This file is part of ccrypt. It is free software and it is covered
dnl  by the GNU general public license. See the file COPYING for details.

dnl  Process this file with autoconf to produce a configure script.

dnl ----------------------------------------------------------------------
AC_INIT(src/ccrypt.c)
AM_INIT_AUTOMAKE(ccrypt, 1.7)
DATE="March 2004"
AM_CONFIG_HEADER(config.h)

dnl ----------------------------------------------------------------------
dnl  Find lisp installation directory
AC_ARG_WITH(lispdir,
 [  --with-lispdir=DIR      override emacs site-lisp directory],
 lispdir=$withval, [AM_PATH_LISPDIR])

dnl ----------------------------------------------------------------------
dnl  The names of the installed executables and the default suffix are in
dnl  principle configurable. However, they should not normally be changed,
dnl  because other scripts might depend on them.

NAME=ccrypt
NAMEENCRYPT=ccencrypt
NAMEDECRYPT=ccdecrypt
NAMECAT=ccat
SUF=.cpt

dnl Upper case name
NAMEUC=`echo $NAME | tr a-z A-Z`

dnl ----------------------------------------------------------------------
dnl Export some parameters to config file
AC_DEFINE_UNQUOTED(NAME,"$NAME",Name of the ccrypt binary)
AC_DEFINE_UNQUOTED(NAMEENCRYPT,"$NAMEENCRYPT",Name of the ccencrypt binary)
AC_DEFINE_UNQUOTED(NAMEDECRYPT,"$NAMEDECRYPT",Name of the ccdecrypt binary)
AC_DEFINE_UNQUOTED(NAMECAT,"$NAMECAT",Name of the ccat binary)
AC_DEFINE_UNQUOTED(SUF,"$SUF",Default suffix for encrypted files)

dnl ----------------------------------------------------------------------
dnl remember user's CFLAGS
iCFLAGS="$CFLAGS"

dnl ----------------------------------------------------------------------
dnl Check for programs.
AC_PROG_CC

dnl  Note: CFLAGS can now be specified by the user at ./configure time,
dnl  but we enforce -O3, as this really makes a big difference in terms
dnl  of performance for ccrypt. (74% faster than -O0, 19% faster than
dnl  -O2). The space/time tradeoff is biased in favor of time for ccrypt.

if test "$GCC" = "yes"; then
   if test "$iCFLAGS" = ""; then
     CFLAGS="-O3 -Wall"
   else
     CFLAGS="$iCFLAGS -O3"
   fi
fi

AC_CHECK_PROGS(TAR, gtar, tar)

dnl ----------------------------------------------------------------------
dnl check for features

AC_ARG_ENABLE(libcrypt,
[  --disable-libcrypt      don't link against libcrypt, use own replacement])

dnl ----------------------------------------------------------------------
dnl Checks for libraries.

if test "$enable_libcrypt" != no; then
  AC_CHECK_LIB(crypt, crypt)
fi

if test "$ac_cv_lib_crypt_crypt" != yes; then
   EXTRA_OBJS="$EXTRA_OBJS unixcrypt3.o"
fi

dnl ----------------------------------------------------------------------
dnl Checks for header files.
AC_CHECK_HEADERS(stdint.h)

dnl ----------------------------------------------------------------------
dnl Checks for library functions.
AC_CHECK_FUNC(getopt_long, , EXTRA_OBJS="$EXTRA_OBJS getopt.o getopt1.o")

dnl ----------------------------------------------------------------------
dnl Find sizes of some types
AC_CHECK_SIZEOF(unsigned int, 4)
AC_CHECK_SIZEOF(unsigned long, 4)

dnl Determine 32-bit unsigned integer type
AC_MSG_CHECKING([for 32 bit unsigned integer type])
if test "$ac_cv_sizeof_unsigned_int" -eq 4; then
   UINT32_TYPE="unsigned int";
elif test "$ac_cv_sizeof_unsigned_long" -eq 4; then
   UINT32_TYPE="unsigned long";
else
AC_MSG_ERROR(cannot find 32 bit integer type)
fi
AC_MSG_RESULT($UINT32_TYPE)
AC_DEFINE_UNQUOTED(UINT32_TYPE,$UINT32_TYPE,unsigned 32 bit integer type)

dnl ----------------------------------------------------------------------
dnl Set up substitutions of non-standard configuration parameters
AC_SUBST(NAME)
AC_SUBST(NAMEENCRYPT)
AC_SUBST(NAMEDECRYPT)
AC_SUBST(NAMECAT)
AC_SUBST(SUF)
AC_SUBST(DATE)
AC_SUBST(NAMEUC)
AC_SUBST(EXTRA_OBJS)
AC_SUBST(TAR)

dnl ----------------------------------------------------------------------
AC_OUTPUT([doc/ccrypt.1
	   Makefile 
	   src/Makefile 
	   emacs/Makefile
	   check/Makefile
	   doc/Makefile
          ])