--- a/Makefile 2019-07-02 09:24:57.554332875 -0600 +++ b/Makefile 2019-07-02 09:25:42.626694604 -0600 @@ -41,7 +41,7 @@ PLATS= aix bsd c89 freebsd generic linux # What to install. TO_BIN= lua$V luac$V TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp -TO_LIB= liblua$V.a +TO_LIB= liblua$V.a liblua$V.so.0.0.0 TO_MAN= lua$V.1 luac$V.1 # Lua version and release. @@ -62,6 +62,9 @@ install: dummy cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0.0 + ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so.0 + ln -s liblua$V.so.0.0.0 $(INSTALL_LIB)/liblua$V.so cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) uninstall: --- a/src/ldo.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/ldo.h 2019-07-02 09:25:42.626694604 -0600 @@ -47,8 +47,8 @@ LUAI_FUNC int luaD_pcall (lua_State *L, LUAI_FUNC int luaD_poscall (lua_State *L, CallInfo *ci, StkId firstResult, int nres); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); -LUAI_FUNC void luaD_growstack (lua_State *L, int n); -LUAI_FUNC void luaD_shrinkstack (lua_State *L); +LUA_API void luaD_growstack (lua_State *L, int n); +LUA_API void luaD_shrinkstack (lua_State *L); LUAI_FUNC void luaD_inctop (lua_State *L); LUAI_FUNC l_noret luaD_throw (lua_State *L, int errcode); --- a/src/lfunc.h 2017-04-19 11:39:34.000000000 -0600 +++ b/src/lfunc.h 2019-07-02 09:25:42.630694635 -0600 @@ -47,14 +47,14 @@ struct UpVal { #define upisopen(up) ((up)->v != &(up)->u.value) -LUAI_FUNC Proto *luaF_newproto (lua_State *L); +LUA_API Proto *luaF_newproto (lua_State *L); LUAI_FUNC CClosure *luaF_newCclosure (lua_State *L, int nelems); -LUAI_FUNC LClosure *luaF_newLclosure (lua_State *L, int nelems); -LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); -LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); -LUAI_FUNC void luaF_close (lua_State *L, StkId level); +LUA_API LClosure *luaF_newLclosure (lua_State *L, int nelems); +LUA_API void luaF_initupvals (lua_State *L, LClosure *cl); +LUA_API UpVal *luaF_findupval (lua_State *L, StkId level); +LUA_API void luaF_close (lua_State *L, StkId level); LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); -LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, +LUA_API const char *luaF_getlocalname (const Proto *func, int local_number, int pc); --- a/src/lgc.h 2017-04-19 11:39:34.000000000 -0600 +++ b/src/lgc.h 2019-07-02 09:25:42.634694666 -0600 @@ -133,11 +133,11 @@ LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); LUAI_FUNC void luaC_freeallobjects (lua_State *L); -LUAI_FUNC void luaC_step (lua_State *L); +LUA_API void luaC_step (lua_State *L); LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask); LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); -LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); +LUA_API void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); LUAI_FUNC void luaC_barrierback_ (lua_State *L, Table *o); LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv); LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); --- a/src/llex.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/llex.h 2019-07-02 09:25:42.630694635 -0600 @@ -73,13 +73,13 @@ typedef struct LexState { LUAI_FUNC void luaX_init (lua_State *L); -LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, +LUA_API void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, int firstchar); LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); -LUAI_FUNC void luaX_next (LexState *ls); -LUAI_FUNC int luaX_lookahead (LexState *ls); -LUAI_FUNC l_noret luaX_syntaxerror (LexState *ls, const char *s); -LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); +LUA_API void luaX_next (LexState *ls); +LUA_API int luaX_lookahead (LexState *ls); +LUA_API l_noret luaX_syntaxerror (LexState *ls, const char *s); +LUA_API const char *luaX_token2str (LexState *ls, int token); #endif --- a/src/lmem.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/lmem.h 2019-07-02 09:25:42.630694635 -0600 @@ -56,12 +56,12 @@ #define luaM_reallocvector(L, v,oldn,n,t) \ ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) -LUAI_FUNC l_noret luaM_toobig (lua_State *L); +LUA_API l_noret luaM_toobig (lua_State *L); /* not to be called directly */ -LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, +LUA_API void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, size_t size); -LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, +LUA_API void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elem, int limit, const char *what); --- a/src/lobject.h 2017-04-19 11:39:34.000000000 -0600 +++ b/src/lobject.h 2019-07-02 09:25:42.630694635 -0600 @@ -525,7 +525,7 @@ typedef struct Table { #define luaO_nilobject (&luaO_nilobject_) -LUAI_DDEC const TValue luaO_nilobject_; +LUA_API const TValue luaO_nilobject_; /* size of buffer for 'luaO_utf8esc' function */ #define UTF8BUFFSZ 8 @@ -534,15 +534,15 @@ LUAI_FUNC int luaO_int2fb (unsigned int LUAI_FUNC int luaO_fb2int (int x); LUAI_FUNC int luaO_utf8esc (char *buff, unsigned long x); LUAI_FUNC int luaO_ceillog2 (unsigned int x); -LUAI_FUNC void luaO_arith (lua_State *L, int op, const TValue *p1, +LUA_API void luaO_arith (lua_State *L, int op, const TValue *p1, const TValue *p2, TValue *res); LUAI_FUNC size_t luaO_str2num (const char *s, TValue *o); LUAI_FUNC int luaO_hexavalue (int c); LUAI_FUNC void luaO_tostring (lua_State *L, StkId obj); -LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, +LUA_API const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp); -LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); -LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); +LUA_API const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); +LUA_API void luaO_chunkid (char *out, const char *source, size_t len); #endif --- a/src/lopcodes.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/lopcodes.h 2019-07-02 09:25:42.630694635 -0600 @@ -278,7 +278,7 @@ enum OpArgMask { OpArgK /* argument is a constant or register/constant */ }; -LUAI_DDEC const lu_byte luaP_opmodes[NUM_OPCODES]; +LUA_API const lu_byte luaP_opmodes[NUM_OPCODES]; #define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) #define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) @@ -287,7 +287,7 @@ LUAI_DDEC const lu_byte luaP_opmodes[NUM #define testTMode(m) (luaP_opmodes[m] & (1 << 7)) -LUAI_DDEC const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ +LUA_API const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ /* number of list items to accumulate before a SETLIST instruction */ --- a/src/lstate.h 2017-04-19 11:39:34.000000000 -0600 +++ b/src/lstate.h 2019-07-02 09:25:42.630694635 -0600 @@ -244,9 +244,9 @@ union GCUnion { LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt); LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); -LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); -LUAI_FUNC void luaE_freeCI (lua_State *L); -LUAI_FUNC void luaE_shrinkCI (lua_State *L); +LUA_API CallInfo *luaE_extendCI (lua_State *L); +LUA_API void luaE_freeCI (lua_State *L); +LUA_API void luaE_shrinkCI (lua_State *L); #endif --- a/src/lstring.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/lstring.h 2019-07-02 09:25:42.630694635 -0600 @@ -35,15 +35,15 @@ LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed); LUAI_FUNC unsigned int luaS_hashlongstr (TString *ts); -LUAI_FUNC int luaS_eqlngstr (TString *a, TString *b); +LUA_API int luaS_eqlngstr (TString *a, TString *b); LUAI_FUNC void luaS_resize (lua_State *L, int newsize); LUAI_FUNC void luaS_clearcache (global_State *g); LUAI_FUNC void luaS_init (lua_State *L); LUAI_FUNC void luaS_remove (lua_State *L, TString *ts); LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s); -LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); -LUAI_FUNC TString *luaS_new (lua_State *L, const char *str); -LUAI_FUNC TString *luaS_createlngstrobj (lua_State *L, size_t l); +LUA_API TString *luaS_newlstr (lua_State *L, const char *str, size_t l); +LUA_API TString *luaS_new (lua_State *L, const char *str); +LUA_API TString *luaS_createlngstrobj (lua_State *L, size_t l); #endif --- a/src/ltable.h 2018-05-24 13:39:05.000000000 -0600 +++ b/src/ltable.h 2019-07-02 09:25:42.630694635 -0600 @@ -41,14 +41,14 @@ LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key); -LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, +LUA_API void luaH_setint (lua_State *L, Table *t, lua_Integer key, TValue *value); LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key); -LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); -LUAI_FUNC Table *luaH_new (lua_State *L); +LUA_API TValue *luaH_set (lua_State *L, Table *t, const TValue *key); +LUA_API Table *luaH_new (lua_State *L); LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize, unsigned int nhsize); LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize); --- a/src/ltm.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/ltm.h 2019-07-02 09:25:42.634694666 -0600 @@ -55,10 +55,10 @@ typedef enum { LUAI_DDEC const char *const luaT_typenames_[LUA_TOTALTAGS]; -LUAI_FUNC const char *luaT_objtypename (lua_State *L, const TValue *o); +LUA_API const char *luaT_objtypename (lua_State *L, const TValue *o); LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); -LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, +LUA_API const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event); LUAI_FUNC void luaT_init (lua_State *L); @@ -66,9 +66,9 @@ LUAI_FUNC void luaT_callTM (lua_State *L const TValue *p2, TValue *p3, int hasres); LUAI_FUNC int luaT_callbinTM (lua_State *L, const TValue *p1, const TValue *p2, StkId res, TMS event); -LUAI_FUNC void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, +LUA_API void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, StkId res, TMS event); -LUAI_FUNC int luaT_callorderTM (lua_State *L, const TValue *p1, +LUA_API int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, TMS event); --- a/src/lundump.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/lundump.h 2019-07-02 09:25:42.634694666 -0600 @@ -23,10 +23,10 @@ #define LUAC_FORMAT 0 /* this is the official format */ /* load one chunk; from lundump.c */ -LUAI_FUNC LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); +LUA_API LClosure* luaU_undump (lua_State* L, ZIO* Z, const char* name); /* dump one chunk; from ldump.c */ -LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, +LUA_API int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); #endif --- a/src/lzio.h 2017-04-19 11:20:42.000000000 -0600 +++ b/src/lzio.h 2019-07-02 09:25:42.634694666 -0600 @@ -61,6 +61,6 @@ struct Zio { }; -LUAI_FUNC int luaZ_fill (ZIO *z); +LUA_API int luaZ_fill (ZIO *z); #endif --- a/src/Makefile 2019-07-02 09:24:57.554332875 -0600 +++ b/src/Makefile 2019-07-02 09:25:42.630694635 -0600 @@ -29,6 +29,7 @@ MYOBJS= PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris LUA_A= liblua$V.a +LUA_SO= liblua$V.so.0.0.0 CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \ lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \ ltm.o lundump.o lvm.o lzio.o @@ -43,8 +44,9 @@ LUAC_T= luac$V LUAC_O= luac.o ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) -ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) +ALL_T= $(LUA_A) $(LUA_SO) $(LUA_T) $(LUAC_T) ALL_A= $(LUA_A) +ALL_SO= $(LUA_SO) # Targets start here. default: $(PLAT) @@ -55,14 +57,25 @@ o: $(ALL_O) a: $(ALL_A) +so: $(ALL_SO) + $(LUA_A): $(BASE_O) $(AR) $@ $(BASE_O) $(RANLIB) $@ -$(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) +$(LUA_SO): $(CORE_O) $(LIB_O) + $(CC) -o $@ -Wl,-Bsymbolic-functions -shared -Wl,-soname="$@" $? + ln -fs $@ liblua$V.so.0.0 + ln -fs $@ liblua$V.so.0 + ln -fs $@ liblua$V.so + +$(LUA_T): $(LUA_O) $(LUA_SO) + $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUA_O) $(LIBS) + +$(LUAC_T): $(LUAC_O) $(LUA_SO) + $(CC) -o $@ -L. -llua$V $(MYLDFLAGS) $(LUAC_O) $(LIBS) -$(LUAC_T): $(LUAC_O) $(LUA_A) +$(LUAC_T)-host: $(LUAC_O) $(LUA_A) $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) clean: n296' href='#n296'>296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656