Commit 80df423db04eb7089fd7134777554e2611527afd

Authored by perry.werneck@gmail.com
1 parent 05632ed8

Ajustes iniciais para compilacao na nova versao do MACOSX

Showing 2 changed files with 32 additions and 4 deletions   Show diff stats
Makefile.in
... ... @@ -32,7 +32,7 @@ CFLAGS=@CFLAGS@ @DLL_CFLAGS@ -DDATAROOTDIR=\"$(datarootdir)\" -I../include
32 32 SSL_CFLAGS=@LIBSSL_CFLAGS@
33 33  
34 34 DLL_FLAGS=@DLL_FLAGS@
35   -LDFLAGS=@LDFLAGS@ -Wl,-soname,@DLLPREFIX@3270@DLLEXT@.@VERSION@
  35 +LDFLAGS=@LDFLAGS@
36 36  
37 37 LIBS=@LIBS@ @LIBSSL_LIBS@ @INTL_LIBS@ @SOCKET_LIBS@
38 38  
... ... @@ -125,7 +125,7 @@ $(BINDBG)/@DLLPREFIX@3270@DLLEXT@: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@
125 125 $(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@)
126 126 @echo " CCLD `basename $@`"
127 127 @$(MKDIR) `dirname $@`
128   - @$(LD) $(DLL_FLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
  128 + @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ -o $@ $^ $(LIBS)
129 129  
130 130 $(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(BINRLS)/@DLLPREFIX@3270@DLLEXT@.@VERSION@
131 131 @rm -f $@
... ...
mkfb.c
... ... @@ -38,10 +38,12 @@
38 38 #include "../include/lib3270/config.h"
39 39  
40 40  
41   -#ifdef _WIN32
  41 +#if defined( WIN32 )
42 42 #include <windows.h>
43 43 #define tmpfile w32_tmpfile
44   -#endif // _WIN32
  44 +#elif defined( __APPLE__ )
  45 + #define tmpfile osx_tmpfile
  46 +#endif // OS
45 47  
46 48 #include <sys/stat.h>
47 49 #include <fcntl.h>
... ... @@ -633,4 +635,30 @@ FILE * w32_tmpfile( void )
633 635 free(dir);
634 636 return file;
635 637 }
  638 +#elif defined( __APPLE__ )
  639 +FILE * osx_tmpfile( void )
  640 +{
  641 + int fd = -1;
  642 + FILE *file = NULL;
  643 +
  644 + do
  645 + {
  646 + char *tempname = tempnam(NULL,"XXXXXX");
  647 + if(!tempname)
  648 + return NULL;
  649 + fd = open (tempname,O_CREAT | O_EXCL | O_RDWR,S_IREAD | S_IWRITE);
  650 + } while (fd < 0 && errno == EEXIST);
  651 +
  652 +
  653 + file = fdopen (fd, "w+b");
  654 + if (file == NULL)
  655 + {
  656 + int save_errno = errno;
  657 + close (fd);
  658 + errno = save_errno;
  659 + }
  660 +
  661 + return file;
  662 +}
  663 +
636 664 #endif // _WIN32
... ...