News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

OSX/osx.mk:57: *** missing `endif'. Stop.

Started by THLeaderH, November 27, 2017, 01:52:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

THLeaderH

Hello, James!
I cloned your repository and tried to compile simutrans extended on mac. However, I was trapped by the following error.

OSX/osx.mk:57: *** missing `endif'.  Stop.

This is all I got from the console. How can I solve this?

~config.default~

#
# to compile:
# copy this file to config.default and adjust the settings
#

#BACKEND = allegro
#BACKEND = gdi
#BACKEND = opengl
#BACKEND = sdl
BACKEND = sdl2
#BACKEND = mixer_sdl
#BACKEND = posix

#COLOUR_DEPTH = 0
COLOUR_DEPTH = 16

#OSTYPE = amiga
#OSTYPE = beos
#OSTYPE = cygwin
#OSTYPE = freebsd
#OSTYPE = haiku
#OSTYPE = linux
#OSTYPE = mingw32
#OSTYPE = mingw64
OSTYPE = mac

DEBUG = 3   # Level 1-3, higher number means more debug-friendly but slower, see Makefile
#MSG_LEVEL = 1 # Level 1-4, more runtime debug messages (without only warnings and errors)
OPTIMISE = 1 # Add umpteen optimisation flags
#PROFILE = 1  # Enable profiling
#PROFILE = 2  # Enable profiling with optimisation flags, can be used with `OPTIMISE = 1'

WITH_REVISION = 1 # adds the commit number (truncated) from Github; important for network games
# if you do not use Github and the related scripts for setting the commit number automatically, add -DREVISION="1234" to the FLAGS below

#WIN32_CONSOLE = 1 # adds a console for windows debugging

MULTI_THREAD = 1 # Enable multithreading

# Define these as empty strings, if you don't have the respective config program
#ALLEGRO_CONFIG = allegro-config
#PNG_CONFIG     = pkg-config libpng
#SDL_CONFIG     = sdl-config
#SDL2_CONFIG    = sdl2-config

#VERBOSE = 1

# The following useful conditional compilation flags exist
#
# Needed to compile:
# USE_C: no assembler for copying (required for not using GCC on x86)
# SIM_BIG_ENDIAN: MUST be set for PPC/Motorola byte order! (old mac, amiga)
# NO_INTPTR_T: must be set if intptr_t is not available
#
# Changing appearance:
# USE_SOFTPOINTER: emulate mouse pointer (set automatically in Makefile)
#
# Useful for debugging:
# DEBUG_ROUTES: show routing calculation information in minimap
# SHOW_FORE_GRUND: show which objects are drawn as foreground
# DEBUG_FLUSH_BUFFER: show the dirty areas on the screen
# USE_VALGRIND_MEMCHECK: make valgrind-memcheck aware of the memory allocation stuff in dataobj/freelist
# SYSLOG: send debug output to syslog
#
# Following flags alter game engine (and are off for standard builds)
# OTTD_LIKE: Enables half height tiles and crossconnects all industries
# AUTOMATIC_BRIDGES and AUTOMATIC_TUNNELS: will be built also for player
# AUTOJOIN_PUBLIC: stations next to a public stop will be joined to it
# USE_DIFFERENT_WIND: different airplane approach directions over the map
# DESTINATION_CITYCARS: Citycars can have a destination (enabled automatically - cannot be disabled)
#
# In order to use the flags, add a line like this: (-Dxxx)
# FLAGS = -DUSE_C
# The above flag is recommended for speed on modern CPUs: see http://forum.simutrans.com/index.php?topic=16773.msg159658#msg159658

# Output directories:
#
# use this put objects file in same directory, where the sources are (not recommended):
# ... otherwise defaults to 'build/default')
#
# BUILDDIR = $(shell pwd)
#
# use this to specify the target directory for the executable:
# .. otherwise defaults to BUILDDIR
#
# MAKEOBJ_PROGDIR = $(shell pwd)
# NETTOOL_PROGDIR = $(shell pwd)
# PROGDIR  = $(shell pwd)

FLAGS = -DUSE_C -fno-delete-null-pointer-checks -fno-strict-aliasing -std=c++11


jamespetts

This is a rather odd error - your output shows that an error has been detected at line 57 of the makefile, the error being that there is a missing "endif" directive - yet line 57 is an "endif" directive. May I ask which branch that you are using and whether your makefile is the same as this one?

I should note that I do not have access to any Mac OS X machines, and so do not compile Simutrans-Extended for this platform.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

THLeaderH

Thank you for your reply. I use the master brunch to compile. Makefile seems to be same. Yes, it's so an odd error...
Also I got the following error.

simcity.cc:1608:41: error: cannot pass object of non-trivial type 'plainstring'
      through variadic method; call will abort at runtime [-Wnon-pod-varargs]
        DBG_DEBUG("stadt_t::rdwr", "city'%s'", name);


Anyway, I suppressed these two errors by commenting out and removing "if" closure, so now I can compile the code though the errors are not fundamentally solved.

jamespetts

I am afraid that I do not know enough about the Mac OS X operating system to understand why these errors occur there and not on Windows or Linux, but I am glad that you have managed to work around them.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TurfIt

Quote from: jamespetts on November 27, 2017, 12:01:19 PM
This is a rather odd error - your output shows that an error has been detected at line 57 of the makefile, the error being that there is a missing "endif" directive - yet line 57 is an "endif" directive. May I ask which branch that you
Line 56 is an endif; Make is complaining line 57 also needs an endif since there's two ifs and only one endif. Make is a whitespace sensitive language, hence the endif on line 53 is not seen due to the illegal tab. The main makefile is also infested with illegals, but in areas where make is more tolerant...

jamespetts

I do not think that you are looking at the same makefile as is used for Simutrans-Extended. That makefile, which is here, does not have an endif on line 53, but does have one on line 57. I cannot find any tabs above line 57 in the Simutrans-Extended version of the makefile.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TurfIt

How about here as the post subject indicates...
Erroneous tabs in the main Makefile are indeed all below line 57 - tabs are for recipe lines, not indentation.

jamespetts

I must confess that I had forgotten about the existence of that folder - I thought that the ordinary makefile was sufficient to deal with OS X. I think that someone else must have created that.

In any event, I have now removed the erroneous tab on line 53 - thank you for diagnosing that. I have pushed the fix to the passenger-and-mail-classes branch, as that is close to being ready to integrate.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.