changeset 133:2ec889a79e51

patch from Fridrich Strba, some systems need extra library for regex
author Carl Byington <carl@five-ten-sg.com>
date Sat, 07 Feb 2009 07:57:32 -0800
parents 5e4d6faada34
children 2d6bb72ad041
files configure.in src/Makefile.am src/common.h src/define.h
diffstat 4 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/configure.in	Fri Feb 06 20:38:04 2009 -0800
+++ b/configure.in	Sat Feb 07 07:57:32 2009 -0800
@@ -167,6 +167,13 @@
 AC_LANG_POP([C++])
 
 
+AC_CHECK_FUNCS(regexec,,[AC_CHECK_LIB(regex,regexec,
+               [REGEXLIB=-lregex
+                AC_DEFINE(HAVE_REGEXEC,1,[Define to 1 if you have the regexec function.])],
+               [AC_MSG_ERROR([No regex library found])])])
+AC_SUBST(REGEXLIB)
+
+
 # The following lines adds the --enable-pst-debug option to configure:
 #
 # Give the user the choice to enter one of these:
--- a/src/Makefile.am	Fri Feb 06 20:38:04 2009 -0800
+++ b/src/Makefile.am	Sat Feb 07 07:57:32 2009 -0800
@@ -93,7 +93,7 @@
 
 # the library search path.
 lspst_LDADD       = $(all_libraries) $(PSTLIB) $(ICONVLIB)
-readpst_LDADD     = $(all_libraries) $(PSTLIB) $(ICONVLIB)
+readpst_LDADD     = $(all_libraries) $(PSTLIB) $(ICONVLIB) $(REGEXLIB)
 readpstlog_LDADD  = $(all_libraries) $(PSTLIB) $(ICONVLIB)
 pst2ldif_LDADD    = $(all_libraries) $(PSTLIB) $(ICONVLIB)
 pst2dii_LDADD     = $(all_libraries) $(PSTLIB) $(ICONVLIB) -lgd
--- a/src/common.h	Fri Feb 06 20:38:04 2009 -0800
+++ b/src/common.h	Sat Feb 07 07:57:32 2009 -0800
@@ -36,6 +36,7 @@
     // information on UNIX systems. see http://www.unixpapa.com/incnote/byteorder.html
     #include <sys/param.h>
 #else
+    #include <windows.h>
     #define BYTE_ORDER LITTLE_ENDIAN
 #endif
 
--- a/src/define.h	Fri Feb 06 20:38:04 2009 -0800
+++ b/src/define.h	Sat Feb 07 07:57:32 2009 -0800
@@ -14,16 +14,10 @@
 #include "vbuf.h"
 
 
-
 #ifdef HAVE_CONFIG_H
     #include "config.h"
 #endif
 
-#ifdef _WIN32
-    #undef  HAVE_UNISTD_H
-    #define HAVE_DIRECT_H
-    #define HAVE_WINDOWS_H
-#endif
 
 #define DEBUG_MODE_GEN
 #define DEBUGPRINT
@@ -96,7 +90,7 @@
 #define PERM_DIRS 0777
 
 #ifdef _WIN32
-    #include <direct.h>    // win32
+    #include <direct.h>
 
     #define D_MKDIR(x) mkdir(x)
     #define chdir      _chdir
@@ -127,15 +121,13 @@
     #else
         #include "XGetopt.h"
     #endif
-
-    #include <windows.h>
 #else
     #ifdef HAVE_UNISTD_H
         #include <unistd.h>
-        #define D_MKDIR(x) mkdir(x, PERM_DIRS)
     #else
         #include "XGetopt.h"
     #endif
+    #define D_MKDIR(x) mkdir(x, PERM_DIRS)
 #endif
 
 #ifdef HAVE_SYS_STAT_H