Added
Link Here
|
1 |
--- sdk/configure.ac.orig 2024-05-17 14:19:43 UTC |
2 |
+++ sdk/configure.ac |
3 |
@@ -208,6 +208,8 @@ LINUX=no |
4 |
DARWIN=no |
5 |
ANDROID=no |
6 |
LINUX=no |
7 |
+DRAGONFLY=no |
8 |
+NETBSD=no |
9 |
AC_MSG_CHECKING([platform options]) |
10 |
case $host in |
11 |
*-*-cygwin*) |
12 |
@@ -238,6 +240,12 @@ case $host in |
13 |
*-linux*) |
14 |
LINUX=yes |
15 |
;; |
16 |
+ *-dragonfly*) |
17 |
+ DRAGONFLY=yes |
18 |
+ ;; |
19 |
+ *-netbsd*) |
20 |
+ NETBSD=yes |
21 |
+ ;; |
22 |
*) |
23 |
LIBS_EXTRA="" |
24 |
;; |
25 |
@@ -247,6 +255,8 @@ AM_CONDITIONAL([LINUX], [test "${LINUX}" = "yes"]) |
26 |
AM_CONDITIONAL([DARWIN], [test "${DARWIN}" = "yes"]) |
27 |
AM_CONDITIONAL([ANDROID], [test "${ANDROID}" = "yes"]) |
28 |
AM_CONDITIONAL([LINUX], [test "${LINUX}" = "yes"]) |
29 |
+AM_CONDITIONAL([DRAGONFLY], [test "${DRAGONFLY}" = "yes"]) |
30 |
+AM_CONDITIONAL([NETBSD], [test "${NETBSD}" = "yes"]) |
31 |
|
32 |
AC_SUBST(LIBS_EXTRA) |
33 |
|
34 |
@@ -1369,6 +1379,7 @@ cares=false |
35 |
# |
36 |
openssl=false |
37 |
cares=false |
38 |
+rt=undef |
39 |
if test "x$WIN32" = "xno" ; then |
40 |
|
41 |
AC_ARG_WITH([poll], |
42 |
@@ -1381,12 +1392,71 @@ if test "x$WIN32" = "xno" ; then |
43 |
LDFLAGS="-pthread $LDFLAGS" |
44 |
fi |
45 |
|
46 |
- # librt #TODO: allow --with-rt=... |
47 |
- AC_CHECK_LIB([rt], [aio_write], [ |
48 |
- SAVE_LDFLAGS="-lrt $SAVE_LDFLAGS" |
49 |
- LDFLAGS="-lrt $LDFLAGS" |
50 |
- AC_DEFINE(HAVE_AIO_RT, [1], [Define to indicate AIO presence in librt]) |
51 |
- ], |
52 |
+ # librt |
53 |
+ AC_MSG_CHECKING(for rt) |
54 |
+ AC_ARG_WITH([rt], |
55 |
+ AS_HELP_STRING(--with-rt=PATH, base of Real-time Library installation), |
56 |
+ [ |
57 |
+ case $with_rt in |
58 |
+ no) |
59 |
+ AC_MSG_RESULT([no]) |
60 |
+ |
61 |
+ rt=false |
62 |
+ ;; |
63 |
+ yes) |
64 |
+ AC_CHECK_HEADERS([aio.h], [], |
65 |
+ AC_MSG_ERROR([aio.h header not found or not usable]) |
66 |
+ ) |
67 |
+ AC_CHECK_LIB(rt, [aio_write], [LIBRT_LIBS="$LIBRT_LIBS -lrt"], |
68 |
+ AC_MSG_ERROR([Could not find rt library!]) |
69 |
+ ) |
70 |
+ |
71 |
+ AC_SUBST(LIBRT_LIBS) |
72 |
+ rt=true |
73 |
+ ;; |
74 |
+ *) |
75 |
+ # determine if library is installed |
76 |
+ if test -d "$with_rt/lib"; then |
77 |
+ LDFLAGS="-L$with_rt/lib $LDFLAGS" |
78 |
+ CXXFLAGS="-I$with_rt/include $CXXFLAGS" |
79 |
+ |
80 |
+ AC_CHECK_HEADERS([aio.h], [ |
81 |
+ LIBRT_LDFLAGS="-L$with_rt/lib" |
82 |
+ LIBRT_CXXFLAGS="-I$with_rt/include"], |
83 |
+ AC_MSG_ERROR([aio.h header not found or not usable]) |
84 |
+ ) |
85 |
+ |
86 |
+ AC_CHECK_LIB(rt, [aio_write], [LIBRT_LIBS="$LIBRT_LIBS -lrt"], |
87 |
+ AC_MSG_ERROR([Could not find rt library!]) |
88 |
+ ) |
89 |
+ else |
90 |
+ AC_MSG_ERROR([Could not find rt library in "$with_rt/lib"!]) |
91 |
+ fi |
92 |
+ |
93 |
+ AC_SUBST(LIBRT_LDFLAGS) |
94 |
+ AC_SUBST(LIBRT_CXXFLAGS) |
95 |
+ AC_SUBST(LIBRT_LIBS) |
96 |
+ rt=true |
97 |
+ |
98 |
+ #restore |
99 |
+ LDFLAGS=$SAVE_LDFLAGS |
100 |
+ CXXFLAGS=$SAVE_CXXFLAGS |
101 |
+ ;; |
102 |
+ esac |
103 |
+ ], |
104 |
+ [ |
105 |
+ AC_MSG_RESULT([--with-rt not specified]) |
106 |
+ |
107 |
+ AC_CHECK_HEADERS([aio.h], [], |
108 |
+ AC_MSG_ERROR([aio.h header not found or not usable]) |
109 |
+ ) |
110 |
+ AC_CHECK_LIB(rt, [aio_write], [LIBRT_LIBS="$LIBRT_LIBS -lrt"], |
111 |
+ AC_MSG_NOTICE([Could not find librt]) |
112 |
+ ) |
113 |
+ |
114 |
+ AC_SUBST(LIBRT_LIBS) |
115 |
+ rt=true |
116 |
+ ] |
117 |
) |
118 |
|
119 |
# OpenSSL |
120 |
@@ -1617,6 +1687,12 @@ fi |
121 |
fi |
122 |
|
123 |
# define on all platforms |
124 |
+AM_CONDITIONAL(HAVE_RT, test x$rt = xtrue) |
125 |
+if test "x$rt" = "xtrue" ; then |
126 |
+ AC_DEFINE(HAVE_AIO_RT, [1], [Define to indicate AIO presence in librt]) |
127 |
+fi |
128 |
+ |
129 |
+# define on all platforms |
130 |
AM_CONDITIONAL(HAVE_OPENSSL, test x$openssl = xtrue) |
131 |
if test "x$openssl" = "xtrue" ; then |
132 |
AC_DEFINE(USE_OPENSSL, [1], [Define to use OpenSSL]) |
133 |
@@ -2308,6 +2384,7 @@ AC_MSG_NOTICE([Configured to build Mega SDK: |
134 |
PCRE: $PCRE_CXXFLAGS $PCRE_LDFLAGS $PCRE_LIBS |
135 |
LIBUV: $LIBUV_CXXFLAGS $LIBUV_LDFLAGS $LIBUV_LIBS |
136 |
LIBRAW: $LIBRAW_CXXFLAGS $LIBRAW_LDFLAGS $LIBRAW_LIBS |
137 |
+ LIBRT: $LIBRT_CXXFLAGS $LIBRT_LDFLAGS $LIBRT_LIBS |
138 |
LIBMEDIAINFO: $LIBMEDIAINFO_CXXFLAGS $LIBMEDIAINFO_LDFLAGS $LIBMEDIAINFO_LIBS |
139 |
FFMPEG: $FFMPEG_CXXFLAGS $FFMPEG_LDFLAGS $FFMPEG_LIBS |
140 |
|