+
Skip to content

WIP: MacOS Support #911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,34 @@ AC_CANONICAL_HOST
AC_MSG_CHECKING(platform)
case "$host_os" in
freebsd*)
PLATFORM=freebsd
AC_MSG_RESULT(FreeBSD)
AC_CHECK_LIB(xpg4, setlocale, [LIBS="$LIBS -lxpg4"])
;;
*openbsd*)
PLATFORM=openbsd
AC_MSG_RESULT(OpenBSD)
CFLAGS="$CFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
;;
*darwin*)
PLATFORM=macos
AC_MSG_RESULT(MacOS)
;;
*)
PLATFORM=unknown
AC_MSG_RESULT(unknown)
;;
esac

AC_SUBST(PLATFORM)

AM_CONDITIONAL([HOST_MACOS], [test "$PLATFORM" = "macos"])

if test "x$PLATFORM" = "xmacos"; then
AC_DEFINE([HOST_MACOS], [macos], [Host is MacOS])
fi

PKG_PROG_PKG_CONFIG

PKG_CHECK_MODULES([xt],[xt],
Expand Down Expand Up @@ -1359,13 +1375,18 @@ AH_VERBATIM([_ZEND_EXPLICIT_DEFINITIONS],
#define SUPPRESS_UNUSED_VAR_WARNING(x) \
do { void *p; p = (void *)&x; (void)p; } while (0);

#ifdef HOST_MACOS
#undef HAVE_STRLCAT
#undef HAVE_STRLCPY
#else
#ifndef HAVE_STRLCAT
# include "libs/strlcat.h"
#endif

#ifndef HAVE_STRLCPY
# include "libs/strlcpy.h"
#endif
#endif

#ifndef HAVE_ASPRINTF
int asprintf(char **, const char *, ...);
Expand Down Expand Up @@ -1488,4 +1509,4 @@ Fvwm3 Configuration:
Build man pages? $with_mandoc$problem_mandoc
Build html man pages? $with_htmldoc$problem_htmldoc

"
"
10 changes: 8 additions & 2 deletions libs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ libfvwm3_a_SOURCES = \
XError.h XResource.h charmap.h defaults.h envvar.h fio.h flist.h fqueue.h \
fsm.h ftime.h fvwm_sys_stat.h fvwm_x11.h fvwmlib.h fvwmrect.h fvwmsignal.h \
gravity.c gravity.h getpwuid.h lang-strings.h log.h modifiers.h queue.h \
safemalloc.h setpgrp.h strlcat.h strlcpy.h timeout.h vpacket.h wcontext.h wild.h \
safemalloc.h setpgrp.h timeout.h vpacket.h wcontext.h wild.h \
cJSON.h tree.h strtonum.h \
\
BidiJoin.c Flocale.c PictureUtils.c FScreen.c Graphics.c \
Expand All @@ -27,9 +27,15 @@ libfvwm3_a_SOURCES = \
fvwmrect.c FRenderInit.c safemalloc.c FBidi.c \
wild.c Grab.c Event.c ClientMsg.c setpgrp.c FShape.c \
FGettext.c Rectangles.c timeout.c flist.c charmap.c wcontext.c \
modifiers.c fsm.c FTips.c fio.c fvwmlib3.c strlcat.c strlcpy.c \
modifiers.c fsm.c FTips.c fio.c fvwmlib3.c \
getpwuid.c cJSON.c strtonum.c

if HOST_MACOS
foo=
else
libfvwm3_a_SOURCES += strlcpy.h strlcat.h strlcpy.c strlcat.c
endif

libfvwm3_a_LIBADD = @LIBOBJS@

AM_CPPFLAGS = -I$(top_srcdir) $(xpm_CFLAGS) $(Xft_CFLAGS) $(X_CFLAGS) \
Expand Down
7 changes: 6 additions & 1 deletion modules/FvwmMFL/FvwmMFL.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@
#include <stdbool.h>
#include <unistd.h>

#ifdef HOST_MACOS
#include <event.h>
#else
#include <event2/event.h>
#endif

/* FIXME: including event_struct.h won't be binary comaptible with future
* versions of libevent.
*/
Expand Down Expand Up @@ -898,4 +903,4 @@ int main(int argc, char **argv)
unlink(sock_pathname);

return (0);
}
}
2 changes: 1 addition & 1 deletion modules/FvwmMFL/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ LDADD = -L$(top_builddir)/libs $(X_LIBS) -lfvwm3 \
$(X_PRE_LIBS) -lXext -lX11 $(X_EXTRA_LIBS) $(XRandR_LIBS) \
$(libevent_LIBS) $(Xft_LIBS)

AM_CPPFLAGS = -I$(top_srcdir) $(X_CFLAGS) $(Xft_CFLAGS)
AM_CPPFLAGS = -I$(top_srcdir) $(X_CFLAGS) $(Xft_CFLAGS) $(libevent_CFLAGS)
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载