-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
44 lines (35 loc) · 1.03 KB
/
configure.ac
File metadata and controls
44 lines (35 loc) · 1.03 KB
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
AC_INIT([libload], [1.0.0], [https://github.com/EntySec/libload])
AC_CONFIG_MACRO_DIRS([m4])
AM_INIT_AUTOMAKE([foreign subdir-objects -Wall -Werror])
AC_PROG_CC
AM_PROG_AR
AM_PROG_AS
LT_INIT
AC_CANONICAL_HOST
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug], [Enable debug logging to stderr])],
[enable_debug=$enableval],
[enable_debug=no])
AS_IF([test "x$enable_debug" = "xyes"],
[AC_DEFINE([LIBLOAD_DEBUG], [1], [Enable debug logging])])
# Platform detection
case $host_os in
darwin*)
platform=macos
;;
linux*)
platform=linux
;;
*)
AC_MSG_ERROR([Unsupported platform: $host_os])
;;
esac
AM_CONDITIONAL([PLATFORM_MACOS], [test "x$platform" = "xmacos"])
AM_CONDITIONAL([PLATFORM_LINUX], [test "x$platform" = "xlinux"])
# Check for dlsym on Linux
AS_IF([test "x$platform" = "xlinux"],
[AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([dlsym not found])])])
AM_CFLAGS="-Wall -Wextra -Werror -O2"
AC_SUBST([AM_CFLAGS])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT