忍者ブログ

素人翻訳

適当に翻訳する。

ctags-5.8構築エラー

ctags-5.8の「make」でエラーが出た。

User00:~/ctags-5.8$ make
gcc -I. -I. -DHAVE_CONFIG_H -DKANJI -I/usr/local/include -c args.c
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from args.c:17:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:320:61: error: missing ')' after "__has_attribute"
320 | #if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
| ^
general.h:60:36: error: missing binary operator before token "("
60 | # define __unused__ __attribute__((unused))
| ^
make: *** [Makefile:220: args.o] Error 1
User00:~/ctags-5.8$

このサイトによると、「__unused__」はよく使われるものらしく、別のプログラムによる定義と衝突しているのがエラーの原因とのこと。

同サイトの提案に従って、「__unused__」を別の文字列で置き換える。

「__unused__」が使われている場所は下の通り。

User00:~/ctags-5.8$ find . -type f | grep .*$ | xargs grep -n "__unused__"
./lregex.c:541: const langType language __unused__,
./lregex.c:542: const char* const regex __unused__,
./lregex.c:543: const char* const name __unused__,
./lregex.c:544: const char* const kinds __unused__,
./lregex.c:545: const char* const flags __unused__)
./lregex.c:567: const langType language __unused__,
./lregex.c:568: const char* const regex __unused__,
./lregex.c:569: const char* const flags __unused__,
./lregex.c:570: const regexCallback callback __unused__)
./lregex.c:584: const langType language __unused__, const char* const regex __unused__)
./lregex.c:605: const char *const parameter __unused__)
./lregex.c:627:extern void disableRegexKinds (const langType language __unused__)
./lregex.c:642: const langType language __unused__,
./lregex.c:643: const int kind __unused__, const boolean mode __unused__)
./lregex.c:663:extern void printRegexKinds (const langType language __unused__, boolean indent __unused__)
./parse.c:379: const char *const option, const char *const parameter __unused__)
./c.c:622:static void __unused__ pt (tokenInfo *const token)
./c.c:637:static void __unused__ ps (statementInfo *const st)
./general.h:60:# define __unused__ __attribute__((unused))
./general.h:63:# define __unused__
./lua.c:40:static void __unused__ print_string (char *p, char *q)
./routines.c:532:static void canonicalizePath (char *const path __unused__)
./python.c:138: vString *const parent, int is_class_parent, const char *arglist __unused__)
./main.c:525:extern int main (int __unused__ argc, char **argv)
./eiffel.c:806:static void parseGeneric (tokenInfo *const token, boolean declaration __unused__)
./options.c:751: const char *const option __unused__, const char *const parameter)
./options.c:888: const char *const option __unused__, const char *const parameter)
./options.c:978: const char *const option __unused__,
./options.c:979: const char *const parameter __unused__)
./options.c:1187: const char *const option __unused__,
./options.c:1188: const char *const parameter __unused__)
./options.c:1214: const char *const __unused__ option,
./options.c:1215: const char *const __unused__ parameter)
./options.c:1231: const char *const option __unused__,
./options.c:1232: const char *const parameter __unused__)
./options.c:1406: const char *const option __unused__,
./options.c:1407: const char *const parameter __unused__)
User00:~/ctags-5.8$

general.hの
# define __unused__ __attribute__((unused))

# define __ctags_unused__ __attribute__((__unused__))
に書き換え、

それ以外のファイルの
__unused__

__ctags_unused__
に書き換えて解決。
「./configure」「make」ともに問題無し。

PR

Ubuntu-22.10でppsspp構築[令和5年]

Ubuntu-22.10でppssppを作る。
githubにある説明に従う。

$ sudo apt install build-essential cmake libgl1-mesa-dev libsdl2-dev libvulkan-dev
$ sudo apt install qt5-qmake qtsystems5-dev qtmultimedia5-dev qttools5-dev-tools libqt5opengl5-dev
$ sudo apt install libsdl1.2-dev
$ git clone --recurse-submodules https://github.com/hrydgard/ppsspp.git
$ cd ppsspp
$ ./b.sh --qt

これで完成。
buildディレクトリに「PPSSPPQt」という実行ファイルができるので、それでppssppを起動する。

$ cd build
$ ./PPSSPPQt

ゲームの起動は問題ないのだが、ゲームパッドのDirectInputモードで「R1」と「☓」ボタンだけ入力できない。

$ cat /dev/input/by-id/usb-SHANWAN_JC-U4013S_DirectInput_Mode-event-joystick

を実行して各ボタンを押して確認したところ、☓ボタンもR1ボタンも問題なく入力できている。

$ sudo apt install joystick
$ sudo apt install jstest-gtk

jstest-gtkでもすべてのボタンで問題なく入力できる。

ppssppのゲームパッドの設定画面でSDLの入力が無い。

ppsspp/build/assets/gamecontrollerdb.txtを書き換えても、書き換えた結果を反映してくれない。

cd ppsspp/build
make clean
cd ..

ppsspp/SDL/SDLJoystick.cpp の「void SDLJoystick::setUpController(int deviceIndex)」の最後の方を書き換え、直接Mappingを追加して解決。

~~(略)~~
SDL_GameController *controller = SDL_GameControllerOpen(deviceIndex);
if (controller) {
if (SDL_GameControllerGetAttached(controller)) {
controllers.push_back(controller);

controllerDeviceMap[SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(controller))] = deviceIndex;
cout << "found control pad: " <<
SDL_GameControllerName(controller) << ", loading mapping: ";
KeyMap::NotifyPadConnected(deviceIndex, std::string(pszGUID) + ": " + SDL_GameControllerName(controller));
//ここから改変
char new_mapping[] = "030000006e0500000f20000010010000,SHANWAN JC-U4013S DirectInput Mode,a:b2,b:b3,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:b7,rightx:a2,righty:a3,start:b11,x:b0,y:b1,platform:Linux,";
int updated = SDL_GameControllerAddMapping(new_mapping);
//ここまで改変

auto mapping = SDL_GameControllerMapping(controller);
if (mapping == NULL) {
//cout << "FAILED" << endl;
cout << "Could not find mapping in SDL2 controller database" << endl;
} else {
cout << "SUCCESS, mapping is:" << endl << mapping << endl;
}
} else {
SDL_GameControllerClose(controller);
}
~~(略)~~

SDLJoystick.cppを書き換えた上で、もう一度、

cd ppsspp
./b.sh --qt
cd build
./PPSSPPQt

カレンダー

03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

最新コメント

[08/18 NONAME]
[05/18 NONAME]
[04/09 NONAME]
[03/21 NONAME]
[03/20 NONAME]

最新記事

ブログ内検索

広告

バーコード

広告