--- 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: 18'>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 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311