Debian Codegraph @

configure.ac

raw
1 # configure.ac
2 # Copyright (C) 1999 Robert Bihlmeyer <[email protected]>
3 # Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH
4 #
5 # This file is part of PINENTRY.
6 #
7 # PINENTRY is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # PINENTRY is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20
21 # (Process this file with autoconf to produce a configure script.)
22 AC_PREREQ(2.57)
23 min_automake_version="1.7.6"
24
25 # Remember to remove the "-cvs" suffix *before* a release and to bump the
26 # version number immediately *after* a release and to re-append the suffix.
27 AC_INIT(pinentry-x2go, 0.7.5.5, [[email protected]])
28 AM_CONFIG_HEADER(config.h)
29 AC_CONFIG_SRCDIR(pinentry/pinentry.h)
30 AM_INIT_AUTOMAKE([foreign])
31
32 AC_GNU_SOURCE
33
34 AM_MAINTAINER_MODE
35
36 AC_CANONICAL_HOST
37
38 dnl Checks for programs.
39 missing_dir=`cd $ac_aux_dir && pwd`
40 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
41 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
42 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
43 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
44 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
45 AC_PROG_CC
46 AC_PROG_CPP
47 AC_PROG_INSTALL
48 AC_PROG_RANLIB
49 # We need to check for cplusplus here becuase we may not do the test
50 # for Qt and autoconf does does not allow that.
51 AC_PROG_CXX
52 AC_PROG_LN_S
53 AC_CHECK_TOOL(WINDRES, windres, :)
54
55
56 have_dosish_system=no
57 have_w32_system=no
58 case "${host}" in
59 *-mingw32*)
60 AC_DEFINE(USE_ONLY_8DOT3,1,
61 [set this to limit filenames to the 8.3 format])
62 AC_DEFINE(HAVE_DRIVE_LETTERS,1,
63 [defined if we must run on a stupid file system])
64 have_dosish_system=yes
65 have_w32_system=yes
66 ;;
67 i?86-emx-os2 | i?86-*-os2*emx )
68 # OS/2 with the EMX environment
69 AC_DEFINE(HAVE_DRIVE_LETTERS)
70 have_dosish_system=yes
71 ;;
72
73 i?86-*-msdosdjgpp*)
74 # DOS with the DJGPP environment
75 AC_DEFINE(HAVE_DRIVE_LETTERS)
76 have_dosish_system=yes
77 ;;
78 esac
79
80 if test "$have_dosish_system" = yes; then
81 AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
82 [Defined if we run on some of the PCDOS like systems
83 (DOS, Windoze. OS/2) with special properties like
84 no file modes])
85 fi
86 AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)
87
88 if test "$have_w32_system" = yes; then
89 AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
90 fi
91 AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)
92
93 AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES, false)
94
95 dnl Checks for compiler features.
96 if test "$GCC" = yes; then
97 CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
98 CPPFLAGS="$CPPFLAGS -Wall"
99
100 AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
101 _gcc_cflags_save=$CFLAGS
102 CFLAGS="-Wno-pointer-sign"
103 AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],_gcc_psign=yes,_gcc_psign=no)
104 AC_MSG_RESULT($_gcc_psign)
105 CFLAGS=$_gcc_cflags_save;
106 if test x"$_gcc_psign" = xyes ; then
107 CFLAGS="$CFLAGS -Wno-pointer-sign"
108 fi
109 fi
110
111
112 # Checks for header files.
113 AC_HEADER_STDC
114 AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h)
115
116 dnl Checks for library functions.
117 AC_CHECK_FUNCS(seteuid stpcpy mmap)
118 GNUPG_CHECK_MLOCK
119
120 dnl Checks for libassuan.
121 dnl -> None required becuase we use a stripped down version of libassuan.
122
123
124 dnl Checks for libsecmem.
125 GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
126 GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)
127
128 dnl
129 dnl Check for curses pinentry program.
130 dnl
131 AC_ARG_ENABLE(pinentry-curses,
132 AC_HELP_STRING([--enable-pinentry-curses], [build curses pinentry]),
133 pinentry_curses=$enableval, pinentry_curses=maybe)
134 AC_ARG_ENABLE(fallback-curses,
135 AC_HELP_STRING([--enable-fallback-curses], [include curses fallback]),
136 fallback_curses=$enableval, fallback_curses=maybe)
137
138 AC_CONFIG_FILES([
139 assuan/Makefile
140 secmem/Makefile
141 pinentry/Makefile
142 doc/Makefile
143 Makefile
144 ])
145
146 AC_OUTPUT
147
148 for lrelease in $(which lrelease lrelease-qt5 lrelease-qt4 2>/dev/null); do
149 break;
150 done;
151 for qmake in $(which qmake qmake-qt5 qmake-qt4 2>/dev/null); do
152 break;
153 done;
154 if test -z "$lrelease"; then
155 AC_MSG_ERROR([lrelease not found])
156 fi;
157 if test -z "$qmake"; then
158 AC_MSG_ERROR([qmake not found])
159 fi;
160 ( cd pinentry-x2go && "$lrelease" pinentry-x2go.pro; cd - 1>/dev/null;)
161 ( cd pinentry-x2go && "$qmake" PREFIX="$prefix" QMAKE_CFLAGS="$CPPFLAGS $CFLAGS" QMAKE_LFLAGS="$LDFLAGS" QMAKE_CXXFLAGS="$CPPFLAGS $CXXFLAGS"; cd - 1>/dev/null;)
162
163 AC_MSG_NOTICE([
164 Pinentry-X2Go v${VERSION} has been configured.
165 ])
166