History

Revert "Add a --multiarch-triplet switch to configure"

This reverts commit 76adc5770f4ab5b1aaa2e5dde6104efc06431fe2.

Thomas Preud'homme committed 15 years ago

Commit 0b665201 parent 76adc574 files · +74 −153Browse files

Unified · Split

4 files
  1. configure +35 −124
  2. libtcc.c +6 −18
  3. tcc.h +31 −3
  4. tccelf.c +2 −8
configure+35−124
@@ -31,7 +31,6 @@ includedir="" · 30 unmodified lines
3131 mandir=""
3232 infodir=""
3333 sysroot=""
34−multiarch_triplet=""
3534 cross_prefix=""
3635 cc="gcc"
3736 host_cc="gcc"
@@ -121,8 +120,6 @@ for opt do · 83 unmodified lines
121120 ;;
122121 --sysroot=*) sysroot=`echo $opt | cut -d '=' -f 2`
123122 ;;
124− --multiarch-triplet=*) multiarch_triplet=`echo $opt | cut -d '=' -f 2`
125− ;;
126123 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
127124 ;;
128125 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
@@ -238,37 +235,36 @@ Options: [defaults in brackets after descriptions] · 109 unmodified lines
238235
239236 EOF
240237 echo "Standard options:"
241−echo " --help print this message"
242−echo " --prefix=PREFIX install in PREFIX [$prefix]"
243−echo " --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX"
244−echo " [same as prefix]"
245−echo " --bindir=DIR user executables in DIR [EPREFIX/bin]"
246−echo " --libdir=DIR object code libraries in DIR [EPREFIX/lib]"
247−echo " --tccdir=DIR installation directory [EPREFIX/lib/tcc]"
248−echo " --includedir=DIR C header files in DIR [PREFIX/include]"
249−echo " --sharedir=DIR documentation root DIR [PREFIX]/share"
250−echo " --docdir=DIR documentation in DIR [SHAREDIR/doc/tcc]"
251−echo " --mandir=DIR man documentation in DIR [SHAREDIR/man]"
252−echo " --infodir=DIR info documentation in DIR [SHAREDIR/info]"
238+echo " --help print this message"
239+echo " --prefix=PREFIX install in PREFIX [$prefix]"
240+echo " --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX"
241+echo " [same as prefix]"
242+echo " --bindir=DIR user executables in DIR [EPREFIX/bin]"
243+echo " --libdir=DIR object code libraries in DIR [EPREFIX/lib]"
244+echo " --tccdir=DIR installation directory [EPREFIX/lib/tcc]"
245+echo " --includedir=DIR C header files in DIR [PREFIX/include]"
246+echo " --sharedir=DIR documentation root DIR [PREFIX]/share"
247+echo " --docdir=DIR documentation in DIR [SHAREDIR/doc/tcc]"
248+echo " --mandir=DIR man documentation in DIR [SHAREDIR/man]"
249+echo " --infodir=DIR info documentation in DIR [SHAREDIR/info]"
253250 echo ""
254251 echo "Advanced options (experts only):"
255−echo " --source-path=PATH path of source code [$source_path]"
256−echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
257−echo " --sysroot=PREFIX prepend PREFIX to library/include paths []"
258−echo " --multiarch-triplet=SUFFIX append SUFFIX to library/include paths []"
259−echo " --cc=CC use C compiler CC [$cc]"
260−echo " --disable-static make libtcc.so instead of libtcc.a"
261−echo " --disable-rpath disable use of -rpath with the above"
262−echo " --strip-binaries strip symbol tables from resulting binaries"
263−echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"
264−echo " --enable-mingw32 build windows version on linux with mingw32"
265−echo " --enable-cygwin build windows version on windows with cygwin"
266−echo " [requires cygwin and mingw32-make]"
267−echo " --enable-cross build cross compilers"
268−echo " --extra-cflags= extra compiler flags"
269−echo " --extra-ldflags= extra linker options"
270−echo " --with-selinux use mmap instead of exec mem"
271−echo " [requires write access to /tmp]"
252+echo " --source-path=PATH path of source code [$source_path]"
253+echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
254+echo " --sysroot=PREFIX prepend PREFIX to library/include paths []"
255+echo " --cc=CC use C compiler CC [$cc]"
256+echo " --disable-static make libtcc.so instead of libtcc.a"
257+echo " --disable-rpath disable use of -rpath with the above"
258+echo " --strip-binaries strip symbol tables from resulting binaries"
259+echo " --with-libgcc use /lib/libgcc_s.so.1 instead of libtcc.a"
260+echo " --enable-mingw32 build windows version on linux with mingw32"
261+echo " --enable-cygwin build windows version on windows with cygwin"
262+echo " [requires cygwin and mingw32-make]"
263+echo " --enable-cross build cross compilers"
264+echo " --extra-cflags= extra compiler flags"
265+echo " --extra-ldflags= extra linker options"
266+echo " --with-selinux use mmap instead of exec mem"
267+echo " [requires write access to /tmp]"
272268 echo ""
273269 #echo "NOTE: The object files are build at the place where configure is launched"
274270 exit 1
@@ -334,14 +330,13 @@ echo "Manual directory $mandir" · 59 unmodified lines
334330 echo "Info directory $infodir"
335331 echo "Doc directory $docdir"
336332 echo "Target root prefix $sysroot"
337−echo "Multiarch triplet $multiarch_triplet"
338−echo "Source path $source_path"
339−echo "C compiler $cc"
340−echo "CPU $cpu"
341−echo "Big Endian $bigendian"
342−echo "gprof enabled $gprof"
343−echo "cross compilers $build_cross"
344−echo "use libgcc $use_libgcc"
333+echo "Source path $source_path"
334+echo "C compiler $cc"
335+echo "CPU $cpu"
336+echo "Big Endian $bigendian"
337+echo "gprof enabled $gprof"
338+echo "cross compilers $build_cross"
339+echo "use libgcc $use_libgcc"
345340
346341 echo "Creating config.mak and config.h"
347342
@@ -361,93 +356,9 @@ echo "docdir=\$(DESTDIR)$docdir" >> config.mak · 13 unmodified lines
361356 echo "#ifndef CONFIG_SYSROOT" >> $TMPH
362357 echo "#define CONFIG_SYSROOT \"$sysroot\"" >> $TMPH
363358 echo "#endif" >> $TMPH
364−echo "" >> $TMPH
365−
366−# Set default include and library paths
367−win_incpaths="\\\b/include;\\\b/include/winapi"
368−unix_incpaths="/usr/local/include:/usr/include:\\\b/include"
369−win_libpaths="\\\b/lib"
370−unix_libpaths="CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX"
371−unix_libpaths="$unix_libpaths\":\"CONFIG_SYSROOT CONFIG_TCC_LDDIR"
372−unix_libpaths="$unix_libpaths\":\"CONFIG_SYSROOT \"/usr/local\" CONFIG_TCC_LDDIR"
373−
374−# sep: path separator in paths
375−# tmp: paths multiarchified (one path per line)
376−# q: quote (if sep contains ")
377−# r: carriage return pattern (if sep contains ")
378−# s: space (if sep contains ")
379−multiarchify()
380−{
381− local sep tmp
382−
383− paths="$1"
384− sep="$2"
385− tmp=""
386− q=""
387− r=""
388− s=""
389− if [ -z "${sep%%\"*}" ] ; then
390− q="\""
391− r=" \\\\\n "
392− s=" "
393− fi
394− paths="$paths$sep"
395− while test -n "$paths" ; do
396− tmp="$tmp${tmp:+$r$sep$s}${paths%%$sep*}$s$q/$multiarch_triplet$q"
397− tmp="$tmp$r$sep$s${paths%%$sep*}"
398− paths="${paths#*$sep}"
399− done
400− paths="$tmp"
401−}
402−
403−if test -n "$multiarch_triplet" ; then
404− multiarchify "$win_incpaths" ";"
405− win_incpaths="\"$paths\""
406− multiarchify "$unix_incpaths" ":"
407− unix_incpaths="\"$paths\""
408− multiarchify "$win_libpaths" ";"
409− win_libpaths="\"$paths\""
410− multiarchify "$unix_libpaths" "\":\""
411− unix_libpaths="$paths"
412− echo "#define CONFIG_TCC_MULTIARCH_TRIPLET \"$multiarch_triplet\"" >> $TMPH
413−fi
414−
415−echo "#ifndef CONFIG_TCC_LDDIR" >> $TMPH
416−echo " #if defined(TCC_TARGET_X86_64_CENTOS)" >> $TMPH
417−echo " #define CONFIG_TCC_LDDIR \"/lib64\"" >> $TMPH
418−echo " #else" >> $TMPH
419−echo " #define CONFIG_TCC_LDDIR \"/lib\"" >> $TMPH
420−echo " #endif" >> $TMPH
421−echo "#endif" >> $TMPH
422−echo "" >> $TMPH
423−
424−echo "/* path to find crt1.o, crti.o and crtn.o */" >> $TMPH
425−echo "#ifndef CONFIG_TCC_CRT_PREFIX" >> $TMPH
426−echo "# define CONFIG_TCC_CRT_PREFIX \"/usr\" CONFIG_TCC_LDDIR" >> $TMPH
427−echo "#endif" >> $TMPH
428−echo "" >> $TMPH
429−
430−echo "#ifndef CONFIG_TCC_SYSINCLUDE_PATHS" >> $TMPH
431−echo "# ifdef TCC_TARGET_PE" >> $TMPH
432−echo "# define CONFIG_TCC_SYSINCLUDE_PATHS $win_incpaths" >> $TMPH
433−echo "# else" >> $TMPH
434−echo "# define CONFIG_TCC_SYSINCLUDE_PATHS $unix_incpaths" >> $TMPH
435−echo "# endif" >> $TMPH
436−echo "#endif" >> $TMPH
437−echo "" >> $TMPH
438−echo "#ifndef CONFIG_TCC_LIBPATH" >> $TMPH
439−echo "# ifdef TCC_TARGET_PE" >> $TMPH
440−echo "# define CONFIG_TCC_LIBPATH $win_libpaths" >> $TMPH
441−echo "# else" >> $TMPH
442−echo "# define CONFIG_TCC_LIBPATH $unix_libpaths" >> $TMPH
443−echo "# endif" >> $TMPH
444−echo "#endif" >> $TMPH
445−echo "" >> $TMPH
446−
447359 echo "#ifndef CONFIG_TCCDIR" >> $TMPH
448360 echo "#define CONFIG_TCCDIR \"$tccdir\"" >> $TMPH
449361 echo "#endif" >> $TMPH
450−echo "" >> $TMPH
451362 echo "CC=$cc" >> config.mak
452363 echo "GCC_MAJOR=$gcc_major" >> config.mak
453364 echo "#define GCC_MAJOR $gcc_major" >> $TMPH
libtcc.c+6−18
@@ -1226,19 +1226,14 @@ the_end: · 1225 unmodified lines
12261226 return ret;
12271227 }
12281228
1229−static int tcc_add_file_noerror(TCCState *s, const char *filename, int extra_flags)
1229+LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename)
12301230 {
12311231 dynarray_add((void ***)&s->input_files, &s->nb_input_files, tcc_strdup(filename));
12321232
12331233 if (s->output_type == TCC_OUTPUT_PREPROCESS)
1234− return tcc_add_file_internal(s, filename, extra_flags | AFF_PREPROCESS);
1234+ return tcc_add_file_internal(s, filename, AFF_PRINT_ERROR | AFF_PREPROCESS);
12351235 else
1236− return tcc_add_file_internal(s, filename, extra_flags);
1237−}
1238−
1239−LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename)
1240−{
1241− return tcc_add_file_noerror(s, filename, AFF_PRINT_ERROR);
1236+ return tcc_add_file_internal(s, filename, AFF_PRINT_ERROR);
12421237 }
12431238
12441239 LIBTCCAPI int tcc_add_library_path(TCCState *s, const char *pathname)
@@ -1352,16 +1347,9 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) · 107 unmodified lines
13521347 #else
13531348 if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) &&
13541349 !s->nostdlib) {
1355− if (output_type != TCC_OUTPUT_DLL) {
1356−#ifdef CONFIG_TCC_MULTIARCH_TRIPLET
1357− if (tcc_add_file_noerror(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/" CONFIG_TCC_MULTIARCH_TRIPLET "/crt1.o", 0))
1358−#endif
1359− tcc_add_file(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crt1.o");
1360− }
1361−#ifdef CONFIG_TCC_MULTIARCH_TRIPLET
1362− if (tcc_add_file_noerror(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/" CONFIG_TCC_MULTIARCH_TRIPLET "/crti.o", 0))
1363−#endif
1364− tcc_add_file(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crti.o");
1350+ if (output_type != TCC_OUTPUT_DLL)
1351+ tcc_add_file(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crt1.o");
1352+ tcc_add_file(s, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crti.o");
13651353 }
13661354 #endif
13671355 return 0;
tcc.h+31−3
@@ -139,9 +139,37 @@ · 138 unmodified lines
139139 #define true 1
140140 typedef int BOOL;
141141
142−/* See definition of default values of CONFIG_TCC_LDDIR, CONFIG_TCC_CRT_PREFIX,
143− CONFIG_TCC_SYSINCLUDE_PATHS and CONFIG_TCC_LIBPATH in config.h or configure
144− */
142+#ifndef CONFIG_TCC_LDDIR
143+ #if defined(TCC_TARGET_X86_64_CENTOS)
144+ #define CONFIG_TCC_LDDIR "/lib64"
145+ #else
146+ #define CONFIG_TCC_LDDIR "/lib"
147+ #endif
148+#endif
149+
150+/* path to find crt1.o, crti.o and crtn.o */
151+#ifndef CONFIG_TCC_CRT_PREFIX
152+# define CONFIG_TCC_CRT_PREFIX "/usr" CONFIG_TCC_LDDIR
153+#endif
154+
155+#ifndef CONFIG_TCC_SYSINCLUDE_PATHS
156+# ifdef TCC_TARGET_PE
157+# define CONFIG_TCC_SYSINCLUDE_PATHS "\b/include;\b/include/winapi"
158+# else
159+# define CONFIG_TCC_SYSINCLUDE_PATHS "/usr/local/include:/usr/include:\b/include"
160+# endif
161+#endif
162+
163+#ifndef CONFIG_TCC_LIBPATH
164+# ifdef TCC_TARGET_PE
165+# define CONFIG_TCC_LIBPATH "\b/lib"
166+# else
167+# define CONFIG_TCC_LIBPATH \
168+ CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX \
169+ ":" CONFIG_SYSROOT CONFIG_TCC_LDDIR \
170+ ":" CONFIG_SYSROOT "/usr/local" CONFIG_TCC_LDDIR
171+# endif
172+#endif
145173
146174 #define INCLUDE_STACK_SIZE 32
147175 #define IFDEF_STACK_SIZE 64
tccelf.c+2−8
@@ -1238,10 +1238,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1237 unmodified lines
12381238 if (!s1->nostdlib) {
12391239 #ifdef CONFIG_USE_LIBGCC
12401240 tcc_add_library(s1, "c");
1241−#ifdef CONFIG_TCC_MULTIARCH_TRIPLET
1242− if (tcc_add_file_internal(s1, CONFIG_SYSROOT CONFIG_TCC_LDDIR "/" CONFIG_TCC_MULTIARCH_TRIPLET "/libgcc_s.so.1", 0))
1243−#endif
1244− tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_LDDIR"/libgcc_s.so.1");
1241+ tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_LDDIR"/libgcc_s.so.1");
12451242 #else
12461243 tcc_add_library(s1, "c");
12471244 #ifndef WITHOUT_LIBTCC
@@ -1255,10 +1252,7 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 7 unmodified lines
12551252 }
12561253 /* add crt end if not memory output */
12571254 if (s1->output_type != TCC_OUTPUT_MEMORY && !s1->nostdlib) {
1258−#ifdef CONFIG_TCC_MULTIARCH_TRIPLET
1259− if (tcc_add_file_internal(s1, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/" CONFIG_TCC_MULTIARCH_TRIPLET "/crtn.o", 0))
1260−#endif
1261− tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crtn.o");
1255+ tcc_add_file(s1, CONFIG_SYSROOT CONFIG_TCC_CRT_PREFIX "/crtn.o");
12621256 }
12631257 }
12641258

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t