Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
use autopconf to find out if bundling with pthread is needed
git-svn-id: svn://tron.homeunix.org/simutrans/simutrans/trunk@8107 8aca7d54-2c30-db11-9de9-000461428c89
  • Loading branch information
prissi committed Feb 19, 2017
1 parent e1edfb6 commit e26baf0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 2 additions & 0 deletions config.default.in
Expand Up @@ -25,6 +25,7 @@ COLOUR_DEPTH = @color@

OSTYPE = @os_type@

MSM_LEVEL = 3
DEBUG = 3 # Level 1-3, higher number means more debug-friendly, see Makefile
OPTIMISE = 1 # Add umpteen optimisation flags
#PROFILE = 1 # Enable profiling
Expand All @@ -37,6 +38,7 @@ WITH_REVISION = @svn@ # adds the revision from svn; required for networkgames
#WIN32_CONSOLE = 1 # adds a console for windows debugging

MULTI_THREAD = @multithread@ # Enable multithreading, highly recommended
BUNDLE_PTHREADGC2 = @bundlepthread@

# Define these as empty strings, if you don't have the respective config program
#ALLEGRO_CONFIG = allegro-config
Expand Down
3 changes: 2 additions & 1 deletion configure.ac
Expand Up @@ -18,6 +18,8 @@ AC_CHECK_LIB(freetype2, load_FT_font, [AC_SUBST(freetype2, '-DUSE_FREETYPE')], [
# optional (but highly recommended) multithreading
AC_SEARCH_LIBS(pthread_mutex_destroy, pthread, [AC_SUBST(multithread, 1)], [AC_SUBST(multithread, 0)] )

AC_CHECK_LIB(pthreadGC2, pthread_mutex_destroy, [AC_SUBST(bundlepthread, 1)], [AC_SUBST(bundlepthread, 0)] )

# find OS and backend by libs ...
AC_CHECK_LIB(SDL2, SDL_GetRenderDriverInfo)
AC_CHECK_LIB(SDL, SDL_Init)
Expand Down Expand Up @@ -110,5 +112,4 @@ if test "$ac_cv_sizeof_voidp" == 4
fi
fi


AC_OUTPUT(config.default)
15 changes: 10 additions & 5 deletions distribute.sh
Expand Up @@ -40,6 +40,10 @@ OST=unknown
# now get the OSTYPE from config.default and remove all spaces around
OST=`grep "^OSTYPE" config.default | sed "s/OSTYPE[ ]*=[ ]*//" | sed "s/[ ]*\#.*//"`

PGC=0
# now get the OSTYPE from config.default and remove all spaces around
PGC=`grep "^BUNDLE_PTHREADGC2" config.default | sed "s/BUNDLE_PTHREADGC2[ ]*=[ ]*//" | sed "s/[ ]*\#.*//"`

# now make the correct archive name
simexe=
if [ "$OST" = "mac" ]; then
Expand All @@ -56,8 +60,10 @@ elif [ "$OST" = "mingw" ]; then
# Missing: Copy matching SDL dll!
fi
cd simutrans
# not needed in current distribution
# getDLL

if [ "$PGC" -ne 0 ]; then
getDLL
fi
cd ..
updatepath="/nsis/"
updater="download-paksets.exe"
Expand All @@ -72,7 +78,6 @@ elif [ "$OST" = "amiga" ]; then
simarchivbase=simuamiga
fi


# now add revesion number without any modificators
# fetch language files
if [ `expr match "$*" ".*-rev="` != "0" ]; then
Expand Down Expand Up @@ -128,8 +133,8 @@ distribute
rm simutrans/simutrans$simexe

# cleanup dll's
if [ "$OST" = "mingw" ]; then
rm simutrans/*pthread*.dll
if [ "$PGC" -ne 0 ]; then
rm simutrans/pthreadGC2.dll
fi

# swallow any error values, return success in any case
Expand Down

0 comments on commit e26baf0

Please sign in to comment.