File: configure.ac

package info (click to toggle)
lcmaps 1.6.6-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,016 kB
  • ctags: 1,428
  • sloc: sh: 11,191; ansic: 9,519; makefile: 530; lex: 184; perl: 92; yacc: 60
file content (248 lines) | stat: -rw-r--r-- 8,060 bytes parent folder | download | duplicates (2)
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
#
#       Copyright (c) 2004 on behalf of the EU EGEE Project:
#       The European Organization for Nuclear Research (CERN),
#       Istituto Nazionale di Fisica Nucleare (INFN), Italy
#       Datamat Spa, Italy
#       Centre National de la Recherche Scientifique (CNRS), France
#       CS Systeme d'Information (CSSI), France
#       Royal Institute of Technology, Center for Parallel Computers (KTH-PDC), Sweden
#       Universiteit van Amsterdam (UvA), Netherlands
#       University of Helsinki (UH.HIP), Finland
#       University of Bergen (UiB), Norway
#       Council for the Central Laboratory of the Research Councils (CCLRC), United Kingdom
#
#       Common configure.ac file for the GLite WMS Common module
#
#       Authors: Alberto Di Meglio <alberto.di.meglio@cern.ch>
#       Version info: $Id: configure.ac 17727 2014-04-08 14:19:36Z msalle $
#       Release: $Name: not supported by cvs2svn $
#
# Revision history: See ChangeLog
                                                                                                                                                             
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.57)
AC_INIT([lcmaps], [1.6.6])
AC_CONFIG_MACRO_DIR([project])
AM_INIT_AUTOMAKE([1.6.3 subdir-objects foreign])
AC_CONFIG_SRCDIR([src/lcmaps_config.h.in])

# Notices.
AC_COPYRIGHT([Copyright (c) 2009 The EU EGEE Project
See LICENCE file for details
])
AC_REVISION([$Revision: 17727 $])

#Environment.
WORKDIR=`pwd`
AC_SUBST(WORKDIR)

DISTBIN=$WORKDIR/../../dist
AC_SUBST(DISTBIN)

# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_PROG_INSTALL

dnl ===================
dnl Lex and Yacc checks
dnl ===================
AC_PROG_YACC
dnl Need version for yyparse prototype
yacc_version=$($YACC --version 2> /dev/null|head -1|sed 's/[[^0-9]]\+//')
if test "x$yacc_version" != "x"; then
    yacc_major=$(echo $yacc_version|cut -d. -f1)
    yacc_minor=$(echo $yacc_version|cut -d. -f2)
    AC_MSG_NOTICE([yacc is "$YACC" version is $yacc_major.$yacc_minor])
else
    AC_MSG_NOTICE([yacc is "$YACC" version is unknown])
fi


AM_PROG_LEX
if test "$LEX"="flex"; then
    dnl Test whether flex has the -D option to set macros
    AM_CONDITIONAL([LEX_HAS_D],[$LEX -DTEST -V > /dev/null 2> /dev/null])
fi


# Checks for libraries.
# dlopen library
AC_CHECK_LIB([dl], [dlopen],
[
    DL_LIBS=-ldl
    AC_SUBST([DL_LIBS])
],
[
    AC_MSG_ERROR([cannot find libdl])
])

