~x2go/x2go/pinentry-x2go_build-main

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
# configure.ac
# Copyright (C) 1999 Robert Bihlmeyer <robbe@orcus.priv.at>
# Copyright (C) 2001, 2002, 2003, 2004, 2007 g10 Code GmbH
# 
# This file is part of PINENTRY.
# 
# PINENTRY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# PINENTRY is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
 
# (Process this file with autoconf to produce a configure script.)
AC_PREREQ(2.57)
min_automake_version="1.7.6"

# Remember to remove the "-cvs" suffix *before* a release and to bump the
# version number immediately *after* a release and to re-append the suffix.
AC_INIT(pinentry-x2go, 0.7.5.5, [x2go-dev@lists.x2go.org])
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(pinentry/pinentry.h)
AM_INIT_AUTOMAKE([foreign])

AC_GNU_SOURCE

AM_MAINTAINER_MODE

AC_CANONICAL_HOST

dnl Checks for programs.
missing_dir=`cd $ac_aux_dir && pwd`
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_RANLIB
# We need to check for cplusplus here becuase we may not do the test
# for Qt and autoconf does does not allow that.
AC_PROG_CXX
AC_PROG_LN_S
AC_CHECK_TOOL(WINDRES, windres, :)


have_dosish_system=no
have_w32_system=no
case "${host}" in
    *-mingw32*)
        AC_DEFINE(USE_ONLY_8DOT3,1,
                  [set this to limit filenames to the 8.3 format])
        AC_DEFINE(HAVE_DRIVE_LETTERS,1,
                  [defined if we must run on a stupid file system])
        have_dosish_system=yes
        have_w32_system=yes
        ;;
    i?86-emx-os2 | i?86-*-os2*emx )
        # OS/2 with the EMX environment
        AC_DEFINE(HAVE_DRIVE_LETTERS)
        have_dosish_system=yes
        ;;

    i?86-*-msdosdjgpp*)
        # DOS with the DJGPP environment
        AC_DEFINE(HAVE_DRIVE_LETTERS)
        have_dosish_system=yes
        ;;
esac

if test "$have_dosish_system" = yes; then
   AC_DEFINE(HAVE_DOSISH_SYSTEM,1,
             [Defined if we run on some of the PCDOS like systems 
              (DOS, Windoze. OS/2) with special properties like
              no file modes])
fi
AM_CONDITIONAL(HAVE_DOSISH_SYSTEM, test "$have_dosish_system" = yes)

if test "$have_w32_system" = yes; then
   AC_DEFINE(HAVE_W32_SYSTEM,1, [Defined if we run on a W32 API based system])
fi
AM_CONDITIONAL(HAVE_W32_SYSTEM, test "$have_w32_system" = yes)

AM_CONDITIONAL(BUILD_LIBPINENTRY_CURSES, false)

dnl Checks for compiler features.
if test "$GCC" = yes; then
    CFLAGS="$CFLAGS -Wall -Wcast-align -Wshadow -Wstrict-prototypes"
    CPPFLAGS="$CPPFLAGS -Wall"

    AC_MSG_CHECKING([if gcc supports -Wno-pointer-sign])
    _gcc_cflags_save=$CFLAGS
    CFLAGS="-Wno-pointer-sign"
    AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],_gcc_psign=yes,_gcc_psign=no)
    AC_MSG_RESULT($_gcc_psign)
    CFLAGS=$_gcc_cflags_save;
    if test x"$_gcc_psign" = xyes ; then
       CFLAGS="$CFLAGS -Wno-pointer-sign"
    fi
fi


# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(string.h unistd.h langinfo.h termio.h locale.h utime.h)

dnl Checks for library functions.
AC_CHECK_FUNCS(seteuid stpcpy mmap)
GNUPG_CHECK_MLOCK

dnl Checks for libassuan.
dnl -> None required becuase we use a stripped down version of libassuan.


dnl Checks for libsecmem.
GNUPG_CHECK_TYPEDEF(byte, HAVE_BYTE_TYPEDEF)
GNUPG_CHECK_TYPEDEF(ulong, HAVE_ULONG_TYPEDEF)

dnl
dnl Check for curses pinentry program.
dnl
AC_ARG_ENABLE(pinentry-curses,
            AC_HELP_STRING([--enable-pinentry-curses], [build curses pinentry]),
            pinentry_curses=$enableval, pinentry_curses=maybe)
AC_ARG_ENABLE(fallback-curses,
            AC_HELP_STRING([--enable-fallback-curses], [include curses fallback]),
            fallback_curses=$enableval, fallback_curses=maybe)

AC_CONFIG_FILES([
assuan/Makefile
secmem/Makefile
pinentry/Makefile
doc/Makefile
Makefile
])

AC_OUTPUT

for lrelease in $(which lrelease lrelease-qt5 lrelease-qt4 2>/dev/null); do
  break;
done;
for qmake in $(which qmake qmake-qt5 qmake-qt4 2>/dev/null); do
  break;
done;
if test -z "$lrelease"; then
  AC_MSG_ERROR([lrelease not found])
fi;
if test -z "$qmake"; then
  AC_MSG_ERROR([qmake not found])
fi;
( cd pinentry-x2go && "$lrelease" pinentry-x2go.pro; cd - 1>/dev/null;)
( cd pinentry-x2go && "$qmake" PREFIX="$prefix" QMAKE_CFLAGS="$CPPFLAGS $CFLAGS" QMAKE_LFLAGS="$LDFLAGS" QMAKE_CXXFLAGS="$CPPFLAGS $CXXFLAGS"; cd - 1>/dev/null;)

AC_MSG_NOTICE([
	Pinentry-X2Go v${VERSION} has been configured.
])