source: filezilla/trunk/fuentes/src/fzshellext/configure.ac @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 4 years ago

First release to xenial

File size: 3.4 KB
Line 
1AC_INIT([fzshellext],[0.0.0],[tim.kosse@filezilla-project.org],[],[https://filezilla-project.org/])
2AC_CONFIG_HEADERS([config.h])
3AC_CONFIG_MACRO_DIR([../../m4])
4AC_CONFIG_AUX_DIR(../../config)
5AM_INIT_AUTOMAKE([dist-bzip2 foreign])
6
7AC_ARG_ENABLE(shellext, AS_HELP_STRING([--disable-shellext],[Disable shellextension]), \
8                [build_shellext="$enableval"], [build_shellext="yes"])
9
10AC_CANONICAL_HOST
11
12LT_INIT
13LT_LANG([C++])
14
15if test "x$build_shellext" = "xyes"; then
16
17AC_CACHE_SAVE
18
19if test "X$GCC" = Xyes; then
20        CFLAGS="$CFLAGS -Wall -g"
21        CXXFLAGS="$CXXFLAGS -Wall -g"
22fi
23
24AC_MSG_CHECKING([whether the compiler actually targets MinGW])
25matching=
26cxx_v=`"$CXX" -v 2>&1`
27if echo "$cxx_v" | grep -i '^target:.*$' >/dev/null 2>&1; then
28        if echo "$cxx_v" | grep -i '^target:.*mingw.*$' >/dev/null 2>&1; then
29                matching=1
30        fi
31else
32        # Weird compiler, trust it in blind faith
33        matching=1
34fi
35if test "x$matching" = "x1"; then
36  AC_MSG_RESULT([yes])
37else
38  AC_MSG_RESULT([no])
39  AC_MSG_ERROR([Compiler does not seem to target MinGW.])
40fi
41
42# Check for C++14 support
43CXX_COMPILE_STDCXX_14([],[mandatory])
44CHECK_LIBCXX
45AC_CACHE_SAVE
46
47AC_CHECK_HEADER(shlobj.h,, [
48                AC_MSG_ERROR([shlobj.h not found which is part of the Windows API])
49        ])
50
51
52# Check for windres on MinGW builds
53# ---------------------------------
54
55# Small function to filter the flags for windres,
56# so that only includes and defines are passed to windres.
57parseflags() {
58  WINDRESFLAGS=""
59  for opt in "$@"
60  do
61      case "$opt" in
62      -I*)
63          WINDRESFLAGS="$WINDRESFLAGS --include-dir=${opt#-I}"
64          ;;
65      -D*)
66          WINDRESFLAGS="$WINDRESFLAGS $opt"
67          ;;
68      esac
69  done
70}
71
72WINDRESFLAGS=
73use_resourcefile=
74AC_MSG_CHECKING([whether to use windres])
75if echo $host_os | grep "cygwin\|mingw" > /dev/null 2>&1; then
76  AC_MSG_RESULT([yes])
77  AC_CHECK_TOOL([WINDRES], [windres])
78  if test "x$WINDRES" = "x"; then
79    AC_MSG_ERROR([windres could not be found, please make sure this program is within your path.])
80  fi
81  use_resourcefile=true
82  parseflags $CPPFLAGS
83
84  FZ_CHECK_ICOPYHOOKW
85else
86  AC_MSG_RESULT([no])
87fi
88AC_SUBST(WINDRES)
89AC_SUBST(WINDRESFLAGS)
90
91# Enable DEP and ASLR linker flags
92# --------------------------------
93
94AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [LDFLAGS="$LDFLAGS -Wl,--dynamicbase"])
95AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [LDFLAGS="$LDFLAGS -Wl,--nxcompat"])
96
97# Set Windows-specific linker flags
98# ---------------------------------
99if echo $host_os | grep "cygwin\|mingw" > /dev/null 2>&1; then
100  # We currently require Vista minimum.
101  AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6], [LDFLAGS="$LDFLAGS -Wl,--major-subsystem-version -Wl,6"])
102  AX_CHECK_LINK_FLAG([-Wl,--minor-subsystem-version -Wl,0], [LDFLAGS="$LDFLAGS -Wl,--minor-subsystem-version -Wl,0"])
103  AX_CHECK_LINK_FLAG([-Wl,--major-os-version -Wl,6], [LDFLAGS="$LDFLAGS -Wl,--major-os-version -Wl,6"])
104  AX_CHECK_LINK_FLAG([-Wl,--minor-os-version -Wl,0], [LDFLAGS="$LDFLAGS -Wl,--minor-os-version -Wl,0"])
105
106  # Set the Large Address Aware flag on 32bit Windows
107  if ! echo $host_cpu | grep "x86_64" > /dev/null 2>&1; then
108    AX_CHECK_LINK_FLAG([-Wl,--large-address-aware], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
109  fi
110fi
111
112# Output automake conditionals
113# ----------------------------
114
115fi
116
117AM_CONDITIONAL(USE_RESOURCEFILE, test "$use_resourcefile" = "true")
118AM_CONDITIONAL(BUILD_SHELLEXT, [test "x$build_shellext" = "yes"])
119
120AC_CONFIG_FILES(Makefile)
121AC_OUTPUT
Note: See TracBrowser for help on using the repository browser.