]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Check for MinGW-w64 build, add win32-glob files
authorWolfgang Stöggl <c72578@yahoo.de>
Tue, 26 Dec 2017 05:57:53 +0000 (06:57 +0100)
committerWolfgang Stöggl <c72578@yahoo.de>
Tue, 26 Dec 2017 05:57:53 +0000 (06:57 +0100)
- configure.ac: Add check for MinWG-w64 build during configure.
  Pass the conditional MINGW_W64 to automake
- src/Makefile.am: Add win32-glob.c to RRD_C_FILES and
  win32-glob.h to noinst_HEADERS in case of MINGW_W64
- Enables out of the box configure and make for MinGW-w64 builds

configure.ac
src/Makefile.am

index 991109b79f423f6581c93cfb8d03bfc057b35ea0..7fc3aeb4f7dda87ceaa78bf0798ae0ab88351905 100644 (file)
@@ -433,7 +433,7 @@ AC_DEFINE(NO_NULL_REALLOC)
 fi
 
 AC_LANG_PUSH(C)
-dnl solaris has some odd defines it needs in order to propperly compile ctime_r
+dnl solaris has some odd defines it needs in order to properly compile ctime_r
 AC_MSG_CHECKING([if ctime_r need special care to act posixly correct])
 AC_LINK_IFELSE(
     [AC_LANG_PROGRAM(
@@ -982,6 +982,21 @@ if test -z "$RRDDOCDIR"; then
 
 fi
 
+# Check for MinGW-w64 build and pass to automake
+build_mingw_w64=no
+AC_MSG_CHECKING([for MinGW-w64 build])
+case "$host" in
+    *w64-mingw32*)
+        AC_MSG_RESULT([yes])
+        build_mingw_w64=yes
+    ;;
+    *)
+        AC_MSG_RESULT([no])
+    ;;
+esac
+# Pass the conditional to automake
+AM_CONDITIONAL([MINGW_W64], [test "$build_mingw_w64" = "yes"])
+
 # systemd check
 PKG_PROG_PKG_CONFIG
 AC_ARG_WITH([systemdsystemunitdir],
index 3be1b5f91899d4d69e849950369f151b6925a23f..1813ade7a709bbc6a9431e72df84153f32419ed4 100644 (file)
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-#AUTOMAKE_OPTIONS   = foreign
+AUTOMAKE_OPTIONS   = subdir-objects
 #
 #ACLOCAL_M4       = $(top_srcdir)/config/aclocal.m4
 #AUTOHEADER = @AUTOHEADER@ --localdir=$(top_srcdir)/config
@@ -69,9 +69,9 @@ endif
 
 noinst_HEADERS = \
        unused.h \
-        gettext.h \
+       gettext.h \
        mutex.h \
-        rrd_strtod.h \
+       rrd_strtod.h \
        rrd_snprintf.h \
        rrd_parsetime.h \
        rrd_config_bottom.h rrd_i18n.h \
@@ -92,9 +92,14 @@ UPD_C_FILES += rrd_rados.c
 noinst_HEADERS += rrd_rados.h
 endif
 
+if MINGW_W64
+RRD_C_FILES += ../win32/win32-glob.c
+noinst_HEADERS += ../win32/win32-glob.h
+endif
+
 noinst_LTLIBRARIES        = librrdupd.la
 
-lib_LTLIBRARIES           = librrd.la 
+lib_LTLIBRARIES           = librrd.la
 
 librrdupd_la_SOURCES      = $(UPD_C_FILES)
 librrdupd_la_LIBADD       = $(CORE_LIBS)
@@ -138,7 +143,7 @@ rrdcached_LDADD = librrd.la librrdupd.la $(ALL_LIBS)
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = librrd.pc
 
-# strftime is here because we do not usually need it. unices have propper
+# strftime is here because we do not usually need it. unices have proper
 # iso date support
 EXTRA_DIST= librrd.pc.in strftime.c strftime.h \
        win32comp.c  rrd_thread_safe_nt.c get_ver.awk librrd.sym plbasename.c plbasename.h