diff options
author | 2012-07-28 10:51:11 -0400 | |
---|---|---|
committer | 2012-07-28 10:51:11 -0400 | |
commit | fc499d831ea81a0c3d4ef6e6afc13a238955d609 (patch) | |
tree | f6ae62a9d38fb066e091f4fe9b2795faeb3e6138 | |
parent | b1f13a8a4331c01de10cff16a8f1ded8030c89a8 (diff) | |
download | textadept-fc499d831ea81a0c3d4ef6e6afc13a238955d609.tar.gz textadept-fc499d831ea81a0c3d4ef6e6afc13a238955d609.zip |
Changes to compile for 64-bit Windows.
Since mingw64 cannot compile 64-bit LuaJIT at the moment, textadeptjit64.exe is
not built.
-rw-r--r-- | src/Makefile | 39 | ||||
-rw-r--r-- | src/textadept.c | 14 |
2 files changed, 38 insertions, 15 deletions
diff --git a/src/Makefile b/src/Makefile index 2242e99d..4908cb26 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,8 +2,12 @@ kernel = $(shell uname -s) ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) - ifeq (win32, $(MAKECMDGOALS)) - CROSS = i586-mingw32msvc- + ifeq (win, $(findstring win, $(MAKECMDGOALS))) + ifeq (win32, $(MAKECMDGOALS)) + CROSS = i686-w64-mingw32- + else ifeq (win64, $(MAKECMDGOALS)) + CROSS = x86_64-w64-mingw32- + endif CC = gcc CFLAGS = -mms-bitfields CXX = g++ @@ -13,11 +17,11 @@ ifneq (, $(or $(findstring Linux, $(kernel)), $(findstring BSD, $(kernel)))) MAKE = make plat_flag = -DGTK - gtk_flags = $(shell PKG_CONFIG_PATH=`pwd`/win32gtk/lib/pkgconfig \ - pkg-config --define-variable=prefix=win32gtk \ + gtk_flags = $(shell PKG_CONFIG_PATH=`pwd`/$(MAKECMDGOALS)gtk/lib/pkgconfig \ + pkg-config --define-variable=prefix=$(MAKECMDGOALS)gtk \ --cflags gtk+-2.0) - gtk_libs = $(shell PKG_CONFIG_PATH=`pwd`/win32gtk/lib/pkgconfig \ - pkg-config --define-variable=prefix=win32gtk \ + gtk_libs = $(shell PKG_CONFIG_PATH=`pwd`/$(MAKECMDGOALS)gtk/lib/pkgconfig \ + pkg-config --define-variable=prefix=$(MAKECMDGOALS)gtk \ --libs gtk+-2.0) luadoc = luadoc_start.bat @@ -162,6 +166,7 @@ all: textadept textadeptjit ncurses: textadept-ncurses textadeptjit-ncurses m32: textadept32 textadeptjit32 textadept32-ncurses textadeptjit32-ncurses win32: textadept.exe textadeptjit.exe +win64: textadept64.exe #textadeptjit64.exe osx: textadept.osx textadeptjit.osx osx-ncurses: textadept-ncurses.osx textadeptjit-ncurses.osx @@ -218,6 +223,9 @@ libluajit.a: lua51.dll: cd luajit && $(MAKE) HOST_CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Windows cp luajit/src/$@ . +lua51_64.dll: + cd luajit && $(MAKE) HOST_CC="$(CC)" CROSS=$(CROSS) TARGET_SYS=Windows + cp luajit/src/$@ . libluajit.osx.a: cd luajit && $(MAKE) CC="$(CC) -m32" CROSS=$(CROSS) TARGET_SYS=Darwin || \ return 0 @@ -260,6 +268,13 @@ textadeptjit.exe: $(scintilla_objs) $(scintilla_gtk_objs) scintilla-marshal.o \ LexLPegjit.o textadeptjit.o textadept_rc.o $(luajit_objs) \ lua51.dll gtdialog.o $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(gtk_libs) $(LDFLAGS) +textadept64.exe: $(scintilla_objs) $(scintilla_gtk_objs) scintilla-marshal.o \ + LexLPeg.o textadept.o textadept_rc.o $(lua_objs) gtdialog.o + $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(gtk_libs) $(LDFLAGS) +textadeptjit64.exe: $(scintilla_objs) $(scintilla_gtk_objs) \ + scintilla-marshal.o LexLPegjit.o textadeptjit.o \ + textadept_rc.o $(luajit_objs) lua51_64.dll gtdialog.o + $(CROSS)$(CXX) $(CXXFLAGS) -o ../$@ $^ $(gtk_libs) $(LDFLAGS) textadept.osx: textadept; mv ../$< ../$@ textadeptjit.osx: textadeptjit; mv ../$< ../$@ textadept-ncurses.osx: textadept-ncurses; mv ../$< ../$@ @@ -298,8 +313,10 @@ modules = css hypertext java rails rhtml ruby php release: ../textadept ../textadeptjit ../textadept-ncurses \ ../textadeptjit-ncurses ../textadept32 ../textadeptjit32 \ ../textadept32-ncurses ../textadeptjit32-ncurses ../textadept.exe \ - ../textadeptjit.exe ../textadept.osx ../textadeptjit.osx lua51.dll \ - doc pkg_x86_64 pkg_i386 pkg_win32 pkg_osx pkg_src pkg_modules cleanup + ../textadeptjit.exe ../textadept64.exe ../textadept.osx \ + ../textadeptjit.osx lua51.dll \ + doc pkg_x86_64 pkg_i386 pkg_win32 pkg_win64 pkg_osx pkg_src \ + pkg_modules cleanup # Release directories. @@ -319,6 +336,11 @@ $(basedir).win32: ../textadept.exe ../textadeptjit.exe lua51.dll | $(basedir) cp -r $| $@ && cp $^ $@ cp win32gtk/bin/*.dll $@ && cp -r win32gtk/etc win32gtk/lib win32gtk/share $@ rm -r $@/lib/*.a $@/lib/glib-2.0 $@/lib/gtk-2.0/include $@/lib/pkgconfig +$(basedir).win64: ../textadept64.exe | $(basedir) + cp -r $| $@ && cp $^ $@ + for t in `ls $@/textadept*`; do mv $$t `echo $$t | sed -e 's/64\././;'`; done + cp win64gtk/bin/*.dll $@ && cp -r win64gtk/etc win64gtk/lib win64gtk/share $@ + rm -r $@/lib/*.a $@/lib/glib-2.0 $@/lib/gtk-2.0/include $@/lib/pkgconfig $(basedir).osx: ../textadept.osx ../textadeptjit.osx ../textadept-ncurses.osx \ ../textadeptjit-ncurses.osx | $(basedir) mkdir $@ && cp -rL gtkosx/app $@/Textadept.app @@ -344,6 +366,7 @@ $(basedir).modules: pkg_x86_64: $(basedir).x86_64 ; tar czf ../releases/$<.tgz $< && rm -r $< pkg_i386: $(basedir).i386 ; tar czf ../releases/$<.tgz $< && rm -r $< pkg_win32: $(basedir).win32 ; zip -r ../releases/$<.zip $< && rm -r $< +pkg_win64: $(basedir).win64 ; zip -r ../releases/$<.zip $< && rm -r $< pkg_osx: $(basedir).osx ; zip -r ../releases/$<.zip $< && rm -r $< pkg_src: $(basedir).src ; zip -r ../releases/$<.zip $< && rm -r $< pkg_modules: $(basedir).modules ; zip -r ../releases/$<.zip $< && rm -r $< diff --git a/src/textadept.c b/src/textadept.c index 81a5da0d..ad55db00 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -178,14 +178,14 @@ static int lL_event(lua_State *L, const char *name, ...) { if (type == LUA_TNIL) lua_pushnil(L); else if (type == LUA_TBOOLEAN) - lua_pushboolean(L, (long)arg); + lua_pushboolean(L, (sptr_t)arg); else if (type == LUA_TNUMBER) - lua_pushinteger(L, (long)arg); + lua_pushinteger(L, (sptr_t)arg); else if (type == LUA_TSTRING) lua_pushstring(L, (char *)arg); else if (type == LUA_TLIGHTUSERDATA || type == LUA_TTABLE) { - lua_rawgeti(L, LUA_REGISTRYINDEX, (long)arg); - luaL_unref(L, LUA_REGISTRYINDEX, (long)arg); + lua_rawgeti(L, LUA_REGISTRYINDEX, (sptr_t)arg); + luaL_unref(L, LUA_REGISTRYINDEX, (sptr_t)arg); } } va_end(ap); @@ -1105,7 +1105,7 @@ static int lbuffer_text_range(lua_State *L) { tr.chrg.cpMax = luaL_checkinteger(L, 3); luaL_argcheck(L, tr.chrg.cpMin <= tr.chrg.cpMax, 3, "start > end"); tr.lpstrText = malloc(tr.chrg.cpMax - tr.chrg.cpMin + 1); - SS(focused_view, SCI_GETTEXTRANGE, 0, (long)(&tr)); + SS(focused_view, SCI_GETTEXTRANGE, 0, (sptr_t)(&tr)); lua_pushlstring(L, tr.lpstrText, tr.chrg.cpMax - tr.chrg.cpMin); if (tr.lpstrText) free(tr.lpstrText); return 1; @@ -1119,9 +1119,9 @@ static int lbuffer_text_range(lua_State *L) { * @param type The Scintilla type to convert to. * @return Scintilla param */ -static long lL_checkscintillaparam(lua_State *L, int *narg, int type) { +static sptr_t lL_checkscintillaparam(lua_State *L, int *narg, int type) { if (type == tSTRING) - return (long)luaL_checkstring(L, (*narg)++); + return (sptr_t)luaL_checkstring(L, (*narg)++); else if (type == tBOOL) return lua_toboolean(L, (*narg)++); else if (type == tKEYMOD) { |