From 946b3cb0cf91da6753b6a6e0f60b91d84fcdf097 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 14 Oct 1998 19:42:45 +0000 Subject: Patch from Ralf Corsepius : 2. "make profile" doesn't work. It aborts when building host-tools for embedded targets. I didn't yet have enough time to fix this problem. AFAIS this problem is related to handling of LDFLAGS_PROFILE[|_V] in gcc.cfg.in. For host applications, we use gcc for linking host applications, too. With profiling enabled CFLAGS_PROFILE_V contains -pg and is used to compile, but LDFLAGS_PROFILE_V is empty, hence -pg will not be passed to the linker causing gcc to fail to link, because it can't resolve some symbols introduced by compiling with -pg. I am not sure if I can provide a patch for this - Ether it is trivial to fix or requires basic work on host configuration ;- Fixing this one was trivial - But hard to trace. LDFLAGS_PROFILE_V needs to contain the same flags as CFLAGS_PROFILE_V, if gcc is used for linking (What else should have been expected ?, :-). The same problem was present for *_DEBUG_V, but apparently wasn't noticed by anybody, because things didn't break, but were silently ignored. I fixed these problems by setting these flags in configure.in whenever gcc is reported to be the host-compiler. For non-gcc host compilers "make debug" and "make profile" now becomes the same as an ordinary "make". This is a hack and addressing this problen could be more sophisticated, but I don't think it gives much sense to support compile variants for any host program (Who will ever try to profile/debug host tools?). Therefore I don't think it's useful to invest more effort into this problem. --- configure | 97 ++++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 53 insertions(+), 44 deletions(-) (limited to 'configure') diff --git a/configure b/configure index d9bd7edb69..681c0cec7f 100644 --- a/configure +++ b/configure @@ -2725,18 +2725,23 @@ case $host_os in esac -test "$ac_cv_prog_gcc" = "yes" && CC_CFLAGS_DEFAULT=-Wall -test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=-g +if test "$ac_cv_prog_gcc" = "yes"; then + CC_CFLAGS_DEFAULT=-Wall + CC_CFLAGS_PROFILE_V=${CC_CFLAGS_PROFILE_V-"-pg"} + CC_LDFLAGS_PROFILE_V=${CC_LDFLAGS_PROFILE_V-$CC_CFLAGS_PROFILE_V} +fi + +test "$ac_cv_prog_cc_g" = "yes" && CC_CFLAGS_DEBUG_V=${CC_CFLAGS_DEBUG_V-"-g"} for ac_func in strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2735: checking for $ac_func" >&5 +echo "configure:2740: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2788,7 +2793,7 @@ if test "$target_cpu" = "unix" ; then echo $ac_n "checking whether $RTEMS_HOST supports System V semaphores""... $ac_c" 1>&6 -echo "configure:2792: checking whether $RTEMS_HOST supports System V semaphores" >&5 +echo "configure:2797: checking whether $RTEMS_HOST supports System V semaphores" >&5 if eval "test \"`echo '$''{'rtems_cv_sysv_sem'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2797,7 +2802,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < @@ -2823,7 +2828,7 @@ int main () { } EOF -if { (eval echo configure:2827: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rtems_cv_sysv_sem="yes" else @@ -2846,7 +2851,7 @@ echo "$ac_t""$rtems_cv_sysv_sem" 1>&6 echo $ac_n "checking whether $RTEMS_HOST supports System V shared memory""... $ac_c" 1>&6 -echo "configure:2850: checking whether $RTEMS_HOST supports System V shared memory" >&5 +echo "configure:2855: checking whether $RTEMS_HOST supports System V shared memory" >&5 if eval "test \"`echo '$''{'rtems_cv_sysv_shm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2855,7 +2860,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < @@ -2871,7 +2876,7 @@ int main () { } EOF -if { (eval echo configure:2875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rtems_cv_sysv_shm="yes" else @@ -2894,7 +2899,7 @@ echo "$ac_t""$rtems_cv_sysv_shm" 1>&6 echo $ac_n "checking whether $RTEMS_HOST supports System V messages""... $ac_c" 1>&6 -echo "configure:2898: checking whether $RTEMS_HOST supports System V messages" >&5 +echo "configure:2903: checking whether $RTEMS_HOST supports System V messages" >&5 if eval "test \"`echo '$''{'rtems_cv_sysv_msg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2903,7 +2908,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < @@ -2919,7 +2924,7 @@ int main () { } EOF -if { (eval echo configure:2923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then rtems_cv_sysv_msg="yes" else @@ -2944,7 +2949,7 @@ fi # find all the Executive Makefiles echo $ac_n "checking for Makefile.in in c/src/exec/score/tools/$target_cpu""... $ac_c" 1>&6 -echo "configure:2948: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5 +echo "configure:2953: checking for Makefile.in in c/src/exec/score/tools/$target_cpu" >&5 if test -d $srcdir/c/src/exec/score/tools/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -2959,7 +2964,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/exec/rtems""... $ac_c" 1>&6 -echo "configure:2963: checking for Makefile.in in c/src/exec/rtems" >&5 +echo "configure:2968: checking for Makefile.in in c/src/exec/rtems" >&5 if test -d $srcdir/c/src/exec/rtems; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -2974,7 +2979,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/exec/sapi""... $ac_c" 1>&6 -echo "configure:2978: checking for Makefile.in in c/src/exec/sapi" >&5 +echo "configure:2983: checking for Makefile.in in c/src/exec/sapi" >&5 if test -d $srcdir/c/src/exec/sapi; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -2991,7 +2996,7 @@ fi if test "$RTEMS_HAS_POSIX_API" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/exec/posix""... $ac_c" 1>&6 -echo "configure:2995: checking for Makefile.in in c/src/exec/posix" >&5 +echo "configure:3000: checking for Makefile.in in c/src/exec/posix" >&5 if test -d $srcdir/c/src/exec/posix; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3013,7 +3018,7 @@ if test -d "$srcdir/c/src/lib/libbsp/$target_cpu"; then if test -z "$rtems_bsp"; then echo $ac_n "checking for bsps""... $ac_c" 1>&6 -echo "configure:3017: checking for bsps" >&5 +echo "configure:3022: checking for bsps" >&5 files=`ls $srcdir/c/src/lib/libbsp/$target_cpu` for file in $files; do case $file in @@ -3078,7 +3083,7 @@ echo "configure:3017: checking for bsps" >&5 bspdirs="$bspdirs $bspdir" echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir""... $ac_c" 1>&6 -echo "configure:3082: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5 +echo "configure:3087: checking for Makefile.in in c/src/lib/libbsp/$bspcpudir$bspdir" >&5 if test -d $srcdir/c/src/lib/libbsp/$bspcpudir$bspdir; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3093,7 +3098,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared""... $ac_c" 1>&6 -echo "configure:3097: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5 +echo "configure:3102: checking for Makefile.in in c/src/lib/libbsp/${bspcpudir}shared" >&5 if test -d $srcdir/c/src/lib/libbsp/${bspcpudir}shared; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3116,7 +3121,7 @@ fi # find all the CPU dependent library Makefiles echo $ac_n "checking for Makefile.in in c/src/lib/libcpu/$target_cpu""... $ac_c" 1>&6 -echo "configure:3120: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5 +echo "configure:3125: checking for Makefile.in in c/src/lib/libcpu/$target_cpu" >&5 if test -d $srcdir/c/src/lib/libcpu/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3133,7 +3138,7 @@ fi if test "$skip_startfiles" != "yes"; then echo $ac_n "checking for Makefile.in in c/src/lib/start/$target_cpu""... $ac_c" 1>&6 -echo "configure:3137: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5 +echo "configure:3142: checking for Makefile.in in c/src/lib/start/$target_cpu" >&5 if test -d $srcdir/c/src/lib/start/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3165,12 +3170,12 @@ fi # If the TCP/IP stack is enabled, then find all TCP/IP Makefiles echo $ac_n "checking if networking is enabled? ""... $ac_c" 1>&6 -echo "configure:3169: checking if networking is enabled? " >&5 +echo "configure:3174: checking if networking is enabled? " >&5 echo "$ac_t""$RTEMS_HAS_NETWORKING" 1>&6 if test "$RTEMS_HAS_NETWORKING" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/lib/libnetworking""... $ac_c" 1>&6 -echo "configure:3174: checking for Makefile.in in c/src/lib/libnetworking" >&5 +echo "configure:3179: checking for Makefile.in in c/src/lib/libnetworking" >&5 if test -d $srcdir/c/src/lib/libnetworking; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3192,7 +3197,7 @@ fi # If the tests are enabled, then find all the test suite Makefiles echo $ac_n "checking if the test suites are enabled? ""... $ac_c" 1>&6 -echo "configure:3196: checking if the test suites are enabled? " >&5 +echo "configure:3201: checking if the test suites are enabled? " >&5 tests_enabled=yes # Check whether --enable-tests or --disable-tests was given. if test "${enable_tests+set}" = set; then @@ -3211,7 +3216,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/tools/$target_cpu""... $ac_c" 1>&6 -echo "configure:3215: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5 +echo "configure:3220: checking for Makefile.in in c/src/tests/tools/$target_cpu" >&5 if test -d $srcdir/c/src/tests/tools/$target_cpu; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3228,7 +3233,7 @@ fi if test "$tests_enabled" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/tests/libtests""... $ac_c" 1>&6 -echo "configure:3232: checking for Makefile.in in c/src/tests/libtests" >&5 +echo "configure:3237: checking for Makefile.in in c/src/tests/libtests" >&5 if test -d $srcdir/c/src/tests/libtests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3243,7 +3248,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/sptests""... $ac_c" 1>&6 -echo "configure:3247: checking for Makefile.in in c/src/tests/sptests" >&5 +echo "configure:3252: checking for Makefile.in in c/src/tests/sptests" >&5 if test -d $srcdir/c/src/tests/sptests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3258,7 +3263,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/tmtests""... $ac_c" 1>&6 -echo "configure:3262: checking for Makefile.in in c/src/tests/tmtests" >&5 +echo "configure:3267: checking for Makefile.in in c/src/tests/tmtests" >&5 if test -d $srcdir/c/src/tests/tmtests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3273,7 +3278,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/mptests""... $ac_c" 1>&6 -echo "configure:3277: checking for Makefile.in in c/src/tests/mptests" >&5 +echo "configure:3282: checking for Makefile.in in c/src/tests/mptests" >&5 if test -d $srcdir/c/src/tests/mptests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3289,7 +3294,7 @@ fi if test "$RTEMS_HAS_POSIX_API" = "yes"; then echo $ac_n "checking for Makefile.in in c/src/tests/psxtests""... $ac_c" 1>&6 -echo "configure:3293: checking for Makefile.in in c/src/tests/psxtests" >&5 +echo "configure:3298: checking for Makefile.in in c/src/tests/psxtests" >&5 if test -d $srcdir/c/src/tests/psxtests; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3307,7 +3312,7 @@ fi # If the HWAPI is enabled, the find the HWAPI Makefiles echo $ac_n "checking if the HWAPI is enabled? ""... $ac_c" 1>&6 -echo "configure:3311: checking if the HWAPI is enabled? " >&5 +echo "configure:3316: checking if the HWAPI is enabled? " >&5 # Check whether --enable-hwapi or --disable-hwapi was given. if test "${enable_hwapi+set}" = set; then enableval="$enable_hwapi" @@ -3318,7 +3323,7 @@ if test "${enable_hwapi+set}" = set; then makefiles="$makefiles c/src/lib/libhwapi/Makefile" echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/analog""... $ac_c" 1>&6 -echo "configure:3322: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5 +echo "configure:3327: checking for Makefile.in in c/src/lib/libhwapi/analog" >&5 if test -d $srcdir/c/src/lib/libhwapi/analog; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3333,7 +3338,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/discrete""... $ac_c" 1>&6 -echo "configure:3337: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5 +echo "configure:3342: checking for Makefile.in in c/src/lib/libhwapi/discrete" >&5 if test -d $srcdir/c/src/lib/libhwapi/discrete; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3348,7 +3353,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/drivers""... $ac_c" 1>&6 -echo "configure:3352: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5 +echo "configure:3357: checking for Makefile.in in c/src/lib/libhwapi/drivers" >&5 if test -d $srcdir/c/src/lib/libhwapi/drivers; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3363,7 +3368,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory""... $ac_c" 1>&6 -echo "configure:3367: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5 +echo "configure:3372: checking for Makefile.in in c/src/lib/libhwapi/non_volatile_memory" >&5 if test -d $srcdir/c/src/lib/libhwapi/non_volatile_memory; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3378,7 +3383,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/serial""... $ac_c" 1>&6 -echo "configure:3382: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5 +echo "configure:3387: checking for Makefile.in in c/src/lib/libhwapi/serial" >&5 if test -d $srcdir/c/src/lib/libhwapi/serial; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3393,7 +3398,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/support""... $ac_c" 1>&6 -echo "configure:3397: checking for Makefile.in in c/src/lib/libhwapi/support" >&5 +echo "configure:3402: checking for Makefile.in in c/src/lib/libhwapi/support" >&5 if test -d $srcdir/c/src/lib/libhwapi/support; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3408,7 +3413,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libhwapi/wrapup""... $ac_c" 1>&6 -echo "configure:3412: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5 +echo "configure:3417: checking for Makefile.in in c/src/lib/libhwapi/wrapup" >&5 if test -d $srcdir/c/src/lib/libhwapi/wrapup; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3450,13 +3455,15 @@ fi + + # pick up all the Makefiles in required parts of the tree echo $ac_n "checking for Makefile.in in c/build-tools""... $ac_c" 1>&6 -echo "configure:3460: checking for Makefile.in in c/build-tools" >&5 +echo "configure:3467: checking for Makefile.in in c/build-tools" >&5 if test -d $srcdir/c/build-tools; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3471,7 +3478,7 @@ fi echo $ac_n "checking for Makefile.in in make""... $ac_c" 1>&6 -echo "configure:3475: checking for Makefile.in in make" >&5 +echo "configure:3482: checking for Makefile.in in make" >&5 if test -d $srcdir/make; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3486,7 +3493,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/lib/libmisc""... $ac_c" 1>&6 -echo "configure:3490: checking for Makefile.in in c/src/lib/libmisc" >&5 +echo "configure:3497: checking for Makefile.in in c/src/lib/libmisc" >&5 if test -d $srcdir/c/src/lib/libmisc; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3501,7 +3508,7 @@ fi echo $ac_n "checking for Makefile.in in c/src/tests/samples""... $ac_c" 1>&6 -echo "configure:3505: checking for Makefile.in in c/src/tests/samples" >&5 +echo "configure:3512: checking for Makefile.in in c/src/tests/samples" >&5 if test -d $srcdir/c/src/tests/samples; then rtems_av_save_dir=`pwd`; cd $srcdir; @@ -3744,6 +3751,8 @@ s%@PROJECT_ROOT@%$PROJECT_ROOT%g s%@program_prefix@%$program_prefix%g s%@CC_CFLAGS_DEFAULT@%$CC_CFLAGS_DEFAULT%g s%@CC_CFLAGS_DEBUG_V@%$CC_CFLAGS_DEBUG_V%g +s%@CC_CFLAGS_PROFILE_V@%$CC_CFLAGS_PROFILE_V%g +s%@CC_LDFLAGS_PROFILE_V@%$CC_LDFLAGS_PROFILE_V%g CEOF EOF -- cgit v1.2.3