Skip to content
This repository was archived by the owner on Sep 13, 2020. It is now read-only.

Port to windows for use with Mingw #78

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
328 changes: 163 additions & 165 deletions INSTALL

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
if WINDOWS
SUBDIRS = mingw
else
SUBDIRS = unix
endif

cleanall:
rm -fR Makefile.in aclocal.m4 autom4te.cache/ config config.h.in* configure m4/ config.h config.log config.status libtool stamp-h1 Makefile unix/libparse* unix/.deps unix/.libs/ common/.deps common/.libs common/Makefile common/Makefile.in unix/Makefile unix/Makefile.in
rm -fR Makefile.in aclocal.m4 autom4te.cache/ config config.h.in* configure m4/ config.h config.log config.status libtool stamp-h1 Makefile unix/libparse* unix/.deps unix/.libs/ common/.deps common/.libs common/Makefile common/Makefile.in unix/Makefile unix/Makefile.in mingw/libparse* mingw/.deps mingw/.libs/ common/.deps common/.libs common/Makefile common/Makefile.in mingw/Makefile mingw/Makefile.in
48 changes: 38 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
AC_INIT(parse-embedded, 1.0.5, [email protected])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_SRCDIR(common/simplejson.c)
AC_CONFIG_SRCDIR(unix/src/parse.c)

# AC_CANONICAL_HOST is needed to access $host_os
AC_CANONICAL_HOST

os_dir=unix

case "${host_os}" in
cygwin*|mingw*)
os_dir=mingw
;;
esac

AM_CONDITIONAL([WINDOWS], [test "$os_dir" = "mingw"])
AM_CONDITIONAL([UNIX], [test "$os_dir" = "unix"])


AM_COND_IF([UNIX],
AC_CONFIG_SRCDIR(unix/src/parse.c),
AC_CONFIG_SRCDIR(mingw/src/parse.c)
)

AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE
Expand All @@ -18,8 +38,16 @@ AC_SUBST(CC)

AC_CHECK_LIB(curl, curl_easy_perform)
AC_CHECK_HEADERS(curl/curl.h)
AC_CHECK_LIB(uuid, uuid_generate_random)
AC_CHECK_HEADERS(uuid/uuid.h)


AM_COND_IF([UNIX],
AC_CHECK_LIB(uuid, uuid_generate_random),
AC_CHECK_LIB(rpcrt4, UuidCreate, , [AC_MSG_ERROR([cannot link with rpcrt4.dll.])])
)

AM_COND_IF([UNIX],
AC_CHECK_HEADERS(uuid/uuid.h)
)

AC_CACHE_CHECK([whether getopt has optreset support],
ac_cv_have_getopt_optreset, [
Expand All @@ -42,15 +70,15 @@ AC_ARG_ENABLE([yun],
esac],[yun=false])
AM_CONDITIONAL([YUN_SUPPORT], [test x$yun = xtrue])

AC_CONFIG_FILES([
Makefile
unix/Makefile
unix/src/Makefile
common/Makefile
])
AC_CONFIG_FILES([Makefile common/Makefile])

AM_COND_IF([WINDOWS],
AC_CONFIG_FILES([mingw/Makefile mingw/src/Makefile]),
AC_CONFIG_FILES([unix/Makefile unix/src/Makefile])
)

AM_COND_IF([YUN_SUPPORT],
[AC_CONFIG_FILES([unix/yun/Makefile])])
[AC_CONFIG_FILES([${os_dir}/yun/Makefile])])

AC_OUTPUT

1 change: 1 addition & 0 deletions mingw/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SUBDIRS = src
14 changes: 14 additions & 0 deletions mingw/src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status libtool

lib_LTLIBRARIES=libparse.la
libparse_la_SOURCES=parse.c parse_time.c parse_uuid.c parse_log.c parse_os.c
include_HEADERS=$(top_srcdir)/include/parse.h
libparse_la_CFLAGS=-fPIC -I$(top_srcdir)/common -I$(top_srcdir)/include -I$(top_srcdir)
libparse_la_CPPFLAGS=-fPIC
libparse_la_CXXFLAGS=-fPIC
libparse_la_LDFLAGS= -no-undefined -shared -fPIC
libparse_la_LIBADD=$(top_srcdir)/common/libcommon.la

SUBDIRS=../../common
Loading