# Checks for header files.
AC_CHECK_HEADERS([dlfcn.h stdlib.h string.h syslog.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([malloc realloc setenv strchr strcspn strdup strerror strpbrk strspn strtol getgrouplist])


# Building headers mode
enable_build_headers_default=no
AC_MSG_CHECKING([whether to enable building header files])
AC_ARG_ENABLE([headers], [AC_HELP_STRING([--enable-headers],[build headers])],
[
    AC_MSG_RESULT(yes)
    enable_build_headers="yes"
],[
    AC_MSG_RESULT($enable_build_headers_default)
    enable_build_headers=$enable_build_headers_default
]
)

# Building GLOBUS mode
enable_gsi_mode_default=yes
AC_ARG_ENABLE([gsi-mode],
    [AC_HELP_STRING([--enable-gsi-mode],
		    [create lcmaps flavour that provides a GSI interface (default)])],
    [enable_gsi_mode=$enableval],
    [enable_gsi_mode=$enable_gsi_mode_default])

# When building headers only
AM_CONDITIONAL([ENABLE_HEADERS], [test "x$enable_build_headers" = "xyes"])
AS_IF([test "x$enable_build_headers" = "xyes"], [
    AC_MSG_NOTICE("building headers")

    LCMAPS_FLAVOUR=""
    LCMAPS_FLAVOUR_NAME=""

    AC_DEFINE(ENABLE_HEADERS, 1,[Building headers exclusively enabled])
], [
    # Find proper shared library extension
    eval SHREXT=$shrext_cmds
    AC_SUBST(SHREXT)

    # Configuration items

    AC_CONFIG_FILES([src/Makefile])
    AC_CONFIG_FILES([examples/Makefile])

    AC_CONFIG_FILES([etc/Makefile])

    AC_DEFINE(ENABLE_HEADERS, 0,[Building headers exclusively disabled])
    
    AS_IF([test "x$enable_gsi_mode" = "xyes"],[
	LCMAPS_FLAVOUR=""
	LCMAPS_FLAVOUR_NAME=""

	AC_DEFINE(LCMAPS_GSI_MODE, 1, "If defined provide the GSI interface to LCMAPS")
	AC_MSG_RESULT([Creating GSI flavour of LCMAPS])

	# not sure what canonical symbol we should check for here
	# NOTE: we should check for libcrypto, but presumably due to a clash
	# with globus linking explicitly against libcrypto leads to a segv...
	AC_CHECK_LIB([crypto], [X509_free],
	[
	    CRYPTO_LIBS=-lcrypto
	    AC_SUBST([CRYPTO_LIBS])
	],
	[
	    AC_MSG_ERROR([cannot find libcrypto])
	])

	# Check globus modules
	AC_GLOBUS([COMMON],[],AC_MSG_FAILURE(["no globus-common found"]))
	AC_GLOBUS([GSSAPI_GSI],[],AC_MSG_FAILURE(["no globus-gssapi-gsi found"]))
	AC_GLOBUS([GSS_ASSIST],[],AC_MSG_FAILURE(["no globus-gss-assist found"]))
	AC_GLOBUS([GSI_CREDENTIAL],[],AC_MSG_FAILURE(["no globus-gsi-credentials found"]))

	# Check voms location, only check for C API
	have_voms=no
	AC_VOMS([C])
	AC_MSG_RESULT(["VOMS found $have_voms"])
	if test "x$have_voms" = "xno" ; then
	    AC_MSG_FAILURE(["no working voms found"])
	fi

	AC_CONFIG_FILES([src/lcmaps.pc])
	AC_CONFIG_FILES([src/lcmaps-gss-assist-gridmap.pc])
	AC_CONFIG_FILES([src/lcmaps-return-poolindex.pc])
	AC_CONFIG_FILES([src/lcmaps-return-account-from-pem.pc])
	AC_CONFIG_FILES([src/lcmaps-verify-account-from-pem.pc])

    ],[
	LCMAPS_FLAVOUR="_without_gsi"
	LCMAPS_FLAVOUR_NAME="-without-gsi"

	PACKAGE="$PACKAGE-without-gsi"
	AC_MSG_RESULT([Setting package name to $PACKAGE])
	AC_SUBST(PACKAGE)

	PACKAGE_TARNAME="$PACKAGE_TARNAME-without-gsi"
	AC_MSG_RESULT([setting package tarname $PACKAGE_TARNAME])
	AC_SUBST(PACKAGE_TARNAME)

	AC_MSG_RESULT([Creating GSI-free flavour of LCMAPS])
	
	AC_CONFIG_FILES([src/lcmaps-without-gsi.pc])
	AC_CONFIG_FILES([src/lcmaps-gss-assist-gridmap-without-gsi.pc:src/lcmaps-gss-assist-gridmap.pc.in])
	AC_CONFIG_FILES([src/lcmaps-return-poolindex-without-gsi.pc:src/lcmaps-return-poolindex.pc.in])
    ])
])

AM_CONDITIONAL(LCMAPS_GSI_MODE, test x$enable_gsi_mode = xyes)

AC_SUBST(LCMAPS_FLAVOUR)
AC_SUBST(LCMAPS_FLAVOUR_NAME)

# Set OSG macros when needed
AC_ARG_ENABLE([osg], 
              [AC_HELP_STRING([--enable-osg],
			      [Enables the Open Science Grid specific build option])],
              ADD_THESE_DEFINES="-D ALLOW_EMPTY_CREDENTIALS -D CONF_LCMAPS_DEBUG_LEVEL=4 -D GUMSOSG",
              ADD_THESE_DEFINES="-D ALLOW_EMPTY_CREDENTIALS -D CONF_LCMAPS_DEBUG_LEVEL=4")

AC_SUBST(ADD_THESE_DEFINES)

# Set default directories
AC_SUBST([LCMAPS_ETC_HOME], [${sysconfdir}/lcmaps])
AC_SUBST([LCMAPS_LIB_HOME], [$libdir])

dnl allow the setting of a different path for the LCMAPS plug-ins
dnl Makefiles should set the plugindir to $MODULEDIR.
AC_ARG_WITH([lcmaps_moduledir],
    [AS_HELP_STRING([--with-lcmaps-moduledir=DIR],
                    [Specify the default install location of the LCMAPS plug-ins, when relative: prefix with LIBDIR [default=LIBDIR/lcmaps]])],
    [AS_IF([test "x`echo $withval|cut -c1`" = "x/" ],
	[AC_SUBST([LCMAPS_MOD_HOME], [$withval])], dnl Absolute path
	[AC_SUBST([LCMAPS_MOD_HOME], [$LCMAPS_LIB_HOME/$withval])])
    ],
    [AC_SUBST([LCMAPS_MOD_HOME], [$LCMAPS_LIB_HOME/lcmaps])]
)
AC_MSG_RESULT([LCMAPS_MOD_HOME set to $LCMAPS_MOD_HOME])

LCMAPS_MAJOR_VERSION=`echo ${VERSION}|cut -d. -f1`
LCMAPS_MINOR_VERSION=`echo ${VERSION}|cut -d. -f2`
LCMAPS_PATCH_VERSION=`echo ${VERSION}|cut -d. -f3`
AC_SUBST(LCMAPS_MAJOR_VERSION)
AC_SUBST(LCMAPS_MINOR_VERSION)
AC_SUBST(LCMAPS_PATCH_VERSION)

# Configuration items
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([doc/Makefile])
AC_CONFIG_FILES([doc/evaluationmanager/Makefile])
AC_CONFIG_FILES([interface/Makefile])
AC_CONFIG_FILES([interface/lcmaps_version.h])
AC_CONFIG_FILES([interface/lcmaps-interface.pc])
AC_CONFIG_FILES([interface/lcmaps-globus-interface.pc])
AC_CONFIG_FILES([interface/lcmaps-openssl-interface.pc])
AC_CONFIG_FILES([interface/lcmaps-basic-interface.pc])

AC_CONFIG_HEADERS([src/lcmaps_config.h])

AC_OUTPUT