forked from warewulf/ww-mca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
182 lines (144 loc) · 5.22 KB
/
configure.ac
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
# -*- shell-script -*-
#
# Copyright (c) 2016 Intel, Inc. All rights reserved
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
############################################################################
# Initialization, version number, and other random setup/init stuff
############################################################################
# Load in everything found by autogen.pl
m4_include([config/autogen_found_items.m4])
# We don't have the version number to put in here yet, and we can't
# call WW_GET_VERSION (etc.) before AC_INIT. So use the shell
# version.
AC_INIT([warewulf],
[m4_normalize(esyscmd([config/ww_get_version.sh VERSION --tarball]))],
[[email protected]], [warewulf])
AC_PREREQ(2.59)
AC_CONFIG_AUX_DIR(./config)
# Note that this directory must *exactly* match what was specified via
# -I in ACLOCAL_AMFLAGS in the top-level Makefile.am.
AC_CONFIG_MACRO_DIRS(./config)
# Get our platform support file. This has to be done very, very early
# because it twiddles random bits of autoconf
WW_LOAD_PLATFORM
# setup configure options (e.g., show_title and friends)
WW_CONFIGURE_SETUP
ww_show_title "Configuring Warewulf"
# This must be before AM_INIT_AUTOMAKE
AC_CANONICAL_TARGET
# Init automake
AM_INIT_AUTOMAKE([foreign dist-bzip2 subdir-objects no-define 1.12.2 -Wall -Werror])
# SILENT_RULES is new in AM 1.11, but we require 1.11 or higher via
# autogen. Limited testing shows that calling SILENT_RULES directly
# works in more cases than adding "silent-rules" to INIT_AUTOMAKE
# (even though they're supposed to be identical). Shrug.
AM_SILENT_RULES([yes])
# set the languages
AC_LANG([C])
AC_PATH_PROG(PERLBIN, perl)
if test -z "$PERLBIN"; then
AC_MSG_ERROR([perl not found])
fi
AC_SUBST(PERLBIN)
AC_MSG_CHECKING(for Perl lib location)
WW_PERLLIBDIR="$prefix/lib/"
AC_ARG_WITH(perllibdir, [ --perllibdir=path Path to install Perl libraries ('auto' uses standard perl location)], [
if test -n "$withval" -a "$withval" == "auto" ; then
eval `perl -V:installvendorlib`
WW_PERLLIBDIR=$installvendorlib
elif test -n "$withval" -a "$withval" != "no" ; then
WW_PERLLIBDIR=$withval
fi
])
AC_MSG_RESULT($WW_PERLLIBDIR)
AC_SUBST(WW_PERLLIBDIR)
# AC_USE_SYSTEM_EXTENSIONS will modify CFLAGS if nothing was in there
# beforehand. We don't want that. So if there was nothing in
# CFLAGS, put nothing back in there.
WW_VAR_SCOPE_PUSH([CFLAGS_save])
CFLAGS_save=$CFLAGS
AC_USE_SYSTEM_EXTENSIONS
AS_IF([test -z "$CFLAGS_save"], [CFLAGS=])
WW_VAR_SCOPE_POP
####################################################################
# Setup the configure header files
####################################################################
AH_TOP([/* -*- c -*-
*
* Copyright (c) 2016 Intel, Inc. All rights reserved
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* This file is automatically generated by configure. Edits will be lost
* the next time you run configure!
*/
#ifndef WW_CONFIG_H
#define WW_CONFIG_H
#include <src/include/ww_config_top.h>
])
AH_BOTTOM([
#include <src/include/ww_config_bottom.h>
#endif /* WW_CONFIG_H */
])
############################################################################
# Setup Libtool
############################################################################
# We want new Libtool. None of that old stuff. Pfft.
m4_ifdef([LT_PREREQ], [],
[m4_fatal([libtool version 2.2.6 or higher is required], [63])])
LT_PREREQ([2.2.6])
#
# Enable static so that we have the --with tests done up here and can
# check for OS. Save the values of $enable_static and $enable_shared
# before setting the defaults, because if the user specified
# --[en|dis]able-[static|shared] on the command line, they'll already
# be set. In this way, we can tell if the user requested something or
# if the default was set here.
#
ww_enable_shared="$enable_shared"
ww_enable_static="$enable_static"
AM_ENABLE_SHARED
AM_DISABLE_STATIC
# This did not exist pre AM 1.11.x (where x is somewhere >0 and <3),
# but it is necessary in AM 1.12.x.
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AM_PROG_LEX
LT_INIT()
LT_LANG([C])
LT_LANG([C++])
############################################################################
# Configuration options
############################################################################
# Define WW configure arguments
WW_DEFINE_ARGS
# Define some basic useful values
WW_BASIC_SETUP
# If debug mode, add -g
AS_IF([test "$ww_debug" = "1"],
[CFLAGS="$CFLAGS -g"])
############################################################################
# Setup the core
############################################################################
WW_SETUP_CORE
####################################################################
# Version information
####################################################################
# WW_VERSION was setup by WW_SETUP_CORE above.
# Make configure depend on the VERSION file, since it's used in AC_INIT
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
. $srcdir/VERSION
AC_SUBST([libww_so_version])
####################################################################
# Complete
####################################################################
ww_show_title "Configuration complete"
AC_OUTPUT
WW_SUMMARY_PRINT