2023-06-05 12:29:18 +00:00
|
|
|
AC_INIT([rufus], [4.2], [https://github.com/pbatard/rufus/issues], [rufus], [https://rufus.ie])
|
2011-12-05 01:11:15 +00:00
|
|
|
AM_INIT_AUTOMAKE([-Wno-portability foreign no-dist no-dependencies])
|
2011-12-05 11:19:05 +00:00
|
|
|
AC_CONFIG_SRCDIR([src/rufus.c])
|
2011-12-01 19:43:45 +00:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2014-11-12 23:45:49 +00:00
|
|
|
AM_SILENT_RULES([yes])
|
2011-12-01 19:43:45 +00:00
|
|
|
|
|
|
|
AC_PREREQ([2.50])
|
|
|
|
AC_PROG_CC
|
2015-02-10 22:45:48 +00:00
|
|
|
# autoconf 2.61 doesn't have AC_PROG_AR, but 2.63 has it
|
|
|
|
AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
|
|
|
|
AC_PROG_AR
|
2012-01-11 00:05:16 +00:00
|
|
|
AC_PROG_RANLIB
|
2013-11-01 19:17:46 +00:00
|
|
|
AC_PROG_SED
|
2011-12-05 00:04:01 +00:00
|
|
|
AC_PATH_PROG(RM, rm, rm)
|
[mingw] use delay loading for DLLs that are subject to side loading
* This reverts much of commits f6ac559f4d0a9a2e5043a972442d272c2da71de3 and 19472668370aacec0dba9dda306601cfc4a4ed7e
so that we call the Windows APIs directly again, while ensuring that, by the time we load the DLLs,
sideloading mitigation has already been applied by the application.
* This is a continuation of #1877, and should help prevent re-introducing side-loading issues when we
link against new libraries, as well as allow us to drop some of the manual DLL hooking we've been
doing to prevent it, to clean up the code.
* Note that this is a bit more complex than what the stackoverflow post suggests, because we need to
create delayloaded libs for both 32-bit and 64-bit, which use a different calling convention and
therefore need to use different .def files. So there's a lot of gymkhana involved, with Makefiles
and whatnot, to get us there.
* Also simplify the use of CM_Get_DevNode_Registry_PropertyA() in dev.c since recent versions of
MinGW now have support for it.
* Also fix 2 small issues in net.c (potential overflow) and format.c (memory leak).
2022-04-12 10:09:29 +00:00
|
|
|
AC_CHECK_TOOL(DLLTOOL, dlltool, :)
|
|
|
|
AC_CHECK_TOOL(STRIP, strip, :)
|
|
|
|
AC_CHECK_TOOL(WINDRES, windres, :)
|
2011-12-01 19:43:45 +00:00
|
|
|
AC_C_INLINE
|
|
|
|
AC_DEFINE([_GNU_SOURCE], [], [Use GNU extensions])
|
|
|
|
|
2017-11-13 14:29:48 +00:00
|
|
|
AM_CFLAGS="${AM_CFLAGS} -DWINVER=0x601 -D_WIN32_WINNT=0x601 -D_WIN32_IE=0x800"
|
2017-05-01 22:55:58 +00:00
|
|
|
# "-Wl,--nxcompat" to enable DEP (Data Execution Prevention)
|
2020-04-23 15:48:37 +00:00
|
|
|
# "-Wl,--dynamicbase" to enable ASLR (Address Space Layout Randomization)
|
|
|
|
AM_LDFLAGS="${AM_LDFLAGS} -Wl,-no-undefined -Wl,--nxcompat -Wl,--no-insert-timestamp -Wl,--dynamicbase"
|
2011-12-01 19:43:45 +00:00
|
|
|
|
|
|
|
# Debug symbols
|
2012-02-07 23:16:15 +00:00
|
|
|
AC_ARG_ENABLE([debug],
|
|
|
|
[AS_HELP_STRING([--enable-debug],
|
|
|
|
[keep debug symbols for gdb (default=yes)])],
|
2011-12-01 19:43:45 +00:00
|
|
|
[debug_enabled=$enableval],
|
|
|
|
[debug_enabled='yes'])
|
2012-02-07 23:16:15 +00:00
|
|
|
if test "x$debug_enabled" != "xno" ; then
|
2014-02-01 00:03:57 +00:00
|
|
|
CFLAGS="-g -O0"
|
2011-12-01 19:43:45 +00:00
|
|
|
else
|
2014-02-01 00:03:57 +00:00
|
|
|
CFLAGS="-Os"
|
2011-12-01 19:43:45 +00:00
|
|
|
LDFLAGS="-s"
|
|
|
|
fi
|
|
|
|
|
2015-06-26 21:49:32 +00:00
|
|
|
# Alpha/Beta/Test
|
2014-11-28 00:00:59 +00:00
|
|
|
AC_ARG_ENABLE([alpha],[AS_HELP_STRING([--enable-alpha], [build an ALPHA release (default=no)])], [alpha_enabled=$enableval], [alpha_enabled='no'])
|
|
|
|
if test "x$alpha_enabled" != "xno" ; then
|
|
|
|
CFLAGS+=" -DALPHA"
|
|
|
|
SUFFIX=_ALPHA
|
|
|
|
fi
|
2015-02-08 22:36:57 +00:00
|
|
|
AC_ARG_ENABLE([beta],[AS_HELP_STRING([--enable-beta], [build a BETA release (default=no)])], [beta_enabled=$enableval], [beta_enabled='no'])
|
2014-11-28 00:00:59 +00:00
|
|
|
if test "x$beta_enabled" != "xno" ; then
|
|
|
|
CFLAGS+=" -DBETA"
|
|
|
|
SUFFIX=_BETA
|
|
|
|
fi
|
2015-06-26 21:49:32 +00:00
|
|
|
AC_ARG_ENABLE([test],[AS_HELP_STRING([--enable-test=#], [build a TEST release (default=no)])], [test_enabled=$enableval], [test_enabled='no'])
|
|
|
|
if test "x$test_enabled" != "xno" ; then
|
|
|
|
if test "x$test_enabled" == "xyes" ; then $enableval="" ; fi
|
|
|
|
CFLAGS+=" -DTEST=$enableval"
|
|
|
|
SUFFIX=_TEST$enableval
|
|
|
|
fi
|
2014-11-28 00:00:59 +00:00
|
|
|
|
2012-02-07 23:16:15 +00:00
|
|
|
AC_MSG_RESULT([enabling Large File Support (ISO support)])
|
2012-05-25 17:40:30 +00:00
|
|
|
AM_CFLAGS="$AM_CFLAGS -D_FILE_OFFSET_BITS=64 -D_OFF_T_ -D_off_t=off64_t -Doff_t=off64_t -Doff32_t=long"
|
2012-02-07 23:16:15 +00:00
|
|
|
|
2011-12-01 19:43:45 +00:00
|
|
|
# check for -Wno-pointer-sign compiler support (GCC >= 4)
|
|
|
|
saved_CFLAGS="${CFLAGS}"
|
|
|
|
CFLAGS="$CFLAGS -Wno-pointer-sign"
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
|
|
|
|
[nopointersign_cflags="-Wno-pointer-sign"], [nopointersign_cflags=""])
|
|
|
|
CFLAGS="${saved_CFLAGS}"
|
|
|
|
|
2022-08-02 19:14:29 +00:00
|
|
|
AM_CFLAGS="$AM_CFLAGS -DUNICODE -D_UNICODE -UNDEBUG -DCOBJMACROS -D__USE_MINGW_ANSI_STDIO=0 -std=gnu99 -Wshadow -Wall -Wformat-security -Wundef -Wunused -Wstrict-prototypes -Wno-restrict -Wno-array-bounds -Werror-implicit-function-declaration -Wbidi-chars=none $nopointersign_cflags"
|
2011-12-01 19:43:45 +00:00
|
|
|
|
|
|
|
AC_SUBST([VISIBILITY_CFLAGS])
|
|
|
|
AC_SUBST([AM_CFLAGS])
|
|
|
|
AC_SUBST([AM_LDFLAGS])
|
2014-11-28 00:00:59 +00:00
|
|
|
AC_SUBST([SUFFIX])
|
2011-12-01 19:43:45 +00:00
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
[mingw] use delay loading for DLLs that are subject to side loading
* This reverts much of commits f6ac559f4d0a9a2e5043a972442d272c2da71de3 and 19472668370aacec0dba9dda306601cfc4a4ed7e
so that we call the Windows APIs directly again, while ensuring that, by the time we load the DLLs,
sideloading mitigation has already been applied by the application.
* This is a continuation of #1877, and should help prevent re-introducing side-loading issues when we
link against new libraries, as well as allow us to drop some of the manual DLL hooking we've been
doing to prevent it, to clean up the code.
* Note that this is a bit more complex than what the stackoverflow post suggests, because we need to
create delayloaded libs for both 32-bit and 64-bit, which use a different calling convention and
therefore need to use different .def files. So there's a lot of gymkhana involved, with Makefiles
and whatnot, to get us there.
* Also simplify the use of CM_Get_DevNode_Registry_PropertyA() in dev.c since recent versions of
MinGW now have support for it.
* Also fix 2 small issues in net.c (potential overflow) and format.c (memory leak).
2022-04-12 10:09:29 +00:00
|
|
|
AC_CONFIG_FILES([.mingw/Makefile])
|
2011-12-05 11:19:05 +00:00
|
|
|
AC_CONFIG_FILES([src/Makefile])
|
2014-12-29 20:34:41 +00:00
|
|
|
AC_CONFIG_FILES([src/bled/Makefile])
|
2019-04-12 20:32:40 +00:00
|
|
|
AC_CONFIG_FILES([src/ext2fs/Makefile])
|
2012-01-31 01:40:22 +00:00
|
|
|
AC_CONFIG_FILES([src/libcdio/iso9660/Makefile])
|
|
|
|
AC_CONFIG_FILES([src/libcdio/udf/Makefile])
|
|
|
|
AC_CONFIG_FILES([src/libcdio/driver/Makefile])
|
2018-07-16 15:38:40 +00:00
|
|
|
AC_CONFIG_FILES([res/loc/Makefile])
|
2014-12-29 20:34:41 +00:00
|
|
|
AC_CONFIG_FILES([src/ms-sys/Makefile])
|
|
|
|
AC_CONFIG_FILES([src/syslinux/libfat/Makefile])
|
|
|
|
AC_CONFIG_FILES([src/syslinux/libinstaller/Makefile])
|
2016-02-23 20:52:06 +00:00
|
|
|
AC_CONFIG_FILES([src/syslinux/win/Makefile])
|
2011-12-01 19:43:45 +00:00
|
|
|
AC_OUTPUT
|