Skip to content

Commit

Permalink
- included MacOS changes from Eric Meyers (erictmeyers@gmail.com)
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2804 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed May 23, 2007
1 parent 6c7dbe3 commit 98ab230
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions Compiler/runtime/settingsimpl.c
Expand Up @@ -38,10 +38,18 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* malloc.h is in sys in Mac OS */
#ifdef __APPLE_CC__
#include <sys/malloc.h>
#else /* Linux or Windows here */
#include <malloc.h>
#endif

#include "../absyn_builder/yacclib.h"
#include "rml.h"

Expand Down
13 changes: 12 additions & 1 deletion Compiler/runtime/systemimpl.c
Expand Up @@ -1287,7 +1287,15 @@ RML_END_LABEL
#include <sys/stat.h>
#include <dirent.h>
#include <sys/param.h> /* MAXPATHLEN */

/* MacOS malloc.h is in sys */
#ifndef __APPLE_CC__
#include <malloc.h>
#else
#define HAVE_SCANDIR
#include <sys/malloc.h>
#endif

#include "read_write.h"
#include "rml.h"
#include "../Values.h"
Expand Down Expand Up @@ -1731,7 +1739,10 @@ RML_BEGIN_LABEL(System__compileCFile)

sprintf(command,"%s %s -o %s %s",cc,str,exename,cflags);
//printf("compile using: %s\n",command);
putenv("GCC_EXEC_PREFIX=");

#ifndef __APPLE_CC__ /* seems that we need to disable this on MacOS */
putenv("GCC_EXEC_PREFIX=");
#endif
tmp = getenv("MODELICAUSERCFLAGS");
if (tmp == NULL || tmp[0] == '\0' ) {
putenv("MODELICAUSERCFLAGS= ");
Expand Down
7 changes: 6 additions & 1 deletion c_runtime/libf2c/makefile.u
Expand Up @@ -15,12 +15,17 @@
.SUFFIXES: .c .o
CC = cc
SHELL = /bin/sh
CFLAGS = -O -fexceptions
CFLAGS = -fexceptions -O
OS = $(shell uname -s)

# compile, then strip unnecessary symbols
.c.o:
$(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c
ifeq ($(OS),Darwin)
ld -r -o $*.xxx $*.o
else
ld -r -x -o $*.xxx $*.o
endif
mv $*.xxx $*.o
## Under Solaris (and other systems that do not understand ld -x),
## omit -x in the ld line above.
Expand Down

0 comments on commit 98ab230

Please sign in to comment.