Jump to content

how do update to gcc5


Recommended Posts

The title says it all.

now i have gcc4

makefile db

Spoiler

MAKE = gmake
CC = g++

INCDIR =
LIBDIR =
BINDIR = ..
OBJDIR = .obj

GCC_VERSION = $(shell $(CC) --version 2>&1 | grep "(GCC)" | cut -d' ' -f3  | cut -d'.' -f1)
BSD_VERSION = $(shell uname -v 2>&1 | cut -d' ' -f2 | cut -d'.' -f1)
P4_VERSION = 40250
SVN_VERSION = $(shell svnversion -n .) 
$(shell if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi)

TARGET = $(BINDIR)/dbfile

CFLAGS = -g3 -ggdb -pipe -fno-rtti -fno-exceptions -pthread -D_THREAD_SAFE

ifeq ($(GCC_VERSION), 4)
CFLAGS += -mtune=i686
else
CFLAGS += -mcpu=i686
endif

# boost
INCDIR += -I../../boost

LIBDIR += -L../../libthecore/lib -L../../libsql -L../../libpoly -L../../libgame/lib -L/usr/local/lib/mysql

ifeq ($(BSD_VERSION), 7)
INCDIR += -I../../libmysql/7.x-5.1.35
LIBDIR += -L../../libmysql/7.x-5.1.35
else
INCDIR += -I../../libmysql/5.x-5.1.35
LIBDIR += -L../../libmysql/5.x-5.1.35
endif

LIBS = -lthecore -lmysqlclient -lsql -lpoly -lgame -lm -lz

SRCS =    Config.cpp NetBase.cpp Peer.cpp PeerBase.cpp Main.cpp Lock.cpp DBManager.cpp \
        Cache.cpp LoginData.cpp ClientManager.cpp ClientManagerPlayer.cpp ClientManagerLogin.cpp \
        ClientManagerBoot.cpp ClientManagerParty.cpp ClientManagerGuild.cpp GuildManager.cpp HB.cpp \
        PrivManager.cpp MoneyLog.cpp ItemAwardManager.cpp ClientManagerEventFlag.cpp Marriage.cpp \
        Monarch.cpp BlockCountry.cpp ItemIDRangeManager.cpp ClientManagerHorseName.cpp version.cpp \
        AuctionManager.cpp ProtoReader.cpp CsvReader.cpp 

OBJS = $(SRCS:%.cpp=$(OBJDIR)/%.o)

default: $(TARGET) 

$(TARGET): $(OBJS)
    @echo linking ...
    @$(CC) $(CFLAGS) $(LIBDIR) $(OBJS) $(LIBS) -o $(TARGET)
    @touch version.cpp

$(OBJDIR)/%.o: %.cpp
    @echo compile $<
    @$(CC) $(CFLAGS) $(INCDIR) -c $< -o $@

$(OBJDIR)/version.o: version.cpp
    @$(CC) $(CFLAGS) -D__USER__=\"$(USER)\" -D__HOSTNAME__=\"$(HOSTNAME)\" -D__PWD__=\"$(PWD)\" -D__P4_VERSION__=\"$(P4_VERSION)\" -c $< -o $@
    @echo compile $<

$(OBJDIR):
    @mkdir $(OBJDIR)

clean:
    @rm -f $(OBJS) $(BINDIR)/db_r*

dep:
    @touch Depend
    makedepend -fDepend $(INCDIR) -I/usr/include/c++/3.3 -I/usr/include/c++/4.2 -p$(OBJDIR)/ $(SRCS) 2> /dev/null


sinclude Depend
 

 

Link to comment
Share on other sites

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

1 hour ago, arves100 said:

Change CXX to g++5

and type: pkg install gcc5.

 

If you want to use c++11 add the following in CXXFLAG: -std=c++11

If you want c++14 use -std=c++14

 

If pkg install gcc5 dosen't worked try:

cd /usr/ports/lang/gcc5 && make install clean

 

For warning fix of deprecation do this:

#ifeq ($(GCC_VERSION), 4)
CFLAGS += -mtune=i686
#else
#CFLAGS += -mcpu=i686
#endif

 

"Change CXX to g++5"

How do i do?

"pkg install gcc5"

Look: https://www.youtube.com/watch?v=-yfAbnng1Dw

 

Link to comment
Share on other sites

23 hours ago, arves100 said:

 

common\stl.h

Beginning:

#ifndef __INC_METIN_II_STL_H__
#define __INC_METIN_II_STL_H__

#include <vector>
#include <string>
#include <map>
#include <list>
#include <functional>
#include <stack>
#include <set>
#ifdef __GNUC__
#include <ext/functional>
#define typeof __typeof
#define auto_ptr unique_ptr
#endif

#ifndef itertype
#define itertype(v) __typeof((v).begin())
#endif

 

now:

https://metin2.download/picture/0cABFUiRak8Xvqmr9zBcgM4ev3vuDbIw/.png

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.