aboutsummaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* Tests in abitest.c now work on Win32.James Lyon2013-04-181-2/+16
| | | | | | | I expect that Linux-x86 is probably fine. All other architectures except ARM are definitely broken since I haven't yet implemented gfunc_sret for these, although replicating the current behaviour should be straightforward.
* Fixed tests on Windows (including out-of-tree problems)James Lyon2013-04-171-0/+2
| | | | | | | | | | | Modified tcctest.c so that it uses 'double' in place of 'long double' with MinGW since this is what TCC does, and what Visual C++ does. Added an option -norunsrc to tcc to allow argv[0] to be set independently of the compiled source when using tcc -run, which allows tests that rely on the value of argv[0] to work in out-of-tree builds. Also added Makefile rules to automatically update out-of-tree build Makefiles when in-tree Makefiles have changed.
* Fixed out of tree build problem on Windows.James Lyon2013-04-171-7/+7
| | | | | | | | Some files installed are not generated so need to be copied from the source tree rather than the build tree. I also switched texi2html for makeinfo --html since texi2html is apparently unmaintained.
* add version number to manpageUrs Janssen2013-02-171-2/+2
| | | | | | | avoid c++/c99 style comments in preprocessor directives avoid leadings whitespaces in preprocessor directives mention implemented variable length arrays in documentation fixed ambiguous option in texi2html call (Austin English)
* fixed pasto in in 108b2876; background for the additional $CC test is:Urs Janssen2013-02-151-1/+1
| | | | | | | GCC_MAJOR may be set even is $CC not realy gcc (but i.e. clang, which (as of 3.1) requires an addtional CFLAG to accept the non portable (gnuisms all over the place; try to cimpile tcc with Sun^HOracle, Intel, Pathscale, ... compiler) code).
* - don't use GCC_MAJOR to see if we're not using gcc as GCC_MAJOR might be setUrs Janssen2013-02-151-0/+2
| | | | during configure even with --cc=notgcc as long as gcc is installed.
* configure: detect ARM variantsgrischka2013-02-141-33/+19
| | | | Using gnu make's variable variable-names.
* configure: pass CONFIG_xxxDIR/PATH options via commandlinegrischka2013-02-141-3/+3
| | | | | | | | | | | | | | | - except for CONFIG_SYSROOT and CONFIG_TCCDIR Strictly neccessary it is only for CONFIG_MULTIARCHDIR because otherwise if it's in config.h it is impossible to leave it undefined. But it is also nicer not to use these definitions for cross-compilers. - Also: lib/Makefile : include ../Makefile for CFLAGS lib/libtcc1.c : fix an issue compiling tcc with tcc on x64
* - make clang accept unportable code in libtcc1.cUrs Janssen2013-02-141-0/+5
| | | | - add -dumpversion cmd.line opt
* configure: cleanupgrischka2013-02-141-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add quotes: eval opt=\"$opt\" - use $source_path/conftest.c for OOT build - add fn_makelink() for OOT build - do not check lddir etc. on Windows/MSYS - formatting config-print.c - rename to conftest.c (for consistency) - change option e to b - change output from that from "yes" to "no" - remove inttypes.h dependency - simpify version output Makefile: - improve GCC warning flag checks tcc.h: - add back default CONFIG_LDDIR - add default CONFIG_TCCDIR also (just for fun) tccpp.c: - fix Christian's last warning tccpp.c: In function ‘macro_subst’: tccpp.c:2803:12: warning: ‘*((void *)&cval+4)’ is used uninitialized in this function [-Wuninitialized] That the change fixes the warning doesn't make sense but anyway. libtcc.c: - tcc_error/warning: print correct source filename/line for token :paste: (also inline :asm:) lddir and multiarch logic still needs fixing.
* Improve multiarch detectionThomas Preud'homme2013-02-131-10/+0
| | | | | | * Detect multiarch at configure time * Detect based on the place where crti.o is * Define multiarch triplet in tcc.h
* tcc.h: declare CValue.tab[LDOUBLE_SIZE/4]grischka2013-02-081-2/+2
| | | | | | | | Should fix some warnings wrt. access out of array bounds. tccelf.c: fix "static function unused" warning x86_64-gen.c: fix "ctype.ref uninitialzed" warning and cleanup tcc-win32.txt: remove obsolete limitation notes.
* lib/Makefile: use CC, add bcheck to libtcc1.agrischka2013-02-061-30/+7
| | | | | | | | Also: - fix "make tcc_p" (profiling version) - remove old gcc flags: -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0 - remove test "hello" for Darwin (cannot compile to file)
* tests: cleanupgrischka2013-02-051-2/+0
| | | | | | | | | | | | | | | | tests: - add "hello" to test first basic compilation to file/memory - add "more" test (tests2 suite) - remove some tests tests2: - move into tests dir - Convert some files from DOS to unix LF - remove 2>&1 redirection win32: - tccrun.c: modify exception filter to exit correctly (needed for btest) - tcctest.c: exclude weak_test() (feature does not exist on win32)
* Slightly improved support for !gcc compilersThomas Preud'homme2013-02-041-1/+3
| | | | | Hack before a complete solution after 0.9.26's release to be able to compile tcc with clang.
* Makefile: fix "allow CONFIG_LDDIR=lib64 configuration"grischka2013-02-041-4/+4
| | | | I forgot the commas.
* Makefile: allow CONFIG_LDDIR=lib64 configurationgrischka2013-02-041-7/+9
|
* Fix cross-compilation out-of-tree buildThomas Preud'homme2013-01-301-2/+2
| | | | | | Add tcc.c as a prerequesite of the %-tcc$(EXESUF) target and compile $< instead of tcc.c to make sure tcc.c is search in directories specified by VPATH.
* configure: use relative paths for in-tree buildgrischka2013-01-301-0/+2
| | | | | | Also - move CPPFLAGS to Makefile - Use top_srcdir in lib/Makefile
* Favor arm hardfloat over arm softfloat.Thomas Preud'homme2013-01-291-4/+4
| | | | | | | Favor ARM hardfloat over ARM softfloat calling convention. In particular, this solve the problem of the raspbian distribution where the softfloat ld.so pathname (lib/ld-linux.so.3) is actually a symlink to the hardfloat ld.so pathname (/lib/arm-linux-gnueabihf/ld-2.13.so).
* Install libtcc.h when invoking make installThomas Preud'homme2013-01-141-0/+2
| | | | This fix commit e79281f58ec302e8cc9dfc7d00e06f426fcd2acd
* Revert "Added what I call virtual io to tinycc this way we can make a ↵Thomas Preud'homme2013-01-141-12/+4
| | | | | | | | monolitic executable or library that contains all needed to compile programs, truly tinycc portable." This reverts commit 59e18aee0e509a3ca75dbe6f909e18c1d17893d1. tcc is being stabilized now in order to do a new release soon. Therefore, such a change is not appropriate now.
* Stop setting -Wno-unused-result switch in MakefileThomas Preud'homme2013-01-131-11/+0
| | | | | | | | | | This commit revert commit 061b5799cc1feb15014da589ea98057deda14a23 and subsequent commits to detect whether -Wno-unused-result is supported or not by the compiler used to compile tcc. No warning about unused results is issued in a normal build and thus this switch is only needed if calling make with extra switches in CFLAGS or CPPFLAGS. It should thus be added with the extra switches when calling make and not in the Makefile.
* Added what I call virtual io to tinycc this way we can make a monolitic ↵mingodad2013-01-111-4/+12
| | | | | | executable or library that contains all needed to compile programs, truly tinycc portable. Tested under linux exec the "mk-it" shell script and you'll end up with a portable tinycc executable that doesn't depend on anything else.
* Honor CC when testing for -Wno-unused-resultThomas Preud'homme2013-01-061-1/+1
| | | | | | The compiler used for compiling tcc is the one referenced in the CC variable. As such, the check for -Wno-unused-result presence should be done on CC.
* build: fix out-of-tree installAkim Demaille2012-12-211-3/+1
| | | | | Makefile (install): Fix installation of headers. Do not try to install twice libtcc.h, once should be enough.
* build: fix out-of-tree buildAkim Demaille2012-12-211-1/+1
| | | | * Makefile (TCC-VERSION): Use top_srcdir.
* build: simplify the makefilesAkim Demaille2012-12-211-18/+6
| | | | * Makefile: use "else if" to improve readability.
* Makefile: revamp "tar" targetgrischka2012-12-201-10/+17
| | | | | | | | - Creates release tarball from *current* git branch - Includes tcc-doc.html - converts important windows files files to CRLF (requirement for the cmd.exe batch processor, convenience for reading the txt in notepad)
* build: fix VPATH buildsAkim Demaille2012-12-181-2/+3
| | | | | | | | | | * configure (fn_dirname): New. Use it to ensure the creation of proper symlinks to Makefiles. (config.mak): Define top_builddir and top_srcdir. (CPPFLAGS): Be sure to find the headers. * Makefile, lib/Makefile, tests/Makefile, tests2/Makefile: Adjust to set VPATH properly. Fix confusion between top_builddir and top_srcdir.
* Define TCC_ARM_EABI if using hardfloat ABIThomas Preud'homme2012-11-201-4/+7
| | | | | | | | TCC_ARM_EABI should be defined when compiling with hardfloat calling convention. This commit rework the Makefile to distinguish between calling convention and multiarch and define TCC_ARM_EABI when hardfloat calling convention is used. The result is to first guess the calling convention and then add the multiarch triplet if necessary.
* -Wno-unused-result now added only on gcc >= 4.4Milutin Jovanović2012-11-141-1/+12
| | | | | | This option does not exist in gcc 4.3 and earlier, and it breaks the build on systems with older compilers. The makefile has been enhanced to test for the version and adds it only if a newer compiler is detected.
* Allow source fortificationThomas Preud'homme2012-11-071-1/+1
| | | | | | Source fortification now works correctly : it compiles without warning except unused result and the resulting tcc is working fine. Hence let's stop disabling source fortification and hide unused result instead.
* Honour *FLAGS everywhereThomas Preud'homme2012-11-061-9/+11
| | | | Add CPPFLAGS, CFLAGS and LDFLAGS everywhere it's missing.
* Enable arm hardfloat calling conventionThomas Preud'homme2012-10-281-5/+5
| | | | | Use arm hardfloat calling convention when the system is using it (detected by searching for hardfloat multiarch directory).
* Add multiarch directory for arm hardfloat variantThomas Preud'homme2012-07-291-1/+3
| | | | | | | Arm hardfloat variant uses a different ABI than arm and uses thus a different multiarch directory for headers and libraries. This commit detect whether the system uses the hardfloat variant and configure the multiarch directory accordingly.
* tests: Added numerous tests.Milutin Jovanović2012-06-181-0/+2
| | | | | | | | | | | | The tests are taken almost verbatim from the open source project PicoC. It can be found at https://code.google.com/p/picoc/. The tests range from very simple/trivial ones to more complicated. My view is that the more tests the better. Without tests like this I was very reluctant to make any changes to tcc for the fear of breaking things. The tests pass on Win32, OSX, Linux x86 and x86_64. One or two tests fail on each platform due to differences in the runtime library.
* Detect multiarch on Kfreebsd and HurdThomas Preud'homme2012-06-131-0/+3
|
* osx: Removed some optimizations for x86 builds as they were causing seg faults.Milutin Jovanović2012-06-101-0/+2
| | | | | | | | | | | | | When using gcc compiler (as opposed to llvm) to build 32 bit tcc, compiler flags -mpreferred-stack-boundary=2, -march=i386 and -falign-functions=2 were being used. -march is redundant as -m32 is already being used. The other two seem to be corrupting stack. I am not sure why this is the case, as the explanation of the flags states that only running code size should be affected, but it does. I think that is is safe to remove these flags altogether for all compilers and platforms, especially since they are not being used for 64 bit builds. However I do not want to apply such wide change without agreement from the people on the mailing list.
* Add support for arm hardfloat calling conventionThomas Preud'homme2012-06-051-0/+2
| | | | | See Procedure Call Standard for the ARM Architecture (AAPCS) for more details.
* Several multiarch/biarch fixesThomas Preud'homme2012-05-231-2/+4
| | | | | | | | * Add multiarch directories for arm and i386 * Fix detection of biarch: /lib64/ld-linux-x86-64.so.2 is mandated by ABI and is thus always present, even if there is no biarch * Define CONFIG_LDDIR directly with the right value in case of multiarch instead of defining it to /lib and then redifining it.
* support "x86_64-linux-gnu" subdirs with lib & includegrischka2012-04-181-1/+2
| | | | suggested for newer ubuntu by Damian Gryski
* cleanup some partially broken patchesgrischka2012-04-181-1/+1
| | | | | | | | | | | | | | | | | | | - tests/Makefile: fix commit de54586d5b45800e26952ec77b4f51ad4c1e0079 This hunk it unrelated to the other changes (which are about MacOSX). It is not useful and partially wrong. Optional tests are meant to stay optional, btest would work only for i386 - tcc.h: fix commit c52d79605a3c895a16e18f0b7193f1f4b480a60f by unknown The message says it's for MINTW but the patch has obviously no effect for MINGW (which defines __GNUC__). However the patch seems useful for MSC which however needs _strto(u)i64 with underscore. - Makefile: fix commit 5280293d6b16bbe24dfda76e37f32322fa2874ca Do not build tcc.o with -DONE_SOURCE because we finally build tcc from tcc.o and libtcc.a/so
* Further changes improving the OSX build. Everything builds. libtest passes.Milutin Jovanovic2012-03-061-4/+1
| | | | | | | | | | | | | | | | | | | | Other tests still have issues, currently with weak linking. One of the primary stumbling blocks on OSX is the lack of support for mach-o binaries. Therefore all tcc usage on OSX has to be limited to elf binaries, presumably produced by tcc itself. Therefore I had to enable building of tiny_libmaker for OSX. Then changed the make to use tcc and tiny_libmaker to compile the tcclib1. In order to compile the tests, specifically the parts that use weak linking, I have had to define MACOSX_DEPLOYMENT_TARGET to 10.2, which seems like a hack, but extensive searching seems to indicate that this is the only way to make apple gcc allow weak linking. Using any other value, bigger or smaller breaks weak linking. Also added _ANSI_SOURCE define required by some OSX headers, and some cosmetic gitignore changes. I believe these changes should not impact other platforms.
* Revert "Multiple fixes for 64 bit sections"Andrew Mulbrook2012-03-031-3/+0
| | | | This reverts commit d7a7c3769d0a1dcb8400258cd8adf78a8566de61.
* Multiple fixes for 64 bit sectionsmob2012-02-261-0/+3
| | | | | | | | | | | | | | | This changeset attempts to fix a few problems when giving using the high 32bits of a 64bit section offset. There are likely more issues (or perhaps regressions) lurking in the muck here. In general, this moves a few data type declarations to use uplong. Also, add support for 64bit mingw32 building under cygwin. Because native types are used for 64 bit offsets, this won't fix challenges with cross compiling from 32bit -> 64bit. Tested under cygwin, against binary compiled with -Wl,-Ttext=0xffffff8000000000 Signed-off-by: Andrew Mulbrook <andrew262@gmail.com>
* Attempt to fix 32 bit OSX build. The fix consists of adding -m32 and -m64Milutin Jovanovic2012-02-161-2/+7
| | | | | | | | to the appropriate CFLAGS. In addition, memory hooks are very different on OSX, so build of bcheck.c had to be disabled for now. Change of the CFLAGS does affect builds on other platforms, and this needs to be tested.
* Patch attempting to build OSX TinyCC.Milutin Jovanovic2012-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | Applied patch found on stackoverflow (link below). I also found some related changes that looked like logically needed. The stackoverflow changes addressed only two registers which were breaking a compile. However reading the code in the same file shows two other register accesses that, while not breaking the build, should have the same fix. http://stackoverflow.com/questions/3712902/problems-compiling-tcc-on-os-x/3713144#3713144 The test driver was changed by changing 'cp -u' into 'cp' as '-u' is not supported on mac osx. I found that osx build required the WITHOUT_LIBTCC define. I suspect the reason for this is tcc unability to handle mach-o files. In order to properly address this I had to change 'configure' to propagate target os name to Makefile. Current state is that simple tests work, but not the whole 'make test' suite runs. To the best of my knowledge, these changes should not impact other platforms.
* libtcc: minor adjustmentsgrischka2011-08-111-2/+2
| | | | | | | | | | | | | | | | | - use {B} to substitute tcc_lih_path (instead of \b) - expand CONFIG_TCC_CRTPREFIX in CONFIG_TCC_LIBPATHS which fixes duplicate CONFIG_SYSROOT. - put default CONFIG_SYSROOT ("") into tcc.h - remove hack from commit db6fcce78f4d8ea25036dd6643e9fa83d8e52e5a because $(tccdir)/include is already in sysincludes - configure: error out for unrecognized options. - win32/build-tcc.bat: put libtcc into base dir where it will find lib/include automatically, and build libtcc_test example.
* configure: add switches to set search pathsgrischka2011-08-061-2/+2
| | | | | | | | | | | | | | | | | | | --sysincludepaths=.. specify system include paths, colon separated" Sets CONFIG_TCC_SYSINCLUDEPATHS --libpaths=... specify system library paths, colon separated" Sets CONFIG_TCC_LIBPATHS --crtprefix=... specify location of crt?.o" Sets CONFIG_TCC_CRTPREFIX --elfinterp=... specify elf interpreter" Sets CONFIG_TCC_ELFINTERP Also the CONFIG_TCC_XXX were renamed to make them look more consistent. Also move the elf_interp definitions to tcc.h.