Commit 80df423db04eb7089fd7134777554e2611527afd
1 parent
05632ed8
Exists in
master
and in
3 other branches
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,7 +32,7 @@ CFLAGS=@CFLAGS@ @DLL_CFLAGS@ -DDATAROOTDIR=\"$(datarootdir)\" -I../include | ||
32 | SSL_CFLAGS=@LIBSSL_CFLAGS@ | 32 | SSL_CFLAGS=@LIBSSL_CFLAGS@ |
33 | 33 | ||
34 | DLL_FLAGS=@DLL_FLAGS@ | 34 | DLL_FLAGS=@DLL_FLAGS@ |
35 | -LDFLAGS=@LDFLAGS@ -Wl,-soname,@DLLPREFIX@3270@DLLEXT@.@VERSION@ | 35 | +LDFLAGS=@LDFLAGS@ |
36 | 36 | ||
37 | LIBS=@LIBS@ @LIBSSL_LIBS@ @INTL_LIBS@ @SOCKET_LIBS@ | 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,7 +125,7 @@ $(BINDBG)/@DLLPREFIX@3270@DLLEXT@: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@ | ||
125 | $(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) | 125 | $(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) |
126 | @echo " CCLD `basename $@`" | 126 | @echo " CCLD `basename $@`" |
127 | @$(MKDIR) `dirname $@` | 127 | @$(MKDIR) `dirname $@` |
128 | - @$(LD) $(DLL_FLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) | 128 | + @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ -o $@ $^ $(LIBS) |
129 | 129 | ||
130 | $(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(BINRLS)/@DLLPREFIX@3270@DLLEXT@.@VERSION@ | 130 | $(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(BINRLS)/@DLLPREFIX@3270@DLLEXT@.@VERSION@ |
131 | @rm -f $@ | 131 | @rm -f $@ |
mkfb.c
@@ -38,10 +38,12 @@ | @@ -38,10 +38,12 @@ | ||
38 | #include "../include/lib3270/config.h" | 38 | #include "../include/lib3270/config.h" |
39 | 39 | ||
40 | 40 | ||
41 | -#ifdef _WIN32 | 41 | +#if defined( WIN32 ) |
42 | #include <windows.h> | 42 | #include <windows.h> |
43 | #define tmpfile w32_tmpfile | 43 | #define tmpfile w32_tmpfile |
44 | -#endif // _WIN32 | 44 | +#elif defined( __APPLE__ ) |
45 | + #define tmpfile osx_tmpfile | ||
46 | +#endif // OS | ||
45 | 47 | ||
46 | #include <sys/stat.h> | 48 | #include <sys/stat.h> |
47 | #include <fcntl.h> | 49 | #include <fcntl.h> |
@@ -633,4 +635,30 @@ FILE * w32_tmpfile( void ) | @@ -633,4 +635,30 @@ FILE * w32_tmpfile( void ) | ||
633 | free(dir); | 635 | free(dir); |
634 | return file; | 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 | #endif // _WIN32 | 664 | #endif // _WIN32 |